From xen-changelog-bounces@lists.xen.org Wed Dec 04 00:22:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 00:22: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 1Vo0EA-00035b-56; Wed, 04 Dec 2013 00:22:06 +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 1Vo0E9-00035V-0q
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 00:22:05 +0000
Received: from [193.109.254.147:53690] by server-5.bemta-14.messagelabs.com id
	45/DA-03510-CA57E925; Wed, 04 Dec 2013 00:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1386116522!2666344!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2879 invoked from network); 4 Dec 2013 00:22:03 -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;
	4 Dec 2013 00:22:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo0E6-0002fz-Fr
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 00:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo0E6-0005fj-9l
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 00:22:02 +0000
Date: Wed, 04 Dec 2013 00:22:02 +0000
Message-Id: <E1Vo0E6-0005fj-9l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/AMD: work around erratum 793
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5891e7c1541199350c0f23452f4487a679037f03
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 14:17:30 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 14:17:30 2013 +0100

    x86/AMD: work around erratum 793
    
    The recommendation is to set a bit in an MSR - do this if the firmware
    didn't, considering that otherwise we expose ourselves to a guest
    induced DoS.
    
    This is CVE-2013-6885 / XSA-82.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 98162f256ee33994a9881a720419dda9ad4c03a8
    master date: 2013-12-03 09:49:54 +0100
---
 xen/arch/x86/cpu/amd.c          |   14 ++++++++++++++
 xen/include/asm-x86/msr-index.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index bd19c23..54ca33c 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -649,6 +649,20 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		       "*** Pass \"allow_unsafe\" if you're trusting"
 		       " all your (PV) guest kernels. ***\n");
 
+	if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+		rdmsrl(MSR_AMD64_LS_CFG, value);
+		if (!(value & (1 << 15))) {
+			static bool_t warned;
+
+			if (c == &boot_cpu_data || opt_cpu_info ||
+			    !test_and_set_bool(warned))
+				printk(KERN_WARNING
+				       "CPU%u: Applying workaround for erratum 793\n",
+				       smp_processor_id());
+			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
+		}
+	}
+
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 0b81710..e123ab7 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -245,6 +245,7 @@
 
 /* AMD64 MSRs */
 #define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
--
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 Wed Dec 04 00:22:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 00:22: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 1Vo0EA-00035b-56; Wed, 04 Dec 2013 00:22:06 +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 1Vo0E9-00035V-0q
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 00:22:05 +0000
Received: from [193.109.254.147:53690] by server-5.bemta-14.messagelabs.com id
	45/DA-03510-CA57E925; Wed, 04 Dec 2013 00:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1386116522!2666344!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2879 invoked from network); 4 Dec 2013 00:22:03 -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;
	4 Dec 2013 00:22:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo0E6-0002fz-Fr
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 00:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo0E6-0005fj-9l
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 00:22:02 +0000
Date: Wed, 04 Dec 2013 00:22:02 +0000
Message-Id: <E1Vo0E6-0005fj-9l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/AMD: work around erratum 793
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5891e7c1541199350c0f23452f4487a679037f03
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 14:17:30 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 14:17:30 2013 +0100

    x86/AMD: work around erratum 793
    
    The recommendation is to set a bit in an MSR - do this if the firmware
    didn't, considering that otherwise we expose ourselves to a guest
    induced DoS.
    
    This is CVE-2013-6885 / XSA-82.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 98162f256ee33994a9881a720419dda9ad4c03a8
    master date: 2013-12-03 09:49:54 +0100
---
 xen/arch/x86/cpu/amd.c          |   14 ++++++++++++++
 xen/include/asm-x86/msr-index.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index bd19c23..54ca33c 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -649,6 +649,20 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		       "*** Pass \"allow_unsafe\" if you're trusting"
 		       " all your (PV) guest kernels. ***\n");
 
+	if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+		rdmsrl(MSR_AMD64_LS_CFG, value);
+		if (!(value & (1 << 15))) {
+			static bool_t warned;
+
+			if (c == &boot_cpu_data || opt_cpu_info ||
+			    !test_and_set_bool(warned))
+				printk(KERN_WARNING
+				       "CPU%u: Applying workaround for erratum 793\n",
+				       smp_processor_id());
+			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
+		}
+	}
+
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 0b81710..e123ab7 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -245,6 +245,7 @@
 
 /* AMD64 MSRs */
 #define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
--
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 Wed Dec 04 04:22:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22: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 1Vo3yR-0003fK-GS; Wed, 04 Dec 2013 04:22:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3yQ-0003fE-GZ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:06 +0000
Received: from [85.158.143.35:33456] by server-3.bemta-4.messagelabs.com id
	A3/71-32360-DEDAE925; Wed, 04 Dec 2013 04:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1386130924!3165909!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29980 invoked from network); 4 Dec 2013 04:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 04:22: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 1Vo3yN-0003bM-OX
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3yN-00040l-JP
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:03 +0000
Date: Wed, 04 Dec 2013 04:22:03 +0000
Message-Id: <E1Vo3yN-00040l-JP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] credit: Update other parameters
	when setting tslice_ms
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 88f72c707e9588c60a81cb8a917b0a2b1d5aa1a1
Author:     Nate Studer <nate.studer@dornerworks.com>
AuthorDate: Mon Dec 2 15:51:00 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:51:00 2013 +0100

    credit: Update other parameters when setting tslice_ms
    
    Add a utility function to update the rest of the timeslice
    accounting fields when updating the timeslice of the
    credit scheduler, so that capped CPUs behave correctly.
    
    Before this patch changing the timeslice to a value higher
    than the default would result in a domain not utilizing
    its full capacity and changing the timeslice to a value
    lower than the default would result in a domain exceeding
    its capacity.
    
    Signed-off-by: Nate Studer <nate.studer@dornerworks.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    master commit: 1320b8100c2ed390fc640557a050f5c700d8338d
    master date: 2013-11-15 17:38:10 +0100
---
 xen/common/sched_credit.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index ee3df06..5195442 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -847,6 +847,17 @@ csched_dom_cntl(
     return 0;
 }
 
+static inline void
+__csched_set_tslice(struct csched_private *prv, unsigned timeslice)
+{
+    prv->tslice_ms = timeslice;
+    prv->ticks_per_tslice = CSCHED_TICKS_PER_TSLICE;
+    if ( prv->tslice_ms < prv->ticks_per_tslice )
+        prv->ticks_per_tslice = 1;
+    prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice;
+    prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms;
+}
+
 static int
 csched_sys_cntl(const struct scheduler *ops,
                         struct xen_sysctl_scheduler_op *sc)
@@ -865,7 +876,7 @@ csched_sys_cntl(const struct scheduler *ops,
                     || params->ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN))
             || MICROSECS(params->ratelimit_us) > MILLISECS(params->tslice_ms) )
                 goto out;
-        prv->tslice_ms = params->tslice_ms;
+        __csched_set_tslice(prv, params->tslice_ms);
         prv->ratelimit_us = params->ratelimit_us;
         /* FALLTHRU */
     case XEN_SYSCTL_SCHEDOP_getinfo:
@@ -1623,12 +1634,7 @@ csched_init(struct scheduler *ops)
         sched_credit_tslice_ms = CSCHED_DEFAULT_TSLICE_MS;
     }
 
-    prv->tslice_ms = sched_credit_tslice_ms;
-    prv->ticks_per_tslice = CSCHED_TICKS_PER_TSLICE;
-    if ( prv->tslice_ms < prv->ticks_per_tslice )
-        prv->ticks_per_tslice = 1;
-    prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice;
-    prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms;
+    __csched_set_tslice(prv, sched_credit_tslice_ms);
 
     if ( MICROSECS(sched_ratelimit_us) > MILLISECS(sched_credit_tslice_ms) )
     {
--
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 Wed Dec 04 04:22:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22: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 1Vo3yR-0003fK-GS; Wed, 04 Dec 2013 04:22:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3yQ-0003fE-GZ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:06 +0000
Received: from [85.158.143.35:33456] by server-3.bemta-4.messagelabs.com id
	A3/71-32360-DEDAE925; Wed, 04 Dec 2013 04:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1386130924!3165909!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29980 invoked from network); 4 Dec 2013 04:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 04:22: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 1Vo3yN-0003bM-OX
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3yN-00040l-JP
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:03 +0000
Date: Wed, 04 Dec 2013 04:22:03 +0000
Message-Id: <E1Vo3yN-00040l-JP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] credit: Update other parameters
	when setting tslice_ms
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 88f72c707e9588c60a81cb8a917b0a2b1d5aa1a1
Author:     Nate Studer <nate.studer@dornerworks.com>
AuthorDate: Mon Dec 2 15:51:00 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:51:00 2013 +0100

    credit: Update other parameters when setting tslice_ms
    
    Add a utility function to update the rest of the timeslice
    accounting fields when updating the timeslice of the
    credit scheduler, so that capped CPUs behave correctly.
    
    Before this patch changing the timeslice to a value higher
    than the default would result in a domain not utilizing
    its full capacity and changing the timeslice to a value
    lower than the default would result in a domain exceeding
    its capacity.
    
    Signed-off-by: Nate Studer <nate.studer@dornerworks.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    master commit: 1320b8100c2ed390fc640557a050f5c700d8338d
    master date: 2013-11-15 17:38:10 +0100
---
 xen/common/sched_credit.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index ee3df06..5195442 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -847,6 +847,17 @@ csched_dom_cntl(
     return 0;
 }
 
+static inline void
+__csched_set_tslice(struct csched_private *prv, unsigned timeslice)
+{
+    prv->tslice_ms = timeslice;
+    prv->ticks_per_tslice = CSCHED_TICKS_PER_TSLICE;
+    if ( prv->tslice_ms < prv->ticks_per_tslice )
+        prv->ticks_per_tslice = 1;
+    prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice;
+    prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms;
+}
+
 static int
 csched_sys_cntl(const struct scheduler *ops,
                         struct xen_sysctl_scheduler_op *sc)
@@ -865,7 +876,7 @@ csched_sys_cntl(const struct scheduler *ops,
                     || params->ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN))
             || MICROSECS(params->ratelimit_us) > MILLISECS(params->tslice_ms) )
                 goto out;
-        prv->tslice_ms = params->tslice_ms;
+        __csched_set_tslice(prv, params->tslice_ms);
         prv->ratelimit_us = params->ratelimit_us;
         /* FALLTHRU */
     case XEN_SYSCTL_SCHEDOP_getinfo:
@@ -1623,12 +1634,7 @@ csched_init(struct scheduler *ops)
         sched_credit_tslice_ms = CSCHED_DEFAULT_TSLICE_MS;
     }
 
-    prv->tslice_ms = sched_credit_tslice_ms;
-    prv->ticks_per_tslice = CSCHED_TICKS_PER_TSLICE;
-    if ( prv->tslice_ms < prv->ticks_per_tslice )
-        prv->ticks_per_tslice = 1;
-    prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice;
-    prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms;
+    __csched_set_tslice(prv, sched_credit_tslice_ms);
 
     if ( MICROSECS(sched_ratelimit_us) > MILLISECS(sched_credit_tslice_ms) )
     {
--
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 Wed Dec 04 04:22:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo3yb-0003g9-JH; Wed, 04 Dec 2013 04:22:17 +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 1Vo3ya-0003g2-S3
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:16 +0000
Received: from [85.158.143.35:22468] by server-1.bemta-4.messagelabs.com id
	0C/B0-02132-8FDAE925; Wed, 04 Dec 2013 04:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1386130934!3154259!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31254 invoked from network); 4 Dec 2013 04:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 04:22: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 1Vo3yY-0003bS-CK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3yY-00041A-AD
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:14 +0000
Date: Wed, 04 Dec 2013 04:22:14 +0000
Message-Id: <E1Vo3yY-00041A-AD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] fix leaking of
	v->cpu_affinity_saved on domain destruction
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f6d67d15969396f37a699e85e95bf84db28e3971
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Dec 2 15:52:20 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:52:20 2013 +0100

    fix leaking of v->cpu_affinity_saved on domain destruction
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6757efe1bf50ac7ff68fa4dd7d9333529f70ae9a
    master date: 2013-11-15 17:43:28 +0100
---
 xen/common/domain.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 89ab922..2ebb494 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -676,6 +676,7 @@ static void complete_domain_destroy(struct rcu_head *head)
         {
             free_cpumask_var(v->cpu_affinity);
             free_cpumask_var(v->cpu_affinity_tmp);
+            free_cpumask_var(v->cpu_affinity_saved);
             free_cpumask_var(v->vcpu_dirty_cpumask);
             free_vcpu_struct(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 Wed Dec 04 04:22:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo3yb-0003g9-JH; Wed, 04 Dec 2013 04:22:17 +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 1Vo3ya-0003g2-S3
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:16 +0000
Received: from [85.158.143.35:22468] by server-1.bemta-4.messagelabs.com id
	0C/B0-02132-8FDAE925; Wed, 04 Dec 2013 04:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1386130934!3154259!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31254 invoked from network); 4 Dec 2013 04:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 04:22: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 1Vo3yY-0003bS-CK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3yY-00041A-AD
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:14 +0000
Date: Wed, 04 Dec 2013 04:22:14 +0000
Message-Id: <E1Vo3yY-00041A-AD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] fix leaking of
	v->cpu_affinity_saved on domain destruction
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f6d67d15969396f37a699e85e95bf84db28e3971
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Dec 2 15:52:20 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:52:20 2013 +0100

    fix leaking of v->cpu_affinity_saved on domain destruction
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6757efe1bf50ac7ff68fa4dd7d9333529f70ae9a
    master date: 2013-11-15 17:43:28 +0100
---
 xen/common/domain.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 89ab922..2ebb494 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -676,6 +676,7 @@ static void complete_domain_destroy(struct rcu_head *head)
         {
             free_cpumask_var(v->cpu_affinity);
             free_cpumask_var(v->cpu_affinity_tmp);
+            free_cpumask_var(v->cpu_affinity_saved);
             free_cpumask_var(v->vcpu_dirty_cpumask);
             free_vcpu_struct(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 Wed Dec 04 04:22:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo3yn-0003hS-MC; Wed, 04 Dec 2013 04:22:29 +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 1Vo3ym-0003hG-Gs
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:28 +0000
Received: from [193.109.254.147:28048] by server-11.bemta-14.messagelabs.com
	id 2A/FA-20576-30EAE925; Wed, 04 Dec 2013 04:22:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1386130944!2716388!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15315 invoked from network); 4 Dec 2013 04:22: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;
	4 Dec 2013 04:22: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 1Vo3yi-0003bY-Iu
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3yi-00041W-GX
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:24 +0000
Date: Wed, 04 Dec 2013 04:22:24 +0000
Message-Id: <E1Vo3yi-00041W-GX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: consider modules when cutting
	off memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9e7ee90d11b0ba078b051b8bb1fc1b04687c100b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Dec 2 15:53:50 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:53:50 2013 +0100

    x86: consider modules when cutting off memory
    
    The code in question runs after module ranges got already removed from
    the E820 table, so when determining the new maximum page/PDX we need to
    explicitly take them into account.
    
    Furthermore we need to round up the ending addresses here, in order to
    fully cover eventual partial trailing pages.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: a5db2c7aab7a638d84f22ac8fe5089d81175438b
    master date: 2013-11-18 13:57:20 +0100
---
 xen/arch/x86/setup.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 2ef600b..c512059 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1023,9 +1023,17 @@ void __init __start_xen(unsigned long mbi_p)
                     ASSERT(j);
                 }
                 map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
-                if ( (map_e >> PAGE_SHIFT) < max_page )
+                for ( j = 0; j < mbi->mods_count; ++j )
                 {
-                    max_page = map_e >> PAGE_SHIFT;
+                    uint64_t end = pfn_to_paddr(mod[j].mod_start) +
+                                   mod[j].mod_end;
+
+                    if ( map_e < end )
+                        map_e = end;
+                }
+                if ( PFN_UP(map_e) < max_page )
+                {
+                    max_page = PFN_UP(map_e);
                     max_pdx = pfn_to_pdx(max_page - 1) + 1;
                 }
                 printk(XENLOG_WARNING "Ignoring inaccessible memory range"
--
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 Wed Dec 04 04:22:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo3yn-0003hS-MC; Wed, 04 Dec 2013 04:22:29 +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 1Vo3ym-0003hG-Gs
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:28 +0000
Received: from [193.109.254.147:28048] by server-11.bemta-14.messagelabs.com
	id 2A/FA-20576-30EAE925; Wed, 04 Dec 2013 04:22:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1386130944!2716388!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15315 invoked from network); 4 Dec 2013 04:22: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;
	4 Dec 2013 04:22: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 1Vo3yi-0003bY-Iu
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3yi-00041W-GX
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:24 +0000
Date: Wed, 04 Dec 2013 04:22:24 +0000
Message-Id: <E1Vo3yi-00041W-GX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: consider modules when cutting
	off memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9e7ee90d11b0ba078b051b8bb1fc1b04687c100b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Dec 2 15:53:50 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:53:50 2013 +0100

    x86: consider modules when cutting off memory
    
    The code in question runs after module ranges got already removed from
    the E820 table, so when determining the new maximum page/PDX we need to
    explicitly take them into account.
    
    Furthermore we need to round up the ending addresses here, in order to
    fully cover eventual partial trailing pages.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: a5db2c7aab7a638d84f22ac8fe5089d81175438b
    master date: 2013-11-18 13:57:20 +0100
---
 xen/arch/x86/setup.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 2ef600b..c512059 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1023,9 +1023,17 @@ void __init __start_xen(unsigned long mbi_p)
                     ASSERT(j);
                 }
                 map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
-                if ( (map_e >> PAGE_SHIFT) < max_page )
+                for ( j = 0; j < mbi->mods_count; ++j )
                 {
-                    max_page = map_e >> PAGE_SHIFT;
+                    uint64_t end = pfn_to_paddr(mod[j].mod_start) +
+                                   mod[j].mod_end;
+
+                    if ( map_e < end )
+                        map_e = end;
+                }
+                if ( PFN_UP(map_e) < max_page )
+                {
+                    max_page = PFN_UP(map_e);
                     max_pdx = pfn_to_pdx(max_page - 1) + 1;
                 }
                 printk(XENLOG_WARNING "Ignoring inaccessible memory range"
--
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 Wed Dec 04 04:22:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22: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 1Vo3yw-0003iy-Pi; Wed, 04 Dec 2013 04:22:38 +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 1Vo3yv-0003ii-HO
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:37 +0000
Received: from [85.158.137.68:56262] by server-17.bemta-3.messagelabs.com id
	32/FC-15965-C0EAE925; Wed, 04 Dec 2013 04:22:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1386130955!768459!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9643 invoked from network); 4 Dec 2013 04:22:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 04:22: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 1Vo3ys-0003bg-RN
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3ys-000423-OQ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:34 +0000
Date: Wed, 04 Dec 2013 04:22:34 +0000
Message-Id: <E1Vo3ys-000423-OQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/hvm: reset TSC to 0 after
	domain resume from S3
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cbb45ac29ff24222b80209e580e01677315f8101
Author:     Tomasz Wroblewski <tomasz.wroblewski@citrix.com>
AuthorDate: Mon Dec 2 15:54:42 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:54:42 2013 +0100

    x86/hvm: reset TSC to 0 after domain resume from S3
    
    Host S3 implicitly resets the host TSC to 0, but the tsc offset for hvm
    domains is not recalculated when they resume, causing it to go into
    negative values. In Linux guest using tsc clocksource, this results in
    a hang after wrap back to positive values since the tsc clocksource
    implementation expects it reset.
    
    Signed-off-by: Tomasz Wroblewski <tomasz.wroblewski@citrix.com>
    master commit: e95dc6ba69daef6468b3ae5912710727244d6e2f
    master date: 2013-11-22 14:47:24 +0100
---
 xen/arch/x86/hvm/hvm.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 28824b7..6ab812d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3558,7 +3558,13 @@ static void hvm_s3_suspend(struct domain *d)
 static void hvm_s3_resume(struct domain *d)
 {
     if ( test_and_clear_bool(d->arch.hvm_domain.is_s3_suspended) )
+    {
+        struct vcpu *v;
+
+        for_each_vcpu( d, v )
+            hvm_set_guest_tsc(v, 0);
         domain_unpause(d);
+    }
 }
 
 static int hvmop_set_isa_irq_level(
--
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 Wed Dec 04 04:22:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22: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 1Vo3yw-0003iy-Pi; Wed, 04 Dec 2013 04:22:38 +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 1Vo3yv-0003ii-HO
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:37 +0000
Received: from [85.158.137.68:56262] by server-17.bemta-3.messagelabs.com id
	32/FC-15965-C0EAE925; Wed, 04 Dec 2013 04:22:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1386130955!768459!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9643 invoked from network); 4 Dec 2013 04:22:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 04:22: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 1Vo3ys-0003bg-RN
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3ys-000423-OQ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:34 +0000
Date: Wed, 04 Dec 2013 04:22:34 +0000
Message-Id: <E1Vo3ys-000423-OQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/hvm: reset TSC to 0 after
	domain resume from S3
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cbb45ac29ff24222b80209e580e01677315f8101
Author:     Tomasz Wroblewski <tomasz.wroblewski@citrix.com>
AuthorDate: Mon Dec 2 15:54:42 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:54:42 2013 +0100

    x86/hvm: reset TSC to 0 after domain resume from S3
    
    Host S3 implicitly resets the host TSC to 0, but the tsc offset for hvm
    domains is not recalculated when they resume, causing it to go into
    negative values. In Linux guest using tsc clocksource, this results in
    a hang after wrap back to positive values since the tsc clocksource
    implementation expects it reset.
    
    Signed-off-by: Tomasz Wroblewski <tomasz.wroblewski@citrix.com>
    master commit: e95dc6ba69daef6468b3ae5912710727244d6e2f
    master date: 2013-11-22 14:47:24 +0100
---
 xen/arch/x86/hvm/hvm.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 28824b7..6ab812d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3558,7 +3558,13 @@ static void hvm_s3_suspend(struct domain *d)
 static void hvm_s3_resume(struct domain *d)
 {
     if ( test_and_clear_bool(d->arch.hvm_domain.is_s3_suspended) )
+    {
+        struct vcpu *v;
+
+        for_each_vcpu( d, v )
+            hvm_set_guest_tsc(v, 0);
         domain_unpause(d);
+    }
 }
 
 static int hvmop_set_isa_irq_level(
--
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 Wed Dec 04 04:22:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22: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 1Vo3z6-0003ka-Q8; Wed, 04 Dec 2013 04:22:48 +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 1Vo3z5-0003kO-NV
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:47 +0000
Received: from [193.109.254.147:56399] by server-8.bemta-14.messagelabs.com id
	C0/CC-30921-71EAE925; Wed, 04 Dec 2013 04:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1386130965!2705717!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21872 invoked from network); 4 Dec 2013 04:22:46 -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;
	4 Dec 2013 04:22: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 1Vo3z3-0003bm-40
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3z2-00042S-Vs
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:45 +0000
Date: Wed, 04 Dec 2013 04:22:44 +0000
Message-Id: <E1Vo3z2-00042S-Vs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/crash: disable the watchdog
	NMIs on the crashing cpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 122ce1427fd43143c3a2613cf77c4b04012a2f2b
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Dec 2 15:55:16 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:55:16 2013 +0100

    x86/crash: disable the watchdog NMIs on the crashing cpu
    
    nmi_shootdown_cpus() is called during a crash to park all the other
    CPUs.  This changes the NMI trap handlers which means there's no point
    in having the watchdog still running.
    
    This also disables the watchdog before executing any crash kexec image
    and prevents the image from receiving unexpected NMIs.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    
    PVOps Linux as a kexec image shoots itself in the foot otherwise.
    
    On a Core2 system, Linux declares a firmware bug and tries to invert some bits
    in the performance counter register.  It ends up setting the number of retired
    instructions to generate another NMI to fewer instructions than the NMI
    interrupt path itself, and ceases to make any useful progress.
    
    The call to disable_lapic_nmi_watchdog() must be this late into the kexec path
    to be sure that this cpu is the one which will execute the kexec image.
    Otherwise there are race conditions where the NMIs might be disabled on the
    wrong cpu, resulting in the kexec image still receiving NMIs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 2a16fcd5ba0244fef764886211452acc69c0ed00
    master date: 2013-11-22 14:48:12 +0100
---
 xen/arch/x86/crash.c       |    1 +
 xen/arch/x86/nmi.c         |    2 +-
 xen/include/asm-x86/apic.h |    1 +
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c
index 88cba19..24e2e49 100644
--- a/xen/arch/x86/crash.c
+++ b/xen/arch/x86/crash.c
@@ -59,6 +59,7 @@ static void nmi_shootdown_cpus(void)
 {
     unsigned long msecs;
 
+    disable_lapic_nmi_watchdog();
     local_irq_disable();
 
     crashing_cpu = smp_processor_id();
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 92a141e..c7fafc4 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -164,7 +164,7 @@ static void nmi_timer_fn(void *unused)
     set_timer(&this_cpu(nmi_timer), NOW() + MILLISECS(1000));
 }
 
-static void disable_lapic_nmi_watchdog(void)
+void disable_lapic_nmi_watchdog(void)
 {
     if (nmi_active <= 0)
         return;
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 4e6bea9..c677510 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -206,6 +206,7 @@ extern void smp_local_timer_interrupt (struct cpu_user_regs *regs);
 extern void setup_boot_APIC_clock (void);
 extern void setup_secondary_APIC_clock (void);
 extern void setup_apic_nmi_watchdog (void);
+extern void disable_lapic_nmi_watchdog(void);
 extern int reserve_lapic_nmi(void);
 extern void release_lapic_nmi(void);
 extern void self_nmi(void);
--
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 Wed Dec 04 04:22:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22: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 1Vo3z6-0003ka-Q8; Wed, 04 Dec 2013 04:22:48 +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 1Vo3z5-0003kO-NV
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:47 +0000
Received: from [193.109.254.147:56399] by server-8.bemta-14.messagelabs.com id
	C0/CC-30921-71EAE925; Wed, 04 Dec 2013 04:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1386130965!2705717!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21872 invoked from network); 4 Dec 2013 04:22:46 -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;
	4 Dec 2013 04:22: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 1Vo3z3-0003bm-40
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3z2-00042S-Vs
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:45 +0000
Date: Wed, 04 Dec 2013 04:22:44 +0000
Message-Id: <E1Vo3z2-00042S-Vs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/crash: disable the watchdog
	NMIs on the crashing cpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 122ce1427fd43143c3a2613cf77c4b04012a2f2b
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Dec 2 15:55:16 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:55:16 2013 +0100

    x86/crash: disable the watchdog NMIs on the crashing cpu
    
    nmi_shootdown_cpus() is called during a crash to park all the other
    CPUs.  This changes the NMI trap handlers which means there's no point
    in having the watchdog still running.
    
    This also disables the watchdog before executing any crash kexec image
    and prevents the image from receiving unexpected NMIs.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    
    PVOps Linux as a kexec image shoots itself in the foot otherwise.
    
    On a Core2 system, Linux declares a firmware bug and tries to invert some bits
    in the performance counter register.  It ends up setting the number of retired
    instructions to generate another NMI to fewer instructions than the NMI
    interrupt path itself, and ceases to make any useful progress.
    
    The call to disable_lapic_nmi_watchdog() must be this late into the kexec path
    to be sure that this cpu is the one which will execute the kexec image.
    Otherwise there are race conditions where the NMIs might be disabled on the
    wrong cpu, resulting in the kexec image still receiving NMIs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 2a16fcd5ba0244fef764886211452acc69c0ed00
    master date: 2013-11-22 14:48:12 +0100
---
 xen/arch/x86/crash.c       |    1 +
 xen/arch/x86/nmi.c         |    2 +-
 xen/include/asm-x86/apic.h |    1 +
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c
index 88cba19..24e2e49 100644
--- a/xen/arch/x86/crash.c
+++ b/xen/arch/x86/crash.c
@@ -59,6 +59,7 @@ static void nmi_shootdown_cpus(void)
 {
     unsigned long msecs;
 
+    disable_lapic_nmi_watchdog();
     local_irq_disable();
 
     crashing_cpu = smp_processor_id();
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index 92a141e..c7fafc4 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -164,7 +164,7 @@ static void nmi_timer_fn(void *unused)
     set_timer(&this_cpu(nmi_timer), NOW() + MILLISECS(1000));
 }
 
-static void disable_lapic_nmi_watchdog(void)
+void disable_lapic_nmi_watchdog(void)
 {
     if (nmi_active <= 0)
         return;
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 4e6bea9..c677510 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -206,6 +206,7 @@ extern void smp_local_timer_interrupt (struct cpu_user_regs *regs);
 extern void setup_boot_APIC_clock (void);
 extern void setup_secondary_APIC_clock (void);
 extern void setup_apic_nmi_watchdog (void);
+extern void disable_lapic_nmi_watchdog(void);
 extern int reserve_lapic_nmi(void);
 extern void release_lapic_nmi(void);
 extern void self_nmi(void);
--
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 Wed Dec 04 04:22:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22: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 1Vo3zH-0003mF-Sy; Wed, 04 Dec 2013 04:22: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 1Vo3zG-0003lv-58
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:58 +0000
Received: from [85.158.139.211:4964] by server-5.bemta-5.messagelabs.com id
	46/1A-14928-12EAE925; Wed, 04 Dec 2013 04:22:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1386130975!2094850!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30452 invoked from network); 4 Dec 2013 04:22:56 -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;
	4 Dec 2013 04:22: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 1Vo3zD-0003bv-AU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3zD-00043X-8F
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:55 +0000
Date: Wed, 04 Dec 2013 04:22:55 +0000
Message-Id: <E1Vo3zD-00043X-8F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/xsave: fix nonlazy state
	handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a22a77f036da315b7cb7cefb4eef191e7cd9a247
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 2 15:56:09 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:56:09 2013 +0100

    x86/xsave: fix nonlazy state handling
    
    Nonlazy xstates should be xsaved each time when vcpu_save_fpu.
    Operation to nonlazy xstates will not trigger #NM exception, so
    whenever vcpu scheduled in it got restored and whenever scheduled
    out it should get saved.
    
    Currently this bug affects AMD LWP feature, and later Intel MPX
    feature. With the bugfix both LWP and MPX will work fine.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    
    Furthermore, during restore we also need to set nonlazy_xstate_used
    according to the incoming accumulated XCR0.
    
    Also adjust the changes to i387.c such that there won't be a pointless
    clts()/stts() pair.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7d8b5dd98463524686bdee8b973b53c00c232122
    master date: 2013-11-25 11:19:04 +0100
---
 xen/arch/x86/domctl.c  |    2 ++
 xen/arch/x86/hvm/hvm.c |    2 ++
 xen/arch/x86/i387.c    |   15 +++++++++++++--
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index d5a06fc..0592b6e 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1503,6 +1503,8 @@ long arch_do_domctl(
             {
                 v->arch.xcr0 = _xcr0;
                 v->arch.xcr0_accum = _xcr0_accum;
+                if ( _xcr0_accum & XSTATE_NONLAZY )
+                    v->arch.nonlazy_xstate_used = 1;
                 memcpy(v->arch.xsave_area, _xsave_area,
                        evc->size - 2 * sizeof(uint64_t));
             }
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6ab812d..3cfce05 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1014,6 +1014,8 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
 
     v->arch.xcr0 = ctxt->xcr0;
     v->arch.xcr0_accum = ctxt->xcr0_accum;
+    if ( ctxt->xcr0_accum & XSTATE_NONLAZY )
+        v->arch.nonlazy_xstate_used = 1;
     memcpy(v->arch.xsave_area, &ctxt->save_area,
            desc->length - offsetof(struct hvm_hw_cpu_xsave, save_area));
 
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 7c1feb6..0a001fd 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -122,11 +122,22 @@ static inline void fpu_frstor(struct vcpu *v)
 /*******************************/
 /*      FPU Save Functions     */
 /*******************************/
+
+static inline uint64_t vcpu_xsave_mask(const struct vcpu *v)
+{
+    if ( v->fpu_dirtied )
+        return v->arch.nonlazy_xstate_used ? XSTATE_ALL : XSTATE_LAZY;
+
+    return v->arch.nonlazy_xstate_used ? XSTATE_NONLAZY : 0;
+}
+
 /* Save x87 extended state */
 static inline void fpu_xsave(struct vcpu *v)
 {
     bool_t ok;
+    uint64_t mask = vcpu_xsave_mask(v);
 
+    ASSERT(mask);
     ASSERT(v->arch.xsave_area);
     /*
      * XCR0 normally represents what guest OS set. In case of Xen itself,
@@ -134,7 +145,7 @@ static inline void fpu_xsave(struct vcpu *v)
      */
     ok = set_xcr0(v->arch.xcr0_accum | XSTATE_FP_SSE);
     ASSERT(ok);
-    xsave(v, v->arch.nonlazy_xstate_used ? XSTATE_ALL : XSTATE_LAZY);
+    xsave(v, mask);
     ok = set_xcr0(v->arch.xcr0 ?: XSTATE_FP_SSE);
     ASSERT(ok);
 }
@@ -267,7 +278,7 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
  */
 void vcpu_save_fpu(struct vcpu *v)
 {
-    if ( !v->fpu_dirtied )
+    if ( !v->fpu_dirtied && !v->arch.nonlazy_xstate_used )
         return;
 
     ASSERT(!is_idle_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 Wed Dec 04 04:22:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:22: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 1Vo3zH-0003mF-Sy; Wed, 04 Dec 2013 04:22: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 1Vo3zG-0003lv-58
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:58 +0000
Received: from [85.158.139.211:4964] by server-5.bemta-5.messagelabs.com id
	46/1A-14928-12EAE925; Wed, 04 Dec 2013 04:22:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1386130975!2094850!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30452 invoked from network); 4 Dec 2013 04:22:56 -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;
	4 Dec 2013 04:22: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 1Vo3zD-0003bv-AU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3zD-00043X-8F
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:22:55 +0000
Date: Wed, 04 Dec 2013 04:22:55 +0000
Message-Id: <E1Vo3zD-00043X-8F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/xsave: fix nonlazy state
	handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a22a77f036da315b7cb7cefb4eef191e7cd9a247
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 2 15:56:09 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 2 15:56:09 2013 +0100

    x86/xsave: fix nonlazy state handling
    
    Nonlazy xstates should be xsaved each time when vcpu_save_fpu.
    Operation to nonlazy xstates will not trigger #NM exception, so
    whenever vcpu scheduled in it got restored and whenever scheduled
    out it should get saved.
    
    Currently this bug affects AMD LWP feature, and later Intel MPX
    feature. With the bugfix both LWP and MPX will work fine.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    
    Furthermore, during restore we also need to set nonlazy_xstate_used
    according to the incoming accumulated XCR0.
    
    Also adjust the changes to i387.c such that there won't be a pointless
    clts()/stts() pair.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7d8b5dd98463524686bdee8b973b53c00c232122
    master date: 2013-11-25 11:19:04 +0100
---
 xen/arch/x86/domctl.c  |    2 ++
 xen/arch/x86/hvm/hvm.c |    2 ++
 xen/arch/x86/i387.c    |   15 +++++++++++++--
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index d5a06fc..0592b6e 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1503,6 +1503,8 @@ long arch_do_domctl(
             {
                 v->arch.xcr0 = _xcr0;
                 v->arch.xcr0_accum = _xcr0_accum;
+                if ( _xcr0_accum & XSTATE_NONLAZY )
+                    v->arch.nonlazy_xstate_used = 1;
                 memcpy(v->arch.xsave_area, _xsave_area,
                        evc->size - 2 * sizeof(uint64_t));
             }
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6ab812d..3cfce05 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1014,6 +1014,8 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
 
     v->arch.xcr0 = ctxt->xcr0;
     v->arch.xcr0_accum = ctxt->xcr0_accum;
+    if ( ctxt->xcr0_accum & XSTATE_NONLAZY )
+        v->arch.nonlazy_xstate_used = 1;
     memcpy(v->arch.xsave_area, &ctxt->save_area,
            desc->length - offsetof(struct hvm_hw_cpu_xsave, save_area));
 
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 7c1feb6..0a001fd 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -122,11 +122,22 @@ static inline void fpu_frstor(struct vcpu *v)
 /*******************************/
 /*      FPU Save Functions     */
 /*******************************/
+
+static inline uint64_t vcpu_xsave_mask(const struct vcpu *v)
+{
+    if ( v->fpu_dirtied )
+        return v->arch.nonlazy_xstate_used ? XSTATE_ALL : XSTATE_LAZY;
+
+    return v->arch.nonlazy_xstate_used ? XSTATE_NONLAZY : 0;
+}
+
 /* Save x87 extended state */
 static inline void fpu_xsave(struct vcpu *v)
 {
     bool_t ok;
+    uint64_t mask = vcpu_xsave_mask(v);
 
+    ASSERT(mask);
     ASSERT(v->arch.xsave_area);
     /*
      * XCR0 normally represents what guest OS set. In case of Xen itself,
@@ -134,7 +145,7 @@ static inline void fpu_xsave(struct vcpu *v)
      */
     ok = set_xcr0(v->arch.xcr0_accum | XSTATE_FP_SSE);
     ASSERT(ok);
-    xsave(v, v->arch.nonlazy_xstate_used ? XSTATE_ALL : XSTATE_LAZY);
+    xsave(v, mask);
     ok = set_xcr0(v->arch.xcr0 ?: XSTATE_FP_SSE);
     ASSERT(ok);
 }
@@ -267,7 +278,7 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
  */
 void vcpu_save_fpu(struct vcpu *v)
 {
-    if ( !v->fpu_dirtied )
+    if ( !v->fpu_dirtied && !v->arch.nonlazy_xstate_used )
         return;
 
     ASSERT(!is_idle_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 Wed Dec 04 04:23:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:23: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 1Vo3zR-0003oG-35; Wed, 04 Dec 2013 04:23: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 1Vo3zQ-0003ny-26
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:23:08 +0000
Received: from [193.109.254.147:29412] by server-1.bemta-14.messagelabs.com id
	9F/AC-15600-B2EAE925; Wed, 04 Dec 2013 04:23:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1386130985!2716432!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16520 invoked from network); 4 Dec 2013 04:23:06 -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;
	4 Dec 2013 04:23: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 1Vo3zN-0003cU-GR
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:23:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3zN-000443-E9
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:23:05 +0000
Date: Wed, 04 Dec 2013 04:23:05 +0000
Message-Id: <E1Vo3zN-000443-E9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/AMD: work around erratum 793
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b5aa2861dd0b43a3f0bd4358957bc1b2067968d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 14:15:34 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 14:15:34 2013 +0100

    x86/AMD: work around erratum 793
    
    The recommendation is to set a bit in an MSR - do this if the firmware
    didn't, considering that otherwise we expose ourselves to a guest
    induced DoS.
    
    This is CVE-2013-6885 / XSA-82.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 98162f256ee33994a9881a720419dda9ad4c03a8
    master date: 2013-12-03 09:49:54 +0100
---
 xen/arch/x86/cpu/amd.c          |   14 ++++++++++++++
 xen/include/asm-x86/msr-index.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index a317fd1..e20771b 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -522,6 +522,20 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		       "*** Pass \"allow_unsafe\" if you're trusting"
 		       " all your (PV) guest kernels. ***\n");
 
+	if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+		rdmsrl(MSR_AMD64_LS_CFG, value);
+		if (!(value & (1 << 15))) {
+			static bool_t warned;
+
+			if (c == &boot_cpu_data || opt_cpu_info ||
+			    !test_and_set_bool(warned))
+				printk(KERN_WARNING
+				       "CPU%u: Applying workaround for erratum 793\n",
+				       smp_processor_id());
+			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
+		}
+	}
+
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 0c9654c..9c91a22 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -206,6 +206,7 @@
 
 /* AMD64 MSRs */
 #define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
--
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 Wed Dec 04 04:23:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 04:23: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 1Vo3zR-0003oG-35; Wed, 04 Dec 2013 04:23: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 1Vo3zQ-0003ny-26
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:23:08 +0000
Received: from [193.109.254.147:29412] by server-1.bemta-14.messagelabs.com id
	9F/AC-15600-B2EAE925; Wed, 04 Dec 2013 04:23:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1386130985!2716432!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16520 invoked from network); 4 Dec 2013 04:23:06 -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;
	4 Dec 2013 04:23: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 1Vo3zN-0003cU-GR
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:23:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo3zN-000443-E9
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 04:23:05 +0000
Date: Wed, 04 Dec 2013 04:23:05 +0000
Message-Id: <E1Vo3zN-000443-E9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/AMD: work around erratum 793
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b5aa2861dd0b43a3f0bd4358957bc1b2067968d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 14:15:34 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 14:15:34 2013 +0100

    x86/AMD: work around erratum 793
    
    The recommendation is to set a bit in an MSR - do this if the firmware
    didn't, considering that otherwise we expose ourselves to a guest
    induced DoS.
    
    This is CVE-2013-6885 / XSA-82.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 98162f256ee33994a9881a720419dda9ad4c03a8
    master date: 2013-12-03 09:49:54 +0100
---
 xen/arch/x86/cpu/amd.c          |   14 ++++++++++++++
 xen/include/asm-x86/msr-index.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index a317fd1..e20771b 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -522,6 +522,20 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		       "*** Pass \"allow_unsafe\" if you're trusting"
 		       " all your (PV) guest kernels. ***\n");
 
+	if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+		rdmsrl(MSR_AMD64_LS_CFG, value);
+		if (!(value & (1 << 15))) {
+			static bool_t warned;
+
+			if (c == &boot_cpu_data || opt_cpu_info ||
+			    !test_and_set_bool(warned))
+				printk(KERN_WARNING
+				       "CPU%u: Applying workaround for erratum 793\n",
+				       smp_processor_id());
+			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
+		}
+	}
+
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 0c9654c..9c91a22 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -206,6 +206,7 @@
 
 /* AMD64 MSRs */
 #define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
--
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 Wed Dec 04 09:55:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:55: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 1Vo9Aj-0001RK-FG; Wed, 04 Dec 2013 09:55: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 1Vo9Ai-0001RB-Dh
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:08 +0000
Received: from [85.158.137.68:19301] by server-8.bemta-3.messagelabs.com id
	71/50-31081-BFBFE925; Wed, 04 Dec 2013 09:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1386150905!458869!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15315 invoked from network); 4 Dec 2013 09:55:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09: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 1Vo9Af-0007km-Dj
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Af-00064M-4f
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:05 +0000
Date: Wed, 04 Dec 2013 09:55:05 +0000
Message-Id: <E1Vo9Af-00064M-4f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xc_restore: Initialise console
	and store mfns
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 592b614f3469bb83d1158c3dc8c15b67aacfbf4f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:05:47 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:05:34 2013 +0000

    tools/xc_restore: Initialise console and store mfns
    
    If the console or store mfn chunks are not present in the migration stream,
    stack junk gets reported for the mfns.
    
    XenServer had a very hard to track down VM corruption issue caused by exactly
    this issue.  Xenconsoled would connect to a junk mfn and incremented the ring
    pointer if the junk happend to look like a valid gfn.
    
    Coverity ID: 1056093 1056094
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xcutils/xc_restore.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xcutils/xc_restore.c b/tools/xcutils/xc_restore.c
index 5ec90ac..4ea261b 100644
--- a/tools/xcutils/xc_restore.c
+++ b/tools/xcutils/xc_restore.c
@@ -23,7 +23,7 @@ main(int argc, char **argv)
     xc_interface *xch;
     int io_fd, ret;
     int superpages;
-    unsigned long store_mfn, console_mfn;
+    unsigned long store_mfn = 0, console_mfn = 0;
     xentoollog_level lvl;
     xentoollog_logger *l;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:55:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:55: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 1Vo9Aj-0001RK-FG; Wed, 04 Dec 2013 09:55: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 1Vo9Ai-0001RB-Dh
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:08 +0000
Received: from [85.158.137.68:19301] by server-8.bemta-3.messagelabs.com id
	71/50-31081-BFBFE925; Wed, 04 Dec 2013 09:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1386150905!458869!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15315 invoked from network); 4 Dec 2013 09:55:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09: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 1Vo9Af-0007km-Dj
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Af-00064M-4f
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:05 +0000
Date: Wed, 04 Dec 2013 09:55:05 +0000
Message-Id: <E1Vo9Af-00064M-4f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xc_restore: Initialise console
	and store mfns
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 592b614f3469bb83d1158c3dc8c15b67aacfbf4f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:05:47 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:05:34 2013 +0000

    tools/xc_restore: Initialise console and store mfns
    
    If the console or store mfn chunks are not present in the migration stream,
    stack junk gets reported for the mfns.
    
    XenServer had a very hard to track down VM corruption issue caused by exactly
    this issue.  Xenconsoled would connect to a junk mfn and incremented the ring
    pointer if the junk happend to look like a valid gfn.
    
    Coverity ID: 1056093 1056094
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xcutils/xc_restore.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xcutils/xc_restore.c b/tools/xcutils/xc_restore.c
index 5ec90ac..4ea261b 100644
--- a/tools/xcutils/xc_restore.c
+++ b/tools/xcutils/xc_restore.c
@@ -23,7 +23,7 @@ main(int argc, char **argv)
     xc_interface *xch;
     int io_fd, ret;
     int superpages;
-    unsigned long store_mfn, console_mfn;
+    unsigned long store_mfn = 0, console_mfn = 0;
     xentoollog_level lvl;
     xentoollog_logger *l;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:55:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9At-0001SD-Ht; Wed, 04 Dec 2013 09:55: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 1Vo9As-0001S6-25
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:18 +0000
Received: from [85.158.139.211:53556] by server-1.bemta-5.messagelabs.com id
	D5/AF-21065-50CFE925; Wed, 04 Dec 2013 09:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386150915!2161817!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21314 invoked from network); 4 Dec 2013 09:55: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;
	4 Dec 2013 09: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 1Vo9Ap-0007kp-K6
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ap-00064k-HS
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:15 +0000
Date: Wed, 04 Dec 2013 09:55:15 +0000
Message-Id: <E1Vo9Ap-00064k-HS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenctx: Prevent leaking a file
	handle on error paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 022d4ee27cee157949ab70c928cbf77d8cda0e3b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:05:48 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:07:19 2013 +0000

    tools/xenctx: Prevent leaking a file handle on error paths
    
    Coverity ID: 1126110
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/xentrace/xenctx.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 57e3277..ba502fd 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -208,13 +208,16 @@ static void read_symbol_table(const char *symtab)
             continue;
         default:
             symbol = malloc(sizeof(*symbol));
-            if (symbol == NULL)
+            if (symbol == NULL) {
+                fclose(f);
                 return;
+            }
 
             symbol->address = address;
             symbol->name = strdup(p);
             if (symbol->name == NULL) {
                 free(symbol);
+                fclose(f);
                 return;
             }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:55:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9At-0001SD-Ht; Wed, 04 Dec 2013 09:55: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 1Vo9As-0001S6-25
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:18 +0000
Received: from [85.158.139.211:53556] by server-1.bemta-5.messagelabs.com id
	D5/AF-21065-50CFE925; Wed, 04 Dec 2013 09:55:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386150915!2161817!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21314 invoked from network); 4 Dec 2013 09:55: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;
	4 Dec 2013 09: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 1Vo9Ap-0007kp-K6
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ap-00064k-HS
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:15 +0000
Date: Wed, 04 Dec 2013 09:55:15 +0000
Message-Id: <E1Vo9Ap-00064k-HS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenctx: Prevent leaking a file
	handle on error paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 022d4ee27cee157949ab70c928cbf77d8cda0e3b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:05:48 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:07:19 2013 +0000

    tools/xenctx: Prevent leaking a file handle on error paths
    
    Coverity ID: 1126110
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/xentrace/xenctx.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 57e3277..ba502fd 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -208,13 +208,16 @@ static void read_symbol_table(const char *symtab)
             continue;
         default:
             symbol = malloc(sizeof(*symbol));
-            if (symbol == NULL)
+            if (symbol == NULL) {
+                fclose(f);
                 return;
+            }
 
             symbol->address = address;
             symbol->name = strdup(p);
             if (symbol->name == NULL) {
                 free(symbol);
+                fclose(f);
                 return;
             }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09: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 1Vo9B3-0001TG-L7; Wed, 04 Dec 2013 09:55:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9B2-0001T5-AK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:28 +0000
Received: from [85.158.143.35:51320] by server-3.bemta-4.messagelabs.com id
	6F/35-32360-F0CFE925; Wed, 04 Dec 2013 09:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1386150925!3257460!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12327 invoked from network); 4 Dec 2013 09:55:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:55: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 1Vo9Az-0007kv-Ph
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Az-00065p-NY
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:25 +0000
Date: Wed, 04 Dec 2013 09:55:25 +0000
Message-Id: <E1Vo9Az-00065p-NY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Improve
	xc_dom_malloc_filemap() error handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c635c1ef7833e7505423f6567bf99bd355101587
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:05:49 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:13:08 2013 +0000

    tools/libxc: Improve xc_dom_malloc_filemap() error handling
    
    Coverity ID 1055563
    
    In the original function, mmap() could be called with a length of -1 if the
    second lseek failed and the caller had not provided max_size.
    
    While fixing up this error, improve the logging of other error paths.  I know
    from personal experience that debugging failures function is rather difficult
    given only "xc_dom_malloc_filemap: failed (on file <somefile>)" in the logs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxc/xc_dom_core.c |   35 ++++++++++++++++++++++++++++-------
 1 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 705694a..77a4e64 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -176,13 +176,25 @@ void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
 {
     struct xc_dom_mem *block = NULL;
     int fd = -1;
+    off_t offset;
 
     fd = open(filename, O_RDONLY);
-    if ( fd == -1 )
+    if ( fd == -1 ) {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "failed to open file: %s",
+                     strerror(errno));
+        goto err;
+    }
+
+    if ( (lseek(fd, 0, SEEK_SET) == -1) ||
+         ((offset = lseek(fd, 0, SEEK_END)) == -1) ) {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "failed to seek on file: %s",
+                     strerror(errno));
         goto err;
+    }
 
-    lseek(fd, 0, SEEK_SET);
-    *size = lseek(fd, 0, SEEK_END);
+    *size = offset;
 
     if ( max_size && *size > max_size )
     {
@@ -192,14 +204,24 @@ void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
     }
 
     block = malloc(sizeof(*block));
-    if ( block == NULL )
+    if ( block == NULL ) {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "failed to allocate block (%zu bytes)",
+                     sizeof(*block));
         goto err;
+    }
+
     memset(block, 0, sizeof(*block));
     block->mmap_len = *size;
     block->mmap_ptr = mmap(NULL, block->mmap_len, PROT_READ,
                            MAP_SHARED, fd, 0);
-    if ( block->mmap_ptr == MAP_FAILED )
+    if ( block->mmap_ptr == MAP_FAILED ) {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "failed to mmap file: %s",
+                     strerror(errno));
         goto err;
+    }
+
     block->next = dom->memblocks;
     dom->memblocks = block;
     dom->alloc_malloc += sizeof(*block);
@@ -212,8 +234,7 @@ void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
  err:
     if ( fd != -1 )
         close(fd);
-    if ( block != NULL )
-        free(block);
+    free(block);
     DOMPRINTF("%s: failed (on file `%s')", __FUNCTION__, filename);
     return 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 Wed Dec 04 09:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09: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 1Vo9B3-0001TG-L7; Wed, 04 Dec 2013 09:55:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9B2-0001T5-AK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:28 +0000
Received: from [85.158.143.35:51320] by server-3.bemta-4.messagelabs.com id
	6F/35-32360-F0CFE925; Wed, 04 Dec 2013 09:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1386150925!3257460!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12327 invoked from network); 4 Dec 2013 09:55:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:55: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 1Vo9Az-0007kv-Ph
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Az-00065p-NY
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:25 +0000
Date: Wed, 04 Dec 2013 09:55:25 +0000
Message-Id: <E1Vo9Az-00065p-NY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Improve
	xc_dom_malloc_filemap() error handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c635c1ef7833e7505423f6567bf99bd355101587
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:05:49 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:13:08 2013 +0000

    tools/libxc: Improve xc_dom_malloc_filemap() error handling
    
    Coverity ID 1055563
    
    In the original function, mmap() could be called with a length of -1 if the
    second lseek failed and the caller had not provided max_size.
    
    While fixing up this error, improve the logging of other error paths.  I know
    from personal experience that debugging failures function is rather difficult
    given only "xc_dom_malloc_filemap: failed (on file <somefile>)" in the logs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxc/xc_dom_core.c |   35 ++++++++++++++++++++++++++++-------
 1 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 705694a..77a4e64 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -176,13 +176,25 @@ void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
 {
     struct xc_dom_mem *block = NULL;
     int fd = -1;
+    off_t offset;
 
     fd = open(filename, O_RDONLY);
-    if ( fd == -1 )
+    if ( fd == -1 ) {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "failed to open file: %s",
+                     strerror(errno));
+        goto err;
+    }
+
+    if ( (lseek(fd, 0, SEEK_SET) == -1) ||
+         ((offset = lseek(fd, 0, SEEK_END)) == -1) ) {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "failed to seek on file: %s",
+                     strerror(errno));
         goto err;
+    }
 
-    lseek(fd, 0, SEEK_SET);
-    *size = lseek(fd, 0, SEEK_END);
+    *size = offset;
 
     if ( max_size && *size > max_size )
     {
@@ -192,14 +204,24 @@ void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
     }
 
     block = malloc(sizeof(*block));
-    if ( block == NULL )
+    if ( block == NULL ) {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "failed to allocate block (%zu bytes)",
+                     sizeof(*block));
         goto err;
+    }
+
     memset(block, 0, sizeof(*block));
     block->mmap_len = *size;
     block->mmap_ptr = mmap(NULL, block->mmap_len, PROT_READ,
                            MAP_SHARED, fd, 0);
-    if ( block->mmap_ptr == MAP_FAILED )
+    if ( block->mmap_ptr == MAP_FAILED ) {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "failed to mmap file: %s",
+                     strerror(errno));
         goto err;
+    }
+
     block->next = dom->memblocks;
     dom->memblocks = block;
     dom->alloc_malloc += sizeof(*block);
@@ -212,8 +234,7 @@ void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
  err:
     if ( fd != -1 )
         close(fd);
-    if ( block != NULL )
-        free(block);
+    free(block);
     DOMPRINTF("%s: failed (on file `%s')", __FUNCTION__, filename);
     return 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 Wed Dec 04 09:55:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:55: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 1Vo9BD-0001V1-PI; Wed, 04 Dec 2013 09:55: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 1Vo9BC-0001Ul-BH
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:38 +0000
Received: from [85.158.143.35:40109] by server-3.bemta-4.messagelabs.com id
	BF/85-32360-91CFE925; Wed, 04 Dec 2013 09:55:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1386150936!3154867!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17283 invoked from network); 4 Dec 2013 09:55:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09: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 1Vo9B9-0007l6-VT
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9B9-00066F-TL
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:35 +0000
Date: Wed, 04 Dec 2013 09:55:35 +0000
Message-Id: <E1Vo9B9-00066F-TL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xen-mfndump: Avoid munmap(NULL,
	PAGE_SIZE) on certain error paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fa0ddeef7cf160d7064c8ab361518d1f16fb2e7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:05:50 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:15:55 2013 +0000

    tools/xen-mfndump: Avoid munmap(NULL, PAGE_SIZE) on certain error paths
    
    Coverity ID 1090361 1090362 1090363
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/misc/xen-mfndump.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c
index ce73e5b..88cfafa 100644
--- a/tools/misc/xen-mfndump.c
+++ b/tools/misc/xen-mfndump.c
@@ -240,7 +240,8 @@ int dump_ptes_func(int argc, char *argv[])
            domid, pfn, minfo.p2m_table[pfn]);
 
  out:
-    munmap(page, PAGE_SIZE);
+    if ( page )
+        munmap(page, PAGE_SIZE);
     xc_unmap_domain_meminfo(xch, &minfo);
     munmap(m2p_table, M2P_SIZE(max_mfn));
     return rc;
@@ -359,8 +360,10 @@ int memcmp_mfns_func(int argc, char *argv[])
     printf("  memcpy(1, 2) = %d\n", memcmp(page1, page2, PAGE_SIZE));
 
  out:
-    munmap(page1, PAGE_SIZE);
-    munmap(page2, PAGE_SIZE);
+    if ( page1 )
+        munmap(page1, PAGE_SIZE);
+    if ( page2 )
+        munmap(page2, PAGE_SIZE);
     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 Dec 04 09:55:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:55: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 1Vo9BD-0001V1-PI; Wed, 04 Dec 2013 09:55: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 1Vo9BC-0001Ul-BH
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:38 +0000
Received: from [85.158.143.35:40109] by server-3.bemta-4.messagelabs.com id
	BF/85-32360-91CFE925; Wed, 04 Dec 2013 09:55:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1386150936!3154867!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17283 invoked from network); 4 Dec 2013 09:55:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09: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 1Vo9B9-0007l6-VT
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9B9-00066F-TL
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:35 +0000
Date: Wed, 04 Dec 2013 09:55:35 +0000
Message-Id: <E1Vo9B9-00066F-TL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xen-mfndump: Avoid munmap(NULL,
	PAGE_SIZE) on certain error paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fa0ddeef7cf160d7064c8ab361518d1f16fb2e7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:05:50 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:15:55 2013 +0000

    tools/xen-mfndump: Avoid munmap(NULL, PAGE_SIZE) on certain error paths
    
    Coverity ID 1090361 1090362 1090363
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/misc/xen-mfndump.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c
index ce73e5b..88cfafa 100644
--- a/tools/misc/xen-mfndump.c
+++ b/tools/misc/xen-mfndump.c
@@ -240,7 +240,8 @@ int dump_ptes_func(int argc, char *argv[])
            domid, pfn, minfo.p2m_table[pfn]);
 
  out:
-    munmap(page, PAGE_SIZE);
+    if ( page )
+        munmap(page, PAGE_SIZE);
     xc_unmap_domain_meminfo(xch, &minfo);
     munmap(m2p_table, M2P_SIZE(max_mfn));
     return rc;
@@ -359,8 +360,10 @@ int memcmp_mfns_func(int argc, char *argv[])
     printf("  memcpy(1, 2) = %d\n", memcmp(page1, page2, PAGE_SIZE));
 
  out:
-    munmap(page1, PAGE_SIZE);
-    munmap(page2, PAGE_SIZE);
+    if ( page1 )
+        munmap(page1, PAGE_SIZE);
+    if ( page2 )
+        munmap(page2, PAGE_SIZE);
     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 Dec 04 09:55:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:55: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 1Vo9BN-0001Wd-SB; Wed, 04 Dec 2013 09:55:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9BM-0001WR-Rt
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:48 +0000
Received: from [85.158.143.35:57567] by server-2.bemta-4.messagelabs.com id
	C7/9A-11386-42CFE925; Wed, 04 Dec 2013 09:55:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1386150946!3224206!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19396 invoked from network); 4 Dec 2013 09:55:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09: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 1Vo9BK-0007lC-6a
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9BK-00066f-3L
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:46 +0000
Date: Wed, 04 Dec 2013 09:55:46 +0000
Message-Id: <E1Vo9BK-00066f-3L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xen-mfndump: Avoid using -ERROR
	as an upper loop bound
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f55f10a27c2df554fed42579ef7b374aab5ff262
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:05:51 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:16:11 2013 +0000

    tools/xen-mfndump: Avoid using -ERROR as an upper loop bound
    
    Coverity ID: 1090375
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/misc/xen-mfndump.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c
index 88cfafa..dea9fa9 100644
--- a/tools/misc/xen-mfndump.c
+++ b/tools/misc/xen-mfndump.c
@@ -30,7 +30,8 @@ int help_func(int argc, char *argv[])
 
 int dump_m2p_func(int argc, char *argv[])
 {
-    unsigned long i, max_mfn;
+    unsigned long i;
+    long max_mfn;
     xen_pfn_t *m2p_table;
 
     if ( argc > 0 )
@@ -41,6 +42,12 @@ int dump_m2p_func(int argc, char *argv[])
 
     /* Map M2P and obtain gpfn */
     max_mfn = xc_maximum_ram_page(xch);
+    if ( max_mfn < 0 )
+    {
+        ERROR("Failed to get the maximum mfn");
+        return -1;
+    }
+
     if ( !(m2p_table = xc_map_m2p(xch, max_mfn, PROT_READ, NULL)) )
     {
         ERROR("Failed to map live M2P table");
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:55:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:55: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 1Vo9BN-0001Wd-SB; Wed, 04 Dec 2013 09:55:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9BM-0001WR-Rt
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:48 +0000
Received: from [85.158.143.35:57567] by server-2.bemta-4.messagelabs.com id
	C7/9A-11386-42CFE925; Wed, 04 Dec 2013 09:55:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1386150946!3224206!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19396 invoked from network); 4 Dec 2013 09:55:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09: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 1Vo9BK-0007lC-6a
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9BK-00066f-3L
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:46 +0000
Date: Wed, 04 Dec 2013 09:55:46 +0000
Message-Id: <E1Vo9BK-00066f-3L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xen-mfndump: Avoid using -ERROR
	as an upper loop bound
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f55f10a27c2df554fed42579ef7b374aab5ff262
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:05:51 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:16:11 2013 +0000

    tools/xen-mfndump: Avoid using -ERROR as an upper loop bound
    
    Coverity ID: 1090375
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/misc/xen-mfndump.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c
index 88cfafa..dea9fa9 100644
--- a/tools/misc/xen-mfndump.c
+++ b/tools/misc/xen-mfndump.c
@@ -30,7 +30,8 @@ int help_func(int argc, char *argv[])
 
 int dump_m2p_func(int argc, char *argv[])
 {
-    unsigned long i, max_mfn;
+    unsigned long i;
+    long max_mfn;
     xen_pfn_t *m2p_table;
 
     if ( argc > 0 )
@@ -41,6 +42,12 @@ int dump_m2p_func(int argc, char *argv[])
 
     /* Map M2P and obtain gpfn */
     max_mfn = xc_maximum_ram_page(xch);
+    if ( max_mfn < 0 )
+    {
+        ERROR("Failed to get the maximum mfn");
+        return -1;
+    }
+
     if ( !(m2p_table = xc_map_m2p(xch, max_mfn, PROT_READ, NULL)) )
     {
         ERROR("Failed to map live M2P table");
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:56:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56: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 1Vo9BX-0001YT-Vn; Wed, 04 Dec 2013 09:55:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9BW-0001YI-VK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:59 +0000
Received: from [193.109.254.147:22792] by server-10.bemta-14.messagelabs.com
	id 60/03-20752-E2CFE925; Wed, 04 Dec 2013 09:55:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1386150956!1278711!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14931 invoked from network); 4 Dec 2013 09:55:57 -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;
	4 Dec 2013 09: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 1Vo9BU-0007lL-Bd
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9BU-000672-9x
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:56 +0000
Date: Wed, 04 Dec 2013 09:55:56 +0000
Message-Id: <E1Vo9BU-000672-9x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenconsole: Use
	xc_domain_getinfo() correctly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa344500a3bfceb3ef01931609ac1cfaf6dcf52d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:06:38 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:18:05 2013 +0000

    tools/xenconsole: Use xc_domain_getinfo() correctly
    
    Coverity ID: 1055018
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/console/client/main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 523fc23..38c856a 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -339,7 +339,11 @@ int main(int argc, char **argv)
 		xc_interface *xc_handle = xc_interface_open(0,0,0);
 		if (xc_handle == NULL)
 			err(errno, "Could not open xc interface");
-		xc_domain_getinfo(xc_handle, domid, 1, &xcinfo);
+		if ( (xc_domain_getinfo(xc_handle, domid, 1, &xcinfo) != 1) ||
+		     (xcinfo.domid != domid) ) {
+			xc_interface_close(xc_handle);
+			err(errno, "Failed to get domain information");
+		}
 		/* default to pv console for pv guests and serial for hvm guests */
 		if (xcinfo.hvm)
 			type = CONSOLE_SERIAL;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:56:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56: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 1Vo9BX-0001YT-Vn; Wed, 04 Dec 2013 09:55:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9BW-0001YI-VK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:59 +0000
Received: from [193.109.254.147:22792] by server-10.bemta-14.messagelabs.com
	id 60/03-20752-E2CFE925; Wed, 04 Dec 2013 09:55:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1386150956!1278711!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14931 invoked from network); 4 Dec 2013 09:55:57 -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;
	4 Dec 2013 09: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 1Vo9BU-0007lL-Bd
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9BU-000672-9x
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:55:56 +0000
Date: Wed, 04 Dec 2013 09:55:56 +0000
Message-Id: <E1Vo9BU-000672-9x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenconsole: Use
	xc_domain_getinfo() correctly
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa344500a3bfceb3ef01931609ac1cfaf6dcf52d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:06:38 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:18:05 2013 +0000

    tools/xenconsole: Use xc_domain_getinfo() correctly
    
    Coverity ID: 1055018
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/console/client/main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 523fc23..38c856a 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -339,7 +339,11 @@ int main(int argc, char **argv)
 		xc_interface *xc_handle = xc_interface_open(0,0,0);
 		if (xc_handle == NULL)
 			err(errno, "Could not open xc interface");
-		xc_domain_getinfo(xc_handle, domid, 1, &xcinfo);
+		if ( (xc_domain_getinfo(xc_handle, domid, 1, &xcinfo) != 1) ||
+		     (xcinfo.domid != domid) ) {
+			xc_interface_close(xc_handle);
+			err(errno, "Failed to get domain information");
+		}
 		/* default to pv console for pv guests and serial for hvm guests */
 		if (xcinfo.hvm)
 			type = CONSOLE_SERIAL;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:56:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56: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 1Vo9Bj-0001aK-2R; Wed, 04 Dec 2013 09:56: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 1Vo9Bh-0001a1-3e
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:09 +0000
Received: from [85.158.139.211:10633] by server-11.bemta-5.messagelabs.com id
	62/47-23268-83CFE925; Wed, 04 Dec 2013 09:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386150966!2154476!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32370 invoked from network); 4 Dec 2013 09:56:07 -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;
	4 Dec 2013 09: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 1Vo9Be-0007lu-HR
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Be-00067Z-FK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:06 +0000
Date: Wed, 04 Dec 2013 09:56:06 +0000
Message-Id: <E1Vo9Be-00067Z-FK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenconsoled: Fix file handle
	leaks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9ab1792e1ce9e77afe2cd230d69e56a0737a735f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:06:39 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:19:31 2013 +0000

    tools/xenconsoled: Fix file handle leaks
    
    Coverity ID: 715218 1055876 1055877
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/console/daemon/io.c    |    2 ++
 tools/console/daemon/utils.c |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 250550a..007ecf4 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -278,6 +278,7 @@ static int create_hv_log(void)
 			dolog(LOG_ERR, "Failed to log opening timestamp "
 				       "in %s: %d (%s)", logfile, errno,
 				       strerror(errno));
+			close(fd);
 			return -1;
 		}
 	}
@@ -323,6 +324,7 @@ static int create_domain_log(struct domain *dom)
 			dolog(LOG_ERR, "Failed to log opening timestamp "
 				       "in %s: %d (%s)", logfile, errno,
 				       strerror(errno));
+			close(fd);
 			return -1;
 		}
 	}
diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c
index aab6f42..71dd185 100644
--- a/tools/console/daemon/utils.c
+++ b/tools/console/daemon/utils.c
@@ -104,6 +104,7 @@ void daemonize(const char *pidfile)
 	signal(SIGTSTP, SIG_IGN);
 	signal(SIGTTOU, SIG_IGN);
 	signal(SIGTTIN, SIG_IGN);
+	close(fd);
 }
 
 bool xen_setup(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 Dec 04 09:56:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56: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 1Vo9Bj-0001aK-2R; Wed, 04 Dec 2013 09:56: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 1Vo9Bh-0001a1-3e
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:09 +0000
Received: from [85.158.139.211:10633] by server-11.bemta-5.messagelabs.com id
	62/47-23268-83CFE925; Wed, 04 Dec 2013 09:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386150966!2154476!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32370 invoked from network); 4 Dec 2013 09:56:07 -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;
	4 Dec 2013 09: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 1Vo9Be-0007lu-HR
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Be-00067Z-FK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:06 +0000
Date: Wed, 04 Dec 2013 09:56:06 +0000
Message-Id: <E1Vo9Be-00067Z-FK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenconsoled: Fix file handle
	leaks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9ab1792e1ce9e77afe2cd230d69e56a0737a735f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:06:39 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:19:31 2013 +0000

    tools/xenconsoled: Fix file handle leaks
    
    Coverity ID: 715218 1055876 1055877
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/console/daemon/io.c    |    2 ++
 tools/console/daemon/utils.c |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 250550a..007ecf4 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -278,6 +278,7 @@ static int create_hv_log(void)
 			dolog(LOG_ERR, "Failed to log opening timestamp "
 				       "in %s: %d (%s)", logfile, errno,
 				       strerror(errno));
+			close(fd);
 			return -1;
 		}
 	}
@@ -323,6 +324,7 @@ static int create_domain_log(struct domain *dom)
 			dolog(LOG_ERR, "Failed to log opening timestamp "
 				       "in %s: %d (%s)", logfile, errno,
 				       strerror(errno));
+			close(fd);
 			return -1;
 		}
 	}
diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c
index aab6f42..71dd185 100644
--- a/tools/console/daemon/utils.c
+++ b/tools/console/daemon/utils.c
@@ -104,6 +104,7 @@ void daemonize(const char *pidfile)
 	signal(SIGTSTP, SIG_IGN);
 	signal(SIGTTOU, SIG_IGN);
 	signal(SIGTTIN, SIG_IGN);
+	close(fd);
 }
 
 bool xen_setup(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 Dec 04 09:56:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56: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 1Vo9Bu-0001cq-7M; Wed, 04 Dec 2013 09:56:22 +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 1Vo9Bt-0001cL-15
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:21 +0000
Received: from [193.109.254.147:30244] by server-8.bemta-14.messagelabs.com id
	05/8C-30921-24CFE925; Wed, 04 Dec 2013 09:56:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1386150976!2796088!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30692 invoked from network); 4 Dec 2013 09:56:17 -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;
	4 Dec 2013 09: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 1Vo9Bo-0007m0-Lx
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Bo-00068T-KP
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:16 +0000
Date: Wed, 04 Dec 2013 09:56:16 +0000
Message-Id: <E1Vo9Bo-00068T-KP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstore: Fix 15 potential
	resource leaks in 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 3bca826aae5eb47af4b56487f81cce86995fc9df
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:07:41 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:22:11 2013 +0000

    tools/xenstore: Fix 15 potential resource leaks in build()
    
    Coverity ID: 1055933 1055934
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/xenstore/init-xenstore-domain.c |   45 +++++++++++++++++++-------------
 1 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/tools/xenstore/init-xenstore-domain.c b/tools/xenstore/init-xenstore-domain.c
index 35f1aa3..56a3c72 100644
--- a/tools/xenstore/init-xenstore-domain.c
+++ b/tools/xenstore/init-xenstore-domain.c
@@ -18,51 +18,60 @@ static int build(xc_interface *xch, char** argv)
 	char cmdline[512];
 	uint32_t ssid;
 	xen_domain_handle_t handle = { 0 };
-	int rv;
-	int xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
-	struct xc_dom_image *dom;
+	int rv, xs_fd;
+	struct xc_dom_image *dom = NULL;
 	int maxmem = atoi(argv[2]);
 	int limit_kb = (maxmem + 1)*1024;
 
+	xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
+	if (xs_fd == -1) return -1;
+
 	rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_domain_create(xch, ssid, handle, 0, &domid);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_domain_max_vcpus(xch, domid, 1);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_domain_setmaxmem(xch, domid, limit_kb);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
-	if (rv) return rv;
+	if (rv) goto err;
 
 	rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
-	if (rv < 0) return rv;
+	if (rv < 0) goto err;
 	snprintf(cmdline, 512, "--event %d --internal-db", rv);
 
 	dom = xc_dom_allocate(xch, cmdline, NULL);
 	rv = xc_dom_kernel_file(dom, argv[1]);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_boot_xen_init(dom, xch, domid);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_parse_image(dom);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_mem_init(dom, maxmem);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_boot_mem_init(dom);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_build_image(dom);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_boot_image(dom);
-	if (rv) return rv;
+	if (rv) goto err;
 
 	xc_dom_release(dom);
+	dom = NULL;
 
 	rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_domain_unpause(xch, domid);
-	if (rv) return rv;
+	if (rv) goto err;
 
 	return 0;
+
+err:
+	if (dom)
+		xc_dom_release(dom);
+	close(xs_fd);
+	return rv;
 }
 
 int main(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 Wed Dec 04 09:56:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56: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 1Vo9Bu-0001cq-7M; Wed, 04 Dec 2013 09:56:22 +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 1Vo9Bt-0001cL-15
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:21 +0000
Received: from [193.109.254.147:30244] by server-8.bemta-14.messagelabs.com id
	05/8C-30921-24CFE925; Wed, 04 Dec 2013 09:56:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1386150976!2796088!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30692 invoked from network); 4 Dec 2013 09:56:17 -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;
	4 Dec 2013 09: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 1Vo9Bo-0007m0-Lx
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Bo-00068T-KP
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:16 +0000
Date: Wed, 04 Dec 2013 09:56:16 +0000
Message-Id: <E1Vo9Bo-00068T-KP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstore: Fix 15 potential
	resource leaks in 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 3bca826aae5eb47af4b56487f81cce86995fc9df
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:07:41 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:22:11 2013 +0000

    tools/xenstore: Fix 15 potential resource leaks in build()
    
    Coverity ID: 1055933 1055934
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/xenstore/init-xenstore-domain.c |   45 +++++++++++++++++++-------------
 1 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/tools/xenstore/init-xenstore-domain.c b/tools/xenstore/init-xenstore-domain.c
index 35f1aa3..56a3c72 100644
--- a/tools/xenstore/init-xenstore-domain.c
+++ b/tools/xenstore/init-xenstore-domain.c
@@ -18,51 +18,60 @@ static int build(xc_interface *xch, char** argv)
 	char cmdline[512];
 	uint32_t ssid;
 	xen_domain_handle_t handle = { 0 };
-	int rv;
-	int xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
-	struct xc_dom_image *dom;
+	int rv, xs_fd;
+	struct xc_dom_image *dom = NULL;
 	int maxmem = atoi(argv[2]);
 	int limit_kb = (maxmem + 1)*1024;
 
+	xs_fd = open("/dev/xen/xenbus_backend", O_RDWR);
+	if (xs_fd == -1) return -1;
+
 	rv = xc_flask_context_to_sid(xch, argv[3], strlen(argv[3]), &ssid);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_domain_create(xch, ssid, handle, 0, &domid);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_domain_max_vcpus(xch, domid, 1);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_domain_setmaxmem(xch, domid, limit_kb);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
-	if (rv) return rv;
+	if (rv) goto err;
 
 	rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
-	if (rv < 0) return rv;
+	if (rv < 0) goto err;
 	snprintf(cmdline, 512, "--event %d --internal-db", rv);
 
 	dom = xc_dom_allocate(xch, cmdline, NULL);
 	rv = xc_dom_kernel_file(dom, argv[1]);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_boot_xen_init(dom, xch, domid);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_parse_image(dom);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_mem_init(dom, maxmem);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_boot_mem_init(dom);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_build_image(dom);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_dom_boot_image(dom);
-	if (rv) return rv;
+	if (rv) goto err;
 
 	xc_dom_release(dom);
+	dom = NULL;
 
 	rv = xc_domain_set_virq_handler(xch, domid, VIRQ_DOM_EXC);
-	if (rv) return rv;
+	if (rv) goto err;
 	rv = xc_domain_unpause(xch, domid);
-	if (rv) return rv;
+	if (rv) goto err;
 
 	return 0;
+
+err:
+	if (dom)
+		xc_dom_release(dom);
+	close(xs_fd);
+	return rv;
 }
 
 int main(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 Wed Dec 04 09:56:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56: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 1Vo9C3-0001eR-AP; Wed, 04 Dec 2013 09:56: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 1Vo9C1-0001e8-Fu
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:29 +0000
Received: from [85.158.137.68:48687] by server-10.bemta-3.messagelabs.com id
	C7/16-23989-C4CFE925; Wed, 04 Dec 2013 09:56:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1386150987!1622237!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18100 invoked from network); 4 Dec 2013 09:56:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:56: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 1Vo9By-0007m6-Sh
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9By-00068v-Pp
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:26 +0000
Date: Wed, 04 Dec 2013 09:56:26 +0000
Message-Id: <E1Vo9By-00068v-Pp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstore-rm: Fix memory leaks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 05e243a6a0a6026458ff7ccdc94e308bf8727deb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:07:42 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:24:11 2013 +0000

    tools/xenstore-rm: Fix memory leaks
    
    Coverity ID: 1055935
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xenstore_client.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
index 3ac214b..0ec103f 100644
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -367,10 +367,13 @@ perform(enum mode mode, int optind, int argc, char **argv, struct xs_handle *xsh
 
                         if (list) {
                             free(list);
-                            if (num == 0)
+                            if (num == 0){
+                                free(val);
                                 goto again;
+                            }
                         }
                     }
+                    free(val);
                 }
 
                 free(path);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:56:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56: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 1Vo9C3-0001eR-AP; Wed, 04 Dec 2013 09:56: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 1Vo9C1-0001e8-Fu
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:29 +0000
Received: from [85.158.137.68:48687] by server-10.bemta-3.messagelabs.com id
	C7/16-23989-C4CFE925; Wed, 04 Dec 2013 09:56:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1386150987!1622237!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18100 invoked from network); 4 Dec 2013 09:56:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:56: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 1Vo9By-0007m6-Sh
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9By-00068v-Pp
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:26 +0000
Date: Wed, 04 Dec 2013 09:56:26 +0000
Message-Id: <E1Vo9By-00068v-Pp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstore-rm: Fix memory leaks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 05e243a6a0a6026458ff7ccdc94e308bf8727deb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:07:42 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:24:11 2013 +0000

    tools/xenstore-rm: Fix memory leaks
    
    Coverity ID: 1055935
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xenstore_client.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
index 3ac214b..0ec103f 100644
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -367,10 +367,13 @@ perform(enum mode mode, int optind, int argc, char **argv, struct xs_handle *xsh
 
                         if (list) {
                             free(list);
-                            if (num == 0)
+                            if (num == 0){
+                                free(val);
                                 goto again;
+                            }
                         }
                     }
+                    free(val);
                 }
 
                 free(path);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:56:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9CN-0001hF-Dc; Wed, 04 Dec 2013 09:56: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 1Vo9CL-0001gy-Eu
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:49 +0000
Received: from [193.109.254.147:25063] by server-7.bemta-14.messagelabs.com id
	44/16-15500-06CFE925; Wed, 04 Dec 2013 09:56:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1386151007!1278929!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26861 invoked from network); 4 Dec 2013 09:56: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;
	4 Dec 2013 09: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 1Vo9CJ-0007mJ-65
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9CJ-00069h-4w
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:47 +0000
Date: Wed, 04 Dec 2013 09:56:47 +0000
Message-Id: <E1Vo9CJ-00069h-4w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Avoid deliberate NULL
	pointer dereference
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1677af03c14f2d8d88d2ed9ed8ce6d4906d19fb4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:12:50 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:29:48 2013 +0000

    tools/libxl: Avoid deliberate NULL pointer dereference
    
    Coverity ID: 1055290
    
    Calling LIBXL__LOG_ERRNO(ctx,) with a ctx pointer we have just failed to
    allocate is going to end badly.  Opencode a suitable use of xtl_log() instead.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 9b93262..6263d14 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -31,7 +31,9 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version,
 
     ctx = malloc(sizeof(*ctx));
     if (!ctx) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to allocate context\n");
+        xtl_log(lg, XTL_ERROR, errno, "libxl",
+                "%s:%d:%s: Failed to allocate context\n",
+                __FILE__, __LINE__, __func__);
         rc = ERROR_NOMEM; goto 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 Wed Dec 04 09:56:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9CN-0001hF-Dc; Wed, 04 Dec 2013 09:56: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 1Vo9CL-0001gy-Eu
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:49 +0000
Received: from [193.109.254.147:25063] by server-7.bemta-14.messagelabs.com id
	44/16-15500-06CFE925; Wed, 04 Dec 2013 09:56:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1386151007!1278929!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26861 invoked from network); 4 Dec 2013 09:56: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;
	4 Dec 2013 09: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 1Vo9CJ-0007mJ-65
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9CJ-00069h-4w
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:47 +0000
Date: Wed, 04 Dec 2013 09:56:47 +0000
Message-Id: <E1Vo9CJ-00069h-4w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Avoid deliberate NULL
	pointer dereference
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1677af03c14f2d8d88d2ed9ed8ce6d4906d19fb4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:12:50 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:29:48 2013 +0000

    tools/libxl: Avoid deliberate NULL pointer dereference
    
    Coverity ID: 1055290
    
    Calling LIBXL__LOG_ERRNO(ctx,) with a ctx pointer we have just failed to
    allocate is going to end badly.  Opencode a suitable use of xtl_log() instead.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 9b93262..6263d14 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -31,7 +31,9 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version,
 
     ctx = malloc(sizeof(*ctx));
     if (!ctx) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to allocate context\n");
+        xtl_log(lg, XTL_ERROR, errno, "libxl",
+                "%s:%d:%s: Failed to allocate context\n",
+                __FILE__, __LINE__, __func__);
         rc = ERROR_NOMEM; goto 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 Wed Dec 04 09:56:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9CN-0001hV-Ft; Wed, 04 Dec 2013 09:56: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 1Vo9CM-0001h5-7k
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:50 +0000
Received: from [193.109.254.147:27025] by server-14.bemta-14.messagelabs.com
	id 0B/C8-12628-16CFE925; Wed, 04 Dec 2013 09:56:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1386150997!2769889!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1607 invoked from network); 4 Dec 2013 09:56:38 -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;
	4 Dec 2013 09:56: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 1Vo9C9-0007mE-1h
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9C8-00069L-Vt
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:37 +0000
Date: Wed, 04 Dec 2013 09:56:36 +0000
Message-Id: <E1Vo9C8-00069L-Vt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstored: Don't leak a file
	handle when creating the pidfile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 375b0e1bfba15d4493a24d7b0e33d573d0e2fc3a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:07:44 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:28:41 2013 +0000

    tools/xenstored: Don't leak a file handle when creating the pidfile
    
    Coverity ID: 1055849
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xenstored_posix.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/xenstore/xenstored_posix.c b/tools/xenstore/xenstored_posix.c
index 25bdf74..0c93e6d 100644
--- a/tools/xenstore/xenstored_posix.c
+++ b/tools/xenstore/xenstored_posix.c
@@ -44,6 +44,8 @@ void write_pidfile(const char *pidfile)
 	len = snprintf(buf, sizeof(buf), "%ld\n", (long)getpid());
 	if (write(fd, buf, len) != len)
 		barf_perror("Writing pid file %s", pidfile);
+
+	close(fd);
 }
 
 /* Stevens. */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:56:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:56:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9CN-0001hV-Ft; Wed, 04 Dec 2013 09:56: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 1Vo9CM-0001h5-7k
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:50 +0000
Received: from [193.109.254.147:27025] by server-14.bemta-14.messagelabs.com
	id 0B/C8-12628-16CFE925; Wed, 04 Dec 2013 09:56:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1386150997!2769889!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1607 invoked from network); 4 Dec 2013 09:56:38 -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;
	4 Dec 2013 09:56: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 1Vo9C9-0007mE-1h
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9C8-00069L-Vt
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:37 +0000
Date: Wed, 04 Dec 2013 09:56:36 +0000
Message-Id: <E1Vo9C8-00069L-Vt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstored: Don't leak a file
	handle when creating the pidfile
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 375b0e1bfba15d4493a24d7b0e33d573d0e2fc3a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:07:44 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:28:41 2013 +0000

    tools/xenstored: Don't leak a file handle when creating the pidfile
    
    Coverity ID: 1055849
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xenstored_posix.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/xenstore/xenstored_posix.c b/tools/xenstore/xenstored_posix.c
index 25bdf74..0c93e6d 100644
--- a/tools/xenstore/xenstored_posix.c
+++ b/tools/xenstore/xenstored_posix.c
@@ -44,6 +44,8 @@ void write_pidfile(const char *pidfile)
 	len = snprintf(buf, sizeof(buf), "%ld\n", (long)getpid());
 	if (write(fd, buf, len) != len)
 		barf_perror("Writing pid file %s", pidfile);
+
+	close(fd);
 }
 
 /* Stevens. */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:57:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9CY-0001ji-Ah; Wed, 04 Dec 2013 09:57:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9CV-0001jW-UJ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:00 +0000
Received: from [85.158.139.211:24899] by server-12.bemta-5.messagelabs.com id
	2D/7A-30017-B6CFE925; Wed, 04 Dec 2013 09:56:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386151017!2154781!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5881 invoked from network); 4 Dec 2013 09:56:58 -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;
	4 Dec 2013 09:56: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 1Vo9CT-0007mX-BU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9CT-0006A3-9V
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:57 +0000
Date: Wed, 04 Dec 2013 09:56:57 +0000
Message-Id: <E1Vo9CT-0006A3-9V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Fix integer overflows in
	sched_sedf_domain_set()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9c01516fee7d548af58fd310d3c93dd71ea9ea28
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:12:51 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:33:25 2013 +0000

    tools/libxl: Fix integer overflows in sched_sedf_domain_set()
    
    Coverity ID: 1055662 1055663 1055664
    
    Widen from int to uint64_t before multiplcation, rather than afterwards.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 6263d14..2b847ef 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4924,11 +4924,11 @@ static int sched_sedf_domain_set(libxl__gc *gc, uint32_t domid,
     }
 
     if (scinfo->period != LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT)
-        period = scinfo->period * 1000000;
+        period = (uint64_t)scinfo->period * 1000000;
     if (scinfo->slice != LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT)
-        slice = scinfo->slice * 1000000;
+        slice = (uint64_t)scinfo->slice * 1000000;
     if (scinfo->latency != LIBXL_DOMAIN_SCHED_PARAM_LATENCY_DEFAULT)
-        latency = scinfo->latency * 1000000;
+        latency = (uint64_t)scinfo->latency * 1000000;
     if (scinfo->extratime != LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT)
         extratime = scinfo->extratime;
     if (scinfo->weight != LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_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 Wed Dec 04 09:57:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9CY-0001ji-Ah; Wed, 04 Dec 2013 09:57:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9CV-0001jW-UJ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:00 +0000
Received: from [85.158.139.211:24899] by server-12.bemta-5.messagelabs.com id
	2D/7A-30017-B6CFE925; Wed, 04 Dec 2013 09:56:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386151017!2154781!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5881 invoked from network); 4 Dec 2013 09:56:58 -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;
	4 Dec 2013 09:56: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 1Vo9CT-0007mX-BU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9CT-0006A3-9V
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:56:57 +0000
Date: Wed, 04 Dec 2013 09:56:57 +0000
Message-Id: <E1Vo9CT-0006A3-9V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Fix integer overflows in
	sched_sedf_domain_set()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9c01516fee7d548af58fd310d3c93dd71ea9ea28
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:12:51 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 12:33:25 2013 +0000

    tools/libxl: Fix integer overflows in sched_sedf_domain_set()
    
    Coverity ID: 1055662 1055663 1055664
    
    Widen from int to uint64_t before multiplcation, rather than afterwards.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 6263d14..2b847ef 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4924,11 +4924,11 @@ static int sched_sedf_domain_set(libxl__gc *gc, uint32_t domid,
     }
 
     if (scinfo->period != LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT)
-        period = scinfo->period * 1000000;
+        period = (uint64_t)scinfo->period * 1000000;
     if (scinfo->slice != LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT)
-        slice = scinfo->slice * 1000000;
+        slice = (uint64_t)scinfo->slice * 1000000;
     if (scinfo->latency != LIBXL_DOMAIN_SCHED_PARAM_LATENCY_DEFAULT)
-        latency = scinfo->latency * 1000000;
+        latency = (uint64_t)scinfo->latency * 1000000;
     if (scinfo->extratime != LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT)
         extratime = scinfo->extratime;
     if (scinfo->weight != LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_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 Wed Dec 04 09:57:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9Ch-0001l2-BL; Wed, 04 Dec 2013 09:57: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 1Vo9Cg-0001ks-9h
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:10 +0000
Received: from [85.158.137.68:6284] by server-4.bemta-3.messagelabs.com id
	77/7B-10414-57CFE925; Wed, 04 Dec 2013 09:57:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1386151027!1611897!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28149 invoked from network); 4 Dec 2013 09:57:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:57: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 1Vo9Cd-0007n3-I3
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Cd-0006AZ-Gw
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:07 +0000
Date: Wed, 04 Dec 2013 09:57:07 +0000
Message-Id: <E1Vo9Cd-0006AZ-Gw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Fix memory leak in
	sched_domain_output()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0792426b798fd3b39909d618cf8fe8bac30594f4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:16:48 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 13:39:51 2013 +0000

    tools/libxl: Fix memory leak in sched_domain_output()
    
    Coverity ID: 1055904
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
---
 tools/libxl/xl_cmdimpl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 341863e..bdb4be3 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5094,6 +5094,7 @@ static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
     poolinfo = libxl_list_cpupool(ctx, &n_pools);
     if (!poolinfo) {
         fprintf(stderr, "error getting cpupool info\n");
+        libxl_dominfo_list_free(info, nb_domain);
         return -ERROR_NOMEM;
     }
 
@@ -5115,6 +5116,7 @@ static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
     }
 
     libxl_cpupoolinfo_list_free(poolinfo, n_pools);
+    libxl_dominfo_list_free(info, nb_domain);
     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 Dec 04 09:57:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9Ch-0001l2-BL; Wed, 04 Dec 2013 09:57: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 1Vo9Cg-0001ks-9h
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:10 +0000
Received: from [85.158.137.68:6284] by server-4.bemta-3.messagelabs.com id
	77/7B-10414-57CFE925; Wed, 04 Dec 2013 09:57:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1386151027!1611897!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28149 invoked from network); 4 Dec 2013 09:57:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:57: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 1Vo9Cd-0007n3-I3
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Cd-0006AZ-Gw
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:07 +0000
Date: Wed, 04 Dec 2013 09:57:07 +0000
Message-Id: <E1Vo9Cd-0006AZ-Gw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Fix memory leak in
	sched_domain_output()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0792426b798fd3b39909d618cf8fe8bac30594f4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:16:48 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Nov 25 13:39:51 2013 +0000

    tools/libxl: Fix memory leak in sched_domain_output()
    
    Coverity ID: 1055904
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
---
 tools/libxl/xl_cmdimpl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 341863e..bdb4be3 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5094,6 +5094,7 @@ static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
     poolinfo = libxl_list_cpupool(ctx, &n_pools);
     if (!poolinfo) {
         fprintf(stderr, "error getting cpupool info\n");
+        libxl_dominfo_list_free(info, nb_domain);
         return -ERROR_NOMEM;
     }
 
@@ -5115,6 +5116,7 @@ static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
     }
 
     libxl_cpupoolinfo_list_free(poolinfo, n_pools);
+    libxl_dominfo_list_free(info, nb_domain);
     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 Dec 04 09:57:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9Cr-0001n2-EF; Wed, 04 Dec 2013 09:57: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 1Vo9Cq-0001ml-7L
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:20 +0000
Received: from [85.158.143.35:19992] by server-3.bemta-4.messagelabs.com id
	BC/C8-32360-F7CFE925; Wed, 04 Dec 2013 09:57:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1386151037!3179494!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1473 invoked from network); 4 Dec 2013 09:57:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:57: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 1Vo9Cn-0007nC-O2
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Cn-0006Bg-LC
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:17 +0000
Date: Wed, 04 Dec 2013 09:57:17 +0000
Message-Id: <E1Vo9Cn-0006Bg-LC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/pvh: set only minimal cr0 and cr4
	flags in order to use paging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============1571913478404711720=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 51e2cac257ec8b4080d89f0855c498cbbd76a5e5
Author:     Roger Pau MonnÃ© <roger.pau@citrix.com>
AuthorDate: Tue Nov 26 09:52:47 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 26 09:52:47 2013 +0100

    x86/pvh: set only minimal cr0 and cr4 flags in order to use paging
    
    Right now Xen sets the WP and NE flags on cr0 for PVH, which are not
    needed in order to boot with paging enabled. The same happens with
    cr4, at least on my system OSFXSR, OSXMMEXCPT and MCE are enabled by
    default when there's no need.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Mukesh Rathor <mukesh.rathor@oracle.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 4aab971..44f33cb 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -28,7 +28,6 @@
 #include <asm/msr.h>
 #include <asm/xstate.h>
 #include <asm/hvm/hvm.h>
-#include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/io.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
@@ -1090,13 +1089,11 @@ static int construct_vmcs(struct vcpu *v)
 
     /* PVH domains always start in paging mode */
     if ( is_pvh_domain(d) )
-        v->arch.hvm_vcpu.guest_cr[0] |= X86_CR0_PG | X86_CR0_NE | X86_CR0_WP;
+        v->arch.hvm_vcpu.guest_cr[0] |= X86_CR0_PG;
 
     hvm_update_guest_cr(v, 0);
 
-    v->arch.hvm_vcpu.guest_cr[4] = is_pvh_domain(d) ?
-        (real_cr4_to_pv_guest_cr4(mmu_cr4_features)
-         & ~HVM_CR4_GUEST_RESERVED_BITS(v)) : 0;
+    v->arch.hvm_vcpu.guest_cr[4] = is_pvh_domain(d) ? X86_CR4_PAE : 0;
     hvm_update_guest_cr(v, 4);
 
     if ( cpu_has_vmx_tpr_shadow )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Dec 04 09:57:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9Cr-0001n2-EF; Wed, 04 Dec 2013 09:57: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 1Vo9Cq-0001ml-7L
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:20 +0000
Received: from [85.158.143.35:19992] by server-3.bemta-4.messagelabs.com id
	BC/C8-32360-F7CFE925; Wed, 04 Dec 2013 09:57:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1386151037!3179494!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1473 invoked from network); 4 Dec 2013 09:57:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:57: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 1Vo9Cn-0007nC-O2
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Cn-0006Bg-LC
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:17 +0000
Date: Wed, 04 Dec 2013 09:57:17 +0000
Message-Id: <E1Vo9Cn-0006Bg-LC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/pvh: set only minimal cr0 and cr4
	flags in order to use paging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============1571913478404711720=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 51e2cac257ec8b4080d89f0855c498cbbd76a5e5
Author:     Roger Pau MonnÃ© <roger.pau@citrix.com>
AuthorDate: Tue Nov 26 09:52:47 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 26 09:52:47 2013 +0100

    x86/pvh: set only minimal cr0 and cr4 flags in order to use paging
    
    Right now Xen sets the WP and NE flags on cr0 for PVH, which are not
    needed in order to boot with paging enabled. The same happens with
    cr4, at least on my system OSFXSR, OSXMMEXCPT and MCE are enabled by
    default when there's no need.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Mukesh Rathor <mukesh.rathor@oracle.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 4aab971..44f33cb 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -28,7 +28,6 @@
 #include <asm/msr.h>
 #include <asm/xstate.h>
 #include <asm/hvm/hvm.h>
-#include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/io.h>
 #include <asm/hvm/support.h>
 #include <asm/hvm/vmx/vmx.h>
@@ -1090,13 +1089,11 @@ static int construct_vmcs(struct vcpu *v)
 
     /* PVH domains always start in paging mode */
     if ( is_pvh_domain(d) )
-        v->arch.hvm_vcpu.guest_cr[0] |= X86_CR0_PG | X86_CR0_NE | X86_CR0_WP;
+        v->arch.hvm_vcpu.guest_cr[0] |= X86_CR0_PG;
 
     hvm_update_guest_cr(v, 0);
 
-    v->arch.hvm_vcpu.guest_cr[4] = is_pvh_domain(d) ?
-        (real_cr4_to_pv_guest_cr4(mmu_cr4_features)
-         & ~HVM_CR4_GUEST_RESERVED_BITS(v)) : 0;
+    v->arch.hvm_vcpu.guest_cr[4] = is_pvh_domain(d) ? X86_CR4_PAE : 0;
     hvm_update_guest_cr(v, 4);
 
     if ( cpu_has_vmx_tpr_shadow )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Dec 04 09:57:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9D2-0001p9-HI; Wed, 04 Dec 2013 09:57: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 1Vo9D0-0001oo-HC
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:30 +0000
Received: from [85.158.139.211:28691] by server-13.bemta-5.messagelabs.com id
	42/2C-11357-98CFE925; Wed, 04 Dec 2013 09:57:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1386151048!2156068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15922 invoked from network); 4 Dec 2013 09:57:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:57: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 1Vo9Cx-0007nK-Tl
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Cx-0006C2-SL
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:27 +0000
Date: Wed, 04 Dec 2013 09:57:27 +0000
Message-Id: <E1Vo9Cx-0006C2-SL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: fix segment validation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ed4bfbabd487b41021caa7ed03cee1f00ecbabf
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Tue Nov 26 09:54:21 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 26 09:54:21 2013 +0100

    x86/hvm: fix segment validation
    
    Also Coverity CID 1055180.
    
    Reported-by: David Binderman <dcb314@hotmail.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    
    Use _SEGMENT_* instead of plain numbers and adjust a comment.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 0094c62..d80c166 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2280,7 +2280,7 @@ static int hvm_load_segment_selector(
             if ( !(desc.b & (1u<<11)) )
                 goto unmap_and_fail;
             /* Non-conforming segment: check DPL against RPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && (dpl != rpl) )
+            if ( !(desc.b & _SEGMENT_EC) && (dpl != rpl) )
                 goto unmap_and_fail;
             break;
         case x86_seg_ss:
@@ -2299,8 +2299,13 @@ static int hvm_load_segment_selector(
             /* Readable code or data segment? */
             if ( (desc.b & (5u<<9)) == (4u<<9) )
                 goto unmap_and_fail;
-            /* Non-conforming segment: check DPL against RPL and CPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && ((dpl < cpl) || (dpl < rpl)) )
+            /*
+             * Data or non-conforming code segment:
+             * check DPL against RPL and CPL.
+             */
+            if ( ((desc.b & (_SEGMENT_EC|_SEGMENT_CODE)) !=
+                  (_SEGMENT_EC|_SEGMENT_CODE))
+                 && ((dpl < cpl) || (dpl < rpl)) )
                 goto unmap_and_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 Wed Dec 04 09:57:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9D2-0001p9-HI; Wed, 04 Dec 2013 09:57: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 1Vo9D0-0001oo-HC
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:30 +0000
Received: from [85.158.139.211:28691] by server-13.bemta-5.messagelabs.com id
	42/2C-11357-98CFE925; Wed, 04 Dec 2013 09:57:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1386151048!2156068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15922 invoked from network); 4 Dec 2013 09:57:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:57: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 1Vo9Cx-0007nK-Tl
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Cx-0006C2-SL
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:27 +0000
Date: Wed, 04 Dec 2013 09:57:27 +0000
Message-Id: <E1Vo9Cx-0006C2-SL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: fix segment validation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ed4bfbabd487b41021caa7ed03cee1f00ecbabf
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Tue Nov 26 09:54:21 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 26 09:54:21 2013 +0100

    x86/hvm: fix segment validation
    
    Also Coverity CID 1055180.
    
    Reported-by: David Binderman <dcb314@hotmail.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    
    Use _SEGMENT_* instead of plain numbers and adjust a comment.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 0094c62..d80c166 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2280,7 +2280,7 @@ static int hvm_load_segment_selector(
             if ( !(desc.b & (1u<<11)) )
                 goto unmap_and_fail;
             /* Non-conforming segment: check DPL against RPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && (dpl != rpl) )
+            if ( !(desc.b & _SEGMENT_EC) && (dpl != rpl) )
                 goto unmap_and_fail;
             break;
         case x86_seg_ss:
@@ -2299,8 +2299,13 @@ static int hvm_load_segment_selector(
             /* Readable code or data segment? */
             if ( (desc.b & (5u<<9)) == (4u<<9) )
                 goto unmap_and_fail;
-            /* Non-conforming segment: check DPL against RPL and CPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && ((dpl < cpl) || (dpl < rpl)) )
+            /*
+             * Data or non-conforming code segment:
+             * check DPL against RPL and CPL.
+             */
+            if ( ((desc.b & (_SEGMENT_EC|_SEGMENT_CODE)) !=
+                  (_SEGMENT_EC|_SEGMENT_CODE))
+                 && ((dpl < cpl) || (dpl < rpl)) )
                 goto unmap_and_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 Wed Dec 04 09:57:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9DC-0001r1-Lr; Wed, 04 Dec 2013 09:57:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9DA-0001qj-NA
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:41 +0000
Received: from [193.109.254.147:40879] by server-2.bemta-14.messagelabs.com id
	12/EE-00361-39CFE925; Wed, 04 Dec 2013 09:57:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386151058!2725772!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7403 invoked from network); 4 Dec 2013 09:57:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:57: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 1Vo9D8-0007nQ-39
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9D8-0006CT-1E
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:38 +0000
Date: Wed, 04 Dec 2013 09:57:38 +0000
Message-Id: <E1Vo9D8-0006CT-1E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: clean up segment validation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a02b0fc87cddc60327bf127491df7aa961059680
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 26 09:54:48 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 26 09:54:48 2013 +0100

    x86/hvm: clean up segment validation
    
    Use _SEGMENT_* instead of plain numbers where feasible.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index d80c166..af249f7 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2259,7 +2259,7 @@ static int hvm_load_segment_selector(
         desc = *pdesc;
 
         /* Segment present in memory? */
-        if ( !(desc.b & (1u<<15)) )
+        if ( !(desc.b & _SEGMENT_P) )
         {
             fault_type = TRAP_no_segment;
             goto unmap_and_fail;
@@ -2277,7 +2277,7 @@ static int hvm_load_segment_selector(
         {
         case x86_seg_cs:
             /* Code segment? */
-            if ( !(desc.b & (1u<<11)) )
+            if ( !(desc.b & _SEGMENT_CODE) )
                 goto unmap_and_fail;
             /* Non-conforming segment: check DPL against RPL. */
             if ( !(desc.b & _SEGMENT_EC) && (dpl != rpl) )
@@ -2285,19 +2285,19 @@ static int hvm_load_segment_selector(
             break;
         case x86_seg_ss:
             /* Writable data segment? */
-            if ( (desc.b & (5u<<9)) != (1u<<9) )
+            if ( (desc.b & (_SEGMENT_CODE|_SEGMENT_WR)) != _SEGMENT_WR )
                 goto unmap_and_fail;
             if ( (dpl != cpl) || (dpl != rpl) )
                 goto unmap_and_fail;
             break;
         case x86_seg_ldtr:
             /* LDT system segment? */
-            if ( (desc.b & (15u<<8)) != (2u<<8) )
+            if ( (desc.b & _SEGMENT_TYPE) != (2u<<8) )
                 goto unmap_and_fail;
             goto skip_accessed_flag;
         default:
             /* Readable code or data segment? */
-            if ( (desc.b & (5u<<9)) == (4u<<9) )
+            if ( (desc.b & (_SEGMENT_CODE|_SEGMENT_WR)) == _SEGMENT_CODE )
                 goto unmap_and_fail;
             /*
              * Data or non-conforming code segment:
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:57:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9DC-0001r1-Lr; Wed, 04 Dec 2013 09:57:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9DA-0001qj-NA
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:41 +0000
Received: from [193.109.254.147:40879] by server-2.bemta-14.messagelabs.com id
	12/EE-00361-39CFE925; Wed, 04 Dec 2013 09:57:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386151058!2725772!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7403 invoked from network); 4 Dec 2013 09:57:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:57: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 1Vo9D8-0007nQ-39
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9D8-0006CT-1E
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:38 +0000
Date: Wed, 04 Dec 2013 09:57:38 +0000
Message-Id: <E1Vo9D8-0006CT-1E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: clean up segment validation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a02b0fc87cddc60327bf127491df7aa961059680
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 26 09:54:48 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 26 09:54:48 2013 +0100

    x86/hvm: clean up segment validation
    
    Use _SEGMENT_* instead of plain numbers where feasible.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index d80c166..af249f7 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2259,7 +2259,7 @@ static int hvm_load_segment_selector(
         desc = *pdesc;
 
         /* Segment present in memory? */
-        if ( !(desc.b & (1u<<15)) )
+        if ( !(desc.b & _SEGMENT_P) )
         {
             fault_type = TRAP_no_segment;
             goto unmap_and_fail;
@@ -2277,7 +2277,7 @@ static int hvm_load_segment_selector(
         {
         case x86_seg_cs:
             /* Code segment? */
-            if ( !(desc.b & (1u<<11)) )
+            if ( !(desc.b & _SEGMENT_CODE) )
                 goto unmap_and_fail;
             /* Non-conforming segment: check DPL against RPL. */
             if ( !(desc.b & _SEGMENT_EC) && (dpl != rpl) )
@@ -2285,19 +2285,19 @@ static int hvm_load_segment_selector(
             break;
         case x86_seg_ss:
             /* Writable data segment? */
-            if ( (desc.b & (5u<<9)) != (1u<<9) )
+            if ( (desc.b & (_SEGMENT_CODE|_SEGMENT_WR)) != _SEGMENT_WR )
                 goto unmap_and_fail;
             if ( (dpl != cpl) || (dpl != rpl) )
                 goto unmap_and_fail;
             break;
         case x86_seg_ldtr:
             /* LDT system segment? */
-            if ( (desc.b & (15u<<8)) != (2u<<8) )
+            if ( (desc.b & _SEGMENT_TYPE) != (2u<<8) )
                 goto unmap_and_fail;
             goto skip_accessed_flag;
         default:
             /* Readable code or data segment? */
-            if ( (desc.b & (5u<<9)) == (4u<<9) )
+            if ( (desc.b & (_SEGMENT_CODE|_SEGMENT_WR)) == _SEGMENT_CODE )
                 goto unmap_and_fail;
             /*
              * Data or non-conforming code segment:
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:57:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9DM-0001sk-Pa; Wed, 04 Dec 2013 09:57:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9DK-0001sT-M6
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:50 +0000
Received: from [85.158.143.35:27384] by server-2.bemta-4.messagelabs.com id
	38/7E-11386-D9CFE925; Wed, 04 Dec 2013 09:57:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1386151068!1975716!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6890 invoked from network); 4 Dec 2013 09:57:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:57: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 1Vo9DI-0007nW-8P
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9DI-0006Cp-6F
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:48 +0000
Date: Wed, 04 Dec 2013 09:57:48 +0000
Message-Id: <E1Vo9DI-0006Cp-6F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] pvh support for gdbsx
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dffc22a15850ffc943069a2ab38a2d0234e2df00
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Fri Nov 22 16:48:06 2013 -0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 26 10:48:55 2013 +0000

    pvh support for gdbsx
    
    Add pvh support to gdbsx so it can be used to debug pvh domUs.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 tools/debugger/gdbsx/xg/xg_main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/debugger/gdbsx/xg/xg_main.c b/tools/debugger/gdbsx/xg/xg_main.c
index 64c7484..5736b86 100644
--- a/tools/debugger/gdbsx/xg/xg_main.c
+++ b/tools/debugger/gdbsx/xg/xg_main.c
@@ -81,6 +81,7 @@ int xgtrc_on = 0;
 struct xen_domctl domctl;         /* just use a global domctl */
 
 static int     _hvm_guest;        /* hvm guest? 32bit HVMs have 64bit context */
+static int     _pvh_guest;        /* PV guest in HVM container */
 static domid_t _dom_id;           /* guest domid */
 static int     _max_vcpu_id;      /* thus max_vcpu_id+1 VCPUs */
 static int     _dom0_fd;          /* fd of /dev/privcmd */
@@ -309,6 +310,7 @@ xg_attach(int domid, int guest_bitness)
 
     _max_vcpu_id = domctl.u.getdomaininfo.max_vcpu_id;
     _hvm_guest = (domctl.u.getdomaininfo.flags & XEN_DOMINF_hvm_guest);
+    _pvh_guest = (domctl.u.getdomaininfo.flags & XEN_DOMINF_pvh_guest);
     return _max_vcpu_id;
 }
 
@@ -369,7 +371,7 @@ _change_TF(vcpuid_t which_vcpu, int guest_bitness, int setit)
     int sz = sizeof(anyc);
 
     /* first try the MTF for hvm guest. otherwise do manually */
-    if (_hvm_guest) {
+    if (_hvm_guest || _pvh_guest) {
         domctl.u.debug_op.vcpu = which_vcpu;
         domctl.u.debug_op.op = setit ? XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON :
                                        XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:57:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:57: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 1Vo9DM-0001sk-Pa; Wed, 04 Dec 2013 09:57:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9DK-0001sT-M6
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:50 +0000
Received: from [85.158.143.35:27384] by server-2.bemta-4.messagelabs.com id
	38/7E-11386-D9CFE925; Wed, 04 Dec 2013 09:57:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1386151068!1975716!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6890 invoked from network); 4 Dec 2013 09:57:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:57: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 1Vo9DI-0007nW-8P
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9DI-0006Cp-6F
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:48 +0000
Date: Wed, 04 Dec 2013 09:57:48 +0000
Message-Id: <E1Vo9DI-0006Cp-6F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] pvh support for gdbsx
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dffc22a15850ffc943069a2ab38a2d0234e2df00
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Fri Nov 22 16:48:06 2013 -0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 26 10:48:55 2013 +0000

    pvh support for gdbsx
    
    Add pvh support to gdbsx so it can be used to debug pvh domUs.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 tools/debugger/gdbsx/xg/xg_main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/debugger/gdbsx/xg/xg_main.c b/tools/debugger/gdbsx/xg/xg_main.c
index 64c7484..5736b86 100644
--- a/tools/debugger/gdbsx/xg/xg_main.c
+++ b/tools/debugger/gdbsx/xg/xg_main.c
@@ -81,6 +81,7 @@ int xgtrc_on = 0;
 struct xen_domctl domctl;         /* just use a global domctl */
 
 static int     _hvm_guest;        /* hvm guest? 32bit HVMs have 64bit context */
+static int     _pvh_guest;        /* PV guest in HVM container */
 static domid_t _dom_id;           /* guest domid */
 static int     _max_vcpu_id;      /* thus max_vcpu_id+1 VCPUs */
 static int     _dom0_fd;          /* fd of /dev/privcmd */
@@ -309,6 +310,7 @@ xg_attach(int domid, int guest_bitness)
 
     _max_vcpu_id = domctl.u.getdomaininfo.max_vcpu_id;
     _hvm_guest = (domctl.u.getdomaininfo.flags & XEN_DOMINF_hvm_guest);
+    _pvh_guest = (domctl.u.getdomaininfo.flags & XEN_DOMINF_pvh_guest);
     return _max_vcpu_id;
 }
 
@@ -369,7 +371,7 @@ _change_TF(vcpuid_t which_vcpu, int guest_bitness, int setit)
     int sz = sizeof(anyc);
 
     /* first try the MTF for hvm guest. otherwise do manually */
-    if (_hvm_guest) {
+    if (_hvm_guest || _pvh_guest) {
         domctl.u.debug_op.vcpu = which_vcpu;
         domctl.u.debug_op.op = setit ? XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON :
                                        XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:58:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58: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 1Vo9DX-0001uD-SQ; Wed, 04 Dec 2013 09:58: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 1Vo9DV-0001ty-9p
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:02 +0000
Received: from [85.158.139.211:45731] by server-14.bemta-5.messagelabs.com id
	2E/87-24200-8ACFE925; Wed, 04 Dec 2013 09:58:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1386151078!2152417!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16273 invoked from network); 4 Dec 2013 09:57:59 -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;
	4 Dec 2013 09:57: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 1Vo9DS-0007nf-Dl
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9DS-0006DB-Bt
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:58 +0000
Date: Wed, 04 Dec 2013 09:57:58 +0000
Message-Id: <E1Vo9DS-0006DB-Bt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix fd check in
	libxl__spawn_local_dm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7761760516177645408=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 3b88d95e9c0a5ff91d5b60e94d81f1982af57e7f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Nov 22 12:54:08 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 26 10:55:34 2013 +0000

    libxl: fix fd check in libxl__spawn_local_dm
    
    Checking the logfile_w fd for -1 on failure is no longer true, because
    libxl__create_qemu_logfile will now return ERROR_FAIL on failure which
    is -3.
    
    While there also add an error check for opening /dev/null.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxl/libxl_dm.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 292e351..be39a62 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1228,6 +1228,11 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
         goto out;
     }
     null = open("/dev/null", O_RDONLY);
+    if (null < 0) {
+        LOGE(ERROR, "unable to open /dev/null");
+        rc = ERROR_FAIL;
+        goto out_close;
+    }
 
     const char *dom_path = libxl__xs_get_dompath(gc, domid);
     spawn->pidpath = GCSPRINTF("%s/%s", dom_path, "image/device-model-pid");
@@ -1275,8 +1280,8 @@ retry_transaction:
     rc = 0;
 
 out_close:
-    if (null != -1) close(null);
-    if (logfile_w != -1) close(logfile_w);
+    if (null >= 0) close(null);
+    if (logfile_w >= 0) close(logfile_w);
 out:
     if (rc)
         device_model_spawn_outcome(egc, dmss, rc);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Dec 04 09:58:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58: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 1Vo9DX-0001uD-SQ; Wed, 04 Dec 2013 09:58: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 1Vo9DV-0001ty-9p
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:02 +0000
Received: from [85.158.139.211:45731] by server-14.bemta-5.messagelabs.com id
	2E/87-24200-8ACFE925; Wed, 04 Dec 2013 09:58:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1386151078!2152417!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16273 invoked from network); 4 Dec 2013 09:57:59 -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;
	4 Dec 2013 09:57: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 1Vo9DS-0007nf-Dl
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9DS-0006DB-Bt
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:57:58 +0000
Date: Wed, 04 Dec 2013 09:57:58 +0000
Message-Id: <E1Vo9DS-0006DB-Bt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix fd check in
	libxl__spawn_local_dm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7761760516177645408=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 3b88d95e9c0a5ff91d5b60e94d81f1982af57e7f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Nov 22 12:54:08 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 26 10:55:34 2013 +0000

    libxl: fix fd check in libxl__spawn_local_dm
    
    Checking the logfile_w fd for -1 on failure is no longer true, because
    libxl__create_qemu_logfile will now return ERROR_FAIL on failure which
    is -3.
    
    While there also add an error check for opening /dev/null.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxl/libxl_dm.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 292e351..be39a62 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1228,6 +1228,11 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
         goto out;
     }
     null = open("/dev/null", O_RDONLY);
+    if (null < 0) {
+        LOGE(ERROR, "unable to open /dev/null");
+        rc = ERROR_FAIL;
+        goto out_close;
+    }
 
     const char *dom_path = libxl__xs_get_dompath(gc, domid);
     spawn->pidpath = GCSPRINTF("%s/%s", dom_path, "image/device-model-pid");
@@ -1275,8 +1280,8 @@ retry_transaction:
     rc = 0;
 
 out_close:
-    if (null != -1) close(null);
-    if (logfile_w != -1) close(logfile_w);
+    if (null >= 0) close(null);
+    if (logfile_w >= 0) close(logfile_w);
 out:
     if (rc)
         device_model_spawn_outcome(egc, dmss, rc);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Dec 04 09:58:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9Df-0001vp-V9; Wed, 04 Dec 2013 09:58: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 1Vo9Df-0001vc-7C
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:11 +0000
Received: from [193.109.254.147:7283] by server-11.bemta-14.messagelabs.com id
	E9/14-20576-2BCFE925; Wed, 04 Dec 2013 09:58:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1386151088!2796935!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16922 invoked from network); 4 Dec 2013 09:58:09 -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;
	4 Dec 2013 09:58: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 1Vo9Dc-0007oD-Jx
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Dc-0006Dj-IW
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:08 +0000
Date: Wed, 04 Dec 2013 09:58:08 +0000
Message-Id: <E1Vo9Dc-0006Dj-IW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: fixes for do_daemonize
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4221164548807477944=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit ed8c9047f6fc6d28fc27d37576ec8c8c1be68efe
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Nov 22 12:54:09 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 26 10:57:21 2013 +0000

    xl: fixes for do_daemonize
    
    Fix usage of CHK_ERRNO in do_daemonize and also remove the usage of a
    bogus for(;;).
    
    Coverity-ID: 1130516 and 1130520
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index bdb4be3..c5677cd 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -411,14 +411,14 @@ static int do_daemonize(char *name)
 
     child1 = xl_fork(child_waitdaemon);
     if (child1) {
-        for (;;) {
-            got_child = xl_waitpid(child_waitdaemon, &status, 0);
-            if (got_child == child1) break;
+        got_child = xl_waitpid(child_waitdaemon, &status, 0);
+        if (got_child != child1) {
             assert(got_child == -1);
-            perror("failed to wait for daemonizing child");
+            LOG("failed to wait for daemonizing child: %s", strerror(errno));
             ret = ERROR_FAIL;
             goto out;
         }
+
         if (status) {
             libxl_report_child_exitstatus(ctx, XTL_ERROR,
                        "daemonizing child", child1, status);
@@ -437,16 +437,15 @@ static int do_daemonize(char *name)
         exit(-1);
     }
 
-    CHK_ERRNO(( logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND,
-                               0644) )<0);
+    CHK_ERRNO(logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND, 0644));
     free(fullname);
 
-    CHK_ERRNO(( nullfd = open("/dev/null", O_RDONLY) )<0);
+    CHK_ERRNO(nullfd = open("/dev/null", O_RDONLY));
     dup2(nullfd, 0);
     dup2(logfile, 1);
     dup2(logfile, 2);
 
-    CHK_ERRNO(daemon(0, 1) < 0);
+    CHK_ERRNO(daemon(0, 1));
 
 out:
     return ret;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Dec 04 09:58:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9Df-0001vp-V9; Wed, 04 Dec 2013 09:58: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 1Vo9Df-0001vc-7C
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:11 +0000
Received: from [193.109.254.147:7283] by server-11.bemta-14.messagelabs.com id
	E9/14-20576-2BCFE925; Wed, 04 Dec 2013 09:58:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1386151088!2796935!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16922 invoked from network); 4 Dec 2013 09:58:09 -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;
	4 Dec 2013 09:58: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 1Vo9Dc-0007oD-Jx
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Dc-0006Dj-IW
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:08 +0000
Date: Wed, 04 Dec 2013 09:58:08 +0000
Message-Id: <E1Vo9Dc-0006Dj-IW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: fixes for do_daemonize
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============4221164548807477944=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit ed8c9047f6fc6d28fc27d37576ec8c8c1be68efe
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Nov 22 12:54:09 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 26 10:57:21 2013 +0000

    xl: fixes for do_daemonize
    
    Fix usage of CHK_ERRNO in do_daemonize and also remove the usage of a
    bogus for(;;).
    
    Coverity-ID: 1130516 and 1130520
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index bdb4be3..c5677cd 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -411,14 +411,14 @@ static int do_daemonize(char *name)
 
     child1 = xl_fork(child_waitdaemon);
     if (child1) {
-        for (;;) {
-            got_child = xl_waitpid(child_waitdaemon, &status, 0);
-            if (got_child == child1) break;
+        got_child = xl_waitpid(child_waitdaemon, &status, 0);
+        if (got_child != child1) {
             assert(got_child == -1);
-            perror("failed to wait for daemonizing child");
+            LOG("failed to wait for daemonizing child: %s", strerror(errno));
             ret = ERROR_FAIL;
             goto out;
         }
+
         if (status) {
             libxl_report_child_exitstatus(ctx, XTL_ERROR,
                        "daemonizing child", child1, status);
@@ -437,16 +437,15 @@ static int do_daemonize(char *name)
         exit(-1);
     }
 
-    CHK_ERRNO(( logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND,
-                               0644) )<0);
+    CHK_ERRNO(logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND, 0644));
     free(fullname);
 
-    CHK_ERRNO(( nullfd = open("/dev/null", O_RDONLY) )<0);
+    CHK_ERRNO(nullfd = open("/dev/null", O_RDONLY));
     dup2(nullfd, 0);
     dup2(logfile, 1);
     dup2(logfile, 2);
 
-    CHK_ERRNO(daemon(0, 1) < 0);
+    CHK_ERRNO(daemon(0, 1));
 
 out:
     return ret;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Dec 04 09:58:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58: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 1Vo9Dq-00026G-1t; Wed, 04 Dec 2013 09:58:22 +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 1Vo9Dp-00023E-75
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:21 +0000
Received: from [193.109.254.147:12443] by server-13.bemta-14.messagelabs.com
	id C8/A2-19374-CBCFE925; Wed, 04 Dec 2013 09:58:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1386151098!2769411!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2340 invoked from network); 4 Dec 2013 09:58:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:58:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Dm-0007oJ-Q1
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Dm-0006Eb-N7
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:18 +0000
Date: Wed, 04 Dec 2013 09:58:18 +0000
Message-Id: <E1Vo9Dm-0006Eb-N7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] firmware/tcgbios: Prevent integer
	truncation in the return 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 944cea4588bb825c7e91396dcffa3436733d5f54
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:04:20 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 26 10:58:35 2013 +0000

    firmware/tcgbios: Prevent integer truncation in the return value
    
    rc inside the function is uint32_t.  None of the callers check the return
    value.
    
    Coverity ID: 1055442
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/firmware/rombios/32bit/tcgbios/tcgbios.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
index d5e2202..01d4f2f 100644
--- a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
+++ b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
@@ -428,7 +428,7 @@ uint32_t tcpa_get_laml(void)
  *  data       : pointer to the data (i.e., string) to be added to the log
  *  length     : length of the data
  */
-static uint16_t
+static uint32_t
 tcpa_add_measurement_to_log(uint32_t pcrIndex,
                             uint32_t event_type,
                             uint32_t event_id,
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:58:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58: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 1Vo9Dq-00026G-1t; Wed, 04 Dec 2013 09:58:22 +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 1Vo9Dp-00023E-75
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:21 +0000
Received: from [193.109.254.147:12443] by server-13.bemta-14.messagelabs.com
	id C8/A2-19374-CBCFE925; Wed, 04 Dec 2013 09:58:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1386151098!2769411!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2340 invoked from network); 4 Dec 2013 09:58:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:58:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Dm-0007oJ-Q1
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Dm-0006Eb-N7
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:18 +0000
Date: Wed, 04 Dec 2013 09:58:18 +0000
Message-Id: <E1Vo9Dm-0006Eb-N7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] firmware/tcgbios: Prevent integer
	truncation in the return 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 944cea4588bb825c7e91396dcffa3436733d5f54
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:04:20 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 26 10:58:35 2013 +0000

    firmware/tcgbios: Prevent integer truncation in the return value
    
    rc inside the function is uint32_t.  None of the callers check the return
    value.
    
    Coverity ID: 1055442
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/firmware/rombios/32bit/tcgbios/tcgbios.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
index d5e2202..01d4f2f 100644
--- a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
+++ b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c
@@ -428,7 +428,7 @@ uint32_t tcpa_get_laml(void)
  *  data       : pointer to the data (i.e., string) to be added to the log
  *  length     : length of the data
  */
-static uint16_t
+static uint32_t
 tcpa_add_measurement_to_log(uint32_t pcrIndex,
                             uint32_t event_type,
                             uint32_t event_id,
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:58:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9E0-0002Rx-4k; Wed, 04 Dec 2013 09:58:32 +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 1Vo9Dz-0002Ou-Bi
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:31 +0000
Received: from [85.158.143.35:10483] by server-3.bemta-4.messagelabs.com id
	4A/7B-32360-6CCFE925; Wed, 04 Dec 2013 09:58:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1386151109!3228937!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28992 invoked from network); 4 Dec 2013 09:58:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:58: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 1Vo9Dw-0007oU-VS
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Dw-0006Ez-TG
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:28 +0000
Date: Wed, 04 Dec 2013 09:58:28 +0000
Message-Id: <E1Vo9Dw-0006Ez-TG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] firmware/vgabios: Fix incorrect
	formatting string
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a9378c3785df4bc8a5babb004c69a503c3830993
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:04:21 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 26 10:59:11 2013 +0000

    firmware/vgabios: Fix incorrect formatting string
    
    bios_len is an long, so requires %ld rather than %d.
    
    Coverity ID: 1055813
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/firmware/vgabios/biossums.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/vgabios/biossums.c b/tools/firmware/vgabios/biossums.c
index d5816f4..6288498 100644
--- a/tools/firmware/vgabios/biossums.c
+++ b/tools/firmware/vgabios/biossums.c
@@ -161,7 +161,7 @@ int main(int argc, char* argv[])
       exit(EXIT_FAILURE);
     }
     if (fwrite(bios_data, 1, bios_len, stream) < bios_len) {
-      printf("Error writing %d KBytes to %s.\n", bios_len / 1024, argv[1]);
+      printf("Error writing %ld KBytes to %s.\n", bios_len / 1024, argv[1]);
       fclose(stream);
       exit(EXIT_FAILURE);
     }
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:58:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9E0-0002Rx-4k; Wed, 04 Dec 2013 09:58:32 +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 1Vo9Dz-0002Ou-Bi
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:31 +0000
Received: from [85.158.143.35:10483] by server-3.bemta-4.messagelabs.com id
	4A/7B-32360-6CCFE925; Wed, 04 Dec 2013 09:58:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1386151109!3228937!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28992 invoked from network); 4 Dec 2013 09:58:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:58: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 1Vo9Dw-0007oU-VS
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Dw-0006Ez-TG
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:28 +0000
Date: Wed, 04 Dec 2013 09:58:28 +0000
Message-Id: <E1Vo9Dw-0006Ez-TG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] firmware/vgabios: Fix incorrect
	formatting string
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a9378c3785df4bc8a5babb004c69a503c3830993
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 11:04:21 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 26 10:59:11 2013 +0000

    firmware/vgabios: Fix incorrect formatting string
    
    bios_len is an long, so requires %ld rather than %d.
    
    Coverity ID: 1055813
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/firmware/vgabios/biossums.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/vgabios/biossums.c b/tools/firmware/vgabios/biossums.c
index d5816f4..6288498 100644
--- a/tools/firmware/vgabios/biossums.c
+++ b/tools/firmware/vgabios/biossums.c
@@ -161,7 +161,7 @@ int main(int argc, char* argv[])
       exit(EXIT_FAILURE);
     }
     if (fwrite(bios_data, 1, bios_len, stream) < bios_len) {
-      printf("Error writing %d KBytes to %s.\n", bios_len / 1024, argv[1]);
+      printf("Error writing %ld KBytes to %s.\n", bios_len / 1024, argv[1]);
       fclose(stream);
       exit(EXIT_FAILURE);
     }
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:58:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58: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 1Vo9EA-0002Xk-PV; Wed, 04 Dec 2013 09:58:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9E9-0002XS-LN
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:41 +0000
Received: from [193.109.254.147:55915] by server-16.bemta-14.messagelabs.com
	id 75/9D-20600-0DCFE925; Wed, 04 Dec 2013 09:58:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1386151119!1279170!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1595 invoked from network); 4 Dec 2013 09:58:40 -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;
	4 Dec 2013 09:58:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9E7-0007od-47
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9E7-0006FR-2E
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:39 +0000
Date: Wed, 04 Dec 2013 09:58:39 +0000
Message-Id: <E1Vo9E7-0006FR-2E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: doc comment: clarify SIGCHLD
	demultiplexing requirements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d027f59429bb5426f4b799745bed48832a587cc
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Nov 25 11:53:28 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Nov 26 11:47:40 2013 +0000

    libxl: doc comment: clarify SIGCHLD demultiplexing requirements
    
    Update the comment to clarify that libxl_sigchld_owner_libxl_always
    implies having only one libxl_ctx, and that
    libxl_sigchld_owner_mainloop requires one call to
    libxl_childproc_exited per ctx.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_event.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_event.h b/tools/libxl/libxl_event.h
index 27a65dc..6261f99 100644
--- a/tools/libxl/libxl_event.h
+++ b/tools/libxl/libxl_event.h
@@ -446,13 +446,16 @@ void libxl_osevent_occurred_timeout(libxl_ctx *ctx, void *for_libxl)
  * 
  *     libxl_sigchld_owner_mainloop:
  *       The application must install a SIGCHLD handler and reap (at
- *       least) all of libxl's children and pass their exit status
- *       to libxl by calling libxl_childproc_exited.
+ *       least) all of libxl's children and pass their exit status to
+ *       libxl by calling libxl_childproc_exited.  (If the application
+ *       has multiple libxl ctx's, it must call libxl_childproc_exited
+ *       on each ctx.)
  *
  *     libxl_sigchld_owner_libxl_always:
  *       The application expects libxl to reap all of its children,
  *       and provides a callback to be notified of their exit
- *       statues.
+ *       statues.  The application must have only one libxl_ctx
+ *       configured this way.
  *
  * An application which fails to call setmode, or which passes 0 for
  * hooks, while it uses any libxl operation which might
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:58:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58: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 1Vo9EA-0002Xk-PV; Wed, 04 Dec 2013 09:58:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9E9-0002XS-LN
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:41 +0000
Received: from [193.109.254.147:55915] by server-16.bemta-14.messagelabs.com
	id 75/9D-20600-0DCFE925; Wed, 04 Dec 2013 09:58:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1386151119!1279170!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1595 invoked from network); 4 Dec 2013 09:58:40 -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;
	4 Dec 2013 09:58:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9E7-0007od-47
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9E7-0006FR-2E
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:39 +0000
Date: Wed, 04 Dec 2013 09:58:39 +0000
Message-Id: <E1Vo9E7-0006FR-2E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: doc comment: clarify SIGCHLD
	demultiplexing requirements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d027f59429bb5426f4b799745bed48832a587cc
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Nov 25 11:53:28 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Nov 26 11:47:40 2013 +0000

    libxl: doc comment: clarify SIGCHLD demultiplexing requirements
    
    Update the comment to clarify that libxl_sigchld_owner_libxl_always
    implies having only one libxl_ctx, and that
    libxl_sigchld_owner_mainloop requires one call to
    libxl_childproc_exited per ctx.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_event.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_event.h b/tools/libxl/libxl_event.h
index 27a65dc..6261f99 100644
--- a/tools/libxl/libxl_event.h
+++ b/tools/libxl/libxl_event.h
@@ -446,13 +446,16 @@ void libxl_osevent_occurred_timeout(libxl_ctx *ctx, void *for_libxl)
  * 
  *     libxl_sigchld_owner_mainloop:
  *       The application must install a SIGCHLD handler and reap (at
- *       least) all of libxl's children and pass their exit status
- *       to libxl by calling libxl_childproc_exited.
+ *       least) all of libxl's children and pass their exit status to
+ *       libxl by calling libxl_childproc_exited.  (If the application
+ *       has multiple libxl ctx's, it must call libxl_childproc_exited
+ *       on each ctx.)
  *
  *     libxl_sigchld_owner_libxl_always:
  *       The application expects libxl to reap all of its children,
  *       and provides a callback to be notified of their exit
- *       statues.
+ *       statues.  The application must have only one libxl_ctx
+ *       configured this way.
  *
  * An application which fails to call setmode, or which passes 0 for
  * hooks, while it uses any libxl operation which might
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:58:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58: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 1Vo9EK-0002aK-SF; Wed, 04 Dec 2013 09:58:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9EJ-0002a0-Ji
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:51 +0000
Received: from [85.158.143.35:12753] by server-2.bemta-4.messagelabs.com id
	A0/90-11386-ADCFE925; Wed, 04 Dec 2013 09:58:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1386151129!3258742!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11123 invoked from network); 4 Dec 2013 09:58:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:58:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9EH-0007om-9d
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9EH-0006Fn-8L
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:49 +0000
Date: Wed, 04 Dec 2013 09:58:49 +0000
Message-Id: <E1Vo9EH-0006Fn-8L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: restrict XEN_DOMCTL_getmemlist
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 19f027cc5daff4a37fd0a28bca2514c721852dd0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Nov 27 09:00:41 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 27 09:00:41 2013 +0100

    x86: restrict XEN_DOMCTL_getmemlist
    
    Coverity ID 1055652
    
    (See the code comment.)
    
    This is CVE-2013-4553 / XSA-74.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domctl.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 8644218..ef6c140 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -329,6 +329,26 @@ long arch_do_domctl(
             break;
         }
 
+        /*
+         * XSA-74: This sub-hypercall is broken in several ways:
+         * - lock order inversion (p2m locks inside page_alloc_lock)
+         * - no preemption on huge max_pfns input
+         * - not (re-)checking d->is_dying with page_alloc_lock held
+         * - not honoring start_pfn input (which libxc also doesn't set)
+         * Additionally it is rather useless, as the result is stale by the
+         * time the caller gets to look at it.
+         * As it only has a single, non-production consumer (xen-mceinj),
+         * rather than trying to fix it we restrict it for the time being.
+         */
+        if ( /* No nested locks inside copy_to_guest_offset(). */
+             paging_mode_external(current->domain) ||
+             /* Arbitrary limit capping processing time. */
+             max_pfns > GB(4) / PAGE_SIZE )
+        {
+            ret = -EOPNOTSUPP;
+            break;
+        }
+
         spin_lock(&d->page_alloc_lock);
 
         ret = i = 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 Dec 04 09:58:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:58: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 1Vo9EK-0002aK-SF; Wed, 04 Dec 2013 09:58:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9EJ-0002a0-Ji
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:51 +0000
Received: from [85.158.143.35:12753] by server-2.bemta-4.messagelabs.com id
	A0/90-11386-ADCFE925; Wed, 04 Dec 2013 09:58:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1386151129!3258742!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11123 invoked from network); 4 Dec 2013 09:58:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:58:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9EH-0007om-9d
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9EH-0006Fn-8L
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:49 +0000
Date: Wed, 04 Dec 2013 09:58:49 +0000
Message-Id: <E1Vo9EH-0006Fn-8L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: restrict XEN_DOMCTL_getmemlist
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 19f027cc5daff4a37fd0a28bca2514c721852dd0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Nov 27 09:00:41 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 27 09:00:41 2013 +0100

    x86: restrict XEN_DOMCTL_getmemlist
    
    Coverity ID 1055652
    
    (See the code comment.)
    
    This is CVE-2013-4553 / XSA-74.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domctl.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 8644218..ef6c140 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -329,6 +329,26 @@ long arch_do_domctl(
             break;
         }
 
+        /*
+         * XSA-74: This sub-hypercall is broken in several ways:
+         * - lock order inversion (p2m locks inside page_alloc_lock)
+         * - no preemption on huge max_pfns input
+         * - not (re-)checking d->is_dying with page_alloc_lock held
+         * - not honoring start_pfn input (which libxc also doesn't set)
+         * Additionally it is rather useless, as the result is stale by the
+         * time the caller gets to look at it.
+         * As it only has a single, non-production consumer (xen-mceinj),
+         * rather than trying to fix it we restrict it for the time being.
+         */
+        if ( /* No nested locks inside copy_to_guest_offset(). */
+             paging_mode_external(current->domain) ||
+             /* Arbitrary limit capping processing time. */
+             max_pfns > GB(4) / PAGE_SIZE )
+        {
+            ret = -EOPNOTSUPP;
+            break;
+        }
+
         spin_lock(&d->page_alloc_lock);
 
         ret = i = 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 Dec 04 09:59:05 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:59:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9EX-0002dO-1e; Wed, 04 Dec 2013 09:59: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 1Vo9EU-0002cq-1f
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:03 +0000
Received: from [193.109.254.147:20912] by server-10.bemta-14.messagelabs.com
	id 61/78-20752-5ECFE925; Wed, 04 Dec 2013 09:59:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386151139!2726262!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18228 invoked from network); 4 Dec 2013 09:59:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:59:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9ER-0007ov-Eo
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9ER-0006GC-Cp
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:59 +0000
Date: Wed, 04 Dec 2013 09:58:59 +0000
Message-Id: <E1Vo9ER-0006GC-Cp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: only allow ring 0 guest code
	to make hypercalls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c447caaf49192c7b2c057ffbb565ce72aac666d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Nov 27 09:01:49 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 27 09:01:49 2013 +0100

    x86/HVM: only allow ring 0 guest code to make hypercalls
    
    Anything else would allow for privilege escalation.
    
    This is CVE-2013-4554 / XSA-76.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index af249f7..e2ba9de 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3468,7 +3468,7 @@ int hvm_do_hypercall(struct cpu_user_regs *regs)
     case 4:
     case 2:
         hvm_get_segment_register(curr, x86_seg_ss, &sreg);
-        if ( unlikely(sreg.attr.fields.dpl == 3) )
+        if ( unlikely(sreg.attr.fields.dpl) )
         {
     default:
             regs->eax = -EPERM;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:59:05 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:59:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9EX-0002dO-1e; Wed, 04 Dec 2013 09:59: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 1Vo9EU-0002cq-1f
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:03 +0000
Received: from [193.109.254.147:20912] by server-10.bemta-14.messagelabs.com
	id 61/78-20752-5ECFE925; Wed, 04 Dec 2013 09:59:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386151139!2726262!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18228 invoked from network); 4 Dec 2013 09:59:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:59:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9ER-0007ov-Eo
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9ER-0006GC-Cp
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:58:59 +0000
Date: Wed, 04 Dec 2013 09:58:59 +0000
Message-Id: <E1Vo9ER-0006GC-Cp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: only allow ring 0 guest code
	to make hypercalls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c447caaf49192c7b2c057ffbb565ce72aac666d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Nov 27 09:01:49 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 27 09:01:49 2013 +0100

    x86/HVM: only allow ring 0 guest code to make hypercalls
    
    Anything else would allow for privilege escalation.
    
    This is CVE-2013-4554 / XSA-76.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index af249f7..e2ba9de 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3468,7 +3468,7 @@ int hvm_do_hypercall(struct cpu_user_regs *regs)
     case 4:
     case 2:
         hvm_get_segment_register(curr, x86_seg_ss, &sreg);
-        if ( unlikely(sreg.attr.fields.dpl == 3) )
+        if ( unlikely(sreg.attr.fields.dpl) )
         {
     default:
             regs->eax = -EPERM;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:59:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:59: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 1Vo9Eg-0002fh-4Q; Wed, 04 Dec 2013 09:59: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 1Vo9Ee-0002fJ-8b
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:12 +0000
Received: from [193.109.254.147:26513] by server-6.bemta-14.messagelabs.com id
	BB/98-14958-FECFE925; Wed, 04 Dec 2013 09:59:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1386151149!536747!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6211 invoked from network); 4 Dec 2013 09:59:10 -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;
	4 Dec 2013 09:59:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Eb-0007pU-JP
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Eb-0006Gq-Hv
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:09 +0000
Date: Wed, 04 Dec 2013 09:59:09 +0000
Message-Id: <E1Vo9Eb-0006Gq-Hv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] kexec: prevent deadlock on reentry to
	the crash path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 470f58c159410b280627c2ea7798ea12ad93bd7c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 27 15:13:48 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 27 15:13:48 2013 +0100

    kexec: prevent deadlock on reentry to the crash path
    
    In some cases, such as suffering a queued-invalidation timeout while
    performing an iommu_crash_shutdown(), Xen can end up reentering the crash
    path. Previously, this would result in a deadlock in one_cpu_only(), as the
    test_and_set_bit() would fail.
    
    The crash path is not reentrant, and even if it could be made to be so, it is
    almost certain that we would fall over the same reentry condition again.
    
    The new code can distinguish a reentry case from multiple cpus racing down the
    crash path.  In the case that a reentry is detected, return back out to the
    nested panic() call, which will maybe_reboot() on our behalf.  This requires a
    bit of return plumbing back up to kexec_crash().
    
    While fixing this deadlock, also fix up an minor niggle seen recently from a
    XenServer crash report.  The report was from a Bank 8 MCE, which had managed
    to crash on all cpus at once.  The result was a lot of stack traces with cpus
    in kexec_common_shutdown(), which was infact the inlined version of
    one_cpu_only().  The kexec crash path is not a hotpath, so we can easily
    afford to prevent inlining for the sake of clarity in the stack traces.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/common/kexec.c |   51 ++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 44 insertions(+), 7 deletions(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 17f3ed7..481b0c2 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -233,11 +233,39 @@ void __init set_kexec_crash_area_size(u64 system_ram)
     }
 }
 
-static void one_cpu_only(void)
+/*
+ * Only allow one cpu to continue on the crash path, forcing others to spin.
+ * Racing on the crash path from here will end in misery.  If we reenter,
+ * something has very gone wrong and retrying will (almost certainly) be
+ * futile.  Return up to our nested panic() to try and reboot.
+ *
+ * This is noinline to make it obvious in stack traces which cpus have lost
+ * the race (as opposed to being somewhere in kexec_common_shutdown())
+ */
+static int noinline one_cpu_only(void)
 {
-    /* Only allow the first cpu to continue - force other cpus to spin */
-    if ( test_and_set_bit(KEXEC_FLAG_IN_PROGRESS, &kexec_flags) )
-        for ( ; ; ) ;
+    static unsigned int crashing_cpu = -1;
+    unsigned int cpu = smp_processor_id();
+
+    if ( cmpxchg(&crashing_cpu, -1, cpu) != -1 )
+    {
+        /* Not the first entry into one_cpu_only(). */
+        if ( crashing_cpu == cpu )
+        {
+            printk("Reentered the crash path.  Something is very broken\n");
+            return -EBUSY;
+        }
+
+        /*
+         * Another cpu has beaten us to this point.  Wait here patiently for
+         * it to kill us.
+         */
+        for ( ; ; )
+            halt();
+    }
+
+    set_bit(KEXEC_FLAG_IN_PROGRESS, &kexec_flags);
+    return 0;
 }
 
 /* Save the registers in the per-cpu crash note buffer. */
@@ -288,13 +316,20 @@ crash_xen_info_t *kexec_crash_save_info(void)
     return out;
 }
 
-static void kexec_common_shutdown(void)
+static int kexec_common_shutdown(void)
 {
+    int ret;
+
+    ret = one_cpu_only();
+    if ( ret )
+        return ret;
+
     watchdog_disable();
     console_start_sync();
     spin_debug_disable();
-    one_cpu_only();
     acpi_dmar_reinstate();
+
+    return 0;
 }
 
 void kexec_crash(void)
@@ -309,7 +344,9 @@ void kexec_crash(void)
 
     kexecing = TRUE;
 
-    kexec_common_shutdown();
+    if ( kexec_common_shutdown() != 0 )
+        return;
+
     kexec_crash_save_cpu();
     machine_crash_shutdown();
     machine_kexec(kexec_image[KEXEC_IMAGE_CRASH_BASE + pos]);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:59:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:59: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 1Vo9Eg-0002fh-4Q; Wed, 04 Dec 2013 09:59: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 1Vo9Ee-0002fJ-8b
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:12 +0000
Received: from [193.109.254.147:26513] by server-6.bemta-14.messagelabs.com id
	BB/98-14958-FECFE925; Wed, 04 Dec 2013 09:59:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1386151149!536747!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6211 invoked from network); 4 Dec 2013 09:59:10 -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;
	4 Dec 2013 09:59:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Eb-0007pU-JP
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Eb-0006Gq-Hv
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:09 +0000
Date: Wed, 04 Dec 2013 09:59:09 +0000
Message-Id: <E1Vo9Eb-0006Gq-Hv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] kexec: prevent deadlock on reentry to
	the crash path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 470f58c159410b280627c2ea7798ea12ad93bd7c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 27 15:13:48 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 27 15:13:48 2013 +0100

    kexec: prevent deadlock on reentry to the crash path
    
    In some cases, such as suffering a queued-invalidation timeout while
    performing an iommu_crash_shutdown(), Xen can end up reentering the crash
    path. Previously, this would result in a deadlock in one_cpu_only(), as the
    test_and_set_bit() would fail.
    
    The crash path is not reentrant, and even if it could be made to be so, it is
    almost certain that we would fall over the same reentry condition again.
    
    The new code can distinguish a reentry case from multiple cpus racing down the
    crash path.  In the case that a reentry is detected, return back out to the
    nested panic() call, which will maybe_reboot() on our behalf.  This requires a
    bit of return plumbing back up to kexec_crash().
    
    While fixing this deadlock, also fix up an minor niggle seen recently from a
    XenServer crash report.  The report was from a Bank 8 MCE, which had managed
    to crash on all cpus at once.  The result was a lot of stack traces with cpus
    in kexec_common_shutdown(), which was infact the inlined version of
    one_cpu_only().  The kexec crash path is not a hotpath, so we can easily
    afford to prevent inlining for the sake of clarity in the stack traces.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/common/kexec.c |   51 ++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 44 insertions(+), 7 deletions(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 17f3ed7..481b0c2 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -233,11 +233,39 @@ void __init set_kexec_crash_area_size(u64 system_ram)
     }
 }
 
-static void one_cpu_only(void)
+/*
+ * Only allow one cpu to continue on the crash path, forcing others to spin.
+ * Racing on the crash path from here will end in misery.  If we reenter,
+ * something has very gone wrong and retrying will (almost certainly) be
+ * futile.  Return up to our nested panic() to try and reboot.
+ *
+ * This is noinline to make it obvious in stack traces which cpus have lost
+ * the race (as opposed to being somewhere in kexec_common_shutdown())
+ */
+static int noinline one_cpu_only(void)
 {
-    /* Only allow the first cpu to continue - force other cpus to spin */
-    if ( test_and_set_bit(KEXEC_FLAG_IN_PROGRESS, &kexec_flags) )
-        for ( ; ; ) ;
+    static unsigned int crashing_cpu = -1;
+    unsigned int cpu = smp_processor_id();
+
+    if ( cmpxchg(&crashing_cpu, -1, cpu) != -1 )
+    {
+        /* Not the first entry into one_cpu_only(). */
+        if ( crashing_cpu == cpu )
+        {
+            printk("Reentered the crash path.  Something is very broken\n");
+            return -EBUSY;
+        }
+
+        /*
+         * Another cpu has beaten us to this point.  Wait here patiently for
+         * it to kill us.
+         */
+        for ( ; ; )
+            halt();
+    }
+
+    set_bit(KEXEC_FLAG_IN_PROGRESS, &kexec_flags);
+    return 0;
 }
 
 /* Save the registers in the per-cpu crash note buffer. */
@@ -288,13 +316,20 @@ crash_xen_info_t *kexec_crash_save_info(void)
     return out;
 }
 
-static void kexec_common_shutdown(void)
+static int kexec_common_shutdown(void)
 {
+    int ret;
+
+    ret = one_cpu_only();
+    if ( ret )
+        return ret;
+
     watchdog_disable();
     console_start_sync();
     spin_debug_disable();
-    one_cpu_only();
     acpi_dmar_reinstate();
+
+    return 0;
 }
 
 void kexec_crash(void)
@@ -309,7 +344,9 @@ void kexec_crash(void)
 
     kexecing = TRUE;
 
-    kexec_common_shutdown();
+    if ( kexec_common_shutdown() != 0 )
+        return;
+
     kexec_crash_save_cpu();
     machine_crash_shutdown();
     machine_kexec(kexec_image[KEXEC_IMAGE_CRASH_BASE + pos]);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:59:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:59:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9Eq-0002i8-7h; Wed, 04 Dec 2013 09:59:24 +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 1Vo9Eo-0002he-9b
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:22 +0000
Received: from [85.158.143.35:18570] by server-2.bemta-4.messagelabs.com id
	1B/81-11386-9FCFE925; Wed, 04 Dec 2013 09:59:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1386151159!3180335!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21519 invoked from network); 4 Dec 2013 09:59:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:59:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9El-0007pa-Q1
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9El-0006Hq-MW
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:19 +0000
Date: Wed, 04 Dec 2013 09:59:19 +0000
Message-Id: <E1Vo9El-0006Hq-MW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: properly handle MSI-X unmask
	operation from 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 74fd0036deb585a139b63b26db025805ecedc37a
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Wed Nov 27 15:15:43 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 27 15:15:43 2013 +0100

    x86: properly handle MSI-X unmask operation from guests
    
    For a pass-through device with MSI-x capability, when guest tries
    to unmask the MSI-x interrupt for the passed through device, xen
    doesn't clear the mask bit for MSI-x in hardware in the following
    scenario, which will cause network disconnection:
    
    1. Guest masks the MSI-x interrupt
    2. Guest updates the address and data for it
    3. Guest unmasks the MSI-x interrupt (This is the problematic step)
    
    In the step #3 above, Xen doesn't handle it well. When guest tries
    to unmask MSI-X interrupt, it traps to Xen, Xen just returns to Qemu
    if it notices that address or data has been modified by guest before,
    then Qemu will update Xen with the latest value of address/data by
    hypercall. However, in this whole process, the MSI-X interrupt unmask
    operation is missing, which means Xen doesn't clear the mask bit in
    hardware for the MSI-X interrupt, so it remains disabled, that is why
    it loses the network connection.
    
    This patch fixes this issue.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    
    Only latch the address if the guest really is unmasking the entry.
    
    Clean up the entire change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/io.c          |    3 +++
 xen/arch/x86/hvm/vmsi.c        |   16 ++++++++++++++++
 xen/include/asm-x86/hvm/io.h   |    1 +
 xen/include/asm-x86/hvm/vcpu.h |    2 ++
 4 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 15e0b4c..bf6309d 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -300,7 +300,10 @@ void hvm_io_assist(ioreq_t *p)
     }
 
     if ( p->state == STATE_IOREQ_NONE )
+    {
+        msix_write_completion(curr);
         vcpu_end_shutdown_deferral(curr);
+    }
 }
 
 static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index 4826b4a..10e5f34 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -293,7 +293,11 @@ static int msixtbl_write(struct vcpu *v, unsigned long address,
 
     /* exit to device model if address/data has been modified */
     if ( test_and_clear_bit(nr_entry, &entry->table_flags) )
+    {
+        if ( !(val & PCI_MSIX_VECTOR_BITMASK) )
+            v->arch.hvm_vcpu.hvm_io.msix_unmask_address = address;
         goto out;
+    }
 
     virt = msixtbl_addr_to_virt(entry, address);
     if ( !virt )
@@ -528,3 +532,15 @@ void msixtbl_pt_cleanup(struct domain *d)
     spin_unlock(&d->arch.hvm_domain.msixtbl_list_lock);
     local_irq_restore(flags);
 }
+
+void msix_write_completion(struct vcpu *v)
+{
+    unsigned long ctrl_address = v->arch.hvm_vcpu.hvm_io.msix_unmask_address;
+
+    if ( !ctrl_address )
+        return;
+
+    v->arch.hvm_vcpu.hvm_io.msix_unmask_address = 0;
+    if ( msixtbl_write(v, ctrl_address, 4, 0) != X86EMUL_OKAY )
+        gdprintk(XENLOG_WARNING, "MSI-X write completion failure\n");
+}
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index 6f4cb96..86db58d 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -124,6 +124,7 @@ void hvm_interrupt_post(struct vcpu *v, int vector, int type);
 void hvm_io_assist(ioreq_t *p);
 void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
                   union vioapic_redir_entry *ent);
+void msix_write_completion(struct vcpu *);
 
 struct hvm_hw_stdvga {
     uint8_t sr_index;
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index a309389..4f45060 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -74,6 +74,8 @@ struct hvm_vcpu_io {
      * necessary retry through other than function return codes.
      */
     bool_t mmio_retry, mmio_retrying;
+
+    unsigned long msix_unmask_address;
 };
 
 #define VMCX_EADDR    (~0ULL)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:59:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:59:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9Eq-0002i8-7h; Wed, 04 Dec 2013 09:59:24 +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 1Vo9Eo-0002he-9b
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:22 +0000
Received: from [85.158.143.35:18570] by server-2.bemta-4.messagelabs.com id
	1B/81-11386-9FCFE925; Wed, 04 Dec 2013 09:59:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1386151159!3180335!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21519 invoked from network); 4 Dec 2013 09:59:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:59:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9El-0007pa-Q1
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9El-0006Hq-MW
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:19 +0000
Date: Wed, 04 Dec 2013 09:59:19 +0000
Message-Id: <E1Vo9El-0006Hq-MW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: properly handle MSI-X unmask
	operation from 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 74fd0036deb585a139b63b26db025805ecedc37a
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Wed Nov 27 15:15:43 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 27 15:15:43 2013 +0100

    x86: properly handle MSI-X unmask operation from guests
    
    For a pass-through device with MSI-x capability, when guest tries
    to unmask the MSI-x interrupt for the passed through device, xen
    doesn't clear the mask bit for MSI-x in hardware in the following
    scenario, which will cause network disconnection:
    
    1. Guest masks the MSI-x interrupt
    2. Guest updates the address and data for it
    3. Guest unmasks the MSI-x interrupt (This is the problematic step)
    
    In the step #3 above, Xen doesn't handle it well. When guest tries
    to unmask MSI-X interrupt, it traps to Xen, Xen just returns to Qemu
    if it notices that address or data has been modified by guest before,
    then Qemu will update Xen with the latest value of address/data by
    hypercall. However, in this whole process, the MSI-X interrupt unmask
    operation is missing, which means Xen doesn't clear the mask bit in
    hardware for the MSI-X interrupt, so it remains disabled, that is why
    it loses the network connection.
    
    This patch fixes this issue.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    
    Only latch the address if the guest really is unmasking the entry.
    
    Clean up the entire change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/io.c          |    3 +++
 xen/arch/x86/hvm/vmsi.c        |   16 ++++++++++++++++
 xen/include/asm-x86/hvm/io.h   |    1 +
 xen/include/asm-x86/hvm/vcpu.h |    2 ++
 4 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 15e0b4c..bf6309d 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -300,7 +300,10 @@ void hvm_io_assist(ioreq_t *p)
     }
 
     if ( p->state == STATE_IOREQ_NONE )
+    {
+        msix_write_completion(curr);
         vcpu_end_shutdown_deferral(curr);
+    }
 }
 
 static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index 4826b4a..10e5f34 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -293,7 +293,11 @@ static int msixtbl_write(struct vcpu *v, unsigned long address,
 
     /* exit to device model if address/data has been modified */
     if ( test_and_clear_bit(nr_entry, &entry->table_flags) )
+    {
+        if ( !(val & PCI_MSIX_VECTOR_BITMASK) )
+            v->arch.hvm_vcpu.hvm_io.msix_unmask_address = address;
         goto out;
+    }
 
     virt = msixtbl_addr_to_virt(entry, address);
     if ( !virt )
@@ -528,3 +532,15 @@ void msixtbl_pt_cleanup(struct domain *d)
     spin_unlock(&d->arch.hvm_domain.msixtbl_list_lock);
     local_irq_restore(flags);
 }
+
+void msix_write_completion(struct vcpu *v)
+{
+    unsigned long ctrl_address = v->arch.hvm_vcpu.hvm_io.msix_unmask_address;
+
+    if ( !ctrl_address )
+        return;
+
+    v->arch.hvm_vcpu.hvm_io.msix_unmask_address = 0;
+    if ( msixtbl_write(v, ctrl_address, 4, 0) != X86EMUL_OKAY )
+        gdprintk(XENLOG_WARNING, "MSI-X write completion failure\n");
+}
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index 6f4cb96..86db58d 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -124,6 +124,7 @@ void hvm_interrupt_post(struct vcpu *v, int vector, int type);
 void hvm_io_assist(ioreq_t *p);
 void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
                   union vioapic_redir_entry *ent);
+void msix_write_completion(struct vcpu *);
 
 struct hvm_hw_stdvga {
     uint8_t sr_index;
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index a309389..4f45060 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -74,6 +74,8 @@ struct hvm_vcpu_io {
      * necessary retry through other than function return codes.
      */
     bool_t mmio_retry, mmio_retrying;
+
+    unsigned long msix_unmask_address;
 };
 
 #define VMCX_EADDR    (~0ULL)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:59:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09: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 1Vo9F2-0002kR-Al; Wed, 04 Dec 2013 09: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 1Vo9F0-0002k3-7R
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:34 +0000
Received: from [85.158.139.211:63531] by server-8.bemta-5.messagelabs.com id
	FB/F4-29838-50DFE925; Wed, 04 Dec 2013 09:59:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1386151170!935050!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15393 invoked from network); 4 Dec 2013 09:59:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:59: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 1Vo9Ev-0007pi-Ud
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ev-0006ID-T1
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:29 +0000
Date: Wed, 04 Dec 2013 09:59:29 +0000
Message-Id: <E1Vo9Ev-0006ID-T1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] PVH dom0: iommu related 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 0e624511f228aef57a3c17520c466c1986e68f62
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Wed Nov 27 15:17:02 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 27 15:17:02 2013 +0100

    PVH dom0: iommu related changes
    
    - For now, iommu is required for PVH dom0. Check for that.
    - For pvh, we need to do mfn_to_gmfn before calling mapping function
      intel_iommu_map_page/amd_iommu_map_page which expects a gfn.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/iommu.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 93ad122..9a1baeb 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -125,10 +125,24 @@ int iommu_domain_init(struct domain *d)
     return hd->platform_ops->init(d);
 }
 
+static __init void check_dom0_pvh_reqs(struct domain *d)
+{
+    if ( !iommu_enabled )
+        panic("Presently, iommu must be enabled for pvh dom0\n");
+
+    if ( iommu_passthrough )
+        panic("For pvh dom0, dom0-passthrough must not be enabled\n");
+
+    iommu_dom0_strict = 1;
+}
+
 void __init iommu_dom0_init(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
 
+    if ( is_pvh_domain(d) )
+        check_dom0_pvh_reqs(d);
+
     if ( !iommu_enabled )
         return;
 
@@ -141,12 +155,14 @@ void __init iommu_dom0_init(struct domain *d)
         page_list_for_each ( page, &d->page_list )
         {
             unsigned long mfn = page_to_mfn(page);
+            unsigned long gfn = mfn_to_gmfn(d, mfn);
             unsigned int mapping = IOMMUF_readable;
+
             if ( ((page->u.inuse.type_info & PGT_count_mask) == 0) ||
                  ((page->u.inuse.type_info & PGT_type_mask)
                   == PGT_writable_page) )
                 mapping |= IOMMUF_writable;
-            hd->platform_ops->map_page(d, mfn, mfn, mapping);
+            hd->platform_ops->map_page(d, gfn, mfn, mapping);
             if ( !(i++ & 0xfffff) )
                 process_pending_softirqs();
         }
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:59:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09: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 1Vo9F2-0002kR-Al; Wed, 04 Dec 2013 09: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 1Vo9F0-0002k3-7R
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:34 +0000
Received: from [85.158.139.211:63531] by server-8.bemta-5.messagelabs.com id
	FB/F4-29838-50DFE925; Wed, 04 Dec 2013 09:59:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1386151170!935050!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15393 invoked from network); 4 Dec 2013 09:59:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:59: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 1Vo9Ev-0007pi-Ud
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ev-0006ID-T1
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:29 +0000
Date: Wed, 04 Dec 2013 09:59:29 +0000
Message-Id: <E1Vo9Ev-0006ID-T1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] PVH dom0: iommu related 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 0e624511f228aef57a3c17520c466c1986e68f62
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Wed Nov 27 15:17:02 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 27 15:17:02 2013 +0100

    PVH dom0: iommu related changes
    
    - For now, iommu is required for PVH dom0. Check for that.
    - For pvh, we need to do mfn_to_gmfn before calling mapping function
      intel_iommu_map_page/amd_iommu_map_page which expects a gfn.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/iommu.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 93ad122..9a1baeb 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -125,10 +125,24 @@ int iommu_domain_init(struct domain *d)
     return hd->platform_ops->init(d);
 }
 
+static __init void check_dom0_pvh_reqs(struct domain *d)
+{
+    if ( !iommu_enabled )
+        panic("Presently, iommu must be enabled for pvh dom0\n");
+
+    if ( iommu_passthrough )
+        panic("For pvh dom0, dom0-passthrough must not be enabled\n");
+
+    iommu_dom0_strict = 1;
+}
+
 void __init iommu_dom0_init(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
 
+    if ( is_pvh_domain(d) )
+        check_dom0_pvh_reqs(d);
+
     if ( !iommu_enabled )
         return;
 
@@ -141,12 +155,14 @@ void __init iommu_dom0_init(struct domain *d)
         page_list_for_each ( page, &d->page_list )
         {
             unsigned long mfn = page_to_mfn(page);
+            unsigned long gfn = mfn_to_gmfn(d, mfn);
             unsigned int mapping = IOMMUF_readable;
+
             if ( ((page->u.inuse.type_info & PGT_count_mask) == 0) ||
                  ((page->u.inuse.type_info & PGT_type_mask)
                   == PGT_writable_page) )
                 mapping |= IOMMUF_writable;
-            hd->platform_ops->map_page(d, mfn, mfn, mapping);
+            hd->platform_ops->map_page(d, gfn, mfn, mapping);
             if ( !(i++ & 0xfffff) )
                 process_pending_softirqs();
         }
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 09:59:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:59: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 1Vo9F9-0002mC-DW; Wed, 04 Dec 2013 09:59: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 1Vo9F8-0002lv-Vr
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:43 +0000
Received: from [85.158.139.211:64458] by server-17.bemta-5.messagelabs.com id
	B2/4D-19152-E0DFE925; Wed, 04 Dec 2013 09:59:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1386151180!2164173!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2305 invoked from network); 4 Dec 2013 09:59:41 -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;
	4 Dec 2013 09:59:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9F6-0007pm-2s
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9F6-0006Ic-1p
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:40 +0000
Date: Wed, 04 Dec 2013 09:59:40 +0000
Message-Id: <E1Vo9F6-0006Ic-1p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: Add 8250 earlyprintk
	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 93e22f8248038504be1e638abb91c6856cd16b38
Author:     Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
AuthorDate: Fri Sep 20 15:22:40 2013 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm64: Add 8250 earlyprintk support
    
    Extracted from "Basic Platform support for APM X-Gene Storm."
    
    Signed-off-by: Anup Patel <anup.patel@linaro.org>
    Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
    
    Reworked into generic 8250 driver, use EARLY_UART_REG_SHIFT.
    
    While there observe a missing shift in the arm32 version (UART_THR is zero so
    it doesn't really matter). Changed for consistency.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/Rules.mk             |    6 +++++
 xen/arch/arm/arm64/debug-8250.inc |   45 +++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index c27c2eb..aaa203e 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -82,6 +82,12 @@ EARLY_PRINTK_INC := 8250
 EARLY_UART_BASE_ADDRESS := 0xF0406B00
 EARLY_UART_REG_SHIFT := 2
 endif
+ifeq ($(CONFIG_EARLY_PRINTK), xgene-storm)
+EARLY_PRINTK_INC := 8250
+EARLY_PRINTK_BAUD := 115200
+EARLY_UART_BASE_ADDRESS := 0x1c020000
+EARLY_UART_REG_SHIFT := 2
+endif
 
 ifneq ($(EARLY_PRINTK_INC),)
 EARLY_PRINTK := y
diff --git a/xen/arch/arm/arm64/debug-8250.inc b/xen/arch/arm/arm64/debug-8250.inc
new file mode 100644
index 0000000..158549a
--- /dev/null
+++ b/xen/arch/arm/arm64/debug-8250.inc
@@ -0,0 +1,45 @@
+/*
+ * xen/arch/arm/arm64/debug-8250.inc
+ *
+ * 8250 specific debug code
+ *
+ * Copyright (c) 2013 Applied Micro.
+ *
+ * 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/8250-uart.h>
+
+/* UART wait UART to be ready to transmit
+ * xb: register which contains the UART base address
+ * c: scratch register */
+.macro early_uart_ready xb c
+1:
+       ldrb  w\c, [\xb, #UART_LSR << EARLY_UART_REG_SHIFT]
+       and w\c, w\c, #UART_LSR_THRE
+       cmp w\c, #UART_LSR_THRE
+       b.ne 1b
+.endm
+
+/* 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
+        /* UART_THR  transmit holding */
+        strb   \wt, [\xb, #UART_THR << EARLY_UART_REG_SHIFT]
+.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 Wed Dec 04 09:59:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:59: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 1Vo9F9-0002mC-DW; Wed, 04 Dec 2013 09:59: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 1Vo9F8-0002lv-Vr
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:43 +0000
Received: from [85.158.139.211:64458] by server-17.bemta-5.messagelabs.com id
	B2/4D-19152-E0DFE925; Wed, 04 Dec 2013 09:59:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1386151180!2164173!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2305 invoked from network); 4 Dec 2013 09:59:41 -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;
	4 Dec 2013 09:59:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9F6-0007pm-2s
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9F6-0006Ic-1p
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:40 +0000
Date: Wed, 04 Dec 2013 09:59:40 +0000
Message-Id: <E1Vo9F6-0006Ic-1p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: Add 8250 earlyprintk
	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 93e22f8248038504be1e638abb91c6856cd16b38
Author:     Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
AuthorDate: Fri Sep 20 15:22:40 2013 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm64: Add 8250 earlyprintk support
    
    Extracted from "Basic Platform support for APM X-Gene Storm."
    
    Signed-off-by: Anup Patel <anup.patel@linaro.org>
    Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
    
    Reworked into generic 8250 driver, use EARLY_UART_REG_SHIFT.
    
    While there observe a missing shift in the arm32 version (UART_THR is zero so
    it doesn't really matter). Changed for consistency.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/Rules.mk             |    6 +++++
 xen/arch/arm/arm64/debug-8250.inc |   45 +++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index c27c2eb..aaa203e 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -82,6 +82,12 @@ EARLY_PRINTK_INC := 8250
 EARLY_UART_BASE_ADDRESS := 0xF0406B00
 EARLY_UART_REG_SHIFT := 2
 endif
+ifeq ($(CONFIG_EARLY_PRINTK), xgene-storm)
+EARLY_PRINTK_INC := 8250
+EARLY_PRINTK_BAUD := 115200
+EARLY_UART_BASE_ADDRESS := 0x1c020000
+EARLY_UART_REG_SHIFT := 2
+endif
 
 ifneq ($(EARLY_PRINTK_INC),)
 EARLY_PRINTK := y
diff --git a/xen/arch/arm/arm64/debug-8250.inc b/xen/arch/arm/arm64/debug-8250.inc
new file mode 100644
index 0000000..158549a
--- /dev/null
+++ b/xen/arch/arm/arm64/debug-8250.inc
@@ -0,0 +1,45 @@
+/*
+ * xen/arch/arm/arm64/debug-8250.inc
+ *
+ * 8250 specific debug code
+ *
+ * Copyright (c) 2013 Applied Micro.
+ *
+ * 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/8250-uart.h>
+
+/* UART wait UART to be ready to transmit
+ * xb: register which contains the UART base address
+ * c: scratch register */
+.macro early_uart_ready xb c
+1:
+       ldrb  w\c, [\xb, #UART_LSR << EARLY_UART_REG_SHIFT]
+       and w\c, w\c, #UART_LSR_THRE
+       cmp w\c, #UART_LSR_THRE
+       b.ne 1b
+.endm
+
+/* 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
+        /* UART_THR  transmit holding */
+        strb   \wt, [\xb, #UART_THR << EARLY_UART_REG_SHIFT]
+.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 Wed Dec 04 09:59:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:59: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 1Vo9FJ-0002o3-G8; Wed, 04 Dec 2013 09:59: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 1Vo9FI-0002np-OQ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:52 +0000
Received: from [193.109.254.147:16822] by server-4.bemta-14.messagelabs.com id
	84/D2-03916-81DFE925; Wed, 04 Dec 2013 09:59:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1386151190!2760191!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4834 invoked from network); 4 Dec 2013 09:59:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:59:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9FG-0007px-82
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9FG-0006J0-6N
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:50 +0000
Date: Wed, 04 Dec 2013 09:59:50 +0000
Message-Id: <E1Vo9FG-0006J0-6N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: Add Basic Platform support
	for APM X-Gene Storm.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e921a18742cf609815c72e3d9af7218a0e083407
Author:     Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
AuthorDate: Fri Sep 20 15:22:40 2013 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm64: Add Basic Platform support for APM X-Gene Storm.
    
    This patch adds initial platform stubs for APM X-Gene.
    
    Signed-off-by: Anup Patel <anup.patel@linaro.org>
    Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
    
    Drop earlyprintk (split into earlier patch). Only build on ARM64.
    
    Drop empty init and reset hooks and enable 1:1 workaround.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/platforms/Makefile      |    1 +
 xen/arch/arm/platforms/xgene-storm.c |   48 ++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index f0dd72c..680364f 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -3,3 +3,4 @@ obj-$(CONFIG_ARM_32) += exynos5.o
 obj-$(CONFIG_ARM_32) += midway.o
 obj-$(CONFIG_ARM_32) += omap5.o
 obj-$(CONFIG_ARM_32) += sunxi.o
+obj-$(CONFIG_ARM_64) += xgene-storm.o
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
new file mode 100644
index 0000000..0198cec
--- /dev/null
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -0,0 +1,48 @@
+/*
+ * xen/arch/arm/platforms/xgene-storm.c
+ *
+ * Applied Micro's X-Gene specific settings
+ *
+ * Pranavkumar Sawargaonkar <psawargaonkar@apm.com>
+ * Anup Patel <apatel@apm.com>
+ * Copyright (c) 2013 Applied Micro.
+ *
+ * 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 <asm/platform.h>
+
+static uint32_t xgene_storm_quirks(void)
+{
+    return PLATFORM_QUIRK_DOM0_MAPPING_11;
+}
+
+
+static const char * const xgene_storm_dt_compat[] __initconst =
+{
+    "apm,xgene-storm",
+    NULL
+};
+
+PLATFORM_START(xgene_storm, "APM X-GENE STORM")
+    .compatible = xgene_storm_dt_compat,
+    .quirks = xgene_storm_quirks,
+PLATFORM_END
+
+/*
+ * 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 Wed Dec 04 09:59:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 09:59: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 1Vo9FJ-0002o3-G8; Wed, 04 Dec 2013 09:59: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 1Vo9FI-0002np-OQ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:52 +0000
Received: from [193.109.254.147:16822] by server-4.bemta-14.messagelabs.com id
	84/D2-03916-81DFE925; Wed, 04 Dec 2013 09:59:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1386151190!2760191!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4834 invoked from network); 4 Dec 2013 09:59:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 09:59:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9FG-0007px-82
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9FG-0006J0-6N
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 09:59:50 +0000
Date: Wed, 04 Dec 2013 09:59:50 +0000
Message-Id: <E1Vo9FG-0006J0-6N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: Add Basic Platform support
	for APM X-Gene Storm.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e921a18742cf609815c72e3d9af7218a0e083407
Author:     Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
AuthorDate: Fri Sep 20 15:22:40 2013 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm64: Add Basic Platform support for APM X-Gene Storm.
    
    This patch adds initial platform stubs for APM X-Gene.
    
    Signed-off-by: Anup Patel <anup.patel@linaro.org>
    Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
    
    Drop earlyprintk (split into earlier patch). Only build on ARM64.
    
    Drop empty init and reset hooks and enable 1:1 workaround.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/platforms/Makefile      |    1 +
 xen/arch/arm/platforms/xgene-storm.c |   48 ++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index f0dd72c..680364f 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -3,3 +3,4 @@ obj-$(CONFIG_ARM_32) += exynos5.o
 obj-$(CONFIG_ARM_32) += midway.o
 obj-$(CONFIG_ARM_32) += omap5.o
 obj-$(CONFIG_ARM_32) += sunxi.o
+obj-$(CONFIG_ARM_64) += xgene-storm.o
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
new file mode 100644
index 0000000..0198cec
--- /dev/null
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -0,0 +1,48 @@
+/*
+ * xen/arch/arm/platforms/xgene-storm.c
+ *
+ * Applied Micro's X-Gene specific settings
+ *
+ * Pranavkumar Sawargaonkar <psawargaonkar@apm.com>
+ * Anup Patel <apatel@apm.com>
+ * Copyright (c) 2013 Applied Micro.
+ *
+ * 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 <asm/platform.h>
+
+static uint32_t xgene_storm_quirks(void)
+{
+    return PLATFORM_QUIRK_DOM0_MAPPING_11;
+}
+
+
+static const char * const xgene_storm_dt_compat[] __initconst =
+{
+    "apm,xgene-storm",
+    NULL
+};
+
+PLATFORM_START(xgene_storm, "APM X-GENE STORM")
+    .compatible = xgene_storm_dt_compat,
+    .quirks = xgene_storm_quirks,
+PLATFORM_END
+
+/*
+ * 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 Wed Dec 04 10:00:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:00: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 1Vo9FT-0002ue-Kg; Wed, 04 Dec 2013 10:00:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9FS-0002uR-Nz
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:02 +0000
Received: from [85.158.143.35:25332] by server-2.bemta-4.messagelabs.com id
	41/E2-11386-22DFE925; Wed, 04 Dec 2013 10:00:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1386151200!3240763!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23625 invoked from network); 4 Dec 2013 10:00:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:00:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9FQ-0007q6-EF
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9FQ-0006JQ-BW
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:00 +0000
Date: Wed, 04 Dec 2013 10:00:00 +0000
Message-Id: <E1Vo9FQ-0006JQ-BW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: Add APM implementor id to
	processor implementers.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b3fb41a59b75ea3a878f6e4ab0fabcfaf79ddeb
Author:     Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
AuthorDate: Fri Sep 20 15:22:41 2013 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm64: Add APM implementor id to processor implementers.
    
    This patch updates the list of processor implementers with APM implementor id.
    
    Signed-off-by: Anup Patel <anup.patel@linaro.org>
    Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/setup.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index b032030..d252131 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -64,6 +64,7 @@ static const char * __initdata processor_implementers[] = {
     ['B'] = "Broadcom Corporation",
     ['D'] = "Digital Equipment Corp",
     ['M'] = "Motorola, Freescale Semiconductor Inc.",
+    ['P'] = "Applied Micro",
     ['Q'] = "Qualcomm Inc.",
     ['V'] = "Marvell Semiconductor Inc.",
     ['i'] = "Intel Corporation",
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:00:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:00: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 1Vo9FT-0002ue-Kg; Wed, 04 Dec 2013 10:00:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9FS-0002uR-Nz
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:02 +0000
Received: from [85.158.143.35:25332] by server-2.bemta-4.messagelabs.com id
	41/E2-11386-22DFE925; Wed, 04 Dec 2013 10:00:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1386151200!3240763!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23625 invoked from network); 4 Dec 2013 10:00:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:00:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9FQ-0007q6-EF
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9FQ-0006JQ-BW
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:00 +0000
Date: Wed, 04 Dec 2013 10:00:00 +0000
Message-Id: <E1Vo9FQ-0006JQ-BW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: Add APM implementor id to
	processor implementers.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b3fb41a59b75ea3a878f6e4ab0fabcfaf79ddeb
Author:     Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
AuthorDate: Fri Sep 20 15:22:41 2013 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm64: Add APM implementor id to processor implementers.
    
    This patch updates the list of processor implementers with APM implementor id.
    
    Signed-off-by: Anup Patel <anup.patel@linaro.org>
    Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/setup.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index b032030..d252131 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -64,6 +64,7 @@ static const char * __initdata processor_implementers[] = {
     ['B'] = "Broadcom Corporation",
     ['D'] = "Digital Equipment Corp",
     ['M'] = "Motorola, Freescale Semiconductor Inc.",
+    ['P'] = "Applied Micro",
     ['Q'] = "Qualcomm Inc.",
     ['V'] = "Marvell Semiconductor Inc.",
     ['i'] = "Intel Corporation",
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:00:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10: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 1Vo9Ff-0002we-P1; Wed, 04 Dec 2013 10:00: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 1Vo9Fe-0002wR-Qn
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:15 +0000
Received: from [85.158.139.211:14876] by server-9.bemta-5.messagelabs.com id
	B3/20-15098-E2DFE925; Wed, 04 Dec 2013 10:00:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1386151211!2163904!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30208 invoked from network); 4 Dec 2013 10:00:12 -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;
	4 Dec 2013 10:00: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 1Vo9Fa-0007wA-S7
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Fa-0006KW-I0
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:10 +0000
Date: Wed, 04 Dec 2013 10:00:10 +0000
Message-Id: <E1Vo9Fa-0006KW-I0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: add a quirk to handle
	platforms with unusual GIC layout
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8959f533cdb4ceb228ab846eb327828d99cd979
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Nov 21 15:55:37 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm: add a quirk to handle platforms with unusual GIC layout
    
    On some platforms the pages are placed at a 64K stride instead of as
    contiguous 4K pages.
    
    This is because the ARM64 architecture allows for page sizes of 4/16/64K in
    the MMU so a larger stride allow more granular control of mappings. We only
    currently support 4K.
    
    Use this quirk on the xgene platform.
    
    This should ideally be fixed by an extension to the device tree bindings as
    described in http://www.spinics.net/lists/devicetree/msg10473.html especially
    http://www.spinics.net/lists/devicetree/msg10478.html. However for the time
    being a platform specific quirk will do.
    
    Note that we always map the GICV to the guest (including dom0) at a 4K stride
    length and this is reflected in the DTB passed to the guest.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/gic.c                   |   37 ++++++++++++++++++++++++++++-----
 xen/arch/arm/platforms/xgene-storm.c |    2 +-
 xen/include/asm-arm/platform.h       |    5 ++++
 3 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index ab49106..0084f50 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -30,6 +30,7 @@
 #include <xen/device_tree.h>
 #include <asm/p2m.h>
 #include <asm/domain.h>
+#include <asm/platform.h>
 
 #include <asm/gic.h>
 
@@ -444,7 +445,10 @@ void __init gic_init(void)
     BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) !=
                  FIXMAP_ADDR(FIXMAP_GICC2)-PAGE_SIZE);
     set_fixmap(FIXMAP_GICC1, gic.cbase >> PAGE_SHIFT, DEV_SHARED);
-    set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 1, DEV_SHARED);
+    if ( platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
+        set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 0x10, DEV_SHARED);
+    else
+        set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 0x1, DEV_SHARED);
     set_fixmap(FIXMAP_GICH, gic.hbase >> PAGE_SHIFT, DEV_SHARED);
 
     /* Global settings: interrupt distributor */
@@ -823,6 +827,8 @@ void gic_interrupt(struct cpu_user_regs *regs, int is_fiq)
 
 int gicv_setup(struct domain *d)
 {
+    int ret;
+
     /*
      * Domain 0 gets the hardware address.
      * Guests get the virtual platform layout.
@@ -840,11 +846,30 @@ int gicv_setup(struct domain *d)
 
     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, d->arch.vgic.cbase,
-                            d->arch.vgic.cbase + (2 * PAGE_SIZE) - 1,
-                            gic.vbase);
+    /*
+     * Map the gic virtual cpu interface in the gic cpu interface
+     * region of the guest.
+     *
+     * The second page is always mapped at +4K irrespective of the
+     * GIC_64K_STRIDE quirk. The DTB passed to the guest reflects this.
+     */
+    ret = map_mmio_regions(d, d->arch.vgic.cbase,
+                           d->arch.vgic.cbase + PAGE_SIZE - 1,
+                           gic.vbase);
+    if (ret)
+        return ret;
+
+    if ( !platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
+        ret = map_mmio_regions(d, d->arch.vgic.cbase + PAGE_SIZE,
+                               d->arch.vgic.cbase + (2 * PAGE_SIZE) - 1,
+                               gic.vbase + PAGE_SIZE);
+    else
+        ret = map_mmio_regions(d, d->arch.vgic.cbase + PAGE_SIZE,
+                               d->arch.vgic.cbase + (2 * PAGE_SIZE) - 1,
+                               gic.vbase + 16*PAGE_SIZE);
+
+    return ret;
+
 }
 
 static void gic_irq_eoi(void *info)
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index 0198cec..23ec46d 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -23,7 +23,7 @@
 
 static uint32_t xgene_storm_quirks(void)
 {
-    return PLATFORM_QUIRK_DOM0_MAPPING_11;
+    return PLATFORM_QUIRK_DOM0_MAPPING_11|PLATFORM_QUIRK_GIC_64K_STRIDE;
 }
 
 
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index c282b30..c9314e5 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -44,6 +44,11 @@ struct platform_desc {
  * Useful on platform where System MMU is not yet implemented
  */
 #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
+/*
+ * Quirk for platforms where the 4K GIC register ranges are placed at
+ * 64K stride.
+ */
+#define PLATFORM_QUIRK_GIC_64K_STRIDE (1 << 1)
 
 void __init platform_init(void);
 int __init platform_init_time(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 Dec 04 10:00:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10: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 1Vo9Ff-0002we-P1; Wed, 04 Dec 2013 10:00: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 1Vo9Fe-0002wR-Qn
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:15 +0000
Received: from [85.158.139.211:14876] by server-9.bemta-5.messagelabs.com id
	B3/20-15098-E2DFE925; Wed, 04 Dec 2013 10:00:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1386151211!2163904!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30208 invoked from network); 4 Dec 2013 10:00:12 -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;
	4 Dec 2013 10:00: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 1Vo9Fa-0007wA-S7
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Fa-0006KW-I0
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:10 +0000
Date: Wed, 04 Dec 2013 10:00:10 +0000
Message-Id: <E1Vo9Fa-0006KW-I0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: add a quirk to handle
	platforms with unusual GIC layout
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8959f533cdb4ceb228ab846eb327828d99cd979
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Nov 21 15:55:37 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm: add a quirk to handle platforms with unusual GIC layout
    
    On some platforms the pages are placed at a 64K stride instead of as
    contiguous 4K pages.
    
    This is because the ARM64 architecture allows for page sizes of 4/16/64K in
    the MMU so a larger stride allow more granular control of mappings. We only
    currently support 4K.
    
    Use this quirk on the xgene platform.
    
    This should ideally be fixed by an extension to the device tree bindings as
    described in http://www.spinics.net/lists/devicetree/msg10473.html especially
    http://www.spinics.net/lists/devicetree/msg10478.html. However for the time
    being a platform specific quirk will do.
    
    Note that we always map the GICV to the guest (including dom0) at a 4K stride
    length and this is reflected in the DTB passed to the guest.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/gic.c                   |   37 ++++++++++++++++++++++++++++-----
 xen/arch/arm/platforms/xgene-storm.c |    2 +-
 xen/include/asm-arm/platform.h       |    5 ++++
 3 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index ab49106..0084f50 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -30,6 +30,7 @@
 #include <xen/device_tree.h>
 #include <asm/p2m.h>
 #include <asm/domain.h>
+#include <asm/platform.h>
 
 #include <asm/gic.h>
 
@@ -444,7 +445,10 @@ void __init gic_init(void)
     BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) !=
                  FIXMAP_ADDR(FIXMAP_GICC2)-PAGE_SIZE);
     set_fixmap(FIXMAP_GICC1, gic.cbase >> PAGE_SHIFT, DEV_SHARED);
-    set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 1, DEV_SHARED);
+    if ( platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
+        set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 0x10, DEV_SHARED);
+    else
+        set_fixmap(FIXMAP_GICC2, (gic.cbase >> PAGE_SHIFT) + 0x1, DEV_SHARED);
     set_fixmap(FIXMAP_GICH, gic.hbase >> PAGE_SHIFT, DEV_SHARED);
 
     /* Global settings: interrupt distributor */
@@ -823,6 +827,8 @@ void gic_interrupt(struct cpu_user_regs *regs, int is_fiq)
 
 int gicv_setup(struct domain *d)
 {
+    int ret;
+
     /*
      * Domain 0 gets the hardware address.
      * Guests get the virtual platform layout.
@@ -840,11 +846,30 @@ int gicv_setup(struct domain *d)
 
     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, d->arch.vgic.cbase,
-                            d->arch.vgic.cbase + (2 * PAGE_SIZE) - 1,
-                            gic.vbase);
+    /*
+     * Map the gic virtual cpu interface in the gic cpu interface
+     * region of the guest.
+     *
+     * The second page is always mapped at +4K irrespective of the
+     * GIC_64K_STRIDE quirk. The DTB passed to the guest reflects this.
+     */
+    ret = map_mmio_regions(d, d->arch.vgic.cbase,
+                           d->arch.vgic.cbase + PAGE_SIZE - 1,
+                           gic.vbase);
+    if (ret)
+        return ret;
+
+    if ( !platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
+        ret = map_mmio_regions(d, d->arch.vgic.cbase + PAGE_SIZE,
+                               d->arch.vgic.cbase + (2 * PAGE_SIZE) - 1,
+                               gic.vbase + PAGE_SIZE);
+    else
+        ret = map_mmio_regions(d, d->arch.vgic.cbase + PAGE_SIZE,
+                               d->arch.vgic.cbase + (2 * PAGE_SIZE) - 1,
+                               gic.vbase + 16*PAGE_SIZE);
+
+    return ret;
+
 }
 
 static void gic_irq_eoi(void *info)
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index 0198cec..23ec46d 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -23,7 +23,7 @@
 
 static uint32_t xgene_storm_quirks(void)
 {
-    return PLATFORM_QUIRK_DOM0_MAPPING_11;
+    return PLATFORM_QUIRK_DOM0_MAPPING_11|PLATFORM_QUIRK_GIC_64K_STRIDE;
 }
 
 
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index c282b30..c9314e5 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -44,6 +44,11 @@ struct platform_desc {
  * Useful on platform where System MMU is not yet implemented
  */
 #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
+/*
+ * Quirk for platforms where the 4K GIC register ranges are placed at
+ * 64K stride.
+ */
+#define PLATFORM_QUIRK_GIC_64K_STRIDE (1 << 1)
 
 void __init platform_init(void);
 int __init platform_init_time(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 Dec 04 10:00:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:00:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9Fp-0002yR-9z; Wed, 04 Dec 2013 10:00:25 +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 1Vo9Fn-0002y0-KT
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:23 +0000
Received: from [85.158.143.35:9814] by server-3.bemta-4.messagelabs.com id
	E0/CF-32360-63DFE925; Wed, 04 Dec 2013 10:00:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1386151221!3217702!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 446 invoked from network); 4 Dec 2013 10:00:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:00:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Fl-0007wI-3q
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Fk-0006LQ-VG
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:20 +0000
Date: Wed, 04 Dec 2013 10:00:20 +0000
Message-Id: <E1Vo9Fk-0006LQ-VG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: allow platform code to
	select dom0 event channel 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 12bd2da41ed45892dca43cd21e9220319d22b984
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 20 13:40:48 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm: allow platform code to select dom0 event channel irq
    
    Currently the hardcoded use of GUEST_EVTCHN_PPI is problematic if that is a
    real PPI on the platform.
    
    We really need to be smarter about selecting an unused PPI but in the meantime
    we can at least give the platform code the option of hardcoding a number which
    works for the platform.
    
    Hardcode a suitable PPI on the Xgene platform.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain.c                |    7 +++++--
 xen/arch/arm/platform.c              |    7 +++++++
 xen/arch/arm/platforms/xgene-storm.c |    1 +
 xen/include/asm-arm/platform.h       |    5 +++++
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 2f57d01..52d2403 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -31,6 +31,7 @@
 #include <asm/processor-ca15.h>
 
 #include <asm/gic.h>
+#include <asm/platform.h>
 #include "vtimer.h"
 #include "vuart.h"
 
@@ -526,8 +527,10 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
     if ( (rc = vcpu_domain_init(d)) != 0 )
         goto fail;
 
-    /* XXX dom0 needs more intelligent selection of PPI */
-    d->arch.evtchn_irq = GUEST_EVTCHN_PPI;
+    if ( d->domain_id )
+        d->arch.evtchn_irq = GUEST_EVTCHN_PPI;
+    else
+        d->arch.evtchn_irq = platform_dom0_evtchn_ppi();
 
     /*
      * Virtual UART is only used by linux early printk and decompress code.
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 0fbbdc7..a7f9ee4 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -156,6 +156,13 @@ bool_t platform_device_is_blacklisted(const struct dt_device_node *node)
     return dt_match_node(blacklist, node);
 }
 
+unsigned int platform_dom0_evtchn_ppi(void)
+{
+    if ( platform && platform->dom0_evtchn_ppi )
+        return platform->dom0_evtchn_ppi;
+    return GUEST_EVTCHN_PPI;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index 23ec46d..f416da3 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -36,6 +36,7 @@ static const char * const xgene_storm_dt_compat[] __initconst =
 PLATFORM_START(xgene_storm, "APM X-GENE STORM")
     .compatible = xgene_storm_dt_compat,
     .quirks = xgene_storm_quirks,
+    .dom0_evtchn_ppi = 24,
 PLATFORM_END
 
 /*
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index c9314e5..5900ee4 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -37,6 +37,10 @@ struct platform_desc {
      * List of devices which must not pass-through to a guest
      */
     const struct dt_device_match *blacklist_dev;
+    /*
+     * The IRQ (PPI) to use to inject event channels to dom0.
+     */
+    unsigned int dom0_evtchn_ppi;
 };
 
 /*
@@ -61,6 +65,7 @@ void platform_reset(void);
 void platform_poweroff(void);
 bool_t platform_has_quirk(uint32_t quirk);
 bool_t platform_device_is_blacklisted(const struct dt_device_node *node);
+unsigned int platform_dom0_evtchn_ppi(void);
 
 #define PLATFORM_START(_name, _namestr)                         \
 static const struct platform_desc  __plat_desc_##_name __used   \
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:00:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:00:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9Fp-0002yR-9z; Wed, 04 Dec 2013 10:00:25 +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 1Vo9Fn-0002y0-KT
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:23 +0000
Received: from [85.158.143.35:9814] by server-3.bemta-4.messagelabs.com id
	E0/CF-32360-63DFE925; Wed, 04 Dec 2013 10:00:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1386151221!3217702!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 446 invoked from network); 4 Dec 2013 10:00:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:00:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Fl-0007wI-3q
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Fk-0006LQ-VG
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:20 +0000
Date: Wed, 04 Dec 2013 10:00:20 +0000
Message-Id: <E1Vo9Fk-0006LQ-VG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: allow platform code to
	select dom0 event channel 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 12bd2da41ed45892dca43cd21e9220319d22b984
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 20 13:40:48 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm: allow platform code to select dom0 event channel irq
    
    Currently the hardcoded use of GUEST_EVTCHN_PPI is problematic if that is a
    real PPI on the platform.
    
    We really need to be smarter about selecting an unused PPI but in the meantime
    we can at least give the platform code the option of hardcoding a number which
    works for the platform.
    
    Hardcode a suitable PPI on the Xgene platform.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain.c                |    7 +++++--
 xen/arch/arm/platform.c              |    7 +++++++
 xen/arch/arm/platforms/xgene-storm.c |    1 +
 xen/include/asm-arm/platform.h       |    5 +++++
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 2f57d01..52d2403 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -31,6 +31,7 @@
 #include <asm/processor-ca15.h>
 
 #include <asm/gic.h>
+#include <asm/platform.h>
 #include "vtimer.h"
 #include "vuart.h"
 
@@ -526,8 +527,10 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
     if ( (rc = vcpu_domain_init(d)) != 0 )
         goto fail;
 
-    /* XXX dom0 needs more intelligent selection of PPI */
-    d->arch.evtchn_irq = GUEST_EVTCHN_PPI;
+    if ( d->domain_id )
+        d->arch.evtchn_irq = GUEST_EVTCHN_PPI;
+    else
+        d->arch.evtchn_irq = platform_dom0_evtchn_ppi();
 
     /*
      * Virtual UART is only used by linux early printk and decompress code.
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 0fbbdc7..a7f9ee4 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -156,6 +156,13 @@ bool_t platform_device_is_blacklisted(const struct dt_device_node *node)
     return dt_match_node(blacklist, node);
 }
 
+unsigned int platform_dom0_evtchn_ppi(void)
+{
+    if ( platform && platform->dom0_evtchn_ppi )
+        return platform->dom0_evtchn_ppi;
+    return GUEST_EVTCHN_PPI;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index 23ec46d..f416da3 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -36,6 +36,7 @@ static const char * const xgene_storm_dt_compat[] __initconst =
 PLATFORM_START(xgene_storm, "APM X-GENE STORM")
     .compatible = xgene_storm_dt_compat,
     .quirks = xgene_storm_quirks,
+    .dom0_evtchn_ppi = 24,
 PLATFORM_END
 
 /*
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index c9314e5..5900ee4 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -37,6 +37,10 @@ struct platform_desc {
      * List of devices which must not pass-through to a guest
      */
     const struct dt_device_match *blacklist_dev;
+    /*
+     * The IRQ (PPI) to use to inject event channels to dom0.
+     */
+    unsigned int dom0_evtchn_ppi;
 };
 
 /*
@@ -61,6 +65,7 @@ void platform_reset(void);
 void platform_poweroff(void);
 bool_t platform_has_quirk(uint32_t quirk);
 bool_t platform_device_is_blacklisted(const struct dt_device_node *node);
+unsigned int platform_dom0_evtchn_ppi(void);
 
 #define PLATFORM_START(_name, _namestr)                         \
 static const struct platform_desc  __plat_desc_##_name __used   \
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:00:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10: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 1Vo9Fz-000301-Nl; Wed, 04 Dec 2013 10:00:35 +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 1Vo9Fx-0002zk-NH
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:33 +0000
Received: from [85.158.143.35:34309] by server-1.bemta-4.messagelabs.com id
	D7/13-02132-14DFE925; Wed, 04 Dec 2013 10:00:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386151231!3233315!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21894 invoked from network); 4 Dec 2013 10:00:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:00: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 1Vo9Fv-0007wQ-9H
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Fv-0006Lr-6x
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:31 +0000
Date: Wed, 04 Dec 2013 10:00:31 +0000
Message-Id: <E1Vo9Fv-0006Lr-6x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: Map xgene PCI memory
	regions and interrupts 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 89a3a0a5869a1e47f43f57e1715cdb3c68ef1924
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Nov 22 15:56:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm64: Map xgene PCI memory regions and interrupts to dom0.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/platforms/xgene-storm.c |   82 ++++++++++++++++++++++++++++++++++
 1 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index f416da3..ea9b0f4 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -20,12 +20,93 @@
 
 #include <xen/config.h>
 #include <asm/platform.h>
+#include <asm/gic.h>
 
 static uint32_t xgene_storm_quirks(void)
 {
     return PLATFORM_QUIRK_DOM0_MAPPING_11|PLATFORM_QUIRK_GIC_64K_STRIDE;
 }
 
+static int map_one_mmio(struct domain *d, const char *what,
+                         paddr_t start, paddr_t end)
+{
+    int ret;
+
+    printk("Additional MMIO %"PRIpaddr"-%"PRIpaddr" (%s)\n",
+           start, end, what);
+    ret = map_mmio_regions(d, start, end, start);
+    if ( ret )
+        printk("Failed to map %s @ %"PRIpaddr" to dom%d\n",
+               what, start, d->domain_id);
+    return ret;
+}
+
+static int map_one_spi(struct domain *d, const char *what,
+                       unsigned int spi, unsigned int type)
+{
+    struct dt_irq irq;
+    int ret;
+
+    irq.type = type;
+
+    irq.irq = spi + 32; /* SPIs start at IRQ 32 */
+
+    printk("Additional IRQ %u (%s)\n", irq.irq, what);
+
+    ret = gic_route_irq_to_guest(d, &irq, what);
+    if ( ret )
+        printk("Failed to route %s to dom%d\n", what, d->domain_id);
+
+    return ret;
+}
+
+/*
+ * Xen does not currently support mapping MMIO regions and interrupt
+ * for bus child devices (referenced via the "ranges" and
+ * "interrupt-map" properties to domain 0). Instead for now map the
+ * necessary resources manually.
+ */
+static int xgene_storm_specific_mapping(struct domain *d)
+{
+    int ret;
+
+    /* Map the PCIe bus resources */
+    ret = map_one_mmio(d, "PCI MEM REGION", 0xe000000000UL, 0xe010000000UL);
+    if ( ret )
+        goto err;
+
+    ret = map_one_mmio(d, "PCI IO REGION", 0xe080000000UL, 0xe080010000UL);
+    if ( ret )
+        goto err;
+
+    ret = map_one_mmio(d, "PCI CFG REGION", 0xe0d0000000UL, 0xe0d0200000UL);
+    if ( ret )
+        goto err;
+    ret = map_one_mmio(d, "PCI MSI REGION", 0xe010000000UL, 0xe010800000UL);
+    if ( ret )
+        goto err;
+
+    ret = map_one_spi(d, "PCI#INTA", 0xc2, DT_IRQ_TYPE_LEVEL_HIGH);
+    if ( ret )
+        goto err;
+
+    ret = map_one_spi(d, "PCI#INTB", 0xc3, DT_IRQ_TYPE_LEVEL_HIGH);
+    if ( ret )
+        goto err;
+
+    ret = map_one_spi(d, "PCI#INTC", 0xc4, DT_IRQ_TYPE_LEVEL_HIGH);
+    if ( ret )
+        goto err;
+
+    ret = map_one_spi(d, "PCI#INTD", 0xc5, DT_IRQ_TYPE_LEVEL_HIGH);
+    if ( ret )
+        goto err;
+
+    ret = 0;
+err:
+    return ret;
+}
+
 
 static const char * const xgene_storm_dt_compat[] __initconst =
 {
@@ -36,6 +117,7 @@ static const char * const xgene_storm_dt_compat[] __initconst =
 PLATFORM_START(xgene_storm, "APM X-GENE STORM")
     .compatible = xgene_storm_dt_compat,
     .quirks = xgene_storm_quirks,
+    .specific_mapping = xgene_storm_specific_mapping,
     .dom0_evtchn_ppi = 24,
 PLATFORM_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 Dec 04 10:00:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10: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 1Vo9Fz-000301-Nl; Wed, 04 Dec 2013 10:00:35 +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 1Vo9Fx-0002zk-NH
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:33 +0000
Received: from [85.158.143.35:34309] by server-1.bemta-4.messagelabs.com id
	D7/13-02132-14DFE925; Wed, 04 Dec 2013 10:00:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386151231!3233315!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21894 invoked from network); 4 Dec 2013 10:00:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:00: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 1Vo9Fv-0007wQ-9H
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Fv-0006Lr-6x
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:31 +0000
Date: Wed, 04 Dec 2013 10:00:31 +0000
Message-Id: <E1Vo9Fv-0006Lr-6x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: Map xgene PCI memory
	regions and interrupts 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 89a3a0a5869a1e47f43f57e1715cdb3c68ef1924
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Nov 22 15:56:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:06 2013 +0000

    xen: arm64: Map xgene PCI memory regions and interrupts to dom0.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/platforms/xgene-storm.c |   82 ++++++++++++++++++++++++++++++++++
 1 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index f416da3..ea9b0f4 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -20,12 +20,93 @@
 
 #include <xen/config.h>
 #include <asm/platform.h>
+#include <asm/gic.h>
 
 static uint32_t xgene_storm_quirks(void)
 {
     return PLATFORM_QUIRK_DOM0_MAPPING_11|PLATFORM_QUIRK_GIC_64K_STRIDE;
 }
 
+static int map_one_mmio(struct domain *d, const char *what,
+                         paddr_t start, paddr_t end)
+{
+    int ret;
+
+    printk("Additional MMIO %"PRIpaddr"-%"PRIpaddr" (%s)\n",
+           start, end, what);
+    ret = map_mmio_regions(d, start, end, start);
+    if ( ret )
+        printk("Failed to map %s @ %"PRIpaddr" to dom%d\n",
+               what, start, d->domain_id);
+    return ret;
+}
+
+static int map_one_spi(struct domain *d, const char *what,
+                       unsigned int spi, unsigned int type)
+{
+    struct dt_irq irq;
+    int ret;
+
+    irq.type = type;
+
+    irq.irq = spi + 32; /* SPIs start at IRQ 32 */
+
+    printk("Additional IRQ %u (%s)\n", irq.irq, what);
+
+    ret = gic_route_irq_to_guest(d, &irq, what);
+    if ( ret )
+        printk("Failed to route %s to dom%d\n", what, d->domain_id);
+
+    return ret;
+}
+
+/*
+ * Xen does not currently support mapping MMIO regions and interrupt
+ * for bus child devices (referenced via the "ranges" and
+ * "interrupt-map" properties to domain 0). Instead for now map the
+ * necessary resources manually.
+ */
+static int xgene_storm_specific_mapping(struct domain *d)
+{
+    int ret;
+
+    /* Map the PCIe bus resources */
+    ret = map_one_mmio(d, "PCI MEM REGION", 0xe000000000UL, 0xe010000000UL);
+    if ( ret )
+        goto err;
+
+    ret = map_one_mmio(d, "PCI IO REGION", 0xe080000000UL, 0xe080010000UL);
+    if ( ret )
+        goto err;
+
+    ret = map_one_mmio(d, "PCI CFG REGION", 0xe0d0000000UL, 0xe0d0200000UL);
+    if ( ret )
+        goto err;
+    ret = map_one_mmio(d, "PCI MSI REGION", 0xe010000000UL, 0xe010800000UL);
+    if ( ret )
+        goto err;
+
+    ret = map_one_spi(d, "PCI#INTA", 0xc2, DT_IRQ_TYPE_LEVEL_HIGH);
+    if ( ret )
+        goto err;
+
+    ret = map_one_spi(d, "PCI#INTB", 0xc3, DT_IRQ_TYPE_LEVEL_HIGH);
+    if ( ret )
+        goto err;
+
+    ret = map_one_spi(d, "PCI#INTC", 0xc4, DT_IRQ_TYPE_LEVEL_HIGH);
+    if ( ret )
+        goto err;
+
+    ret = map_one_spi(d, "PCI#INTD", 0xc5, DT_IRQ_TYPE_LEVEL_HIGH);
+    if ( ret )
+        goto err;
+
+    ret = 0;
+err:
+    return ret;
+}
+
 
 static const char * const xgene_storm_dt_compat[] __initconst =
 {
@@ -36,6 +117,7 @@ static const char * const xgene_storm_dt_compat[] __initconst =
 PLATFORM_START(xgene_storm, "APM X-GENE STORM")
     .compatible = xgene_storm_dt_compat,
     .quirks = xgene_storm_quirks,
+    .specific_mapping = xgene_storm_specific_mapping,
     .dom0_evtchn_ppi = 24,
 PLATFORM_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 Dec 04 10:00:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:00:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9G9-00031o-3e; Wed, 04 Dec 2013 10:00:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9G8-00031c-5x
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:44 +0000
Received: from [85.158.139.211:33078] by server-17.bemta-5.messagelabs.com id
	C1/40-19152-B4DFE925; Wed, 04 Dec 2013 10:00:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386151241!2156056!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8032 invoked from network); 4 Dec 2013 10:00:42 -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;
	4 Dec 2013 10:00: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 1Vo9G5-0007wW-Et
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9G5-0006MM-CV
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:41 +0000
Date: Wed, 04 Dec 2013 10:00:41 +0000
Message-Id: <E1Vo9G5-0006MM-CV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: include ns16550 driver on
	arm64 too
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a906f23659ad729b4b7fad725226e8bcfc5f1b96
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 13:08:58 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: include ns16550 driver on arm64 too
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 config/arm64.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/config/arm64.mk b/config/arm64.mk
index 49055fa..15b57a4 100644
--- a/config/arm64.mk
+++ b/config/arm64.mk
@@ -7,6 +7,7 @@ CONFIG_XEN_INSTALL_SUFFIX :=
 CFLAGS += #-marm -march= -mcpu= etc
 
 HAS_PL011 := y
+HAS_NS16550 := y
 
 # Use only if calling $(LD) directly.
 LDFLAGS_DIRECT += -EL
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:00:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:00:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9G9-00031o-3e; Wed, 04 Dec 2013 10:00:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9G8-00031c-5x
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:44 +0000
Received: from [85.158.139.211:33078] by server-17.bemta-5.messagelabs.com id
	C1/40-19152-B4DFE925; Wed, 04 Dec 2013 10:00:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386151241!2156056!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8032 invoked from network); 4 Dec 2013 10:00:42 -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;
	4 Dec 2013 10:00: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 1Vo9G5-0007wW-Et
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9G5-0006MM-CV
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:41 +0000
Date: Wed, 04 Dec 2013 10:00:41 +0000
Message-Id: <E1Vo9G5-0006MM-CV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: include ns16550 driver on
	arm64 too
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a906f23659ad729b4b7fad725226e8bcfc5f1b96
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 13:08:58 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: include ns16550 driver on arm64 too
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 config/arm64.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/config/arm64.mk b/config/arm64.mk
index 49055fa..15b57a4 100644
--- a/config/arm64.mk
+++ b/config/arm64.mk
@@ -7,6 +7,7 @@ CONFIG_XEN_INSTALL_SUFFIX :=
 CFLAGS += #-marm -march= -mcpu= etc
 
 HAS_PL011 := y
+HAS_NS16550 := y
 
 # Use only if calling $(LD) directly.
 LDFLAGS_DIRECT += -EL
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:00:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:00: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 1Vo9GJ-00033a-74; Wed, 04 Dec 2013 10:00:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9GI-00033I-22
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:54 +0000
Received: from [85.158.143.35:37325] by server-1.bemta-4.messagelabs.com id
	0A/F3-02132-55DFE925; Wed, 04 Dec 2013 10:00:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1386151251!3237207!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22808 invoked from network); 4 Dec 2013 10:00:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:00: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 1Vo9GF-0007wc-Jg
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9GF-0006Mi-IX
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:51 +0000
Date: Wed, 04 Dec 2013 10:00:51 +0000
Message-Id: <E1Vo9GF-0006Mi-IX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Handle cpus nodes with
	#address-cells > 1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6dd38956335a49075dd6103106e264aa01df508f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 13:11:46 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: Handle cpus nodes with #address-cells > 1
    
    The APM X-Gene Mustang board DTS has #address-cells = 2.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/smpboot.c |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 6c90fa6..7636ab8 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -125,18 +125,42 @@ void __init smp_init_cpus(void)
 
     dt_for_each_child_node( cpus, cpu )
     {
-        u32 hwid;
+        const __be32 *prop;
+        u64 addr;
+        u32 reg_len, hwid;
 
         if ( !dt_device_type_is_equal(cpu, "cpu") )
             continue;
 
-        if ( !dt_property_read_u32(cpu, "reg", &hwid) )
+        if ( dt_n_size_cells(cpu) != 0 )
+            printk(XENLOG_WARNING "cpu node `%s`: #size-cells %d\n",
+                   dt_node_full_name(cpu), dt_n_size_cells(cpu));
+
+        prop = dt_get_property(cpu, "reg", &reg_len);
+        if ( !prop )
+        {
+            printk(XENLOG_WARNING "cpu node `%s`: has no reg property\n",
+                   dt_node_full_name(cpu));
+            continue;
+        }
+
+        if ( reg_len < dt_cells_to_size(dt_n_addr_cells(cpu)) )
         {
-            printk(XENLOG_WARNING "cpu node `%s`: missing reg property\n",
+            printk(XENLOG_WARNING "cpu node `%s`: reg property too short\n",
                    dt_node_full_name(cpu));
             continue;
         }
 
+        addr = dt_read_number(prop, dt_n_addr_cells(cpu));
+
+        hwid = addr;
+        if ( hwid != addr )
+        {
+            printk(XENLOG_WARNING "cpu node `%s`: hwid overflow %"PRIx64"\n",
+                   dt_node_full_name(cpu), addr);
+            continue;
+        }
+
         /*
          * 8 MSBs must be set to 0 in the DT since the reg property
          * defines the MPIDR[23:0]
@@ -159,8 +183,8 @@ void __init smp_init_cpus(void)
             if ( tmp_map[j] == hwid )
             {
                 printk(XENLOG_WARNING
-                       "cpu node `%s`: duplicate /cpu reg properties in the DT\n",
-                       dt_node_full_name(cpu));
+                       "cpu node `%s`: duplicate /cpu reg properties %"PRIx32" in the DT\n",
+                       dt_node_full_name(cpu), hwid);
                 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 Wed Dec 04 10:00:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:00: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 1Vo9GJ-00033a-74; Wed, 04 Dec 2013 10:00:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9GI-00033I-22
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:54 +0000
Received: from [85.158.143.35:37325] by server-1.bemta-4.messagelabs.com id
	0A/F3-02132-55DFE925; Wed, 04 Dec 2013 10:00:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1386151251!3237207!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22808 invoked from network); 4 Dec 2013 10:00:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:00: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 1Vo9GF-0007wc-Jg
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9GF-0006Mi-IX
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:00:51 +0000
Date: Wed, 04 Dec 2013 10:00:51 +0000
Message-Id: <E1Vo9GF-0006Mi-IX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Handle cpus nodes with
	#address-cells > 1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6dd38956335a49075dd6103106e264aa01df508f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 13:11:46 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: Handle cpus nodes with #address-cells > 1
    
    The APM X-Gene Mustang board DTS has #address-cells = 2.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/smpboot.c |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 6c90fa6..7636ab8 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -125,18 +125,42 @@ void __init smp_init_cpus(void)
 
     dt_for_each_child_node( cpus, cpu )
     {
-        u32 hwid;
+        const __be32 *prop;
+        u64 addr;
+        u32 reg_len, hwid;
 
         if ( !dt_device_type_is_equal(cpu, "cpu") )
             continue;
 
-        if ( !dt_property_read_u32(cpu, "reg", &hwid) )
+        if ( dt_n_size_cells(cpu) != 0 )
+            printk(XENLOG_WARNING "cpu node `%s`: #size-cells %d\n",
+                   dt_node_full_name(cpu), dt_n_size_cells(cpu));
+
+        prop = dt_get_property(cpu, "reg", &reg_len);
+        if ( !prop )
+        {
+            printk(XENLOG_WARNING "cpu node `%s`: has no reg property\n",
+                   dt_node_full_name(cpu));
+            continue;
+        }
+
+        if ( reg_len < dt_cells_to_size(dt_n_addr_cells(cpu)) )
         {
-            printk(XENLOG_WARNING "cpu node `%s`: missing reg property\n",
+            printk(XENLOG_WARNING "cpu node `%s`: reg property too short\n",
                    dt_node_full_name(cpu));
             continue;
         }
 
+        addr = dt_read_number(prop, dt_n_addr_cells(cpu));
+
+        hwid = addr;
+        if ( hwid != addr )
+        {
+            printk(XENLOG_WARNING "cpu node `%s`: hwid overflow %"PRIx64"\n",
+                   dt_node_full_name(cpu), addr);
+            continue;
+        }
+
         /*
          * 8 MSBs must be set to 0 in the DT since the reg property
          * defines the MPIDR[23:0]
@@ -159,8 +183,8 @@ void __init smp_init_cpus(void)
             if ( tmp_map[j] == hwid )
             {
                 printk(XENLOG_WARNING
-                       "cpu node `%s`: duplicate /cpu reg properties in the DT\n",
-                       dt_node_full_name(cpu));
+                       "cpu node `%s`: duplicate /cpu reg properties %"PRIx32" in the DT\n",
+                       dt_node_full_name(cpu), hwid);
                 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 Wed Dec 04 10:01:07 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:01:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9GV-00035W-BT; Wed, 04 Dec 2013 10:01:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9GT-00035I-Vs
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:06 +0000
Received: from [85.158.143.35:31957] by server-3.bemta-4.messagelabs.com id
	B7/D1-32360-16DFE925; Wed, 04 Dec 2013 10:01:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1386151262!3157198!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9921 invoked from network); 4 Dec 2013 10:01:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:01:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9GQ-0007xE-DD
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9GP-0006NE-V9
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:02 +0000
Date: Wed, 04 Dec 2013 10:01:01 +0000
Message-Id: <E1Vo9GP-0006NE-V9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Make register bit
	definitions unsigned.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21f81ab1c6be3c110d865f2084e882a970e10c61
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 13:12:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: Make register bit definitions unsigned.
    
    Otherwise the results of the shifting can be undefined and/or sign extended.
    
    Most registers are 32-bit on both arm32 and arm64 and hence are just unsigned
    ints, however HCR is 64-bit on arm64 and therefore is unsigned long.
    
    Pointed out in the context of HCR_* by Pranavkumar Sawargaonkar.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Cc: Pranavkumar Sawargaonkar <psawargaonkar@apm.com>
---
 xen/include/asm-arm/processor.h |  144 +++++++++++++++++++-------------------
 1 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 3da3a3d..b2746cc 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -18,71 +18,71 @@
 #define MPIDR_INVALID       (~MPIDR_HWID_MASK)
 
 /* TTBCR Translation Table Base Control Register */
-#define TTBCR_EAE    0x80000000
-#define TTBCR_N_MASK 0x07
-#define TTBCR_N_16KB 0x00
-#define TTBCR_N_8KB  0x01
-#define TTBCR_N_4KB  0x02
-#define TTBCR_N_2KB  0x03
-#define TTBCR_N_1KB  0x04
+#define TTBCR_EAE    _AC(0x80000000,U)
+#define TTBCR_N_MASK _AC(0x07,U)
+#define TTBCR_N_16KB _AC(0x00,U)
+#define TTBCR_N_8KB  _AC(0x01,U)
+#define TTBCR_N_4KB  _AC(0x02,U)
+#define TTBCR_N_2KB  _AC(0x03,U)
+#define TTBCR_N_1KB  _AC(0x04,U)
 
 /* SCTLR System Control Register. */
 /* HSCTLR is a subset of this. */
-#define SCTLR_TE        (1<<30)
-#define SCTLR_AFE       (1<<29)
-#define SCTLR_TRE       (1<<28)
-#define SCTLR_NMFI      (1<<27)
-#define SCTLR_EE        (1<<25)
-#define SCTLR_VE        (1<<24)
-#define SCTLR_U         (1<<22)
-#define SCTLR_FI        (1<<21)
-#define SCTLR_WXN       (1<<19)
-#define SCTLR_HA        (1<<17)
-#define SCTLR_RR        (1<<14)
-#define SCTLR_V         (1<<13)
-#define SCTLR_I         (1<<12)
-#define SCTLR_Z         (1<<11)
-#define SCTLR_SW        (1<<10)
-#define SCTLR_B         (1<<7)
-#define SCTLR_C         (1<<2)
-#define SCTLR_A         (1<<1)
-#define SCTLR_M         (1<<0)
-
-#define HSCTLR_BASE       0x30c51878
+#define SCTLR_TE        (_AC(1,U)<<30)
+#define SCTLR_AFE       (_AC(1,U)<<29)
+#define SCTLR_TRE       (_AC(1,U)<<28)
+#define SCTLR_NMFI      (_AC(1,U)<<27)
+#define SCTLR_EE        (_AC(1,U)<<25)
+#define SCTLR_VE        (_AC(1,U)<<24)
+#define SCTLR_U         (_AC(1,U)<<22)
+#define SCTLR_FI        (_AC(1,U)<<21)
+#define SCTLR_WXN       (_AC(1,U)<<19)
+#define SCTLR_HA        (_AC(1,U)<<17)
+#define SCTLR_RR        (_AC(1,U)<<14)
+#define SCTLR_V         (_AC(1,U)<<13)
+#define SCTLR_I         (_AC(1,U)<<12)
+#define SCTLR_Z         (_AC(1,U)<<11)
+#define SCTLR_SW        (_AC(1,U)<<10)
+#define SCTLR_B         (_AC(1,U)<<7)
+#define SCTLR_C         (_AC(1,U)<<2)
+#define SCTLR_A         (_AC(1,U)<<1)
+#define SCTLR_M         (_AC(1,U)<<0)
+
+#define HSCTLR_BASE     _AC(0x30c51878,U)
 
 /* HCR Hyp Configuration Register */
-#define HCR_RW          (1<<31) /* Register Width, ARM64 only */
-#define HCR_TGE         (1<<27) /* Trap General Exceptions */
-#define HCR_TVM         (1<<26) /* Trap Virtual Memory Controls */
-#define HCR_TTLB        (1<<25) /* Trap TLB Maintenance Operations */
-#define HCR_TPU         (1<<24) /* Trap Cache Maintenance Operations to PoU */
-#define HCR_TPC         (1<<23) /* Trap Cache Maintenance Operations to PoC */
-#define HCR_TSW         (1<<22) /* Trap Set/Way Cache Maintenance Operations */
-#define HCR_TAC         (1<<21) /* Trap ACTLR Accesses */
-#define HCR_TIDCP       (1<<20) /* Trap lockdown */
-#define HCR_TSC         (1<<19) /* Trap SMC instruction */
-#define HCR_TID3        (1<<18) /* Trap ID Register Group 3 */
-#define HCR_TID2        (1<<17) /* Trap ID Register Group 2 */
-#define HCR_TID1        (1<<16) /* Trap ID Register Group 1 */
-#define HCR_TID0        (1<<15) /* Trap ID Register Group 0 */
-#define HCR_TWE         (1<<14) /* Trap WFE instruction */
-#define HCR_TWI         (1<<13) /* Trap WFI instruction */
-#define HCR_DC          (1<<12) /* Default cacheable */
-#define HCR_BSU_MASK    (3<<10) /* Barrier Shareability Upgrade */
-#define HCR_BSU_NONE     (0<<10)
-#define HCR_BSU_INNER    (1<<10)
-#define HCR_BSU_OUTER    (2<<10)
-#define HCR_BSU_FULL     (3<<10)
-#define HCR_FB          (1<<9) /* Force Broadcast of Cache/BP/TLB operations */
-#define HCR_VA          (1<<8) /* Virtual Asynchronous Abort */
-#define HCR_VI          (1<<7) /* Virtual IRQ */
-#define HCR_VF          (1<<6) /* Virtual FIQ */
-#define HCR_AMO         (1<<5) /* Override CPSR.A */
-#define HCR_IMO         (1<<4) /* Override CPSR.I */
-#define HCR_FMO         (1<<3) /* Override CPSR.F */
-#define HCR_PTW         (1<<2) /* Protected Walk */
-#define HCR_SWIO        (1<<1) /* Set/Way Invalidation Override */
-#define HCR_VM          (1<<0) /* Virtual MMU Enable */
+#define HCR_RW          (_AC(1,UL)<<31) /* Register Width, ARM64 only */
+#define HCR_TGE         (_AC(1,UL)<<27) /* Trap General Exceptions */
+#define HCR_TVM         (_AC(1,UL)<<26) /* Trap Virtual Memory Controls */
+#define HCR_TTLB        (_AC(1,UL)<<25) /* Trap TLB Maintenance Operations */
+#define HCR_TPU         (_AC(1,UL)<<24) /* Trap Cache Maintenance Operations to PoU */
+#define HCR_TPC         (_AC(1,UL)<<23) /* Trap Cache Maintenance Operations to PoC */
+#define HCR_TSW         (_AC(1,UL)<<22) /* Trap Set/Way Cache Maintenance Operations */
+#define HCR_TAC         (_AC(1,UL)<<21) /* Trap ACTLR Accesses */
+#define HCR_TIDCP       (_AC(1,UL)<<20) /* Trap lockdown */
+#define HCR_TSC         (_AC(1,UL)<<19) /* Trap SMC instruction */
+#define HCR_TID3        (_AC(1,UL)<<18) /* Trap ID Register Group 3 */
+#define HCR_TID2        (_AC(1,UL)<<17) /* Trap ID Register Group 2 */
+#define HCR_TID1        (_AC(1,UL)<<16) /* Trap ID Register Group 1 */
+#define HCR_TID0        (_AC(1,UL)<<15) /* Trap ID Register Group 0 */
+#define HCR_TWE         (_AC(1,UL)<<14) /* Trap WFE instruction */
+#define HCR_TWI         (_AC(1,UL)<<13) /* Trap WFI instruction */
+#define HCR_DC          (_AC(1,UL)<<12) /* Default cacheable */
+#define HCR_BSU_MASK    (_AC(3,UL)<<10) /* Barrier Shareability Upgrade */
+#define HCR_BSU_NONE     (_AC(0,UL)<<10)
+#define HCR_BSU_INNER    (_AC(1,UL)<<10)
+#define HCR_BSU_OUTER    (_AC(2,UL)<<10)
+#define HCR_BSU_FULL     (_AC(3,UL)<<10)
+#define HCR_FB          (_AC(1,UL)<<9) /* Force Broadcast of Cache/BP/TLB operations */
+#define HCR_VA          (_AC(1,UL)<<8) /* Virtual Asynchronous Abort */
+#define HCR_VI          (_AC(1,UL)<<7) /* Virtual IRQ */
+#define HCR_VF          (_AC(1,UL)<<6) /* Virtual FIQ */
+#define HCR_AMO         (_AC(1,UL)<<5) /* Override CPSR.A */
+#define HCR_IMO         (_AC(1,UL)<<4) /* Override CPSR.I */
+#define HCR_FMO         (_AC(1,UL)<<3) /* Override CPSR.F */
+#define HCR_PTW         (_AC(1,UL)<<2) /* Protected Walk */
+#define HCR_SWIO        (_AC(1,UL)<<1) /* Set/Way Invalidation Override */
+#define HCR_VM          (_AC(1,UL)<<0) /* Virtual MMU Enable */
 
 #define HSR_EC_UNKNOWN              0x00
 #define HSR_EC_WFI_WFE              0x01
@@ -346,20 +346,20 @@ union hsr {
                               HSR_SYSREG_OP2_MASK)
 
 /* Physical Address Register */
-#define PAR_F           (1<<0)
+#define PAR_F           (_AC(1,U)<<0)
 
 /* .... If F == 1 */
 #define PAR_FSC_SHIFT   (1)
-#define PAR_FSC_MASK    (0x3f<<PAR_FSC_SHIFT)
-#define PAR_STAGE21     (1<<8)     /* Stage 2 Fault During Stage 1 Walk */
-#define PAR_STAGE2      (1<<9)     /* Stage 2 Fault */
+#define PAR_FSC_MASK    (_AC(0x3f,U)<<PAR_FSC_SHIFT)
+#define PAR_STAGE21     (_AC(1,U)<<8)     /* Stage 2 Fault During Stage 1 Walk */
+#define PAR_STAGE2      (_AC(1,U)<<9)     /* Stage 2 Fault */
 
 /* If F == 0 */
 #define PAR_MAIR_SHIFT  56                       /* Memory Attributes */
 #define PAR_MAIR_MASK   (0xffLL<<PAR_MAIR_SHIFT)
-#define PAR_NS          (1<<9)                   /* Non-Secure */
+#define PAR_NS          (_AC(1,U)<<9)                   /* Non-Secure */
 #define PAR_SH_SHIFT    7                        /* Shareability */
-#define PAR_SH_MASK     (3<<PAR_SH_SHIFT)
+#define PAR_SH_MASK     (_AC(3,U)<<PAR_SH_SHIFT)
 
 /* Fault Status Register */
 /*
@@ -372,11 +372,11 @@ union hsr {
  * 10xxxx -- Other
  * 11xxxx -- Implementation Defined
  */
-#define FSC_TYPE_MASK (0x3<<4)
-#define FSC_TYPE_FAULT (0x00<<4)
-#define FSC_TYPE_ABT   (0x01<<4)
-#define FSC_TYPE_OTH   (0x02<<4)
-#define FSC_TYPE_IMPL  (0x03<<4)
+#define FSC_TYPE_MASK (_AC(0x3,U)<<4)
+#define FSC_TYPE_FAULT (_AC(0x00,U)<<4)
+#define FSC_TYPE_ABT   (_AC(0x01,U)<<4)
+#define FSC_TYPE_OTH   (_AC(0x02,U)<<4)
+#define FSC_TYPE_IMPL  (_AC(0x03,U)<<4)
 
 #define FSC_FLT_TRANS  (0x04)
 #define FSC_FLT_ACCESS (0x08)
@@ -391,7 +391,7 @@ union hsr {
 #define FSC_LKD        (0x34) /* Lockdown Abort */
 #define FSC_CPR        (0x3a) /* Coprocossor Abort */
 
-#define FSC_LL_MASK    (0x03<<0)
+#define FSC_LL_MASK    (_AC(0x03,U)<<0)
 
 /* Time counter hypervisor control register */
 #define CNTHCTL_PA      (1u<<0)  /* Kernel/user access to physical counter */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:01:07 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:01:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9GV-00035W-BT; Wed, 04 Dec 2013 10:01:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9GT-00035I-Vs
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:06 +0000
Received: from [85.158.143.35:31957] by server-3.bemta-4.messagelabs.com id
	B7/D1-32360-16DFE925; Wed, 04 Dec 2013 10:01:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1386151262!3157198!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9921 invoked from network); 4 Dec 2013 10:01:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:01:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9GQ-0007xE-DD
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9GP-0006NE-V9
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:02 +0000
Date: Wed, 04 Dec 2013 10:01:01 +0000
Message-Id: <E1Vo9GP-0006NE-V9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Make register bit
	definitions unsigned.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21f81ab1c6be3c110d865f2084e882a970e10c61
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 13:12:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: Make register bit definitions unsigned.
    
    Otherwise the results of the shifting can be undefined and/or sign extended.
    
    Most registers are 32-bit on both arm32 and arm64 and hence are just unsigned
    ints, however HCR is 64-bit on arm64 and therefore is unsigned long.
    
    Pointed out in the context of HCR_* by Pranavkumar Sawargaonkar.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Cc: Pranavkumar Sawargaonkar <psawargaonkar@apm.com>
---
 xen/include/asm-arm/processor.h |  144 +++++++++++++++++++-------------------
 1 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 3da3a3d..b2746cc 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -18,71 +18,71 @@
 #define MPIDR_INVALID       (~MPIDR_HWID_MASK)
 
 /* TTBCR Translation Table Base Control Register */
-#define TTBCR_EAE    0x80000000
-#define TTBCR_N_MASK 0x07
-#define TTBCR_N_16KB 0x00
-#define TTBCR_N_8KB  0x01
-#define TTBCR_N_4KB  0x02
-#define TTBCR_N_2KB  0x03
-#define TTBCR_N_1KB  0x04
+#define TTBCR_EAE    _AC(0x80000000,U)
+#define TTBCR_N_MASK _AC(0x07,U)
+#define TTBCR_N_16KB _AC(0x00,U)
+#define TTBCR_N_8KB  _AC(0x01,U)
+#define TTBCR_N_4KB  _AC(0x02,U)
+#define TTBCR_N_2KB  _AC(0x03,U)
+#define TTBCR_N_1KB  _AC(0x04,U)
 
 /* SCTLR System Control Register. */
 /* HSCTLR is a subset of this. */
-#define SCTLR_TE        (1<<30)
-#define SCTLR_AFE       (1<<29)
-#define SCTLR_TRE       (1<<28)
-#define SCTLR_NMFI      (1<<27)
-#define SCTLR_EE        (1<<25)
-#define SCTLR_VE        (1<<24)
-#define SCTLR_U         (1<<22)
-#define SCTLR_FI        (1<<21)
-#define SCTLR_WXN       (1<<19)
-#define SCTLR_HA        (1<<17)
-#define SCTLR_RR        (1<<14)
-#define SCTLR_V         (1<<13)
-#define SCTLR_I         (1<<12)
-#define SCTLR_Z         (1<<11)
-#define SCTLR_SW        (1<<10)
-#define SCTLR_B         (1<<7)
-#define SCTLR_C         (1<<2)
-#define SCTLR_A         (1<<1)
-#define SCTLR_M         (1<<0)
-
-#define HSCTLR_BASE       0x30c51878
+#define SCTLR_TE        (_AC(1,U)<<30)
+#define SCTLR_AFE       (_AC(1,U)<<29)
+#define SCTLR_TRE       (_AC(1,U)<<28)
+#define SCTLR_NMFI      (_AC(1,U)<<27)
+#define SCTLR_EE        (_AC(1,U)<<25)
+#define SCTLR_VE        (_AC(1,U)<<24)
+#define SCTLR_U         (_AC(1,U)<<22)
+#define SCTLR_FI        (_AC(1,U)<<21)
+#define SCTLR_WXN       (_AC(1,U)<<19)
+#define SCTLR_HA        (_AC(1,U)<<17)
+#define SCTLR_RR        (_AC(1,U)<<14)
+#define SCTLR_V         (_AC(1,U)<<13)
+#define SCTLR_I         (_AC(1,U)<<12)
+#define SCTLR_Z         (_AC(1,U)<<11)
+#define SCTLR_SW        (_AC(1,U)<<10)
+#define SCTLR_B         (_AC(1,U)<<7)
+#define SCTLR_C         (_AC(1,U)<<2)
+#define SCTLR_A         (_AC(1,U)<<1)
+#define SCTLR_M         (_AC(1,U)<<0)
+
+#define HSCTLR_BASE     _AC(0x30c51878,U)
 
 /* HCR Hyp Configuration Register */
-#define HCR_RW          (1<<31) /* Register Width, ARM64 only */
-#define HCR_TGE         (1<<27) /* Trap General Exceptions */
-#define HCR_TVM         (1<<26) /* Trap Virtual Memory Controls */
-#define HCR_TTLB        (1<<25) /* Trap TLB Maintenance Operations */
-#define HCR_TPU         (1<<24) /* Trap Cache Maintenance Operations to PoU */
-#define HCR_TPC         (1<<23) /* Trap Cache Maintenance Operations to PoC */
-#define HCR_TSW         (1<<22) /* Trap Set/Way Cache Maintenance Operations */
-#define HCR_TAC         (1<<21) /* Trap ACTLR Accesses */
-#define HCR_TIDCP       (1<<20) /* Trap lockdown */
-#define HCR_TSC         (1<<19) /* Trap SMC instruction */
-#define HCR_TID3        (1<<18) /* Trap ID Register Group 3 */
-#define HCR_TID2        (1<<17) /* Trap ID Register Group 2 */
-#define HCR_TID1        (1<<16) /* Trap ID Register Group 1 */
-#define HCR_TID0        (1<<15) /* Trap ID Register Group 0 */
-#define HCR_TWE         (1<<14) /* Trap WFE instruction */
-#define HCR_TWI         (1<<13) /* Trap WFI instruction */
-#define HCR_DC          (1<<12) /* Default cacheable */
-#define HCR_BSU_MASK    (3<<10) /* Barrier Shareability Upgrade */
-#define HCR_BSU_NONE     (0<<10)
-#define HCR_BSU_INNER    (1<<10)
-#define HCR_BSU_OUTER    (2<<10)
-#define HCR_BSU_FULL     (3<<10)
-#define HCR_FB          (1<<9) /* Force Broadcast of Cache/BP/TLB operations */
-#define HCR_VA          (1<<8) /* Virtual Asynchronous Abort */
-#define HCR_VI          (1<<7) /* Virtual IRQ */
-#define HCR_VF          (1<<6) /* Virtual FIQ */
-#define HCR_AMO         (1<<5) /* Override CPSR.A */
-#define HCR_IMO         (1<<4) /* Override CPSR.I */
-#define HCR_FMO         (1<<3) /* Override CPSR.F */
-#define HCR_PTW         (1<<2) /* Protected Walk */
-#define HCR_SWIO        (1<<1) /* Set/Way Invalidation Override */
-#define HCR_VM          (1<<0) /* Virtual MMU Enable */
+#define HCR_RW          (_AC(1,UL)<<31) /* Register Width, ARM64 only */
+#define HCR_TGE         (_AC(1,UL)<<27) /* Trap General Exceptions */
+#define HCR_TVM         (_AC(1,UL)<<26) /* Trap Virtual Memory Controls */
+#define HCR_TTLB        (_AC(1,UL)<<25) /* Trap TLB Maintenance Operations */
+#define HCR_TPU         (_AC(1,UL)<<24) /* Trap Cache Maintenance Operations to PoU */
+#define HCR_TPC         (_AC(1,UL)<<23) /* Trap Cache Maintenance Operations to PoC */
+#define HCR_TSW         (_AC(1,UL)<<22) /* Trap Set/Way Cache Maintenance Operations */
+#define HCR_TAC         (_AC(1,UL)<<21) /* Trap ACTLR Accesses */
+#define HCR_TIDCP       (_AC(1,UL)<<20) /* Trap lockdown */
+#define HCR_TSC         (_AC(1,UL)<<19) /* Trap SMC instruction */
+#define HCR_TID3        (_AC(1,UL)<<18) /* Trap ID Register Group 3 */
+#define HCR_TID2        (_AC(1,UL)<<17) /* Trap ID Register Group 2 */
+#define HCR_TID1        (_AC(1,UL)<<16) /* Trap ID Register Group 1 */
+#define HCR_TID0        (_AC(1,UL)<<15) /* Trap ID Register Group 0 */
+#define HCR_TWE         (_AC(1,UL)<<14) /* Trap WFE instruction */
+#define HCR_TWI         (_AC(1,UL)<<13) /* Trap WFI instruction */
+#define HCR_DC          (_AC(1,UL)<<12) /* Default cacheable */
+#define HCR_BSU_MASK    (_AC(3,UL)<<10) /* Barrier Shareability Upgrade */
+#define HCR_BSU_NONE     (_AC(0,UL)<<10)
+#define HCR_BSU_INNER    (_AC(1,UL)<<10)
+#define HCR_BSU_OUTER    (_AC(2,UL)<<10)
+#define HCR_BSU_FULL     (_AC(3,UL)<<10)
+#define HCR_FB          (_AC(1,UL)<<9) /* Force Broadcast of Cache/BP/TLB operations */
+#define HCR_VA          (_AC(1,UL)<<8) /* Virtual Asynchronous Abort */
+#define HCR_VI          (_AC(1,UL)<<7) /* Virtual IRQ */
+#define HCR_VF          (_AC(1,UL)<<6) /* Virtual FIQ */
+#define HCR_AMO         (_AC(1,UL)<<5) /* Override CPSR.A */
+#define HCR_IMO         (_AC(1,UL)<<4) /* Override CPSR.I */
+#define HCR_FMO         (_AC(1,UL)<<3) /* Override CPSR.F */
+#define HCR_PTW         (_AC(1,UL)<<2) /* Protected Walk */
+#define HCR_SWIO        (_AC(1,UL)<<1) /* Set/Way Invalidation Override */
+#define HCR_VM          (_AC(1,UL)<<0) /* Virtual MMU Enable */
 
 #define HSR_EC_UNKNOWN              0x00
 #define HSR_EC_WFI_WFE              0x01
@@ -346,20 +346,20 @@ union hsr {
                               HSR_SYSREG_OP2_MASK)
 
 /* Physical Address Register */
-#define PAR_F           (1<<0)
+#define PAR_F           (_AC(1,U)<<0)
 
 /* .... If F == 1 */
 #define PAR_FSC_SHIFT   (1)
-#define PAR_FSC_MASK    (0x3f<<PAR_FSC_SHIFT)
-#define PAR_STAGE21     (1<<8)     /* Stage 2 Fault During Stage 1 Walk */
-#define PAR_STAGE2      (1<<9)     /* Stage 2 Fault */
+#define PAR_FSC_MASK    (_AC(0x3f,U)<<PAR_FSC_SHIFT)
+#define PAR_STAGE21     (_AC(1,U)<<8)     /* Stage 2 Fault During Stage 1 Walk */
+#define PAR_STAGE2      (_AC(1,U)<<9)     /* Stage 2 Fault */
 
 /* If F == 0 */
 #define PAR_MAIR_SHIFT  56                       /* Memory Attributes */
 #define PAR_MAIR_MASK   (0xffLL<<PAR_MAIR_SHIFT)
-#define PAR_NS          (1<<9)                   /* Non-Secure */
+#define PAR_NS          (_AC(1,U)<<9)                   /* Non-Secure */
 #define PAR_SH_SHIFT    7                        /* Shareability */
-#define PAR_SH_MASK     (3<<PAR_SH_SHIFT)
+#define PAR_SH_MASK     (_AC(3,U)<<PAR_SH_SHIFT)
 
 /* Fault Status Register */
 /*
@@ -372,11 +372,11 @@ union hsr {
  * 10xxxx -- Other
  * 11xxxx -- Implementation Defined
  */
-#define FSC_TYPE_MASK (0x3<<4)
-#define FSC_TYPE_FAULT (0x00<<4)
-#define FSC_TYPE_ABT   (0x01<<4)
-#define FSC_TYPE_OTH   (0x02<<4)
-#define FSC_TYPE_IMPL  (0x03<<4)
+#define FSC_TYPE_MASK (_AC(0x3,U)<<4)
+#define FSC_TYPE_FAULT (_AC(0x00,U)<<4)
+#define FSC_TYPE_ABT   (_AC(0x01,U)<<4)
+#define FSC_TYPE_OTH   (_AC(0x02,U)<<4)
+#define FSC_TYPE_IMPL  (_AC(0x03,U)<<4)
 
 #define FSC_FLT_TRANS  (0x04)
 #define FSC_FLT_ACCESS (0x08)
@@ -391,7 +391,7 @@ union hsr {
 #define FSC_LKD        (0x34) /* Lockdown Abort */
 #define FSC_CPR        (0x3a) /* Coprocossor Abort */
 
-#define FSC_LL_MASK    (0x03<<0)
+#define FSC_LL_MASK    (_AC(0x03,U)<<0)
 
 /* Time counter hypervisor control register */
 #define CNTHCTL_PA      (1u<<0)  /* Kernel/user access to physical counter */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:01:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:01: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 1Vo9Gd-00037g-NQ; Wed, 04 Dec 2013 10:01: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 1Vo9Gd-00037W-BZ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:15 +0000
Received: from [85.158.139.211:25905] by server-12.bemta-5.messagelabs.com id
	3E/26-30017-A6DFE925; Wed, 04 Dec 2013 10:01:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1386151272!935751!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31107 invoked from network); 4 Dec 2013 10:01:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:01:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ga-0007xK-IY
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ga-0006Nf-Gb
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:12 +0000
Date: Wed, 04 Dec 2013 10:01:12 +0000
Message-Id: <E1Vo9Ga-0006Nf-Gb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: explicitly map 64 bit
	release address
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 56435450bcdb7d667b0eba33469560fddf480929
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 14:36:47 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: explicitly map 64 bit release address
    
    In case it is outside visible ram.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/arm64/smpboot.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index 8239590..8696ed6 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -4,6 +4,8 @@
 #include <xen/errno.h>
 #include <xen/mm.h>
 #include <xen/smp.h>
+#include <xen/vmap.h>
+#include <asm/io.h>
 
 struct smp_enable_ops {
         int             (*prepare_cpu)(int);
@@ -14,7 +16,7 @@ static struct smp_enable_ops smp_enable_ops[NR_CPUS];
 
 static int __init smp_spin_table_cpu_up(int cpu)
 {
-    paddr_t *release;
+    paddr_t __iomem *release;
 
     if (!cpu_release_addr[cpu])
     {
@@ -22,12 +24,20 @@ static int __init smp_spin_table_cpu_up(int cpu)
         return -ENODEV;
     }
 
-    release = __va(cpu_release_addr[cpu]);
+    release = ioremap_nocache(cpu_release_addr[cpu], 8);
+    if ( !release )
+    {
+        dprintk(XENLOG_ERR, "CPU%d: Unable to map release address\n", cpu);
+        return -EFAULT;
+    }
 
     release[0] = __pa(init_secondary);
     flush_xen_data_tlb_range_va((vaddr_t)release, sizeof(*release));
 
+    iounmap(release);
+
     sev();
+
     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 Dec 04 10:01:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:01: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 1Vo9Gd-00037g-NQ; Wed, 04 Dec 2013 10:01: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 1Vo9Gd-00037W-BZ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:15 +0000
Received: from [85.158.139.211:25905] by server-12.bemta-5.messagelabs.com id
	3E/26-30017-A6DFE925; Wed, 04 Dec 2013 10:01:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1386151272!935751!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31107 invoked from network); 4 Dec 2013 10:01:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:01:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ga-0007xK-IY
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ga-0006Nf-Gb
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:12 +0000
Date: Wed, 04 Dec 2013 10:01:12 +0000
Message-Id: <E1Vo9Ga-0006Nf-Gb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: explicitly map 64 bit
	release address
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 56435450bcdb7d667b0eba33469560fddf480929
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 10 14:36:47 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: explicitly map 64 bit release address
    
    In case it is outside visible ram.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/arm64/smpboot.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index 8239590..8696ed6 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -4,6 +4,8 @@
 #include <xen/errno.h>
 #include <xen/mm.h>
 #include <xen/smp.h>
+#include <xen/vmap.h>
+#include <asm/io.h>
 
 struct smp_enable_ops {
         int             (*prepare_cpu)(int);
@@ -14,7 +16,7 @@ static struct smp_enable_ops smp_enable_ops[NR_CPUS];
 
 static int __init smp_spin_table_cpu_up(int cpu)
 {
-    paddr_t *release;
+    paddr_t __iomem *release;
 
     if (!cpu_release_addr[cpu])
     {
@@ -22,12 +24,20 @@ static int __init smp_spin_table_cpu_up(int cpu)
         return -ENODEV;
     }
 
-    release = __va(cpu_release_addr[cpu]);
+    release = ioremap_nocache(cpu_release_addr[cpu], 8);
+    if ( !release )
+    {
+        dprintk(XENLOG_ERR, "CPU%d: Unable to map release address\n", cpu);
+        return -EFAULT;
+    }
 
     release[0] = __pa(init_secondary);
     flush_xen_data_tlb_range_va((vaddr_t)release, sizeof(*release));
 
+    iounmap(release);
+
     sev();
+
     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 Dec 04 10:01:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:01: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 1Vo9Go-00039o-Qj; Wed, 04 Dec 2013 10:01: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 1Vo9Gn-00039S-I8
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:25 +0000
Received: from [85.158.137.68:16674] by server-4.bemta-3.messagelabs.com id
	96/53-10414-47DFE925; Wed, 04 Dec 2013 10:01:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1386151283!1601947!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12322 invoked from network); 4 Dec 2013 10:01:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:01:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Gk-0007xQ-Q2
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Gk-0006Or-N1
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:22 +0000
Date: Wed, 04 Dec 2013 10:01:22 +0000
Message-Id: <E1Vo9Gk-0006Or-N1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: enable synchronous console
	while starting secondary CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c241a8981a9f5709e100363bd0e5d6fdb6d90bbc
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 11 17:23:18 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: enable synchronous console while starting secondary CPUs
    
    Setting synchronous console ensures that any printk hits the buffer
    immediately and that any outstanding queued log messages are flushed. This
    ensures that such log messages are not being printed while the secondary CPU
    may be using early_printk during early bringup.
    
    Signed-of-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/smpboot.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 7636ab8..e862477 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -28,6 +28,7 @@
 #include <xen/softirq.h>
 #include <xen/timer.h>
 #include <xen/irq.h>
+#include <xen/console.h>
 #include <asm/gic.h>
 
 cpumask_t cpu_online_map;
@@ -356,6 +357,8 @@ int __cpu_up(unsigned int cpu)
     if ( rc < 0 )
         return rc;
 
+    console_start_sync(); /* Secondary may use early_printk */
+
     /* Tell the remote CPU which stack to boot on. */
     init_data.stack = idle_vcpu[cpu]->arch.stack;
 
@@ -368,6 +371,8 @@ int __cpu_up(unsigned int cpu)
 
     rc = arch_cpu_up(cpu);
 
+    console_end_sync();
+
     if ( rc < 0 )
     {
         printk("Failed to bring up CPU%d\n", 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 Dec 04 10:01:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:01: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 1Vo9Go-00039o-Qj; Wed, 04 Dec 2013 10:01: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 1Vo9Gn-00039S-I8
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:25 +0000
Received: from [85.158.137.68:16674] by server-4.bemta-3.messagelabs.com id
	96/53-10414-47DFE925; Wed, 04 Dec 2013 10:01:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1386151283!1601947!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12322 invoked from network); 4 Dec 2013 10:01:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:01:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Gk-0007xQ-Q2
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Gk-0006Or-N1
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:22 +0000
Date: Wed, 04 Dec 2013 10:01:22 +0000
Message-Id: <E1Vo9Gk-0006Or-N1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: enable synchronous console
	while starting secondary CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c241a8981a9f5709e100363bd0e5d6fdb6d90bbc
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Oct 11 17:23:18 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: enable synchronous console while starting secondary CPUs
    
    Setting synchronous console ensures that any printk hits the buffer
    immediately and that any outstanding queued log messages are flushed. This
    ensures that such log messages are not being printed while the secondary CPU
    may be using early_printk during early bringup.
    
    Signed-of-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/smpboot.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 7636ab8..e862477 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -28,6 +28,7 @@
 #include <xen/softirq.h>
 #include <xen/timer.h>
 #include <xen/irq.h>
+#include <xen/console.h>
 #include <asm/gic.h>
 
 cpumask_t cpu_online_map;
@@ -356,6 +357,8 @@ int __cpu_up(unsigned int cpu)
     if ( rc < 0 )
         return rc;
 
+    console_start_sync(); /* Secondary may use early_printk */
+
     /* Tell the remote CPU which stack to boot on. */
     init_data.stack = idle_vcpu[cpu]->arch.stack;
 
@@ -368,6 +371,8 @@ int __cpu_up(unsigned int cpu)
 
     rc = arch_cpu_up(cpu);
 
+    console_end_sync();
+
     if ( rc < 0 )
     {
         printk("Failed to bring up CPU%d\n", 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 Dec 04 10:01:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:01: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 1Vo9Gy-0003BT-Ts; Wed, 04 Dec 2013 10:01:36 +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 1Vo9Gx-0003BE-KZ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:35 +0000
Received: from [193.109.254.147:42933] by server-7.bemta-14.messagelabs.com id
	22/1F-15500-E7DFE925; Wed, 04 Dec 2013 10:01:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1386151293!2792940!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14403 invoked from network); 4 Dec 2013 10:01:34 -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;
	4 Dec 2013 10:01:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Gu-0007xb-VJ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Gu-0006PH-T5
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:32 +0000
Date: Wed, 04 Dec 2013 10:01:32 +0000
Message-Id: <E1Vo9Gu-0006PH-T5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: improve early memory map
	readability
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fce9a38af8a38e6d951a008919f7d9f7ba77615b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 20 13:46:41 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: improve early memory map readability
    
    Purely cosmetic, put a blank line after the early memory map to separate it
    from the subsequent information. This looks better since the memory map is
    preceded by a blank line too.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/common/device_tree.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 44253da..943b181 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -452,6 +452,7 @@ static void __init early_print_info(void)
         early_printk(" RESVD[%d]: %"PRIpaddr" - %"PRIpaddr"\n",
                      i, s, e);
     }
+    early_printk("\n");
 }
 
 /**
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:01:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:01: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 1Vo9Gy-0003BT-Ts; Wed, 04 Dec 2013 10:01:36 +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 1Vo9Gx-0003BE-KZ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:35 +0000
Received: from [193.109.254.147:42933] by server-7.bemta-14.messagelabs.com id
	22/1F-15500-E7DFE925; Wed, 04 Dec 2013 10:01:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1386151293!2792940!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14403 invoked from network); 4 Dec 2013 10:01:34 -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;
	4 Dec 2013 10:01:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Gu-0007xb-VJ
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Gu-0006PH-T5
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:32 +0000
Date: Wed, 04 Dec 2013 10:01:32 +0000
Message-Id: <E1Vo9Gu-0006PH-T5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: improve early memory map
	readability
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fce9a38af8a38e6d951a008919f7d9f7ba77615b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 20 13:46:41 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: improve early memory map readability
    
    Purely cosmetic, put a blank line after the early memory map to separate it
    from the subsequent information. This looks better since the memory map is
    preceded by a blank line too.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/common/device_tree.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 44253da..943b181 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -452,6 +452,7 @@ static void __init early_print_info(void)
         early_printk(" RESVD[%d]: %"PRIpaddr" - %"PRIpaddr"\n",
                      i, s, e);
     }
+    early_printk("\n");
 }
 
 /**
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:01:47 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:01: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 1Vo9H9-0003D7-0R; Wed, 04 Dec 2013 10:01:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9H8-0003Cw-1u
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:46 +0000
Received: from [85.158.139.211:45156] by server-3.bemta-5.messagelabs.com id
	24/89-05884-98DFE925; Wed, 04 Dec 2013 10:01:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386151303!2164710!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19995 invoked from network); 4 Dec 2013 10:01:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:01:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9H5-0007xk-4h
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9H5-0006Pm-2Q
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:43 +0000
Date: Wed, 04 Dec 2013 10:01:43 +0000
Message-Id: <E1Vo9H5-0006Pm-2Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: handle 40-bit addresses in
	the p2m
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c5b00aae9525db09d77c577080560b8bf688978
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 20 13:56:08 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: handle 40-bit addresses in the p2m
    
    On the X-gene platform there are resources up this high which must be mapped
    to dom0.
    
    Remove the first level page from the p2m->pages list since it is actually two
    pages and must be freed as such. Do so in p2m_teardown.
    
    I've also punted on the implementation of dump_p2m_lookup for high
    addresses...
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/p2m.c |   60 +++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 48 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 82dda65..af32511 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -7,6 +7,10 @@
 #include <asm/flushtlb.h>
 #include <asm/gic.h>
 
+/* First level P2M is 2 consecutive pages */
+#define P2M_FIRST_ORDER 1
+#define P2M_FIRST_ENTRIES (LPAE_ENTRIES<<P2M_FIRST_ORDER)
+
 void dump_p2m_lookup(struct domain *d, paddr_t addr)
 {
     struct p2m_domain *p2m = &d->arch.p2m;
@@ -14,6 +18,12 @@ void dump_p2m_lookup(struct domain *d, paddr_t addr)
 
     printk("dom%d IPA 0x%"PRIpaddr"\n", d->domain_id, addr);
 
+    if ( first_linear_offset(addr) > LPAE_ENTRIES )
+    {
+        printk("Cannot dump addresses in second of first level pages...\n");
+        return;
+    }
+
     printk("P2M @ %p mfn:0x%lx\n",
            p2m->first_level, page_to_mfn(p2m->first_level));
 
@@ -31,6 +41,30 @@ void p2m_load_VTTBR(struct domain *d)
     isb(); /* Ensure update is visible */
 }
 
+static int p2m_first_level_index(paddr_t addr)
+{
+    /*
+     * 1st pages are concatenated so zeroeth offset gives us the
+     * index of the 1st page
+     */
+    return zeroeth_table_offset(addr);
+}
+
+/*
+ * Map whichever of the first pages contain addr. The caller should
+ * then use first_table_offset as an index.
+ */
+static lpae_t *p2m_map_first(struct p2m_domain *p2m, paddr_t addr)
+{
+    struct page_info *page;
+
+    BUG_ON(first_linear_offset(addr) > P2M_FIRST_ENTRIES);
+
+    page = p2m->first_level + p2m_first_level_index(addr);
+
+    return __map_domain_page(page);
+}
+
 /*
  * Lookup the MFN corresponding to a domain's PFN.
  *
@@ -45,7 +79,7 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr)
 
     spin_lock(&p2m->lock);
 
-    first = __map_domain_page(p2m->first_level);
+    first = p2m_map_first(p2m, paddr);
 
     pte = first[first_table_offset(paddr)];
     if ( !pte.p2m.valid || !pte.p2m.table )
@@ -135,18 +169,21 @@ static int create_p2m_entries(struct domain *d,
     struct p2m_domain *p2m = &d->arch.p2m;
     lpae_t *first = NULL, *second = NULL, *third = NULL;
     paddr_t addr;
-    unsigned long cur_first_offset = ~0, cur_second_offset = ~0;
+    unsigned long cur_first_page = ~0,
+                  cur_first_offset = ~0,
+                  cur_second_offset = ~0;
 
     spin_lock(&p2m->lock);
 
-    /* XXX Don't actually handle 40 bit guest physical addresses */
-    BUG_ON(start_gpaddr & 0x8000000000ULL);
-    BUG_ON(end_gpaddr   & 0x8000000000ULL);
-
-    first = __map_domain_page(p2m->first_level);
-
     for(addr = start_gpaddr; addr < end_gpaddr; addr += PAGE_SIZE)
     {
+        if ( cur_first_page != p2m_first_level_index(addr) )
+        {
+            if ( first ) unmap_domain_page(first);
+            first = p2m_map_first(p2m, addr);
+            cur_first_page = p2m_first_level_index(addr);
+        }
+
         if ( !first[first_table_offset(addr)].p2m.valid )
         {
             rc = p2m_create_table(d, &first[first_table_offset(addr)]);
@@ -279,15 +316,12 @@ int p2m_alloc_table(struct domain *d)
     struct page_info *page;
     void *p;
 
-    /* First level P2M is 2 consecutive pages */
-    page = alloc_domheap_pages(NULL, 1, 0);
+    page = alloc_domheap_pages(NULL, P2M_FIRST_ORDER, 0);
     if ( page == NULL )
         return -ENOMEM;
 
     spin_lock(&p2m->lock);
 
-    page_list_add(page, &p2m->pages);
-
     /* Clear both first level pages */
     p = __map_domain_page(page);
     clear_page(p);
@@ -380,6 +414,8 @@ void p2m_teardown(struct domain *d)
     while ( (pg = page_list_remove_head(&p2m->pages)) )
         free_domheap_page(pg);
 
+    free_domheap_pages(p2m->first_level, P2M_FIRST_ORDER);
+
     p2m->first_level = NULL;
 
     p2m_free_vmid(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 Wed Dec 04 10:01:47 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:01: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 1Vo9H9-0003D7-0R; Wed, 04 Dec 2013 10:01:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9H8-0003Cw-1u
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:46 +0000
Received: from [85.158.139.211:45156] by server-3.bemta-5.messagelabs.com id
	24/89-05884-98DFE925; Wed, 04 Dec 2013 10:01:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386151303!2164710!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19995 invoked from network); 4 Dec 2013 10:01:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:01:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9H5-0007xk-4h
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9H5-0006Pm-2Q
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:43 +0000
Date: Wed, 04 Dec 2013 10:01:43 +0000
Message-Id: <E1Vo9H5-0006Pm-2Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: handle 40-bit addresses in
	the p2m
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c5b00aae9525db09d77c577080560b8bf688978
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 20 13:56:08 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:26:07 2013 +0000

    xen: arm: handle 40-bit addresses in the p2m
    
    On the X-gene platform there are resources up this high which must be mapped
    to dom0.
    
    Remove the first level page from the p2m->pages list since it is actually two
    pages and must be freed as such. Do so in p2m_teardown.
    
    I've also punted on the implementation of dump_p2m_lookup for high
    addresses...
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/p2m.c |   60 +++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 48 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 82dda65..af32511 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -7,6 +7,10 @@
 #include <asm/flushtlb.h>
 #include <asm/gic.h>
 
+/* First level P2M is 2 consecutive pages */
+#define P2M_FIRST_ORDER 1
+#define P2M_FIRST_ENTRIES (LPAE_ENTRIES<<P2M_FIRST_ORDER)
+
 void dump_p2m_lookup(struct domain *d, paddr_t addr)
 {
     struct p2m_domain *p2m = &d->arch.p2m;
@@ -14,6 +18,12 @@ void dump_p2m_lookup(struct domain *d, paddr_t addr)
 
     printk("dom%d IPA 0x%"PRIpaddr"\n", d->domain_id, addr);
 
+    if ( first_linear_offset(addr) > LPAE_ENTRIES )
+    {
+        printk("Cannot dump addresses in second of first level pages...\n");
+        return;
+    }
+
     printk("P2M @ %p mfn:0x%lx\n",
            p2m->first_level, page_to_mfn(p2m->first_level));
 
@@ -31,6 +41,30 @@ void p2m_load_VTTBR(struct domain *d)
     isb(); /* Ensure update is visible */
 }
 
+static int p2m_first_level_index(paddr_t addr)
+{
+    /*
+     * 1st pages are concatenated so zeroeth offset gives us the
+     * index of the 1st page
+     */
+    return zeroeth_table_offset(addr);
+}
+
+/*
+ * Map whichever of the first pages contain addr. The caller should
+ * then use first_table_offset as an index.
+ */
+static lpae_t *p2m_map_first(struct p2m_domain *p2m, paddr_t addr)
+{
+    struct page_info *page;
+
+    BUG_ON(first_linear_offset(addr) > P2M_FIRST_ENTRIES);
+
+    page = p2m->first_level + p2m_first_level_index(addr);
+
+    return __map_domain_page(page);
+}
+
 /*
  * Lookup the MFN corresponding to a domain's PFN.
  *
@@ -45,7 +79,7 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr)
 
     spin_lock(&p2m->lock);
 
-    first = __map_domain_page(p2m->first_level);
+    first = p2m_map_first(p2m, paddr);
 
     pte = first[first_table_offset(paddr)];
     if ( !pte.p2m.valid || !pte.p2m.table )
@@ -135,18 +169,21 @@ static int create_p2m_entries(struct domain *d,
     struct p2m_domain *p2m = &d->arch.p2m;
     lpae_t *first = NULL, *second = NULL, *third = NULL;
     paddr_t addr;
-    unsigned long cur_first_offset = ~0, cur_second_offset = ~0;
+    unsigned long cur_first_page = ~0,
+                  cur_first_offset = ~0,
+                  cur_second_offset = ~0;
 
     spin_lock(&p2m->lock);
 
-    /* XXX Don't actually handle 40 bit guest physical addresses */
-    BUG_ON(start_gpaddr & 0x8000000000ULL);
-    BUG_ON(end_gpaddr   & 0x8000000000ULL);
-
-    first = __map_domain_page(p2m->first_level);
-
     for(addr = start_gpaddr; addr < end_gpaddr; addr += PAGE_SIZE)
     {
+        if ( cur_first_page != p2m_first_level_index(addr) )
+        {
+            if ( first ) unmap_domain_page(first);
+            first = p2m_map_first(p2m, addr);
+            cur_first_page = p2m_first_level_index(addr);
+        }
+
         if ( !first[first_table_offset(addr)].p2m.valid )
         {
             rc = p2m_create_table(d, &first[first_table_offset(addr)]);
@@ -279,15 +316,12 @@ int p2m_alloc_table(struct domain *d)
     struct page_info *page;
     void *p;
 
-    /* First level P2M is 2 consecutive pages */
-    page = alloc_domheap_pages(NULL, 1, 0);
+    page = alloc_domheap_pages(NULL, P2M_FIRST_ORDER, 0);
     if ( page == NULL )
         return -ENOMEM;
 
     spin_lock(&p2m->lock);
 
-    page_list_add(page, &p2m->pages);
-
     /* Clear both first level pages */
     p = __map_domain_page(page);
     clear_page(p);
@@ -380,6 +414,8 @@ void p2m_teardown(struct domain *d)
     while ( (pg = page_list_remove_head(&p2m->pages)) )
         free_domheap_page(pg);
 
+    free_domheap_pages(p2m->first_level, P2M_FIRST_ORDER);
+
     p2m->first_level = NULL;
 
     p2m_free_vmid(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 Wed Dec 04 10:02:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02: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 1Vo9HW-0003G9-5E; Wed, 04 Dec 2013 10:02: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 1Vo9HJ-0003Ed-A6
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:57 +0000
Received: from [193.109.254.147:64050] by server-11.bemta-14.messagelabs.com
	id 73/5D-20576-49DFE925; Wed, 04 Dec 2013 10:01:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386151313!2727670!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25732 invoked from network); 4 Dec 2013 10:01:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:01:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9HF-0007xx-Gm
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9HF-0006Q8-Di
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:53 +0000
Date: Wed, 04 Dec 2013 10:01:53 +0000
Message-Id: <E1Vo9HF-0006Q8-Di@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Handle xen_platform_pci=0 case
	with qemu-xen.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bc047635b51abd41c917aa2b813211ee0de2c38
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Nov 27 18:21:34 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:28:06 2013 +0000

    libxl: Handle xen_platform_pci=0 case with qemu-xen.
    
    This should result in QEMU *not* adding the xen-platform device.
    
    Since QEMU 1.6, this can be achieved by using a different qemu machine.
    The one used by libxl is "xenfv", but using QEMU >=1.6 with "-machine
    pc,accel=xen" works as well with only one difference compared to
    "xenfv", there is no xen-platform device.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index be39a62..ea773b3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -608,7 +608,8 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     }
     for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
         flexarray_append(dm_args, b_info->extra[i]);
-    flexarray_append(dm_args, "-M");
+
+    flexarray_append(dm_args, "-machine");
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_PV:
         flexarray_append(dm_args, "xenpv");
@@ -616,7 +617,14 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_append(dm_args, b_info->extra_pv[i]);
         break;
     case LIBXL_DOMAIN_TYPE_HVM:
-        flexarray_append(dm_args, "xenfv");
+        if (!libxl_defbool_val(b_info->u.hvm.xen_platform_pci)) {
+            /* Switching here to the machine "pc" which does not add
+             * the xen-platform device instead of the default "xenfv" machine.
+             */
+            flexarray_append(dm_args, "pc,accel=xen");
+        } else {
+            flexarray_append(dm_args, "xenfv");
+        }
         for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
             flexarray_append(dm_args, b_info->extra_hvm[i]);
         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 Wed Dec 04 10:02:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02: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 1Vo9HW-0003G9-5E; Wed, 04 Dec 2013 10:02: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 1Vo9HJ-0003Ed-A6
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:57 +0000
Received: from [193.109.254.147:64050] by server-11.bemta-14.messagelabs.com
	id 73/5D-20576-49DFE925; Wed, 04 Dec 2013 10:01:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386151313!2727670!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25732 invoked from network); 4 Dec 2013 10:01:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:01:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9HF-0007xx-Gm
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9HF-0006Q8-Di
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:01:53 +0000
Date: Wed, 04 Dec 2013 10:01:53 +0000
Message-Id: <E1Vo9HF-0006Q8-Di@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Handle xen_platform_pci=0 case
	with qemu-xen.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bc047635b51abd41c917aa2b813211ee0de2c38
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Nov 27 18:21:34 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:28:06 2013 +0000

    libxl: Handle xen_platform_pci=0 case with qemu-xen.
    
    This should result in QEMU *not* adding the xen-platform device.
    
    Since QEMU 1.6, this can be achieved by using a different qemu machine.
    The one used by libxl is "xenfv", but using QEMU >=1.6 with "-machine
    pc,accel=xen" works as well with only one difference compared to
    "xenfv", there is no xen-platform device.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index be39a62..ea773b3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -608,7 +608,8 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
     }
     for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
         flexarray_append(dm_args, b_info->extra[i]);
-    flexarray_append(dm_args, "-M");
+
+    flexarray_append(dm_args, "-machine");
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_PV:
         flexarray_append(dm_args, "xenpv");
@@ -616,7 +617,14 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_append(dm_args, b_info->extra_pv[i]);
         break;
     case LIBXL_DOMAIN_TYPE_HVM:
-        flexarray_append(dm_args, "xenfv");
+        if (!libxl_defbool_val(b_info->u.hvm.xen_platform_pci)) {
+            /* Switching here to the machine "pc" which does not add
+             * the xen-platform device instead of the default "xenfv" machine.
+             */
+            flexarray_append(dm_args, "pc,accel=xen");
+        } else {
+            flexarray_append(dm_args, "xenfv");
+        }
         for (i = 0; b_info->extra_hvm && b_info->extra_hvm[i] != NULL; i++)
             flexarray_append(dm_args, b_info->extra_hvm[i]);
         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 Wed Dec 04 10:02:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9Hb-0003HR-70; Wed, 04 Dec 2013 10:02: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 1Vo9HS-0003Ff-8Q
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:06 +0000
Received: from [85.158.143.35:54803] by server-1.bemta-4.messagelabs.com id
	6C/87-02132-D9DFE925; Wed, 04 Dec 2013 10:02:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1386151324!3225891!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22735 invoked from network); 4 Dec 2013 10:02:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:02: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 1Vo9HP-0007yT-Rv
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9HP-0006Qe-OL
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:03 +0000
Date: Wed, 04 Dec 2013 10:02:03 +0000
Message-Id: <E1Vo9HP-0006Qe-OL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Update xen_platform_pci in man
	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 80507420f96b06d68a5b23c18998486330b49657
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Nov 28 12:31:08 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:32:37 2013 +0000

    docs: Update xen_platform_pci in man xl.cfg
    
    To reflect requirement for Qemu 1.6.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ijc -- slightly tweak wording ]
---
 docs/man/xl.cfg.pod.5 |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 3b227b7..7f107cb 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1007,6 +1007,9 @@ drivers are available for various Operating Systems including HVM
 Linux L<http://wiki.xen.org/wiki/XenLinuxPVonHVMdrivers> and Microsoft
 Windows L<http://wiki.xen.org/wiki/XenWindowsGplPv>.
 
+Setting B<xen_platform_pci=0> with the default device_model "qemu-xen"
+requires at least QEMU 1.6.
+
 =item B<viridian=BOOLEAN>
 
 Turns on or off the exposure of MicroSoft Hyper-V (AKA viridian)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:02:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9Hb-0003HR-70; Wed, 04 Dec 2013 10:02: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 1Vo9HS-0003Ff-8Q
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:06 +0000
Received: from [85.158.143.35:54803] by server-1.bemta-4.messagelabs.com id
	6C/87-02132-D9DFE925; Wed, 04 Dec 2013 10:02:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1386151324!3225891!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22735 invoked from network); 4 Dec 2013 10:02:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:02: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 1Vo9HP-0007yT-Rv
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9HP-0006Qe-OL
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:03 +0000
Date: Wed, 04 Dec 2013 10:02:03 +0000
Message-Id: <E1Vo9HP-0006Qe-OL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Update xen_platform_pci in man
	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 80507420f96b06d68a5b23c18998486330b49657
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Nov 28 12:31:08 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 09:32:37 2013 +0000

    docs: Update xen_platform_pci in man xl.cfg
    
    To reflect requirement for Qemu 1.6.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ijc -- slightly tweak wording ]
---
 docs/man/xl.cfg.pod.5 |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 3b227b7..7f107cb 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1007,6 +1007,9 @@ drivers are available for various Operating Systems including HVM
 Linux L<http://wiki.xen.org/wiki/XenLinuxPVonHVMdrivers> and Microsoft
 Windows L<http://wiki.xen.org/wiki/XenWindowsGplPv>.
 
+Setting B<xen_platform_pci=0> with the default device_model "qemu-xen"
+requires at least QEMU 1.6.
+
 =item B<viridian=BOOLEAN>
 
 Turns on or off the exposure of MicroSoft Hyper-V (AKA viridian)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:02:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02: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 1Vo9He-0003IN-Bi; Wed, 04 Dec 2013 10:02:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Hc-0003I0-ON
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:16 +0000
Received: from [193.109.254.147:30039] by server-16.bemta-14.messagelabs.com
	id 93/16-20600-7ADFE925; Wed, 04 Dec 2013 10:02:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1386151334!2777021!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15887 invoked from network); 4 Dec 2013 10:02:15 -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;
	4 Dec 2013 10:02:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ha-0007yZ-3F
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9HZ-0006R2-W7
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:14 +0000
Date: Wed, 04 Dec 2013 10:02:13 +0000
Message-Id: <E1Vo9HZ-0006R2-W7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] memshr: fix off-by-one in filename
	size 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 29f3dc1e0715bc9237761ce4a39aed3610a86a85
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Thu Nov 28 23:17:11 2013 +1300
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    memshr: fix off-by-one in filename size check
    
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/memshr/shm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/memshr/shm.c b/tools/memshr/shm.c
index c925cf2..30975dc 100644
--- a/tools/memshr/shm.c
+++ b/tools/memshr/shm.c
@@ -217,9 +217,9 @@ uint16_t shm_vbd_image_get(const char* file, vbd_image_info_t *vbd_imgs)
         DPRINTF("No space in vbds table.\n");
         return 0;
     }
-    if(strlen(file) > MAX_NAME_LEN)
+    if(strlen(file) > MAX_NAME_LEN - 1)
     {
-        DPRINTF("Filename: %s too long (>%d).\n", file, MAX_NAME_LEN);
+        DPRINTF("Filename: %s too long (>%d).\n", file, MAX_NAME_LEN - 1);
         return 0; 
     }
     /* Init the entry */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:02:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02: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 1Vo9He-0003IN-Bi; Wed, 04 Dec 2013 10:02:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Hc-0003I0-ON
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:16 +0000
Received: from [193.109.254.147:30039] by server-16.bemta-14.messagelabs.com
	id 93/16-20600-7ADFE925; Wed, 04 Dec 2013 10:02:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1386151334!2777021!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15887 invoked from network); 4 Dec 2013 10:02:15 -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;
	4 Dec 2013 10:02:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ha-0007yZ-3F
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9HZ-0006R2-W7
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:14 +0000
Date: Wed, 04 Dec 2013 10:02:13 +0000
Message-Id: <E1Vo9HZ-0006R2-W7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] memshr: fix off-by-one in filename
	size 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 29f3dc1e0715bc9237761ce4a39aed3610a86a85
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Thu Nov 28 23:17:11 2013 +1300
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    memshr: fix off-by-one in filename size check
    
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/memshr/shm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/memshr/shm.c b/tools/memshr/shm.c
index c925cf2..30975dc 100644
--- a/tools/memshr/shm.c
+++ b/tools/memshr/shm.c
@@ -217,9 +217,9 @@ uint16_t shm_vbd_image_get(const char* file, vbd_image_info_t *vbd_imgs)
         DPRINTF("No space in vbds table.\n");
         return 0;
     }
-    if(strlen(file) > MAX_NAME_LEN)
+    if(strlen(file) > MAX_NAME_LEN - 1)
     {
-        DPRINTF("Filename: %s too long (>%d).\n", file, MAX_NAME_LEN);
+        DPRINTF("Filename: %s too long (>%d).\n", file, MAX_NAME_LEN - 1);
         return 0; 
     }
     /* Init the entry */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:02:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10: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 1Vo9Hs-0003Jz-Eg; Wed, 04 Dec 2013 10:02: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 1Vo9Hp-0003JZ-QR
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:31 +0000
Received: from [193.109.254.147:31603] by server-9.bemta-14.messagelabs.com id
	CC/42-13957-2BDFE925; Wed, 04 Dec 2013 10:02:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1386151344!2761471!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10495 invoked from network); 4 Dec 2013 10:02:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:02: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 1Vo9Hk-0007yi-9M
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Hk-0006Ru-7m
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:24 +0000
Date: Wed, 04 Dec 2013 10:02:24 +0000
Message-Id: <E1Vo9Hk-0006Ru-7m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: introduce
	raw_copy_to_guest_flush_dcache() 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 31389a2b12131cef5c9572ebd43b0d21aaf40f15
Author:     Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
AuthorDate: Wed Nov 27 19:09:51 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    xen: arm: introduce raw_copy_to_guest_flush_dcache() function
    
    This function flushes the dcache while copying the data.
    
    Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall<julien.grall@linaro.org>
---
 xen/arch/arm/guestcopy.c           |   16 +++++++++++++++-
 xen/include/asm-arm/guest_access.h |    2 ++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index d146cd6..08800a4 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -5,7 +5,8 @@
 #include <asm/mm.h>
 #include <asm/guest_access.h>
 
-unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len)
+static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
+                                              unsigned len, unsigned flush_dcache)
 {
     /* XXX needs to handle faults */
     unsigned offset = (vaddr_t)to & ~PAGE_MASK;
@@ -24,6 +25,8 @@ unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len)
         p = map_domain_page(g>>PAGE_SHIFT);
         p += offset;
         memcpy(p, from, size);
+        if ( flush_dcache )
+            flush_xen_dcache_va_range(p, size);
 
         unmap_domain_page(p - offset);
         len -= size;
@@ -35,6 +38,17 @@ unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len)
     return 0;
 }
 
+unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len)
+{
+    return raw_copy_to_guest_helper(to, from, len, 0);
+}
+
+unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from,
+                                             unsigned len)
+{
+    return raw_copy_to_guest_helper(to, from, len, 1);
+}
+
 unsigned long raw_clear_guest(void *to, unsigned len)
 {
     /* XXX needs to handle faults */
diff --git a/xen/include/asm-arm/guest_access.h b/xen/include/asm-arm/guest_access.h
index 8ff088f..5876988 100644
--- a/xen/include/asm-arm/guest_access.h
+++ b/xen/include/asm-arm/guest_access.h
@@ -11,6 +11,8 @@
     (likely(count < (~0UL/size)) && access_ok(addr,count*size))
 
 unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len);
+unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from,
+                                             unsigned len);
 unsigned long raw_copy_from_guest(void *to, const void *from, unsigned len);
 unsigned long raw_clear_guest(void *to, unsigned len);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:02:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10: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 1Vo9Hs-0003Jz-Eg; Wed, 04 Dec 2013 10:02: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 1Vo9Hp-0003JZ-QR
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:31 +0000
Received: from [193.109.254.147:31603] by server-9.bemta-14.messagelabs.com id
	CC/42-13957-2BDFE925; Wed, 04 Dec 2013 10:02:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1386151344!2761471!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10495 invoked from network); 4 Dec 2013 10:02:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:02: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 1Vo9Hk-0007yi-9M
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Hk-0006Ru-7m
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:24 +0000
Date: Wed, 04 Dec 2013 10:02:24 +0000
Message-Id: <E1Vo9Hk-0006Ru-7m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: introduce
	raw_copy_to_guest_flush_dcache() 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 31389a2b12131cef5c9572ebd43b0d21aaf40f15
Author:     Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
AuthorDate: Wed Nov 27 19:09:51 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    xen: arm: introduce raw_copy_to_guest_flush_dcache() function
    
    This function flushes the dcache while copying the data.
    
    Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall<julien.grall@linaro.org>
---
 xen/arch/arm/guestcopy.c           |   16 +++++++++++++++-
 xen/include/asm-arm/guest_access.h |    2 ++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index d146cd6..08800a4 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -5,7 +5,8 @@
 #include <asm/mm.h>
 #include <asm/guest_access.h>
 
-unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len)
+static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
+                                              unsigned len, unsigned flush_dcache)
 {
     /* XXX needs to handle faults */
     unsigned offset = (vaddr_t)to & ~PAGE_MASK;
@@ -24,6 +25,8 @@ unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len)
         p = map_domain_page(g>>PAGE_SHIFT);
         p += offset;
         memcpy(p, from, size);
+        if ( flush_dcache )
+            flush_xen_dcache_va_range(p, size);
 
         unmap_domain_page(p - offset);
         len -= size;
@@ -35,6 +38,17 @@ unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len)
     return 0;
 }
 
+unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len)
+{
+    return raw_copy_to_guest_helper(to, from, len, 0);
+}
+
+unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from,
+                                             unsigned len)
+{
+    return raw_copy_to_guest_helper(to, from, len, 1);
+}
+
 unsigned long raw_clear_guest(void *to, unsigned len)
 {
     /* XXX needs to handle faults */
diff --git a/xen/include/asm-arm/guest_access.h b/xen/include/asm-arm/guest_access.h
index 8ff088f..5876988 100644
--- a/xen/include/asm-arm/guest_access.h
+++ b/xen/include/asm-arm/guest_access.h
@@ -11,6 +11,8 @@
     (likely(count < (~0UL/size)) && access_ok(addr,count*size))
 
 unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len);
+unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from,
+                                             unsigned len);
 unsigned long raw_copy_from_guest(void *to, const void *from, unsigned len);
 unsigned long raw_clear_guest(void *to, unsigned len);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:02:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9Hz-0003LD-JX; Wed, 04 Dec 2013 10:02: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 1Vo9Hy-0003Kr-HR
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:39 +0000
Received: from [85.158.139.211:6432] by server-10.bemta-5.messagelabs.com id
	E4/53-01405-CBDFE925; Wed, 04 Dec 2013 10:02:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1386151354!2154211!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26528 invoked from network); 4 Dec 2013 10:02:35 -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;
	4 Dec 2013 10:02: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 1Vo9Hu-0007yq-IR
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Hu-0006ST-CO
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:34 +0000
Date: Wed, 04 Dec 2013 10:02:34 +0000
Message-Id: <E1Vo9Hu-0006ST-CO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: flush dcache while preparing
	the device tree 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 c8f14de363587a0143e5d4181cca44979f4baa98
Author:     Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
AuthorDate: Wed Nov 27 19:09:52 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    xen: arm: flush dcache while preparing the device tree for Dom0
    
    Without flushing dcache the hypervisor couldn't copy the device tree
    correctly when booting the kernel dom0 Image (memory with device tree
    is corrupted). As the result - when we try to load the kernel dom0
    Image - dom0 hungs frequently. This issue is not reproduced with the
    kernel dom0 zImage because the zImage decompressor code flushes all
    dcache before starting the decompressed kernel Image. When the
    hypervisor loads the kernel image or initrd, this memory region
    isn't corrupted because the hypervisor code flushes the dcache.
    
    Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall<julien.grall@linaro.org>
---
 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 e9bb01f..99e785a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -906,7 +906,8 @@ static void dtb_load(struct kernel_info *kinfo)
     printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
            kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
 
-    rc = raw_copy_to_guest(dtb_virt, kinfo->fdt, fdt_totalsize(kinfo->fdt));
+    rc = raw_copy_to_guest_flush_dcache(dtb_virt, kinfo->fdt,
+                                        fdt_totalsize(kinfo->fdt));
     if ( rc != 0 )
         panic("Unable to copy the DTB to dom0 memory (rc = %lu)\n", rc);
     xfree(kinfo->fdt);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:02:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vo9Hz-0003LD-JX; Wed, 04 Dec 2013 10:02: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 1Vo9Hy-0003Kr-HR
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:39 +0000
Received: from [85.158.139.211:6432] by server-10.bemta-5.messagelabs.com id
	E4/53-01405-CBDFE925; Wed, 04 Dec 2013 10:02:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1386151354!2154211!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26528 invoked from network); 4 Dec 2013 10:02:35 -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;
	4 Dec 2013 10:02: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 1Vo9Hu-0007yq-IR
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Hu-0006ST-CO
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:34 +0000
Date: Wed, 04 Dec 2013 10:02:34 +0000
Message-Id: <E1Vo9Hu-0006ST-CO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: flush dcache while preparing
	the device tree 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 c8f14de363587a0143e5d4181cca44979f4baa98
Author:     Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
AuthorDate: Wed Nov 27 19:09:52 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    xen: arm: flush dcache while preparing the device tree for Dom0
    
    Without flushing dcache the hypervisor couldn't copy the device tree
    correctly when booting the kernel dom0 Image (memory with device tree
    is corrupted). As the result - when we try to load the kernel dom0
    Image - dom0 hungs frequently. This issue is not reproduced with the
    kernel dom0 zImage because the zImage decompressor code flushes all
    dcache before starting the decompressed kernel Image. When the
    hypervisor loads the kernel image or initrd, this memory region
    isn't corrupted because the hypervisor code flushes the dcache.
    
    Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall<julien.grall@linaro.org>
---
 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 e9bb01f..99e785a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -906,7 +906,8 @@ static void dtb_load(struct kernel_info *kinfo)
     printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
            kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
 
-    rc = raw_copy_to_guest(dtb_virt, kinfo->fdt, fdt_totalsize(kinfo->fdt));
+    rc = raw_copy_to_guest_flush_dcache(dtb_virt, kinfo->fdt,
+                                        fdt_totalsize(kinfo->fdt));
     if ( rc != 0 )
         panic("Unable to copy the DTB to dom0 memory (rc = %lu)\n", rc);
     xfree(kinfo->fdt);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:02:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02: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 1Vo9I8-0003Ma-Mk; Wed, 04 Dec 2013 10:02:48 +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 1Vo9I8-0003MP-1T
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:48 +0000
Received: from [193.109.254.147:32342] by server-10.bemta-14.messagelabs.com
	id 78/F1-20752-6CDFE925; Wed, 04 Dec 2013 10:02:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386151364!2728043!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4926 invoked from network); 4 Dec 2013 10:02:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:02: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 1Vo9I4-0007z3-Ny
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9I4-0006Sr-LU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:44 +0000
Date: Wed, 04 Dec 2013 10:02:44 +0000
Message-Id: <E1Vo9I4-0006Sr-LU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/ovmf: remove hardcoded OVMF
	loading location
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d04442a9b2f53cda3847d907dc1e7939c288404f
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Nov 26 19:31:41 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    hvmloader/ovmf: remove hardcoded OVMF loading location
    
    Load OVMF from (100000000ULL - sizeof(ovmf)) to 0xFFFFFFFF, with proper
    rounding down.
    
    Tested with OVMF release build (1 MB) and debug build (2 MB), both
    worked fine.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/ovmf.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/firmware/hvmloader/ovmf.c b/tools/firmware/hvmloader/ovmf.c
index ee4cbbf..148102a 100644
--- a/tools/firmware/hvmloader/ovmf.c
+++ b/tools/firmware/hvmloader/ovmf.c
@@ -38,9 +38,9 @@
 #define ROM_INCLUDE_OVMF
 #include "roms.inc"
 
-#define OVMF_BEGIN              0xFFF00000ULL
-#define OVMF_SIZE               0x00100000ULL
+#define OVMF_SIZE               (sizeof(ovmf))
 #define OVMF_MAXOFFSET          0x000FFFFFULL
+#define OVMF_BEGIN              (0x100000000ULL - ((OVMF_SIZE + OVMF_MAXOFFSET) & ~OVMF_MAXOFFSET))
 #define OVMF_END                (OVMF_BEGIN + OVMF_SIZE)
 #define LOWCHUNK_BEGIN          0x000F0000
 #define LOWCHUNK_SIZE           0x00010000
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:02:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02: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 1Vo9I8-0003Ma-Mk; Wed, 04 Dec 2013 10:02:48 +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 1Vo9I8-0003MP-1T
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:48 +0000
Received: from [193.109.254.147:32342] by server-10.bemta-14.messagelabs.com
	id 78/F1-20752-6CDFE925; Wed, 04 Dec 2013 10:02:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386151364!2728043!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4926 invoked from network); 4 Dec 2013 10:02:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:02: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 1Vo9I4-0007z3-Ny
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9I4-0006Sr-LU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:44 +0000
Date: Wed, 04 Dec 2013 10:02:44 +0000
Message-Id: <E1Vo9I4-0006Sr-LU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/ovmf: remove hardcoded OVMF
	loading location
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d04442a9b2f53cda3847d907dc1e7939c288404f
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Nov 26 19:31:41 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    hvmloader/ovmf: remove hardcoded OVMF loading location
    
    Load OVMF from (100000000ULL - sizeof(ovmf)) to 0xFFFFFFFF, with proper
    rounding down.
    
    Tested with OVMF release build (1 MB) and debug build (2 MB), both
    worked fine.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/ovmf.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/firmware/hvmloader/ovmf.c b/tools/firmware/hvmloader/ovmf.c
index ee4cbbf..148102a 100644
--- a/tools/firmware/hvmloader/ovmf.c
+++ b/tools/firmware/hvmloader/ovmf.c
@@ -38,9 +38,9 @@
 #define ROM_INCLUDE_OVMF
 #include "roms.inc"
 
-#define OVMF_BEGIN              0xFFF00000ULL
-#define OVMF_SIZE               0x00100000ULL
+#define OVMF_SIZE               (sizeof(ovmf))
 #define OVMF_MAXOFFSET          0x000FFFFFULL
+#define OVMF_BEGIN              (0x100000000ULL - ((OVMF_SIZE + OVMF_MAXOFFSET) & ~OVMF_MAXOFFSET))
 #define OVMF_END                (OVMF_BEGIN + OVMF_SIZE)
 #define LOWCHUNK_BEGIN          0x000F0000
 #define LOWCHUNK_SIZE           0x00010000
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:02:58 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02: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 1Vo9II-0003OB-Pj; Wed, 04 Dec 2013 10:02: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 1Vo9IH-0003Nj-OE
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:57 +0000
Received: from [85.158.143.35:6853] by server-1.bemta-4.messagelabs.com id
	B7/B9-02132-0DDFE925; Wed, 04 Dec 2013 10:02:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1386151375!3157990!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30248 invoked from network); 4 Dec 2013 10:02:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:02: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 1Vo9IE-0007z9-Sf
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9IE-0006TD-R4
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:54 +0000
Date: Wed, 04 Dec 2013 10:02:54 +0000
Message-Id: <E1Vo9IE-0006TD-R4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/ovmf: show OVMF_BEGIN as
	bios address
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dea17b0c21861bbc72a10e08d8548b33edae243d
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Nov 26 19:31:42 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    hvmloader/ovmf: show OVMF_BEGIN as bios address
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/ovmf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/hvmloader/ovmf.c b/tools/firmware/hvmloader/ovmf.c
index 148102a..a67a2de 100644
--- a/tools/firmware/hvmloader/ovmf.c
+++ b/tools/firmware/hvmloader/ovmf.c
@@ -99,7 +99,7 @@ struct bios_config ovmf_config =  {
     .image = ovmf,
     .image_size = sizeof(ovmf),
 
-    .bios_address = 0,
+    .bios_address = OVMF_BEGIN,
     .bios_load = ovmf_load,
 
     .load_roms = 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 Dec 04 10:02:58 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:02: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 1Vo9II-0003OB-Pj; Wed, 04 Dec 2013 10:02: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 1Vo9IH-0003Nj-OE
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:57 +0000
Received: from [85.158.143.35:6853] by server-1.bemta-4.messagelabs.com id
	B7/B9-02132-0DDFE925; Wed, 04 Dec 2013 10:02:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1386151375!3157990!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30248 invoked from network); 4 Dec 2013 10:02:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:02: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 1Vo9IE-0007z9-Sf
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9IE-0006TD-R4
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:02:54 +0000
Date: Wed, 04 Dec 2013 10:02:54 +0000
Message-Id: <E1Vo9IE-0006TD-R4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/ovmf: show OVMF_BEGIN as
	bios address
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dea17b0c21861bbc72a10e08d8548b33edae243d
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Nov 26 19:31:42 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    hvmloader/ovmf: show OVMF_BEGIN as bios address
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/ovmf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/hvmloader/ovmf.c b/tools/firmware/hvmloader/ovmf.c
index 148102a..a67a2de 100644
--- a/tools/firmware/hvmloader/ovmf.c
+++ b/tools/firmware/hvmloader/ovmf.c
@@ -99,7 +99,7 @@ struct bios_config ovmf_config =  {
     .image = ovmf,
     .image_size = sizeof(ovmf),
 
-    .bios_address = 0,
+    .bios_address = OVMF_BEGIN,
     .bios_load = ovmf_load,
 
     .load_roms = 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 Dec 04 10:03:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10: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 1Vo9Ih-0003SM-TL; Wed, 04 Dec 2013 10:03:23 +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 1Vo9Ih-0003S6-4L
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:23 +0000
Received: from [193.109.254.147:35373] by server-11.bemta-14.messagelabs.com
	id 4A/01-20576-9EDFE925; Wed, 04 Dec 2013 10:03:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1386151385!2764401!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3774 invoked from network); 4 Dec 2013 10:03:21 -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;
	4 Dec 2013 10:03: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 1Vo9IP-0007zl-1p
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9IO-0006Tk-Vn
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:05 +0000
Date: Wed, 04 Dec 2013 10:03:04 +0000
Message-Id: <E1Vo9IO-0006Tk-Vn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Remove useless and incorrect
	EXPORT_SYMBOLS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a60bd95a198739e320e9c934da3ab23f703b0b8a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Nov 21 10:49:14 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    xen: arm: Remove useless and incorrect EXPORT_SYMBOLS
    
    Dietmar noticed that one of these was incorrect, but in actual fact they are
    not even used. They are defined as nops in Xen for the benefit of code
    imported to Linux which ARM's smpboot.c is not.
    
    Just get rid of them.
    
    Reported-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/smpboot.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index e862477..6b4a18c 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -32,11 +32,8 @@
 #include <asm/gic.h>
 
 cpumask_t cpu_online_map;
-EXPORT_SYMBOL(cpu_online_map);
 cpumask_t cpu_present_map;
-EXPORT_SYMBOL(cpu_online_map);
 cpumask_t cpu_possible_map;
-EXPORT_SYMBOL(cpu_possible_map);
 
 struct cpuinfo_arm cpu_data[NR_CPUS];
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:03:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10: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 1Vo9Ih-0003SM-TL; Wed, 04 Dec 2013 10:03:23 +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 1Vo9Ih-0003S6-4L
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:23 +0000
Received: from [193.109.254.147:35373] by server-11.bemta-14.messagelabs.com
	id 4A/01-20576-9EDFE925; Wed, 04 Dec 2013 10:03:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1386151385!2764401!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3774 invoked from network); 4 Dec 2013 10:03:21 -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;
	4 Dec 2013 10:03: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 1Vo9IP-0007zl-1p
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9IO-0006Tk-Vn
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:05 +0000
Date: Wed, 04 Dec 2013 10:03:04 +0000
Message-Id: <E1Vo9IO-0006Tk-Vn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Remove useless and incorrect
	EXPORT_SYMBOLS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a60bd95a198739e320e9c934da3ab23f703b0b8a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Nov 21 10:49:14 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:04 2013 +0000

    xen: arm: Remove useless and incorrect EXPORT_SYMBOLS
    
    Dietmar noticed that one of these was incorrect, but in actual fact they are
    not even used. They are defined as nops in Xen for the benefit of code
    imported to Linux which ARM's smpboot.c is not.
    
    Just get rid of them.
    
    Reported-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/smpboot.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index e862477..6b4a18c 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -32,11 +32,8 @@
 #include <asm/gic.h>
 
 cpumask_t cpu_online_map;
-EXPORT_SYMBOL(cpu_online_map);
 cpumask_t cpu_present_map;
-EXPORT_SYMBOL(cpu_online_map);
 cpumask_t cpu_possible_map;
-EXPORT_SYMBOL(cpu_possible_map);
 
 struct cpuinfo_arm cpu_data[NR_CPUS];
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:03:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:03: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 1Vo9In-0003Tj-W3; Wed, 04 Dec 2013 10:03:29 +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 1Vo9Im-0003T7-W3
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:29 +0000
Received: from [193.109.254.147:4347] by server-11.bemta-14.messagelabs.com id
	1C/51-20576-FEDFE925; Wed, 04 Dec 2013 10:03:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1386151405!2793928!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9708 invoked from network); 4 Dec 2013 10:03:26 -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;
	4 Dec 2013 10:03: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 1Vo9Ij-0007zr-Dk
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ij-0006VD-By
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:25 +0000
Date: Wed, 04 Dec 2013 10:03:25 +0000
Message-Id: <E1Vo9Ij-0006VD-By@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Fix ptr calculation when converting
	from a VA
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb08944a482a5e80a3ff1113f0735761cc4c6cb8
Author:     Jean-Yves Migeon <jym@NetBSD.org>
AuthorDate: Fri Nov 29 11:39:23 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 11:07:01 2013 +0000

    Fix ptr calculation when converting from a VA
    
    The ptr calculation shall take the offset into the page into account
    when ptr is valid.
    
    Reported regression on NetBSD's port-xen with last known working libxen
    being rev 2.9. This corrupts the kernel symbol table when the table is
    not loaded on a page boundary.
    
    Issue was tracked down by FastIce and Jeff Rizzo. See also
    http://mail-index.netbsd.org/port-xen/2013/10/16/msg008088.html
    
    Signed-off-by: Jean-Yves Migeon <jym@NetBSD.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index a183e62..7099cee 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -342,7 +342,7 @@ static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
     if ( ptr == NULL )
         return ptr;
     *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
-    return ptr;
+    return ptr + offset;
 }
 
 static inline xen_pfn_t xc_dom_p2m_host(struct xc_dom_image *dom, xen_pfn_t pfn)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:03:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:03: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 1Vo9In-0003Tj-W3; Wed, 04 Dec 2013 10:03:29 +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 1Vo9Im-0003T7-W3
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:29 +0000
Received: from [193.109.254.147:4347] by server-11.bemta-14.messagelabs.com id
	1C/51-20576-FEDFE925; Wed, 04 Dec 2013 10:03:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1386151405!2793928!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9708 invoked from network); 4 Dec 2013 10:03:26 -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;
	4 Dec 2013 10:03: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 1Vo9Ij-0007zr-Dk
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ij-0006VD-By
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:25 +0000
Date: Wed, 04 Dec 2013 10:03:25 +0000
Message-Id: <E1Vo9Ij-0006VD-By@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Fix ptr calculation when converting
	from a VA
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb08944a482a5e80a3ff1113f0735761cc4c6cb8
Author:     Jean-Yves Migeon <jym@NetBSD.org>
AuthorDate: Fri Nov 29 11:39:23 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 11:07:01 2013 +0000

    Fix ptr calculation when converting from a VA
    
    The ptr calculation shall take the offset into the page into account
    when ptr is valid.
    
    Reported regression on NetBSD's port-xen with last known working libxen
    being rev 2.9. This corrupts the kernel symbol table when the table is
    not loaded on a page boundary.
    
    Issue was tracked down by FastIce and Jeff Rizzo. See also
    http://mail-index.netbsd.org/port-xen/2013/10/16/msg008088.html
    
    Signed-off-by: Jean-Yves Migeon <jym@NetBSD.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index a183e62..7099cee 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -342,7 +342,7 @@ static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
     if ( ptr == NULL )
         return ptr;
     *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
-    return ptr;
+    return ptr + offset;
 }
 
 static inline xen_pfn_t xc_dom_p2m_host(struct xc_dom_image *dom, xen_pfn_t pfn)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:03:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:03: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 1Vo9Iq-0003Ua-Fi; Wed, 04 Dec 2013 10:03:32 +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 1Vo9Io-0003TH-4I
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:30 +0000
Received: from [85.158.143.35:10802] by server-2.bemta-4.messagelabs.com id
	3A/7B-11386-0FDFE925; Wed, 04 Dec 2013 10:03:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386151406!3234712!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20798 invoked from network); 4 Dec 2013 10:03:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:03:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9IZ-0007zo-88
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9IZ-0006U8-5F
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:15 +0000
Date: Wed, 04 Dec 2013 10:03:15 +0000
Message-Id: <E1Vo9IZ-0006U8-5F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Add some words describing
	xen-pvdevice
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5743de0269cfec9ad65ce12dce80745fa7b3b669
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Wed Nov 13 16:09:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:05 2013 +0000

    docs: Add some words describing xen-pvdevice
    
    This patch adds a short description of xen-pvdevice to
    pci-device-reservations.txt, which contains the canonical list
    of device IDs that may be used to create xen-pvdevice instances.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- ran expand to de-tabbify ]
---
 docs/misc/pci-device-reservations.txt |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/docs/misc/pci-device-reservations.txt b/docs/misc/pci-device-reservations.txt
index 19bd9d5..9d6d780 100644
--- a/docs/misc/pci-device-reservations.txt
+++ b/docs/misc/pci-device-reservations.txt
@@ -6,8 +6,8 @@ System (subject to the availability of suitable drivers) to make use of
 paravirtualisation features such as disk and network devices etc.
 
 Some Xen vendors wish to provide alternative and/or additional guest drivers
-that can bind to virtual devices. This may be done using the Xen PCI vendor
-ID of 0x5853 and Xen-vendor/device specific PCI device IDs. This file
+that can bind to virtual devices[1]. This may be done using the Xen PCI
+vendor ID of 0x5853 and Xen-vendor/device specific PCI device IDs. This file
 records reservations made within the device ID range in order to avoid
 multiple Xen vendors using conflicting IDs.
 
@@ -29,3 +29,30 @@ Reservations
 0x0002        | Citrix XenServer (grandfathered allocation for XenServer 6.1)
 0xc000-0xc0ff | Citrix XenServer
 0xc100-0xc1ff | Citrix XenClient
+
+[1] Upstream QEMU provides a parameterized device called xen-pvdevice that
+    can be used to host guest drivers. Execute:
+
+    qemu-system-i386 -device xen-pvdevice,help
+
+    for a list of all parameters. The following parameters are relevant to
+    driver binding:
+
+    vendor-id (default 0x5853):     The PCI vendor ID and subsystem vendor
+                                    ID of the device.
+    device-id (must be specified):  The PCI device ID and subsystem device
+                                    ID of the device.
+    revision (default 0x01):        The PCI revision of the device
+
+    Also the size parameter (default 0x400000) can be used to specify the
+    size of the single MMIO BAR that the device exposes. This area may be
+    used by drivers for mapping grant tables, etc.
+
+    Note that the presence of the Xen Platform PCI device is generally a
+    pre-requisite for an additional xen-pvdevice as it is the platform
+    device that provides that IO ports necessary for unplugging emulated
+    devices. See hvm-emulated-unplug.markdown for details of the IO ports
+    and unplug protocol.
+
+    libxl provides support for creation of a single additional xen-pvdevice.
+    See the vendor_device parameter in xl.cfg(5).
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:03:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:03: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 1Vo9Iq-0003Ua-Fi; Wed, 04 Dec 2013 10:03:32 +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 1Vo9Io-0003TH-4I
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:30 +0000
Received: from [85.158.143.35:10802] by server-2.bemta-4.messagelabs.com id
	3A/7B-11386-0FDFE925; Wed, 04 Dec 2013 10:03:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386151406!3234712!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20798 invoked from network); 4 Dec 2013 10:03:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:03:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9IZ-0007zo-88
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9IZ-0006U8-5F
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:15 +0000
Date: Wed, 04 Dec 2013 10:03:15 +0000
Message-Id: <E1Vo9IZ-0006U8-5F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Add some words describing
	xen-pvdevice
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5743de0269cfec9ad65ce12dce80745fa7b3b669
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Wed Nov 13 16:09:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 29 10:29:05 2013 +0000

    docs: Add some words describing xen-pvdevice
    
    This patch adds a short description of xen-pvdevice to
    pci-device-reservations.txt, which contains the canonical list
    of device IDs that may be used to create xen-pvdevice instances.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- ran expand to de-tabbify ]
---
 docs/misc/pci-device-reservations.txt |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/docs/misc/pci-device-reservations.txt b/docs/misc/pci-device-reservations.txt
index 19bd9d5..9d6d780 100644
--- a/docs/misc/pci-device-reservations.txt
+++ b/docs/misc/pci-device-reservations.txt
@@ -6,8 +6,8 @@ System (subject to the availability of suitable drivers) to make use of
 paravirtualisation features such as disk and network devices etc.
 
 Some Xen vendors wish to provide alternative and/or additional guest drivers
-that can bind to virtual devices. This may be done using the Xen PCI vendor
-ID of 0x5853 and Xen-vendor/device specific PCI device IDs. This file
+that can bind to virtual devices[1]. This may be done using the Xen PCI
+vendor ID of 0x5853 and Xen-vendor/device specific PCI device IDs. This file
 records reservations made within the device ID range in order to avoid
 multiple Xen vendors using conflicting IDs.
 
@@ -29,3 +29,30 @@ Reservations
 0x0002        | Citrix XenServer (grandfathered allocation for XenServer 6.1)
 0xc000-0xc0ff | Citrix XenServer
 0xc100-0xc1ff | Citrix XenClient
+
+[1] Upstream QEMU provides a parameterized device called xen-pvdevice that
+    can be used to host guest drivers. Execute:
+
+    qemu-system-i386 -device xen-pvdevice,help
+
+    for a list of all parameters. The following parameters are relevant to
+    driver binding:
+
+    vendor-id (default 0x5853):     The PCI vendor ID and subsystem vendor
+                                    ID of the device.
+    device-id (must be specified):  The PCI device ID and subsystem device
+                                    ID of the device.
+    revision (default 0x01):        The PCI revision of the device
+
+    Also the size parameter (default 0x400000) can be used to specify the
+    size of the single MMIO BAR that the device exposes. This area may be
+    used by drivers for mapping grant tables, etc.
+
+    Note that the presence of the Xen Platform PCI device is generally a
+    pre-requisite for an additional xen-pvdevice as it is the platform
+    device that provides that IO ports necessary for unplugging emulated
+    devices. See hvm-emulated-unplug.markdown for details of the IO ports
+    and unplug protocol.
+
+    libxl provides support for creation of a single additional xen-pvdevice.
+    See the vendor_device parameter in xl.cfg(5).
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:03:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:03: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 1Vo9Iy-0003WM-Ik; Wed, 04 Dec 2013 10:03: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 1Vo9Ix-0003Vi-4Y
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:39 +0000
Received: from [85.158.143.35:13033] by server-3.bemta-4.messagelabs.com id
	0C/58-32360-9FDFE925; Wed, 04 Dec 2013 10:03:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1386151415!3218501!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3740 invoked from network); 4 Dec 2013 10:03:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:03: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 1Vo9It-0007zz-Kl
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9It-0006Vd-I9
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:35 +0000
Date: Wed, 04 Dec 2013 10:03:35 +0000
Message-Id: <E1Vo9It-0006Vd-I9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: correct file open success check
	in libxl__device_pci_reset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3928e5ccdb6c3c4e1f5c6f0d61b3d6219a24d009
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:14:57 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 11:56:39 2013 +0000

    libxl: correct file open success check in libxl__device_pci_reset
    
    It could, even if only in theory, be fd 0.
    
    (This is not the same as commit 4b62556b57!)
    
    Coverity-ID: 1055895
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index c8eceb4..095d564 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -979,7 +979,7 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to access pciback path %s", reset);
     reset = libxl__sprintf(gc, "%s/"PCI_BDF"/reset", SYSFS_PCI_DEV, domain, bus, dev, func);
     fd = open(reset, O_WRONLY);
-    if (fd > 0) {
+    if (fd >= 0) {
         rc = write(fd, "1", 1);
         if (rc < 0)
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "write to %s returned %d", reset, 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 Dec 04 10:03:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:03: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 1Vo9Iy-0003WM-Ik; Wed, 04 Dec 2013 10:03: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 1Vo9Ix-0003Vi-4Y
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:39 +0000
Received: from [85.158.143.35:13033] by server-3.bemta-4.messagelabs.com id
	0C/58-32360-9FDFE925; Wed, 04 Dec 2013 10:03:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1386151415!3218501!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3740 invoked from network); 4 Dec 2013 10:03:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:03: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 1Vo9It-0007zz-Kl
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9It-0006Vd-I9
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:35 +0000
Date: Wed, 04 Dec 2013 10:03:35 +0000
Message-Id: <E1Vo9It-0006Vd-I9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: correct file open success check
	in libxl__device_pci_reset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3928e5ccdb6c3c4e1f5c6f0d61b3d6219a24d009
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:14:57 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 11:56:39 2013 +0000

    libxl: correct file open success check in libxl__device_pci_reset
    
    It could, even if only in theory, be fd 0.
    
    (This is not the same as commit 4b62556b57!)
    
    Coverity-ID: 1055895
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index c8eceb4..095d564 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -979,7 +979,7 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to access pciback path %s", reset);
     reset = libxl__sprintf(gc, "%s/"PCI_BDF"/reset", SYSFS_PCI_DEV, domain, bus, dev, func);
     fd = open(reset, O_WRONLY);
-    if (fd > 0) {
+    if (fd >= 0) {
         rc = write(fd, "1", 1);
         if (rc < 0)
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "write to %s returned %d", reset, 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 Dec 04 10:03:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:03: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 1Vo9JA-0003Z9-Lv; Wed, 04 Dec 2013 10:03: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 1Vo9J8-0003YO-43
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:50 +0000
Received: from [85.158.137.68:63694] by server-13.bemta-3.messagelabs.com id
	C3/24-28603-30EFE925; Wed, 04 Dec 2013 10:03:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1386151426!1634311!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5460 invoked from network); 4 Dec 2013 10:03:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:03: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 1Vo9J3-00080E-T5
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9J3-0006W5-QE
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:45 +0000
Date: Wed, 04 Dec 2013 10:03:45 +0000
Message-Id: <E1Vo9J3-0006W5-QE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't leak p in
	libxl__wait_for_backend
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0ca009727b3ea5b17046e0ee990238e9488eab9c
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Mon Dec 2 13:27:27 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 11:59:58 2013 +0000

    libxl: don't leak p in libxl__wait_for_backend
    
    Use libxl__xs_read_checked instead of xs_read. While at it, tidy up the
    function as well.
    
    Coverity-ID: 1055891
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_device.c   |   41 +++++++++++++++++------------------------
 tools/libxl/libxl_internal.h |    3 ++-
 2 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index d995c83..ba7d100 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -1199,37 +1199,30 @@ int libxl__wait_for_device_model_deprecated(libxl__gc *gc,
                                      check_callback, check_callback_userdata);
 }
 
-int libxl__wait_for_backend(libxl__gc *gc, char *be_path, char *state)
+int libxl__wait_for_backend(libxl__gc *gc, const char *be_path,
+                            const char *state)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     int watchdog = 100;
-    unsigned int len;
-    char *p;
-    char *path = GCSPRINTF("%s/state", be_path);
-    int rc = -1;
+    const char *p, *path = GCSPRINTF("%s/state", be_path);
+    int rc;
+
+    while (watchdog-- > 0) {
+        rc = libxl__xs_read_checked(gc, XBT_NULL, path, &p);
+        if (rc) return rc;
 
-    while (watchdog > 0) {
-        p = xs_read(ctx->xsh, XBT_NULL, path, &len);
         if (p == NULL) {
-            if (errno == ENOENT) {
-                LOG(ERROR, "Backend %s does not exist", be_path);
-            } else {
-                LOGE(ERROR, "Failed to access backend %s", be_path);
-            }
-            goto out;
-        } else {
-            if (!strcmp(p, state)) {
-                rc = 0;
-                goto out;
-            } else {
-                usleep(100000);
-                watchdog--;
-            }
+            LOG(ERROR, "Backend %s does not exist", be_path);
+            return ERROR_FAIL;
         }
+
+        if (!strcmp(p, state))
+            return 0;
+
+        usleep(100000);
     }
+
     LOG(ERROR, "Backend %s not ready", be_path);
-out:
-    return rc;
+    return ERROR_FAIL;
 }
 
 /*
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index a2d8247..1bd23ff 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -944,7 +944,8 @@ _hidden char *libxl__device_frontend_path(libxl__gc *gc, libxl__device *device);
 _hidden int libxl__parse_backend_path(libxl__gc *gc, const char *path,
                                       libxl__device *dev);
 _hidden int libxl__device_destroy(libxl__gc *gc, libxl__device *dev);
-_hidden int libxl__wait_for_backend(libxl__gc *gc, char *be_path, char *state);
+_hidden int libxl__wait_for_backend(libxl__gc *gc, const char *be_path,
+                                    const char *state);
 _hidden int libxl__nic_type(libxl__gc *gc, libxl__device *dev,
                             libxl_nic_type *nictype);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:03:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:03: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 1Vo9JA-0003Z9-Lv; Wed, 04 Dec 2013 10:03: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 1Vo9J8-0003YO-43
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:50 +0000
Received: from [85.158.137.68:63694] by server-13.bemta-3.messagelabs.com id
	C3/24-28603-30EFE925; Wed, 04 Dec 2013 10:03:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1386151426!1634311!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5460 invoked from network); 4 Dec 2013 10:03:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:03: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 1Vo9J3-00080E-T5
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9J3-0006W5-QE
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:45 +0000
Date: Wed, 04 Dec 2013 10:03:45 +0000
Message-Id: <E1Vo9J3-0006W5-QE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't leak p in
	libxl__wait_for_backend
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0ca009727b3ea5b17046e0ee990238e9488eab9c
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Mon Dec 2 13:27:27 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 11:59:58 2013 +0000

    libxl: don't leak p in libxl__wait_for_backend
    
    Use libxl__xs_read_checked instead of xs_read. While at it, tidy up the
    function as well.
    
    Coverity-ID: 1055891
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_device.c   |   41 +++++++++++++++++------------------------
 tools/libxl/libxl_internal.h |    3 ++-
 2 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index d995c83..ba7d100 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -1199,37 +1199,30 @@ int libxl__wait_for_device_model_deprecated(libxl__gc *gc,
                                      check_callback, check_callback_userdata);
 }
 
-int libxl__wait_for_backend(libxl__gc *gc, char *be_path, char *state)
+int libxl__wait_for_backend(libxl__gc *gc, const char *be_path,
+                            const char *state)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
     int watchdog = 100;
-    unsigned int len;
-    char *p;
-    char *path = GCSPRINTF("%s/state", be_path);
-    int rc = -1;
+    const char *p, *path = GCSPRINTF("%s/state", be_path);
+    int rc;
+
+    while (watchdog-- > 0) {
+        rc = libxl__xs_read_checked(gc, XBT_NULL, path, &p);
+        if (rc) return rc;
 
-    while (watchdog > 0) {
-        p = xs_read(ctx->xsh, XBT_NULL, path, &len);
         if (p == NULL) {
-            if (errno == ENOENT) {
-                LOG(ERROR, "Backend %s does not exist", be_path);
-            } else {
-                LOGE(ERROR, "Failed to access backend %s", be_path);
-            }
-            goto out;
-        } else {
-            if (!strcmp(p, state)) {
-                rc = 0;
-                goto out;
-            } else {
-                usleep(100000);
-                watchdog--;
-            }
+            LOG(ERROR, "Backend %s does not exist", be_path);
+            return ERROR_FAIL;
         }
+
+        if (!strcmp(p, state))
+            return 0;
+
+        usleep(100000);
     }
+
     LOG(ERROR, "Backend %s not ready", be_path);
-out:
-    return rc;
+    return ERROR_FAIL;
 }
 
 /*
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index a2d8247..1bd23ff 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -944,7 +944,8 @@ _hidden char *libxl__device_frontend_path(libxl__gc *gc, libxl__device *device);
 _hidden int libxl__parse_backend_path(libxl__gc *gc, const char *path,
                                       libxl__device *dev);
 _hidden int libxl__device_destroy(libxl__gc *gc, libxl__device *dev);
-_hidden int libxl__wait_for_backend(libxl__gc *gc, char *be_path, char *state);
+_hidden int libxl__wait_for_backend(libxl__gc *gc, const char *be_path,
+                                    const char *state);
 _hidden int libxl__nic_type(libxl__gc *gc, libxl__device *dev,
                             libxl_nic_type *nictype);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:04:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:04: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 1Vo9JK-0003bF-MT; Wed, 04 Dec 2013 10:04:02 +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 1Vo9JI-0003ad-A7
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:00 +0000
Received: from [193.109.254.147:2337] by server-1.bemta-14.messagelabs.com id
	13/1D-15600-D0EFE925; Wed, 04 Dec 2013 10:03:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1386151436!2772580!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14362 invoked from network); 4 Dec 2013 10:03:57 -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;
	4 Dec 2013 10:03: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 1Vo9JE-00080K-45
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9JE-0006Wg-2E
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:56 +0000
Date: Wed, 04 Dec 2013 10:03:56 +0000
Message-Id: <E1Vo9JE-0006Wg-2E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: remove unsigned less-than-0
	comparison
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ce021b0df555c32f4c18ec2534f8f5b8c88e9066
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:14:59 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 12:01:59 2013 +0000

    libxl: remove unsigned less-than-0 comparison
    
    ...from libxl_cpuid_parse_config_xend. value is unsigned so this doesn't
    work, and either way the following comparison on it being bigger than 3
    does what was intended here anyway.
    
    Coverity-ID: 1055614
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_cpuid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
index e1c406c..dd21b78 100644
--- a/tools/libxl/libxl_cpuid.c
+++ b/tools/libxl/libxl_cpuid.c
@@ -298,7 +298,7 @@ int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
         }
         value = str[1] - 'a';
         endptr = strchr(str, '=');
-        if (value < 0 || value > 3 || endptr == NULL) {
+        if (value > 3 || endptr == NULL) {
             return 4;
         }
         str = endptr + 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 Wed Dec 04 10:04:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:04: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 1Vo9JK-0003bF-MT; Wed, 04 Dec 2013 10:04:02 +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 1Vo9JI-0003ad-A7
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:00 +0000
Received: from [193.109.254.147:2337] by server-1.bemta-14.messagelabs.com id
	13/1D-15600-D0EFE925; Wed, 04 Dec 2013 10:03:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1386151436!2772580!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14362 invoked from network); 4 Dec 2013 10:03:57 -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;
	4 Dec 2013 10:03: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 1Vo9JE-00080K-45
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9JE-0006Wg-2E
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:03:56 +0000
Date: Wed, 04 Dec 2013 10:03:56 +0000
Message-Id: <E1Vo9JE-0006Wg-2E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: remove unsigned less-than-0
	comparison
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ce021b0df555c32f4c18ec2534f8f5b8c88e9066
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:14:59 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 12:01:59 2013 +0000

    libxl: remove unsigned less-than-0 comparison
    
    ...from libxl_cpuid_parse_config_xend. value is unsigned so this doesn't
    work, and either way the following comparison on it being bigger than 3
    does what was intended here anyway.
    
    Coverity-ID: 1055614
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_cpuid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
index e1c406c..dd21b78 100644
--- a/tools/libxl/libxl_cpuid.c
+++ b/tools/libxl/libxl_cpuid.c
@@ -298,7 +298,7 @@ int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
         }
         value = str[1] - 'a';
         endptr = strchr(str, '=');
-        if (value < 0 || value > 3 || endptr == NULL) {
+        if (value > 3 || endptr == NULL) {
             return 4;
         }
         str = endptr + 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 Wed Dec 04 10:04:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:04: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 1Vo9JU-0003dx-Pe; Wed, 04 Dec 2013 10:04: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 1Vo9JS-0003dN-Kx
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:10 +0000
Received: from [85.158.139.211:29727] by server-4.bemta-5.messagelabs.com id
	A2/31-26791-81EFE925; Wed, 04 Dec 2013 10:04:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1386151446!2168220!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23268 invoked from network); 4 Dec 2013 10:04:07 -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;
	4 Dec 2013 10:04: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 1Vo9JO-00080u-Bf
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9JO-0006XF-8I
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:06 +0000
Date: Wed, 04 Dec 2013 10:04:06 +0000
Message-Id: <E1Vo9JO-0006XF-8I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: actually abort if initializing
	a ctx's lock fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1cb2bdde1f2393d75a925e6c15862b93d3e7abd
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:15:00 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 12:02:58 2013 +0000

    libxl: actually abort if initializing a ctx's lock fails
    
    If initializing the ctx's lock fails, don't keep going, but instead
    error out.
    
    Coverity-ID: 1055289
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2b847ef..26eaee4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -74,6 +74,8 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version,
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Failed to initialize mutex");
         free(ctx);
         ctx = 0;
+        rc = ERROR_FAIL;
+        goto out;
     }
 
     /* Now ctx is safe for ctx_free; failures simply set rc and "goto 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 Wed Dec 04 10:04:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:04: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 1Vo9JU-0003dx-Pe; Wed, 04 Dec 2013 10:04: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 1Vo9JS-0003dN-Kx
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:10 +0000
Received: from [85.158.139.211:29727] by server-4.bemta-5.messagelabs.com id
	A2/31-26791-81EFE925; Wed, 04 Dec 2013 10:04:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1386151446!2168220!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23268 invoked from network); 4 Dec 2013 10:04:07 -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;
	4 Dec 2013 10:04: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 1Vo9JO-00080u-Bf
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9JO-0006XF-8I
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:06 +0000
Date: Wed, 04 Dec 2013 10:04:06 +0000
Message-Id: <E1Vo9JO-0006XF-8I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: actually abort if initializing
	a ctx's lock fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1cb2bdde1f2393d75a925e6c15862b93d3e7abd
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:15:00 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 12:02:58 2013 +0000

    libxl: actually abort if initializing a ctx's lock fails
    
    If initializing the ctx's lock fails, don't keep going, but instead
    error out.
    
    Coverity-ID: 1055289
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2b847ef..26eaee4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -74,6 +74,8 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version,
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Failed to initialize mutex");
         free(ctx);
         ctx = 0;
+        rc = ERROR_FAIL;
+        goto out;
     }
 
     /* Now ctx is safe for ctx_free; failures simply set rc and "goto 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 Wed Dec 04 10:04:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:04: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 1Vo9Je-0003gD-T9; Wed, 04 Dec 2013 10:04:22 +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 1Vo9Jc-0003ff-C7
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:21 +0000
Received: from [193.109.254.147:62031] by server-9.bemta-14.messagelabs.com id
	A0/07-13957-22EFE925; Wed, 04 Dec 2013 10:04:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1386151456!2778080!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10270 invoked from network); 4 Dec 2013 10:04:17 -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;
	4 Dec 2013 10:04: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 1Vo9JY-000812-PW
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9JY-0006YC-Fm
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:16 +0000
Date: Wed, 04 Dec 2013 10:04:16 +0000
Message-Id: <E1Vo9JY-0006YC-Fm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't leak output vcpu info on
	error in libxl_list_vcpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c113a57f55dc4e36e3552342721db01efa832c6
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:15:01 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 12:04:23 2013 +0000

    libxl: don't leak output vcpu info on error in libxl_list_vcpu
    
    Coverity-ID: 1055887
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 26eaee4..a57d571 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4544,15 +4544,15 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
     for (*nb_vcpu = 0; *nb_vcpu <= domaininfo.max_vcpu_id; ++*nb_vcpu, ++ptr) {
         if (libxl_cpu_bitmap_alloc(ctx, &ptr->cpumap, 0)) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpumap");
-            return NULL;
+            goto err;
         }
         if (xc_vcpu_getinfo(ctx->xch, domid, *nb_vcpu, &vcpuinfo) == -1) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu info");
-            return NULL;
+            goto err;
         }
         if (xc_vcpu_getaffinity(ctx->xch, domid, *nb_vcpu, ptr->cpumap.map) == -1) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu affinity");
-            return NULL;
+            goto err;
         }
         ptr->vcpuid = *nb_vcpu;
         ptr->cpu = vcpuinfo.cpu;
@@ -4562,6 +4562,10 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
         ptr->vcpu_time = vcpuinfo.cpu_time;
     }
     return ret;
+
+err:
+    free(ret);
+    return NULL;
 }
 
 int libxl_set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid, uint32_t vcpuid,
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:04:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:04: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 1Vo9Je-0003gD-T9; Wed, 04 Dec 2013 10:04:22 +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 1Vo9Jc-0003ff-C7
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:21 +0000
Received: from [193.109.254.147:62031] by server-9.bemta-14.messagelabs.com id
	A0/07-13957-22EFE925; Wed, 04 Dec 2013 10:04:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1386151456!2778080!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10270 invoked from network); 4 Dec 2013 10:04:17 -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;
	4 Dec 2013 10:04: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 1Vo9JY-000812-PW
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9JY-0006YC-Fm
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:16 +0000
Date: Wed, 04 Dec 2013 10:04:16 +0000
Message-Id: <E1Vo9JY-0006YC-Fm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't leak output vcpu info on
	error in libxl_list_vcpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c113a57f55dc4e36e3552342721db01efa832c6
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:15:01 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 12:04:23 2013 +0000

    libxl: don't leak output vcpu info on error in libxl_list_vcpu
    
    Coverity-ID: 1055887
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 26eaee4..a57d571 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4544,15 +4544,15 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
     for (*nb_vcpu = 0; *nb_vcpu <= domaininfo.max_vcpu_id; ++*nb_vcpu, ++ptr) {
         if (libxl_cpu_bitmap_alloc(ctx, &ptr->cpumap, 0)) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpumap");
-            return NULL;
+            goto err;
         }
         if (xc_vcpu_getinfo(ctx->xch, domid, *nb_vcpu, &vcpuinfo) == -1) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu info");
-            return NULL;
+            goto err;
         }
         if (xc_vcpu_getaffinity(ctx->xch, domid, *nb_vcpu, ptr->cpumap.map) == -1) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu affinity");
-            return NULL;
+            goto err;
         }
         ptr->vcpuid = *nb_vcpu;
         ptr->cpu = vcpuinfo.cpu;
@@ -4562,6 +4562,10 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
         ptr->vcpu_time = vcpuinfo.cpu_time;
     }
     return ret;
+
+err:
+    free(ret);
+    return NULL;
 }
 
 int libxl_set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid, uint32_t vcpuid,
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:04:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:04: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 1Vo9Jp-0003ib-0B; Wed, 04 Dec 2013 10:04:33 +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 1Vo9Jm-0003hr-JA
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:30 +0000
Received: from [85.158.143.35:25198] by server-1.bemta-4.messagelabs.com id
	3D/2D-02132-C2EFE925; Wed, 04 Dec 2013 10:04:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1386151467!3261131!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7607 invoked from network); 4 Dec 2013 10:04:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:04: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 1Vo9Ji-000818-VS
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ji-0006YY-TS
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:26 +0000
Date: Wed, 04 Dec 2013 10:04:26 +0000
Message-Id: <E1Vo9Ji-0006YY-TS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't leak pcidevs in
	libxl_pcidev_assignable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26b35b9ace97f433fcf4c5dfbdfb573d1075255f
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:15:03 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 12:09:14 2013 +0000

    libxl: don't leak pcidevs in libxl_pcidev_assignable
    
    Coverity-ID: 1055896
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_pci.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 095d564..2e52470 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -1021,11 +1021,10 @@ static int libxl_pcidev_assignable(libxl_ctx *ctx, libxl_device_pci *pcidev)
             pcidevs[i].bus == pcidev->bus &&
             pcidevs[i].dev == pcidev->dev &&
             pcidevs[i].func == pcidev->func)
-        {
-            return 1;
-        }
+            break;
     }
-    return 0;
+    free(pcidevs);
+    return i != num;
 }
 
 int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, int starting)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:04:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:04: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 1Vo9Jp-0003ib-0B; Wed, 04 Dec 2013 10:04:33 +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 1Vo9Jm-0003hr-JA
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:30 +0000
Received: from [85.158.143.35:25198] by server-1.bemta-4.messagelabs.com id
	3D/2D-02132-C2EFE925; Wed, 04 Dec 2013 10:04:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1386151467!3261131!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7607 invoked from network); 4 Dec 2013 10:04:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:04: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 1Vo9Ji-000818-VS
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ji-0006YY-TS
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:26 +0000
Date: Wed, 04 Dec 2013 10:04:26 +0000
Message-Id: <E1Vo9Ji-0006YY-TS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't leak pcidevs in
	libxl_pcidev_assignable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26b35b9ace97f433fcf4c5dfbdfb573d1075255f
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:15:03 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 2 12:09:14 2013 +0000

    libxl: don't leak pcidevs in libxl_pcidev_assignable
    
    Coverity-ID: 1055896
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_pci.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 095d564..2e52470 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -1021,11 +1021,10 @@ static int libxl_pcidev_assignable(libxl_ctx *ctx, libxl_device_pci *pcidev)
             pcidevs[i].bus == pcidev->bus &&
             pcidevs[i].dev == pcidev->dev &&
             pcidevs[i].func == pcidev->func)
-        {
-            return 1;
-        }
+            break;
     }
-    return 0;
+    free(pcidevs);
+    return i != num;
 }
 
 int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, int starting)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:04:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:04: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 1Vo9K4-0003lg-3d; Wed, 04 Dec 2013 10:04:48 +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 1Vo9K0-0003kc-1o
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:46 +0000
Received: from [193.109.254.147:27860] by server-8.bemta-14.messagelabs.com id
	23/1A-30921-93EFE925; Wed, 04 Dec 2013 10:04:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386151477!2728858!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=MAILTO_TO_SPAM_ADDR,
	UPPERCASE_50_75
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31787 invoked from network); 4 Dec 2013 10:04:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:04: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 1Vo9Jt-00081G-AU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Jt-0006Yv-46
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:37 +0000
Date: Wed, 04 Dec 2013 10:04:37 +0000
Message-Id: <E1Vo9Jt-0006Yv-46@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/build: Use a distro version of
	figlet
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b47bcdb6d3830f05e3b9d686326ef0ba45b9915
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Nov 22 21:08:00 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 2 13:46:44 2013 +0000

    xen/build: Use a distro version of figlet
    
    It is quite inappropriate to keep a hacked up versions of figlet in our source
    tree, especially when the purpose of the hackary is just to provide a text to
    octal conversion.
    
    This version of figlet contributes a surprisingly large proportion of the
    Coverity issues found under xen/ (and therefore attributed against Xen)
    
    Figlet can be found in all distros, so make use of it.  We keep xen.flf (being
    the Xen figlet font) and replace the hacked up octal transform with a short
    python script.
    
    The Xen Makefile has been tweaked in such a way that it still prints the
    figlet banner for the build.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 .gitignore               |    3 +-
 README                   |    1 +
 xen/Makefile             |   16 +-
 xen/tools/Makefile       |    2 -
 xen/tools/fig-to-oct.py  |   18 +
 xen/tools/figlet/xen.flf | 2230 ----------------------------------------------
 xen/tools/xen.flf        | 2230 ++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 2259 insertions(+), 2241 deletions(-)

diff --git a/.gitignore b/.gitignore
index f88e431..47f92a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -292,7 +292,7 @@ tools/xm-test/lib/XmTestLib/config.py
 tools/xm-test/lib/XmTestReport/xmtest.py
 tools/xm-test/tests/*.test
 tools/ocaml-xenstored*
-xen/.banner*
+xen/.banner
 xen/System.map
 xen/arch/arm/asm-offsets.s
 xen/arch/arm/xen.lds
@@ -315,7 +315,6 @@ xen/include/linux
 xen/include/public/public
 xen/include/xen/*.new
 xen/include/xen/acm_policy.h
-xen/include/xen/banner.h
 xen/include/xen/compile.h
 xen/tools/figlet/figlet
 xen/tools/symbols
diff --git a/README b/README
index 8689ce1..4148a26 100644
--- a/README
+++ b/README
@@ -71,6 +71,7 @@ disabled at compile time:
       includes the alternative ocaml xenstored.
     * cmake (if building vtpm stub domains)
     * markdown
+    * figlet (for generating the traditional Xen start of day banner)
 
 Second, you need to acquire a suitable kernel for use in domain 0. If
 possible you should use a kernel provided by your OS distributor. If
diff --git a/xen/Makefile b/xen/Makefile
index 597972d..1ea2717 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -86,7 +86,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
 	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET)-syms *~ core
 	rm -f include/asm-*/asm-offsets.h
-	[ -d tools/figlet ] && rm -f .banner*
+	rm -f .banner
 
 .PHONY: _distclean
 _distclean: clean
@@ -114,10 +114,12 @@ delete-unfresh-files:
 	fi
 
 .banner: Makefile
-	$(MAKE) -C tools
-	@tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) 2>$@2 >$@1
-	@cat $@1 $@2 >$@
-	@rm -f $@1 $@2
+	@if which figlet >/dev/null 2>&1 ; then \
+		echo " Xen $(XEN_FULLVERSION)" | figlet -f tools/xen.flf > $@.tmp; \
+	else \
+		echo " Xen $(XEN_FULLVERSION)" > $@.tmp; \
+	fi
+	@mv -f $@.tmp $@
 
 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
 include/xen/compile.h: include/xen/compile.h.in .banner
@@ -132,8 +134,8 @@ include/xen/compile.h: include/xen/compile.h.in .banner
 	    -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
 	    -e 's!@@changeset@@!$(shell tools/scmversion $(XEN_ROOT) || echo "unavailable")!g' \
 	    < include/xen/compile.h.in > $@.new
-	@grep \" .banner >> $@.new
-	@grep -v \" .banner
+	@cat .banner
+	@$(PYTHON) tools/fig-to-oct.py < .banner >> $@.new
 	@mv -f $@.new $@
 
 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
diff --git a/xen/tools/Makefile b/xen/tools/Makefile
index 612e36d..e940939 100644
--- a/xen/tools/Makefile
+++ b/xen/tools/Makefile
@@ -3,12 +3,10 @@ include $(XEN_ROOT)/Config.mk
 
 .PHONY: default
 default:
-	[ -d figlet ] && $(MAKE) -C figlet
 	$(MAKE) symbols
 
 .PHONY: clean
 clean:
-	[ -d figlet ] && $(MAKE) -C figlet clean
 	rm -f *.o symbols
 
 symbols: symbols.c
diff --git a/xen/tools/fig-to-oct.py b/xen/tools/fig-to-oct.py
new file mode 100644
index 0000000..db4fd32
--- /dev/null
+++ b/xen/tools/fig-to-oct.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+import sys
+
+chars_per_line = 18
+chars_so_far = 0
+
+sys.stdout.write('"')
+
+for char in sys.stdin.read():
+
+    sys.stdout.write("\\%03o" % ord(char))
+    chars_so_far = chars_so_far + 1
+
+    if chars_so_far == chars_per_line:
+        chars_so_far = 0
+        sys.stdout.write('" \\\n"')
+
+sys.stdout.write('"\n')
diff --git a/xen/tools/figlet/xen.flf b/xen/tools/figlet/xen.flf
deleted file mode 100644
index e13e842..0000000
--- a/xen/tools/figlet/xen.flf
+++ /dev/null
@@ -1,2230 +0,0 @@
-flf2a$ 6 5 16 15 14 0 24463 229
-Standard by Glenn Chappell & Ian Chai 3/93 -- based on Frank's .sig
-Includes ISO Latin-1
-figlet release 2.1 -- 12 Aug 1994
-Modified for figlet 2.2 by John Cowan <cowan@ccil.org>
-  to add Latin-{2,3,4,5} support (Unicode U+0100-017F).
-Permission is hereby given to modify this font, as long as the
-modifier's name is placed on a comment line.
-
-Modified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter
-supported by FIGlet and FIGWin.  May also be slightly modified for better use
-of new full-width/kern/smush alternatives, but default output is NOT changed.
-
-Modified by Keir Fraser <kaf24@cl.cam.ac.uk> for Xen build system.
-
- $@
- $@
- $@
- $@
- $@
- $@@
-  _ @
- | |@
- | |@
- |_|@
- (_)@
-    @@
-  _ _ @
- ( | )@
-  V V @
-   $  @
-   $  @
-      @@
-    _  _   @
-  _| || |_ @
- |_  ..  _|@
- |_      _|@
-   |_||_|  @
-           @@
-   _  @
-  | | @
- / __)@
- \__ \@
- (   /@
-  |_| @@
-  _  __@
- (_)/ /@
-   / / @
-  / /_ @
- /_/(_)@
-       @@
-   ___   @
-  ( _ )  @
-  / _ \/\@
- | (_>  <@
-  \___/\/@
-         @@
-  _ @
- ( )@
- |/ @
-  $ @
-  $ @
-    @@
-   __@
-  / /@
- | | @
- | | @
- | | @
-  \_\@@
- __  @
- \ \ @
-  | |@
-  | |@
-  | |@
- /_/ @@
-       @
- __/\__@
- \    /@
- /_  _\@
-   \/  @
-       @@
-        @
-    _   @
-  _| |_ @
- |_   _|@
-   |_|  @
-        @@
-    @
-    @
-    @
-  _ @
- ( )@
- |/ @@
-     @
-     @
-  __ @
- |__|@
-  $  @
-     @@
-    @
-    @
-    @
-  _ @
- (_)@
-    @@
-     __@
-    / /@
-   / / @
-  / /  @
- /_/   @
-       @@
-   ___  @
-  / _ \ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-  _ @
- / |@
- | |@
- | |@
- |_|@
-    @@
-  ____  @
- |___ \ @
-   __) |@
-  / __/ @
- |_____|@
-        @@
-  _____ @
- |___ / @
-   |_ \ @
-  ___) |@
- |____/ @
-        @@
-  _  _   @
- | || |  @
- | || |_ @
- |__   _|@
-    |_|  @
-         @@
-  ____  @
- | ___| @
- |___ \ @
-  ___) |@
- |____/ @
-        @@
-   __   @
-  / /_  @
- | '_ \ @
- | (_) |@
-  \___/ @
-        @@
-  _____ @
- |___  |@
-    / / @
-   / /  @
-  /_/   @
-        @@
-   ___  @
-  ( _ ) @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-   ___  @
-  / _ \ @
- | (_) |@
-  \__, |@
-    /_/ @
-        @@
-    @
-  _ @
- (_)@
-  _ @
- (_)@
-    @@
-    @
-  _ @
- (_)@
-  _ @
- ( )@
- |/ @@
-   __@
-  / /@
- / / @
- \ \ @
-  \_\@
-     @@
-        @
-  _____ @
- |_____|@
- |_____|@
-    $   @
-        @@
- __  @
- \ \ @
-  \ \@
-  / /@
- /_/ @
-     @@
-  ___ @
- |__ \@
-   / /@
-  |_| @
-  (_) @
-      @@
-    ____  @
-   / __ \ @
-  / / _` |@
- | | (_| |@
-  \ \__,_|@
-   \____/ @@
-     _    @
-    / \   @
-   / _ \  @
-  / ___ \ @
- /_/   \_\@
-          @@
-  ____  @
- | __ ) @
- |  _ \ @
- | |_) |@
- |____/ @
-        @@
-   ____ @
-  / ___|@
- | |    @
- | |___ @
-  \____|@
-        @@
-  ____  @
- |  _ \ @
- | | | |@
- | |_| |@
- |____/ @
-        @@
-  _____ @
- | ____|@
- |  _|  @
- | |___ @
- |_____|@
-        @@
-  _____ @
- |  ___|@
- | |_   @
- |  _|  @
- |_|    @
-        @@
-   ____ @
-  / ___|@
- | |  _ @
- | |_| |@
-  \____|@
-        @@
-  _   _ @
- | | | |@
- | |_| |@
- |  _  |@
- |_| |_|@
-        @@
-  ___ @
- |_ _|@
-  | | @
-  | | @
- |___|@
-      @@
-      _ @
-     | |@
-  _  | |@
- | |_| |@
-  \___/ @
-        @@
-  _  __@
- | |/ /@
- | ' / @
- | . \ @
- |_|\_\@
-       @@
-  _     @
- | |    @
- | |    @
- | |___ @
- |_____|@
-        @@
-  __  __ @
- |  \/  |@
- | |\/| |@
- | |  | |@
- |_|  |_|@
-         @@
-  _   _ @
- | \ | |@
- |  \| |@
- | |\  |@
- |_| \_|@
-        @@
-   ___  @
-  / _ \ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-  ____  @
- |  _ \ @
- | |_) |@
- |  __/ @
- |_|    @
-        @@
-   ___  @
-  / _ \ @
- | | | |@
- | |_| |@
-  \__\_\@
-        @@
-  ____  @
- |  _ \ @
- | |_) |@
- |  _ < @
- |_| \_\@
-        @@
-  ____  @
- / ___| @
- \___ \ @
-  ___) |@
- |____/ @
-        @@
-  _____ @
- |_   _|@
-   | |  @
-   | |  @
-   |_|  @
-        @@
-  _   _ @
- | | | |@
- | | | |@
- | |_| |@
-  \___/ @
-        @@
- __     __@
- \ \   / /@
-  \ \ / / @
-   \ V /  @
-    \_/   @
-          @@
- __        __@
- \ \      / /@
-  \ \ /\ / / @
-   \ V  V /  @
-    \_/\_/   @
-             @@
- __  __@
- \ \/ /@
-  \  / @
-  /  \ @
- /_/\_\@
-       @@
- __   __@
- \ \ / /@
-  \ V / @
-   | |  @
-   |_|  @
-        @@
-  _____@
- |__  /@
-   / / @
-  / /_ @
- /____|@
-       @@
-  __ @
- | _|@
- | | @
- | | @
- | | @
- |__|@@
- __    @
- \ \   @
-  \ \  @
-   \ \ @
-    \_\@
-       @@
-  __ @
- |_ |@
-  | |@
-  | |@
-  | |@
- |__|@@
-  /\ @
- |/\|@
-   $ @
-   $ @
-   $ @
-     @@
-        @
-        @
-        @
-        @
-  _____ @
- |_____|@@
-  _ @
- ( )@
-  \|@
-  $ @
-  $ @
-    @@
-        @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-  _     @
- | |__  @
- | '_ \ @
- | |_) |@
- |_.__/ @
-        @@
-       @
-   ___ @
-  / __|@
- | (__ @
-  \___|@
-       @@
-      _ @
-   __| |@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-       @
-   ___ @
-  / _ \@
- |  __/@
-  \___|@
-       @@
-   __ @
-  / _|@
- | |_ @
- |  _|@
- |_|  @
-      @@
-        @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__, |@
-  |___/ @@
-  _     @
- | |__  @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-  _ @
- (_)@
- | |@
- | |@
- |_|@
-    @@
-    _ @
-   (_)@
-   | |@
-   | |@
-  _/ |@
- |__/ @@
-  _    @
- | | __@
- | |/ /@
- |   < @
- |_|\_\@
-       @@
-  _ @
- | |@
- | |@
- | |@
- |_|@
-    @@
-            @
-  _ __ ___  @
- | '_ ` _ \ @
- | | | | | |@
- |_| |_| |_|@
-            @@
-        @
-  _ __  @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-        @
-   ___  @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-        @
-  _ __  @
- | '_ \ @
- | |_) |@
- | .__/ @
- |_|    @@
-        @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__, |@
-     |_|@@
-       @
-  _ __ @
- | '__|@
- | |   @
- |_|   @
-       @@
-      @
-  ___ @
- / __|@
- \__ \@
- |___/@
-      @@
-  _   @
- | |_ @
- | __|@
- | |_ @
-  \__|@
-      @@
-        @
-  _   _ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-        @
- __   __@
- \ \ / /@
-  \ V / @
-   \_/  @
-        @@
-           @
- __      __@
- \ \ /\ / /@
-  \ V  V / @
-   \_/\_/  @
-           @@
-       @
- __  __@
- \ \/ /@
-  >  < @
- /_/\_\@
-       @@
-        @
-  _   _ @
- | | | |@
- | |_| |@
-  \__, |@
-  |___/ @@
-      @
-  ____@
- |_  /@
-  / / @
- /___|@
-      @@
-    __@
-   / /@
-  | | @
- < <  @
-  | | @
-   \_\@@
-  _ @
- | |@
- | |@
- | |@
- | |@
- |_|@@
- __   @
- \ \  @
-  | | @
-   > >@
-  | | @
- /_/  @@
-  /\/|@
- |/\/ @
-   $  @
-   $  @
-   $  @
-      @@
-  _   _ @
- (_)_(_)@
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-  _   _ @
- (_)_(_)@
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-  _   _ @
- (_) (_)@
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-  _   _ @
- (_)_(_)@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-  _   _ @
- (_)_(_)@
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-  _   _ @
- (_) (_)@
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-   ___ @
-  / _ \@
- | |/ /@
- | |\ \@
- | ||_/@
- |_|   @@
-160  NO-BREAK SPACE
- $@
- $@
- $@
- $@
- $@
- $@@
-161  INVERTED EXCLAMATION MARK
-  _ @
- (_)@
- | |@
- | |@
- |_|@
-    @@
-162  CENT SIGN
-    _  @
-   | | @
-  / __)@
- | (__ @
-  \   )@
-   |_| @@
-163  POUND SIGN
-    ___  @
-   / ,_\ @
- _| |_   @
-  | |___ @
- (_,____|@
-         @@
-164  CURRENCY SIGN
- /\___/\@
- \  _  /@
- | (_) |@
- / ___ \@
- \/   \/@
-        @@
-165  YEN SIGN
-  __ __ @
-  \ V / @
- |__ __|@
- |__ __|@
-   |_|  @
-        @@
-166  BROKEN BAR
-  _ @
- | |@
- |_|@
-  _ @
- | |@
- |_|@@
-167  SECTION SIGN
-    __ @
-  _/ _)@
- / \ \ @
- \ \\ \@
-  \ \_/@
- (__/  @@
-168  DIAERESIS
-  _   _ @
- (_) (_)@
-  $   $ @
-  $   $ @
-  $   $ @
-        @@
-169  COPYRIGHT SIGN
-    _____   @
-   / ___ \  @
-  / / __| \ @
- | | (__   |@
-  \ \___| / @
-   \_____/  @@
-170  FEMININE ORDINAL INDICATOR
-  __ _ @
- / _` |@
- \__,_|@
- |____|@
-    $  @
-       @@
-171  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
-   ____@
-  / / /@
- / / / @
- \ \ \ @
-  \_\_\@
-       @@
-172  NOT SIGN
-        @
-  _____ @
- |___  |@
-     |_|@
-    $   @
-        @@
-173  SOFT HYPHEN
-       @
-       @
-  ____ @
- |____|@
-    $  @
-       @@
-174  REGISTERED SIGN
-    _____   @
-   / ___ \  @
-  / | _ \ \ @
- |  |   /  |@
-  \ |_|_\ / @
-   \_____/  @@
-175  MACRON
-  _____ @
- |_____|@
-    $   @
-    $   @
-    $   @
-        @@
-176  DEGREE SIGN
-   __  @
-  /  \ @
- | () |@
-  \__/ @
-    $  @
-       @@
-177  PLUS-MINUS SIGN
-    _   @
-  _| |_ @
- |_   _|@
-  _|_|_ @
- |_____|@
-        @@
-178  SUPERSCRIPT TWO
-  ___ @
- |_  )@
-  / / @
- /___|@
-   $  @
-      @@
-179  SUPERSCRIPT THREE
-  ____@
- |__ /@
-  |_ \@
- |___/@
-   $  @
-      @@
-180  ACUTE ACCENT
-  __@
- /_/@
-  $ @
-  $ @
-  $ @
-    @@
-181  MICRO SIGN
-        @
-  _   _ @
- | | | |@
- | |_| |@
- | ._,_|@
- |_|    @@
-182  PILCROW SIGN
-   _____ @
-  /     |@
- | (| | |@
-  \__ | |@
-    |_|_|@
-         @@
-183  MIDDLE DOT
-    @
-  _ @
- (_)@
-  $ @
-  $ @
-    @@
-184  CEDILLA
-    @
-    @
-    @
-    @
-  _ @
- )_)@@
-185  SUPERSCRIPT ONE
-  _ @
- / |@
- | |@
- |_|@
-  $ @
-    @@
-186  MASCULINE ORDINAL INDICATOR
-  ___ @
- / _ \@
- \___/@
- |___|@
-   $  @
-      @@
-187  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
- ____  @
- \ \ \ @
-  \ \ \@
-  / / /@
- /_/_/ @
-       @@
-188  VULGAR FRACTION ONE QUARTER
-  _   __    @
- / | / / _  @
- | |/ / | | @
- |_/ /|_  _|@
-  /_/   |_| @
-            @@
-189  VULGAR FRACTION ONE HALF
-  _   __   @
- / | / /__ @
- | |/ /_  )@
- |_/ / / / @
-  /_/ /___|@
-           @@
-190  VULGAR FRACTION THREE QUARTERS
-  ____  __    @
- |__ / / / _  @
-  |_ \/ / | | @
- |___/ /|_  _|@
-    /_/   |_| @
-              @@
-191  INVERTED QUESTION MARK
-   _  @
-  (_) @
-  | | @
- / /_ @
- \___|@
-      @@
-192  LATIN CAPITAL LETTER A WITH GRAVE
-   __   @
-   \_\  @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-193  LATIN CAPITAL LETTER A WITH ACUTE
-    __  @
-   /_/  @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-194  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
-   //\  @
-  |/_\| @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-195  LATIN CAPITAL LETTER A WITH TILDE
-   /\/| @
-  |/\/  @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-196  LATIN CAPITAL LETTER A WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-197  LATIN CAPITAL LETTER A WITH RING ABOVE
-    _   @
-   (o)  @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-198  LATIN CAPITAL LETTER AE
-     ______ @
-    /  ____|@
-   / _  _|  @
-  / __ |___ @
- /_/ |_____|@
-            @@
-199  LATIN CAPITAL LETTER C WITH CEDILLA
-   ____ @
-  / ___|@
- | |    @
- | |___ @
-  \____|@
-    )_) @@
-200  LATIN CAPITAL LETTER E WITH GRAVE
-   __   @
-  _\_\_ @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-201  LATIN CAPITAL LETTER E WITH ACUTE
-    __  @
-  _/_/_ @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-202  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
-   //\  @
-  |/_\| @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-203  LATIN CAPITAL LETTER E WITH DIAERESIS
-  _   _ @
- (_)_(_)@
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-204  LATIN CAPITAL LETTER I WITH GRAVE
-  __  @
-  \_\ @
- |_ _|@
-  | | @
- |___|@
-      @@
-205  LATIN CAPITAL LETTER I WITH ACUTE
-   __ @
-  /_/ @
- |_ _|@
-  | | @
- |___|@
-      @@
-206  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
-  //\ @
- |/_\|@
- |_ _|@
-  | | @
- |___|@
-      @@
-207  LATIN CAPITAL LETTER I WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-  |_ _| @
-   | |  @
-  |___| @
-        @@
-208  LATIN CAPITAL LETTER ETH
-    ____  @
-   |  _ \ @
-  _| |_| |@
- |__ __| |@
-   |____/ @
-          @@
-209  LATIN CAPITAL LETTER N WITH TILDE
-   /\/|@
-  |/\/ @
- | \| |@
- | .` |@
- |_|\_|@
-       @@
-210  LATIN CAPITAL LETTER O WITH GRAVE
-   __   @
-   \_\  @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-211  LATIN CAPITAL LETTER O WITH ACUTE
-    __  @
-   /_/  @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-212  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
-   //\  @
-  |/_\| @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-213  LATIN CAPITAL LETTER O WITH TILDE
-   /\/| @
-  |/\/  @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-214  LATIN CAPITAL LETTER O WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-215  MULTIPLICATION SIGN
-     @
-     @
- /\/\@
- >  <@
- \/\/@
-     @@
-216  LATIN CAPITAL LETTER O WITH STROKE
-   ____ @
-  / _// @
- | |// |@
- | //| |@
-  //__/ @
-        @@
-217  LATIN CAPITAL LETTER U WITH GRAVE
-   __   @
-  _\_\_ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-218  LATIN CAPITAL LETTER U WITH ACUTE
-    __  @
-  _/_/_ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-219  LATIN CAPITAL LETTER U WITH CIRCUMFLEX
-   //\  @
-  |/ \| @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-220  LATIN CAPITAL LETTER U WITH DIAERESIS
-  _   _ @
- (_) (_)@
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-221  LATIN CAPITAL LETTER Y WITH ACUTE
-    __  @
- __/_/__@
- \ \ / /@
-  \ V / @
-   |_|  @
-        @@
-222  LATIN CAPITAL LETTER THORN
-  _     @
- | |___ @
- |  __ \@
- |  ___/@
- |_|    @
-        @@
-223  LATIN SMALL LETTER SHARP S
-   ___ @
-  / _ \@
- | |/ /@
- | |\ \@
- | ||_/@
- |_|   @@
-224  LATIN SMALL LETTER A WITH GRAVE
-   __   @
-   \_\_ @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-225  LATIN SMALL LETTER A WITH ACUTE
-    __  @
-   /_/_ @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-226  LATIN SMALL LETTER A WITH CIRCUMFLEX
-   //\  @
-  |/_\| @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-227  LATIN SMALL LETTER A WITH TILDE
-   /\/| @
-  |/\/_ @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-228  LATIN SMALL LETTER A WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-229  LATIN SMALL LETTER A WITH RING ABOVE
-    __  @
-   (()) @
-  / _ '|@
- | (_| |@
-  \__,_|@
-        @@
-230  LATIN SMALL LETTER AE
-           @
-   __ ____ @
-  / _`  _ \@
- | (_|  __/@
-  \__,____|@
-           @@
-231  LATIN SMALL LETTER C WITH CEDILLA
-       @
-   ___ @
-  / __|@
- | (__ @
-  \___|@
-   )_) @@
-232  LATIN SMALL LETTER E WITH GRAVE
-   __  @
-   \_\ @
-  / _ \@
- |  __/@
-  \___|@
-       @@
-233  LATIN SMALL LETTER E WITH ACUTE
-    __ @
-   /_/ @
-  / _ \@
- |  __/@
-  \___|@
-       @@
-234  LATIN SMALL LETTER E WITH CIRCUMFLEX
-   //\ @
-  |/_\|@
-  / _ \@
- |  __/@
-  \___|@
-       @@
-235  LATIN SMALL LETTER E WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-  / _ \ @
- |  __/ @
-  \___| @
-        @@
-236  LATIN SMALL LETTER I WITH GRAVE
- __ @
- \_\@
- | |@
- | |@
- |_|@
-    @@
-237  LATIN SMALL LETTER I WITH ACUTE
-  __@
- /_/@
- | |@
- | |@
- |_|@
-    @@
-238  LATIN SMALL LETTER I WITH CIRCUMFLEX
-  //\ @
- |/_\|@
-  | | @
-  | | @
-  |_| @
-      @@
-239  LATIN SMALL LETTER I WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-   | |  @
-   | |  @
-   |_|  @
-        @@
-240  LATIN SMALL LETTER ETH
-   /\/\ @
-   >  < @
-  _\/\ |@
- / __` |@
- \____/ @
-        @@
-241  LATIN SMALL LETTER N WITH TILDE
-   /\/| @
-  |/\/  @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-242  LATIN SMALL LETTER O WITH GRAVE
-   __   @
-   \_\  @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-243  LATIN SMALL LETTER O WITH ACUTE
-    __  @
-   /_/  @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-244  LATIN SMALL LETTER O WITH CIRCUMFLEX
-   //\  @
-  |/_\| @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-245  LATIN SMALL LETTER O WITH TILDE
-   /\/| @
-  |/\/  @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-246  LATIN SMALL LETTER O WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-247  DIVISION SIGN
-        @
-    _   @
-  _(_)_ @
- |_____|@
-   (_)  @
-        @@
-248  LATIN SMALL LETTER O WITH STROKE
-         @
-   ____  @
-  / _//\ @
- | (//) |@
-  \//__/ @
-         @@
-249  LATIN SMALL LETTER U WITH GRAVE
-   __   @
-  _\_\_ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-250  LATIN SMALL LETTER U WITH ACUTE
-    __  @
-  _/_/_ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-251  LATIN SMALL LETTER U WITH CIRCUMFLEX
-   //\  @
-  |/ \| @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-252  LATIN SMALL LETTER U WITH DIAERESIS
-  _   _ @
- (_) (_)@
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-253  LATIN SMALL LETTER Y WITH ACUTE
-    __  @
-  _/_/_ @
- | | | |@
- | |_| |@
-  \__, |@
-  |___/ @@
-254  LATIN SMALL LETTER THORN
-  _     @
- | |__  @
- | '_ \ @
- | |_) |@
- | .__/ @
- |_|    @@
-255  LATIN SMALL LETTER Y WITH DIAERESIS
-  _   _ @
- (_) (_)@
- | | | |@
- | |_| |@
-  \__, |@
-  |___/ @@
-0x0100  LATIN CAPITAL LETTER A WITH MACRON
-   ____ @
-  /___/ @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-0x0101  LATIN SMALL LETTER A WITH MACRON
-    ___ @
-   /_ _/@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-0x0102  LATIN CAPITAL LETTER A WITH BREVE
-  _   _ @
-  \\_// @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-0x0103  LATIN SMALL LETTER A WITH BREVE
-   \_/  @
-   ___  @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-0x0104  LATIN CAPITAL LETTER A WITH OGONEK
-        @
-    _   @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-     (_(@@
-0x0105  LATIN SMALL LETTER A WITH OGONEK
-        @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__,_|@
-     (_(@@
-0x0106  LATIN CAPITAL LETTER C WITH ACUTE
-     __ @
-   _/_/ @
-  / ___|@
- | |___ @
-  \____|@
-        @@
-0x0107  LATIN SMALL LETTER C WITH ACUTE
-    __ @
-   /__/@
-  / __|@
- | (__ @
-  \___|@
-       @@
-0x0108  LATIN CAPITAL LETTER C WITH CIRCUMFLEX
-     /\ @
-   _//\\@
-  / ___|@
- | |___ @
-  \____|@
-        @@
-0x0109  LATIN SMALL LETTER C WITH CIRCUMFLEX
-    /\ @
-   /_\ @
-  / __|@
- | (__ @
-  \___|@
-       @@
-0x010A  LATIN CAPITAL LETTER C WITH DOT ABOVE
-    []  @
-   ____ @
-  / ___|@
- | |___ @
-  \____|@
-        @@
-0x010B  LATIN SMALL LETTER C WITH DOT ABOVE
-   []  @
-   ___ @
-  / __|@
- | (__ @
-  \___|@
-       @@
-0x010C  LATIN CAPITAL LETTER C WITH CARON
-   \\// @
-   _\/_ @
-  / ___|@
- | |___ @
-  \____|@
-        @@
-0x010D  LATIN SMALL LETTER C WITH CARON
-   \\//@
-   _\/ @
-  / __|@
- | (__ @
-  \___|@
-       @@
-0x010E  LATIN CAPITAL LETTER D WITH CARON
-   \\// @
-  __\/  @
- |  _ \ @
- | |_| |@
- |____/ @
-        @@
-0x010F  LATIN SMALL LETTER D WITH CARON
-  \/  _ @
-   __| |@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-0x0110  LATIN CAPITAL LETTER D WITH STROKE
-   ____   @
-  |_ __ \ @
- /| |/ | |@
- /|_|/_| |@
-  |_____/ @
-          @@
-0x0111  LATIN SMALL LETTER D WITH STROKE
-    ---|@
-   __| |@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-0x0112  LATIN CAPITAL LETTER E WITH MACRON
-   ____ @
-  /___/ @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-0x0113  LATIN SMALL LETTER E WITH MACRON
-    ____@
-   /_ _/@
-  / _ \ @
- |  __/ @
-  \___| @
-        @@
-0x0114  LATIN CAPITAL LETTER E WITH BREVE
-  _   _ @
-  \\_// @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-0x0115  LATIN SMALL LETTER E WITH BREVE
-  \\  //@
-    --  @
-  / _ \ @
- |  __/ @
-  \___| @
-        @@
-0x0116  LATIN CAPITAL LETTER E WITH DOT ABOVE
-    []  @
-  _____ @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-0x0117  LATIN SMALL LETTER E WITH DOT ABOVE
-    [] @
-    __ @
-  / _ \@
- |  __/@
-  \___|@
-       @@
-0x0118  LATIN CAPITAL LETTER E WITH OGONEK
-        @
-  _____ @
- | ____|@
- |  _|_ @
- |_____|@
-    (__(@@
-0x0119  LATIN SMALL LETTER E WITH OGONEK
-       @
-   ___ @
-  / _ \@
- |  __/@
-  \___|@
-    (_(@@
-0x011A  LATIN CAPITAL LETTER E WITH CARON
-   \\// @
-  __\/_ @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-0x011B  LATIN SMALL LETTER E WITH CARON
-   \\//@
-    \/ @
-  / _ \@
- |  __/@
-  \___|@
-       @@
-0x011C  LATIN CAPITAL LETTER G WITH CIRCUMFLEX
-   _/\_ @
-  / ___|@
- | |  _ @
- | |_| |@
-  \____|@
-        @@
-0x011D  LATIN SMALL LETTER G WITH CIRCUMFLEX
-     /\ @
-   _/_ \@
-  / _` |@
- | (_| |@
-  \__, |@
-  |___/ @@
-0x011E  LATIN CAPITAL LETTER G WITH BREVE
-   _\/_ @
-  / ___|@
- | |  _ @
- | |_| |@
-  \____|@
-        @@
-0x011F  LATIN SMALL LETTER G WITH BREVE
-  \___/ @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__, |@
-  |___/ @@
-0x0120  LATIN CAPITAL LETTER G WITH DOT ABOVE
-   _[]_ @
-  / ___|@
- | |  _ @
- | |_| |@
-  \____|@
-        @@
-0x0121  LATIN SMALL LETTER G WITH DOT ABOVE
-   []   @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__, |@
-  |___/ @@
-0x0122  LATIN CAPITAL LETTER G WITH CEDILLA
-   ____ @
-  / ___|@
- | |  _ @
- | |_| |@
-  \____|@
-   )__) @@
-0x0123  LATIN SMALL LETTER G WITH CEDILLA
-        @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__, |@
-  |_))))@@
-0x0124  LATIN CAPITAL LETTER H WITH CIRCUMFLEX
-  _/ \_ @
- | / \ |@
- | |_| |@
- |  _  |@
- |_| |_|@
-        @@
-0x0125  LATIN SMALL LETTER H WITH CIRCUMFLEX
-  _  /\ @
- | |//\ @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-0x0126  LATIN CAPITAL LETTER H WITH STROKE
-  _   _ @
- | |=| |@
- | |_| |@
- |  _  |@
- |_| |_|@
-        @@
-0x0127  LATIN SMALL LETTER H WITH STROKE
-  _     @
- |=|__  @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-0x0128  LATIN CAPITAL LETTER I WITH TILDE
-  /\//@
- |_ _|@
-  | | @
-  | | @
- |___|@
-      @@
-0x0129  LATIN SMALL LETTER I WITH TILDE
-    @
- /\/@
- | |@
- | |@
- |_|@
-    @@
-0x012A  LATIN CAPITAL LETTER I WITH MACRON
- /___/@
- |_ _|@
-  | | @
-  | | @
- |___|@
-      @@
-0x012B  LATIN SMALL LETTER I WITH MACRON
-  ____@
- /___/@
-  | | @
-  | | @
-  |_| @
-      @@
-0x012C  LATIN CAPITAL LETTER I WITH BREVE
-  \__/@
- |_ _|@
-  | | @
-  | | @
- |___|@
-      @@
-0x012D  LATIN SMALL LETTER I WITH BREVE
-    @
- \_/@
- | |@
- | |@
- |_|@
-    @@
-0x012E  LATIN CAPITAL LETTER I WITH OGONEK
-  ___ @
- |_ _|@
-  | | @
-  | | @
- |___|@
-  (__(@@
-0x012F  LATIN SMALL LETTER I WITH OGONEK
-  _  @
- (_) @
- | | @
- | | @
- |_|_@
-  (_(@@
-0x0130  LATIN CAPITAL LETTER I WITH DOT ABOVE
-  _[] @
- |_ _|@
-  | | @
-  | | @
- |___|@
-      @@
-0x0131  LATIN SMALL LETTER DOTLESS I
-    @
-  _ @
- | |@
- | |@
- |_|@
-    @@
-0x0132  LATIN CAPITAL LIGATURE IJ
-  ___  _ @
- |_ _|| |@
-  | | | |@
-  | |_| |@
- |__|__/ @
-         @@
-0x0133  LATIN SMALL LIGATURE IJ
-  _   _ @
- (_) (_)@
- | | | |@
- | | | |@
- |_|_/ |@
-   |__/ @@
-0x0134  LATIN CAPITAL LETTER J WITH CIRCUMFLEX
-      /\ @
-     /_\|@
-  _  | | @
- | |_| | @
-  \___/  @
-         @@
-0x0135  LATIN SMALL LETTER J WITH CIRCUMFLEX
-    /\@
-   /_\@
-   | |@
-   | |@
-  _/ |@
- |__/ @@
-0x0136  LATIN CAPITAL LETTER K WITH CEDILLA
-  _  _  @
- | |/ / @
- | ' /  @
- | . \  @
- |_|\_\ @
-    )__)@@
-0x0137  LATIN SMALL LETTER K WITH CEDILLA
-  _    @
- | | __@
- | |/ /@
- |   < @
- |_|\_\@
-    )_)@@
-0x0138  LATIN SMALL LETTER KRA
-       @
-  _ __ @
- | |/ \@
- |   < @
- |_|\_\@
-       @@
-0x0139  LATIN CAPITAL LETTER L WITH ACUTE
-  _   //@
- | | // @
- | |    @
- | |___ @
- |_____|@
-        @@
-0x013A  LATIN SMALL LETTER L WITH ACUTE
-  //@
- | |@
- | |@
- | |@
- |_|@
-    @@
-0x013B  LATIN CAPITAL LETTER L WITH CEDILLA
-  _     @
- | |    @
- | |    @
- | |___ @
- |_____|@
-    )__)@@
-0x013C  LATIN SMALL LETTER L WITH CEDILLA
-  _   @
- | |  @
- | |  @
- | |  @
- |_|  @
-   )_)@@
-0x013D  LATIN CAPITAL LETTER L WITH CARON
-  _ \\//@
- | | \/ @
- | |    @
- | |___ @
- |_____|@
-        @@
-0x013E  LATIN SMALL LETTER L WITH CARON
-  _ \\//@
- | | \/ @
- | |    @
- | |    @
- |_|    @
-        @@
-0x013F  LATIN CAPITAL LETTER L WITH MIDDLE DOT
-  _     @
- | |    @
- | | [] @
- | |___ @
- |_____|@
-        @@
-0x0140  LATIN SMALL LETTER L WITH MIDDLE DOT
-  _    @
- | |   @
- | | []@
- | |   @
- |_|   @
-       @@
-0x0141  LATIN CAPITAL LETTER L WITH STROKE
-  __    @
- | //   @
- |//|   @
- // |__ @
- |_____|@
-        @@
-0x0142  LATIN SMALL LETTER L WITH STROKE
-  _ @
- | |@
- |//@
- //|@
- |_|@
-    @@
-0x0143  LATIN CAPITAL LETTER N WITH ACUTE
-  _/ /_ @
- | \ | |@
- |  \| |@
- | |\  |@
- |_| \_|@
-        @@
-0x0144  LATIN SMALL LETTER N WITH ACUTE
-     _  @
-  _ /_/ @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-0x0145  LATIN CAPITAL LETTER N WITH CEDILLA
-  _   _ @
- | \ | |@
- |  \| |@
- | |\  |@
- |_| \_|@
- )_)    @@
-0x0146  LATIN SMALL LETTER N WITH CEDILLA
-        @
-  _ __  @
- | '_ \ @
- | | | |@
- |_| |_|@
- )_)    @@
-0x0147  LATIN CAPITAL LETTER N WITH CARON
-  _\/ _ @
- | \ | |@
- |  \| |@
- | |\  |@
- |_| \_|@
-        @@
-0x0148  LATIN SMALL LETTER N WITH CARON
-  \\//  @
-  _\/_  @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-0x0149  LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
-          @
-  _  __   @
- ( )| '_\ @
- |/| | | |@
-   |_| |_|@
-          @@
-0x014A  LATIN CAPITAL LETTER ENG
-  _   _ @
- | \ | |@
- |  \| |@
- | |\  |@
- |_| \ |@
-     )_)@@
-0x014B  LATIN SMALL LETTER ENG
-  _ __  @
- | '_ \ @
- | | | |@
- |_| | |@
-     | |@
-    |__ @@
-0x014C  LATIN CAPITAL LETTER O WITH MACRON
-   ____ @
-  /_ _/ @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-0x014D  LATIN SMALL LETTER O WITH MACRON
-   ____ @
-  /_ _/ @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-0x014E  LATIN CAPITAL LETTER O WITH BREVE
-  \   / @
-   _-_  @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-0x014F  LATIN SMALL LETTER O WITH BREVE
-  \   / @
-   _-_  @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-0x0150  LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
-    ___ @
-   /_/_/@
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-0x0151  LATIN SMALL LETTER O WITH DOUBLE ACUTE
-    ___ @
-   /_/_/@
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-0x0152  LATIN CAPITAL LIGATURE OE
-   ___  ___ @
-  / _ \| __|@
- | | | |  | @
- | |_| | |__@
-  \___/|____@
-            @@
-0x0153  LATIN SMALL LIGATURE OE
-             @
-   ___   ___ @
-  / _ \ / _ \@
- | (_) |  __/@
-  \___/ \___|@
-             @@
-0x0154  LATIN CAPITAL LETTER R WITH ACUTE
-  _/_/  @
- |  _ \ @
- | |_) |@
- |  _ < @
- |_| \_\@
-        @@
-0x0155  LATIN SMALL LETTER R WITH ACUTE
-     __@
-  _ /_/@
- | '__|@
- | |   @
- |_|   @
-       @@
-0x0156  LATIN CAPITAL LETTER R WITH CEDILLA
-  ____  @
- |  _ \ @
- | |_) |@
- |  _ < @
- |_| \_\@
- )_)    @@
-0x0157  LATIN SMALL LETTER R WITH CEDILLA
-       @
-  _ __ @
- | '__|@
- | |   @
- |_|   @
-   )_) @@
-0x0158  LATIN CAPITAL LETTER R WITH CARON
-  _\_/  @
- |  _ \ @
- | |_) |@
- |  _ < @
- |_| \_\@
-        @@
-0x0159  LATIN SMALL LETTER R WITH CARON
-  \\// @
-  _\/_ @
- | '__|@
- | |   @
- |_|   @
-       @@
-0x015A  LATIN CAPITAL LETTER S WITH ACUTE
-  _/_/  @
- / ___| @
- \___ \ @
-  ___) |@
- |____/ @
-        @@
-0x015B  LATIN SMALL LETTER S WITH ACUTE
-    __@
-  _/_/@
- / __|@
- \__ \@
- |___/@
-      @@
-0x015C  LATIN CAPITAL LETTER S WITH CIRCUMFLEX
-  _/\_  @
- / ___| @
- \___ \ @
-  ___) |@
- |____/ @
-        @@
-0x015D  LATIN SMALL LETTER S WITH CIRCUMFLEX
-      @
-  /_\_@
- / __|@
- \__ \@
- |___/@
-      @@
-0x015E  LATIN CAPITAL LETTER S WITH CEDILLA
-  ____  @
- / ___| @
- \___ \ @
-  ___) |@
- |____/ @
-    )__)@@
-0x015F  LATIN SMALL LETTER S WITH CEDILLA
-      @
-  ___ @
- / __|@
- \__ \@
- |___/@
-   )_)@@
-0x0160  LATIN CAPITAL LETTER S WITH CARON
-  _\_/  @
- / ___| @
- \___ \ @
-  ___) |@
- |____/ @
-        @@
-0x0161  LATIN SMALL LETTER S WITH CARON
-  \\//@
-  _\/ @
- / __|@
- \__ \@
- |___/@
-      @@
-0x0162  LATIN CAPITAL LETTER T WITH CEDILLA
-  _____ @
- |_   _|@
-   | |  @
-   | |  @
-   |_|  @
-    )__)@@
-0x0163  LATIN SMALL LETTER T WITH CEDILLA
-  _   @
- | |_ @
- | __|@
- | |_ @
-  \__|@
-   )_)@@
-0x0164  LATIN CAPITAL LETTER T WITH CARON
-  _____ @
- |_   _|@
-   | |  @
-   | |  @
-   |_|  @
-        @@
-0x0165  LATIN SMALL LETTER T WITH CARON
-  \/  @
- | |_ @
- | __|@
- | |_ @
-  \__|@
-      @@
-0x0166  LATIN CAPITAL LETTER T WITH STROKE
-  _____ @
- |_   _|@
-   | |  @
-  -|-|- @
-   |_|  @
-        @@
-0x0167  LATIN SMALL LETTER T WITH STROKE
-  _   @
- | |_ @
- | __|@
- |-|_ @
-  \__|@
-      @@
-0x0168  LATIN CAPITAL LETTER U WITH TILDE
-        @
-  _/\/_ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-0x0169  LATIN SMALL LETTER U WITH TILDE
-        @
-  _/\/_ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-0x016A  LATIN CAPITAL LETTER U WITH MACRON
-   ____ @
-  /__ _/@
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-0x016B  LATIN SMALL LETTER U WITH MACRON
-   ____ @
-  / _  /@
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-0x016C  LATIN CAPITAL LETTER U WITH BREVE
-        @
-   \_/_ @
- | | | |@
- | |_| |@
-  \____|@
-        @@
-0x016D  LATIN SMALL LETTER U WITH BREVE
-        @
-   \_/_ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-0x016E  LATIN CAPITAL LETTER U WITH RING ABOVE
-    O   @
-  __  _ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-0x016F  LATIN SMALL LETTER U WITH RING ABOVE
-    O   @
-  __ __ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-0x0170  LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
-   -- --@
-  /_//_/@
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-0x0171  LATIN SMALL LETTER U WITH DOUBLE ACUTE
-    ____@
-  _/_/_/@
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-0x0172  LATIN CAPITAL LETTER U WITH OGONEK
-  _   _ @
- | | | |@
- | | | |@
- | |_| |@
-  \___/ @
-    (__(@@
-0x0173  LATIN SMALL LETTER U WITH OGONEK
-        @
-  _   _ @
- | | | |@
- | |_| |@
-  \__,_|@
-     (_(@@
-0x0174  LATIN CAPITAL LETTER W WITH CIRCUMFLEX
- __    /\  __@
- \ \  //\\/ /@
-  \ \ /\ / / @
-   \ V  V /  @
-    \_/\_/   @
-             @@
-0x0175  LATIN SMALL LETTER W WITH CIRCUMFLEX
-      /\   @
- __  //\\__@
- \ \ /\ / /@
-  \ V  V / @
-   \_/\_/  @
-           @@
-0x0176  LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
-    /\  @
- __//\\ @
- \ \ / /@
-  \ V / @
-   |_|  @
-        @@
-0x0177  LATIN SMALL LETTER Y WITH CIRCUMFLEX
-    /\  @
-   //\\ @
- | | | |@
- | |_| |@
-  \__, |@
-  |___/ @@
-0x0178  LATIN CAPITAL LETTER Y WITH DIAERESIS
-  []  []@
- __    _@
- \ \ / /@
-  \ V / @
-   |_|  @
-        @@
-0x0179  LATIN CAPITAL LETTER Z WITH ACUTE
-  __/_/@
- |__  /@
-   / / @
-  / /_ @
- /____|@
-       @@
-0x017A  LATIN SMALL LETTER Z WITH ACUTE
-    _ @
-  _/_/@
- |_  /@
-  / / @
- /___|@
-      @@
-0x017B  LATIN CAPITAL LETTER Z WITH DOT ABOVE
-  __[]_@
- |__  /@
-   / / @
-  / /_ @
- /____|@
-       @@
-0x017C  LATIN SMALL LETTER Z WITH DOT ABOVE
-   [] @
-  ____@
- |_  /@
-  / / @
- /___|@
-      @@
-0x017D  LATIN CAPITAL LETTER Z WITH CARON
-  _\_/_@
- |__  /@
-   / / @
-  / /_ @
- /____|@
-       @@
-0x017E  LATIN SMALL LETTER Z WITH CARON
-  \\//@
-  _\/_@
- |_  /@
-  / / @
- /___|@
-      @@
-0x017F  LATIN SMALL LETTER LONG S
-     __ @
-    / _|@
- |-| |  @
- |-| |  @
-   |_|  @
-        @@
-0x02C7  CARON
- \\//@
-  \/ @
-    $@
-    $@
-    $@
-    $@@
-0x02D8  BREVE
- \\_//@
-  \_/ @
-     $@
-     $@
-     $@
-     $@@
-0x02D9  DOT ABOVE
- []@
-  $@
-  $@
-  $@
-  $@
-  $@@
-0x02DB  OGONEK
-    $@
-    $@
-    $@
-    $@
-    $@
- )_) @@
-0x02DD  DOUBLE ACUTE ACCENT
-  _ _ @
- /_/_/@
-     $@
-     $@
-     $@
-     $@@
diff --git a/xen/tools/xen.flf b/xen/tools/xen.flf
new file mode 100644
index 0000000..e13e842
--- /dev/null
+++ b/xen/tools/xen.flf
@@ -0,0 +1,2230 @@
+flf2a$ 6 5 16 15 14 0 24463 229
+Standard by Glenn Chappell & Ian Chai 3/93 -- based on Frank's .sig
+Includes ISO Latin-1
+figlet release 2.1 -- 12 Aug 1994
+Modified for figlet 2.2 by John Cowan <cowan@ccil.org>
+  to add Latin-{2,3,4,5} support (Unicode U+0100-017F).
+Permission is hereby given to modify this font, as long as the
+modifier's name is placed on a comment line.
+
+Modified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter
+supported by FIGlet and FIGWin.  May also be slightly modified for better use
+of new full-width/kern/smush alternatives, but default output is NOT changed.
+
+Modified by Keir Fraser <kaf24@cl.cam.ac.uk> for Xen build system.
+
+ $@
+ $@
+ $@
+ $@
+ $@
+ $@@
+  _ @
+ | |@
+ | |@
+ |_|@
+ (_)@
+    @@
+  _ _ @
+ ( | )@
+  V V @
+   $  @
+   $  @
+      @@
+    _  _   @
+  _| || |_ @
+ |_  ..  _|@
+ |_      _|@
+   |_||_|  @
+           @@
+   _  @
+  | | @
+ / __)@
+ \__ \@
+ (   /@
+  |_| @@
+  _  __@
+ (_)/ /@
+   / / @
+  / /_ @
+ /_/(_)@
+       @@
+   ___   @
+  ( _ )  @
+  / _ \/\@
+ | (_>  <@
+  \___/\/@
+         @@
+  _ @
+ ( )@
+ |/ @
+  $ @
+  $ @
+    @@
+   __@
+  / /@
+ | | @
+ | | @
+ | | @
+  \_\@@
+ __  @
+ \ \ @
+  | |@
+  | |@
+  | |@
+ /_/ @@
+       @
+ __/\__@
+ \    /@
+ /_  _\@
+   \/  @
+       @@
+        @
+    _   @
+  _| |_ @
+ |_   _|@
+   |_|  @
+        @@
+    @
+    @
+    @
+  _ @
+ ( )@
+ |/ @@
+     @
+     @
+  __ @
+ |__|@
+  $  @
+     @@
+    @
+    @
+    @
+  _ @
+ (_)@
+    @@
+     __@
+    / /@
+   / / @
+  / /  @
+ /_/   @
+       @@
+   ___  @
+  / _ \ @
+ | | | |@
+ | |_| |@
+  \___/ @
+        @@
+  _ @
+ / |@
+ | |@
+ | |@
+ |_|@
+    @@
+  ____  @
+ |___ \ @
+   __) |@
+  / __/ @
+ |_____|@
+        @@
+  _____ @
+ |___ / @
+   |_ \ @
+  ___) |@
+ |____/ @
+        @@
+  _  _   @
+ | || |  @
+ | || |_ @
+ |__   _|@
+    |_|  @
+         @@
+  ____  @
+ | ___| @
+ |___ \ @
+  ___) |@
+ |____/ @
+        @@
+   __   @
+  / /_  @
+ | '_ \ @
+ | (_) |@
+  \___/ @
+        @@
+  _____ @
+ |___  |@
+    / / @
+   / /  @
+  /_/   @
+        @@
+   ___  @
+  ( _ ) @
+  / _ \ @
+ | (_) |@
+  \___/ @
+        @@
+   ___  @
+  / _ \ @
+ | (_) |@
+  \__, |@
+    /_/ @
+        @@
+    @
+  _ @
+ (_)@
+  _ @
+ (_)@
+    @@
+    @
+  _ @
+ (_)@
+  _ @
+ ( )@
+ |/ @@
+   __@
+  / /@
+ / / @
+ \ \ @
+  \_\@
+     @@
+        @
+  _____ @
+ |_____|@
+ |_____|@
+    $   @
+        @@
+ __  @
+ \ \ @
+  \ \@
+  / /@
+ /_/ @
+     @@
+  ___ @
+ |__ \@
+   / /@
+  |_| @
+  (_) @
+      @@
+    ____  @
+   / __ \ @
+  / / _` |@
+ | | (_| |@
+  \ \__,_|@
+   \____/ @@
+     _    @
+    / \   @
+   / _ \  @
+  / ___ \ @
+ /_/   \_\@
+          @@
+  ____  @
+ | __ ) @
+ |  _ \ @
+ | |_) |@
+ |____/ @
+        @@
+   ____ @
+  / ___|@
+ | |    @
+ | |___ @
+  \____|@
+        @@
+  ____  @
+ |  _ \ @
+ | | | |@
+ | |_| |@
+ |____/ @
+        @@
+  _____ @
+ | ____|@
+ |  _|  @
+ | |___ @
+ |_____|@
+        @@
+  _____ @
+ |  ___|@
+ | |_   @
+ |  _|  @
+ |_|    @
+        @@
+   ____ @
+  / ___|@
+ | |  _ @
+ | |_| |@
+  \____|@
+        @@
+  _   _ @
+ | | | |@
+ | |_| |@
+ |  _  |@
+ |_| |_|@
+        @@
+  ___ @
+ |_ _|@
+  | | @
+  | | @
+ |___|@
+      @@
+      _ @
+     | |@
+  _  | |@
+ | |_| |@
+  \___/ @
+        @@
+  _  __@
+ | |/ /@
+ | ' / @
+ | . \ @
+ |_|\_\@
+       @@
+  _     @
+ | |    @
+ | |    @
+ | |___ @
+ |_____|@
+        @@
+  __  __ @
+ |  \/  |@
+ | |\/| |@
+ | |  | |@
+ |_|  |_|@
+         @@
+  _   _ @
+ | \ | |@
+ |  \| |@
+ | |\  |@
+ |_| \_|@
+        @@
+   ___  @
+  / _ \ @
+ | | | |@
+ | |_| |@
+  \___/ @
+        @@
+  ____  @
+ |  _ \ @
+ | |_) |@
+ |  __/ @
+ |_|    @
+        @@
+   ___  @
+  / _ \ @
+ | | | |@
+ | |_| |@
+  \__\_\@
+        @@
+  ____  @
+ |  _ \ @
+ | |_) |@
+ |  _ < @
+ |_| \_\@
+        @@
+  ____  @
+ / ___| @
+ \___ \ @
+  ___) |@
+ |____/ @
+        @@
+  _____ @
+ |_   _|@
+   | |  @
+   | |  @
+   |_|  @
+        @@
+  _   _ @
+ | | | |@
+ | | | |@
+ | |_| |@
+  \___/ @
+        @@
+ __     __@
+ \ \   / /@
+  \ \ / / @
+   \ V /  @
+    \_/   @
+          @@
+ __        __@
+ \ \      / /@
+  \ \ /\ / / @
+   \ V  V /  @
+    \_/\_/   @
+             @@
+ __  __@
+ \ \/ /@
+  \  / @
+  /  \ @
+ /_/\_\@
+       @@
+ __   __@
+ \ \ / /@
+  \ V / @
+   | |  @
+   |_|  @
+        @@
+  _____@
+ |__  /@
+   / / @
+  / /_ @
+ /____|@
+       @@
+  __ @
+ | _|@
+ | | @
+ | | @
+ | | @
+ |__|@@
+ __    @
+ \ \   @
+  \ \  @
+   \ \ @
+    \_\@
+       @@
+  __ @
+ |_ |@
+  | |@
+  | |@
+  | |@
+ |__|@@
+  /\ @
+ |/\|@
+   $ @
+   $ @
+   $ @
+     @@
+        @
+        @
+        @
+        @
+  _____ @
+ |_____|@@
+  _ @
+ ( )@
+  \|@
+  $ @
+  $ @
+    @@
+        @
+   __ _ @
+  / _` |@
+ | (_| |@
+  \__,_|@
+        @@
+  _     @
+ | |__  @
+ | '_ \ @
+ | |_) |@
+ |_.__/ @
+        @@
+       @
+   ___ @
+  / __|@
+ | (__ @
+  \___|@
+       @@
+      _ @
+   __| |@
+  / _` |@
+ | (_| |@
+  \__,_|@
+        @@
+       @
+   ___ @
+  / _ \@
+ |  __/@
+  \___|@
+       @@
+   __ @
+  / _|@
+ | |_ @
+ |  _|@
+ |_|  @
+      @@
+        @
+   __ _ @
+  / _` |@
+ | (_| |@
+  \__, |@
+  |___/ @@
+  _     @
+ | |__  @
+ | '_ \ @
+ | | | |@
+ |_| |_|@
+        @@
+  _ @
+ (_)@
+ | |@
+ | |@
+ |_|@
+    @@
+    _ @
+   (_)@
+   | |@
+   | |@
+  _/ |@
+ |__/ @@
+  _    @
+ | | __@
+ | |/ /@
+ |   < @
+ |_|\_\@
+       @@
+  _ @
+ | |@
+ | |@
+ | |@
+ |_|@
+    @@
+            @
+  _ __ ___  @
+ | '_ ` _ \ @
+ | | | | | |@
+ |_| |_| |_|@
+            @@
+        @
+  _ __  @
+ | '_ \ @
+ | | | |@
+ |_| |_|@
+        @@
+        @
+   ___  @
+  / _ \ @
+ | (_) |@
+  \___/ @
+        @@
+        @
+  _ __  @
+ | '_ \ @
+ | |_) |@
+ | .__/ @
+ |_|    @@
+        @
+   __ _ @
+  / _` |@
+ | (_| |@
+  \__, |@
+     |_|@@
+       @
+  _ __ @
+ | '__|@
+ | |   @
+ |_|   @
+       @@
+      @
+  ___ @
+ / __|@
+ \__ \@
+ |___/@
+      @@
+  _   @
+ | |_ @
+ | __|@
+ | |_ @
+  \__|@
+      @@
+        @
+  _   _ @
+ | | | |@
+ | |_| |@
+  \__,_|@
+        @@
+        @
+ __   __@
+ \ \ / /@
+  \ V / @
+   \_/  @
+        @@
+           @
+ __      __@
+ \ \ /\ / /@
+  \ V  V / @
+   \_/\_/  @
+           @@
+       @
+ __  __@
+ \ \/ /@
+  >  < @
+ /_/\_\@
+       @@
+        @
+  _   _ @
+ | | | |@
+ | |_| |@
+  \__, |@
+  |___/ @@
+      @
+  ____@
+ |_  /@
+  / / @
+ /___|@
+      @@
+    __@
+   / /@
+  | | @
+ < <  @
+  | | @
+   \_\@@
+  _ @
+ | |@
+ | |@
+ | |@
+ | |@
+ |_|@@
+ __   @
+ \ \  @
+  | | @
+   > >@
+  | | @
+ /_/  @@
+  /\/|@
+ |/\/ @
+   $  @
+   $  @
+   $  @
+      @@
+  _   _ @
+ (_)_(_)@
+   /_\  @
+  / _ \ @
+ /_/ \_\@
+        @@
+  _   _ @
+ (_)_(_)@
+  / _ \ @
+ | |_| |@
+  \___/ @
+        @@
+  _   _ @
+ (_) (_)@
+ | | | |@

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

From xen-changelog-bounces@lists.xen.org Wed Dec 04 10:04:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:04: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 1Vo9K4-0003lg-3d; Wed, 04 Dec 2013 10:04:48 +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 1Vo9K0-0003kc-1o
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:46 +0000
Received: from [193.109.254.147:27860] by server-8.bemta-14.messagelabs.com id
	23/1A-30921-93EFE925; Wed, 04 Dec 2013 10:04:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386151477!2728858!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=MAILTO_TO_SPAM_ADDR,
	UPPERCASE_50_75
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31787 invoked from network); 4 Dec 2013 10:04:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:04: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 1Vo9Jt-00081G-AU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Jt-0006Yv-46
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:37 +0000
Date: Wed, 04 Dec 2013 10:04:37 +0000
Message-Id: <E1Vo9Jt-0006Yv-46@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/build: Use a distro version of
	figlet
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b47bcdb6d3830f05e3b9d686326ef0ba45b9915
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Nov 22 21:08:00 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 2 13:46:44 2013 +0000

    xen/build: Use a distro version of figlet
    
    It is quite inappropriate to keep a hacked up versions of figlet in our source
    tree, especially when the purpose of the hackary is just to provide a text to
    octal conversion.
    
    This version of figlet contributes a surprisingly large proportion of the
    Coverity issues found under xen/ (and therefore attributed against Xen)
    
    Figlet can be found in all distros, so make use of it.  We keep xen.flf (being
    the Xen figlet font) and replace the hacked up octal transform with a short
    python script.
    
    The Xen Makefile has been tweaked in such a way that it still prints the
    figlet banner for the build.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 .gitignore               |    3 +-
 README                   |    1 +
 xen/Makefile             |   16 +-
 xen/tools/Makefile       |    2 -
 xen/tools/fig-to-oct.py  |   18 +
 xen/tools/figlet/xen.flf | 2230 ----------------------------------------------
 xen/tools/xen.flf        | 2230 ++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 2259 insertions(+), 2241 deletions(-)

diff --git a/.gitignore b/.gitignore
index f88e431..47f92a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -292,7 +292,7 @@ tools/xm-test/lib/XmTestLib/config.py
 tools/xm-test/lib/XmTestReport/xmtest.py
 tools/xm-test/tests/*.test
 tools/ocaml-xenstored*
-xen/.banner*
+xen/.banner
 xen/System.map
 xen/arch/arm/asm-offsets.s
 xen/arch/arm/xen.lds
@@ -315,7 +315,6 @@ xen/include/linux
 xen/include/public/public
 xen/include/xen/*.new
 xen/include/xen/acm_policy.h
-xen/include/xen/banner.h
 xen/include/xen/compile.h
 xen/tools/figlet/figlet
 xen/tools/symbols
diff --git a/README b/README
index 8689ce1..4148a26 100644
--- a/README
+++ b/README
@@ -71,6 +71,7 @@ disabled at compile time:
       includes the alternative ocaml xenstored.
     * cmake (if building vtpm stub domains)
     * markdown
+    * figlet (for generating the traditional Xen start of day banner)
 
 Second, you need to acquire a suitable kernel for use in domain 0. If
 possible you should use a kernel provided by your OS distributor. If
diff --git a/xen/Makefile b/xen/Makefile
index 597972d..1ea2717 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -86,7 +86,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
 	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET)-syms *~ core
 	rm -f include/asm-*/asm-offsets.h
-	[ -d tools/figlet ] && rm -f .banner*
+	rm -f .banner
 
 .PHONY: _distclean
 _distclean: clean
@@ -114,10 +114,12 @@ delete-unfresh-files:
 	fi
 
 .banner: Makefile
-	$(MAKE) -C tools
-	@tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) 2>$@2 >$@1
-	@cat $@1 $@2 >$@
-	@rm -f $@1 $@2
+	@if which figlet >/dev/null 2>&1 ; then \
+		echo " Xen $(XEN_FULLVERSION)" | figlet -f tools/xen.flf > $@.tmp; \
+	else \
+		echo " Xen $(XEN_FULLVERSION)" > $@.tmp; \
+	fi
+	@mv -f $@.tmp $@
 
 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
 include/xen/compile.h: include/xen/compile.h.in .banner
@@ -132,8 +134,8 @@ include/xen/compile.h: include/xen/compile.h.in .banner
 	    -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
 	    -e 's!@@changeset@@!$(shell tools/scmversion $(XEN_ROOT) || echo "unavailable")!g' \
 	    < include/xen/compile.h.in > $@.new
-	@grep \" .banner >> $@.new
-	@grep -v \" .banner
+	@cat .banner
+	@$(PYTHON) tools/fig-to-oct.py < .banner >> $@.new
 	@mv -f $@.new $@
 
 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
diff --git a/xen/tools/Makefile b/xen/tools/Makefile
index 612e36d..e940939 100644
--- a/xen/tools/Makefile
+++ b/xen/tools/Makefile
@@ -3,12 +3,10 @@ include $(XEN_ROOT)/Config.mk
 
 .PHONY: default
 default:
-	[ -d figlet ] && $(MAKE) -C figlet
 	$(MAKE) symbols
 
 .PHONY: clean
 clean:
-	[ -d figlet ] && $(MAKE) -C figlet clean
 	rm -f *.o symbols
 
 symbols: symbols.c
diff --git a/xen/tools/fig-to-oct.py b/xen/tools/fig-to-oct.py
new file mode 100644
index 0000000..db4fd32
--- /dev/null
+++ b/xen/tools/fig-to-oct.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+import sys
+
+chars_per_line = 18
+chars_so_far = 0
+
+sys.stdout.write('"')
+
+for char in sys.stdin.read():
+
+    sys.stdout.write("\\%03o" % ord(char))
+    chars_so_far = chars_so_far + 1
+
+    if chars_so_far == chars_per_line:
+        chars_so_far = 0
+        sys.stdout.write('" \\\n"')
+
+sys.stdout.write('"\n')
diff --git a/xen/tools/figlet/xen.flf b/xen/tools/figlet/xen.flf
deleted file mode 100644
index e13e842..0000000
--- a/xen/tools/figlet/xen.flf
+++ /dev/null
@@ -1,2230 +0,0 @@
-flf2a$ 6 5 16 15 14 0 24463 229
-Standard by Glenn Chappell & Ian Chai 3/93 -- based on Frank's .sig
-Includes ISO Latin-1
-figlet release 2.1 -- 12 Aug 1994
-Modified for figlet 2.2 by John Cowan <cowan@ccil.org>
-  to add Latin-{2,3,4,5} support (Unicode U+0100-017F).
-Permission is hereby given to modify this font, as long as the
-modifier's name is placed on a comment line.
-
-Modified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter
-supported by FIGlet and FIGWin.  May also be slightly modified for better use
-of new full-width/kern/smush alternatives, but default output is NOT changed.
-
-Modified by Keir Fraser <kaf24@cl.cam.ac.uk> for Xen build system.
-
- $@
- $@
- $@
- $@
- $@
- $@@
-  _ @
- | |@
- | |@
- |_|@
- (_)@
-    @@
-  _ _ @
- ( | )@
-  V V @
-   $  @
-   $  @
-      @@
-    _  _   @
-  _| || |_ @
- |_  ..  _|@
- |_      _|@
-   |_||_|  @
-           @@
-   _  @
-  | | @
- / __)@
- \__ \@
- (   /@
-  |_| @@
-  _  __@
- (_)/ /@
-   / / @
-  / /_ @
- /_/(_)@
-       @@
-   ___   @
-  ( _ )  @
-  / _ \/\@
- | (_>  <@
-  \___/\/@
-         @@
-  _ @
- ( )@
- |/ @
-  $ @
-  $ @
-    @@
-   __@
-  / /@
- | | @
- | | @
- | | @
-  \_\@@
- __  @
- \ \ @
-  | |@
-  | |@
-  | |@
- /_/ @@
-       @
- __/\__@
- \    /@
- /_  _\@
-   \/  @
-       @@
-        @
-    _   @
-  _| |_ @
- |_   _|@
-   |_|  @
-        @@
-    @
-    @
-    @
-  _ @
- ( )@
- |/ @@
-     @
-     @
-  __ @
- |__|@
-  $  @
-     @@
-    @
-    @
-    @
-  _ @
- (_)@
-    @@
-     __@
-    / /@
-   / / @
-  / /  @
- /_/   @
-       @@
-   ___  @
-  / _ \ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-  _ @
- / |@
- | |@
- | |@
- |_|@
-    @@
-  ____  @
- |___ \ @
-   __) |@
-  / __/ @
- |_____|@
-        @@
-  _____ @
- |___ / @
-   |_ \ @
-  ___) |@
- |____/ @
-        @@
-  _  _   @
- | || |  @
- | || |_ @
- |__   _|@
-    |_|  @
-         @@
-  ____  @
- | ___| @
- |___ \ @
-  ___) |@
- |____/ @
-        @@
-   __   @
-  / /_  @
- | '_ \ @
- | (_) |@
-  \___/ @
-        @@
-  _____ @
- |___  |@
-    / / @
-   / /  @
-  /_/   @
-        @@
-   ___  @
-  ( _ ) @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-   ___  @
-  / _ \ @
- | (_) |@
-  \__, |@
-    /_/ @
-        @@
-    @
-  _ @
- (_)@
-  _ @
- (_)@
-    @@
-    @
-  _ @
- (_)@
-  _ @
- ( )@
- |/ @@
-   __@
-  / /@
- / / @
- \ \ @
-  \_\@
-     @@
-        @
-  _____ @
- |_____|@
- |_____|@
-    $   @
-        @@
- __  @
- \ \ @
-  \ \@
-  / /@
- /_/ @
-     @@
-  ___ @
- |__ \@
-   / /@
-  |_| @
-  (_) @
-      @@
-    ____  @
-   / __ \ @
-  / / _` |@
- | | (_| |@
-  \ \__,_|@
-   \____/ @@
-     _    @
-    / \   @
-   / _ \  @
-  / ___ \ @
- /_/   \_\@
-          @@
-  ____  @
- | __ ) @
- |  _ \ @
- | |_) |@
- |____/ @
-        @@
-   ____ @
-  / ___|@
- | |    @
- | |___ @
-  \____|@
-        @@
-  ____  @
- |  _ \ @
- | | | |@
- | |_| |@
- |____/ @
-        @@
-  _____ @
- | ____|@
- |  _|  @
- | |___ @
- |_____|@
-        @@
-  _____ @
- |  ___|@
- | |_   @
- |  _|  @
- |_|    @
-        @@
-   ____ @
-  / ___|@
- | |  _ @
- | |_| |@
-  \____|@
-        @@
-  _   _ @
- | | | |@
- | |_| |@
- |  _  |@
- |_| |_|@
-        @@
-  ___ @
- |_ _|@
-  | | @
-  | | @
- |___|@
-      @@
-      _ @
-     | |@
-  _  | |@
- | |_| |@
-  \___/ @
-        @@
-  _  __@
- | |/ /@
- | ' / @
- | . \ @
- |_|\_\@
-       @@
-  _     @
- | |    @
- | |    @
- | |___ @
- |_____|@
-        @@
-  __  __ @
- |  \/  |@
- | |\/| |@
- | |  | |@
- |_|  |_|@
-         @@
-  _   _ @
- | \ | |@
- |  \| |@
- | |\  |@
- |_| \_|@
-        @@
-   ___  @
-  / _ \ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-  ____  @
- |  _ \ @
- | |_) |@
- |  __/ @
- |_|    @
-        @@
-   ___  @
-  / _ \ @
- | | | |@
- | |_| |@
-  \__\_\@
-        @@
-  ____  @
- |  _ \ @
- | |_) |@
- |  _ < @
- |_| \_\@
-        @@
-  ____  @
- / ___| @
- \___ \ @
-  ___) |@
- |____/ @
-        @@
-  _____ @
- |_   _|@
-   | |  @
-   | |  @
-   |_|  @
-        @@
-  _   _ @
- | | | |@
- | | | |@
- | |_| |@
-  \___/ @
-        @@
- __     __@
- \ \   / /@
-  \ \ / / @
-   \ V /  @
-    \_/   @
-          @@
- __        __@
- \ \      / /@
-  \ \ /\ / / @
-   \ V  V /  @
-    \_/\_/   @
-             @@
- __  __@
- \ \/ /@
-  \  / @
-  /  \ @
- /_/\_\@
-       @@
- __   __@
- \ \ / /@
-  \ V / @
-   | |  @
-   |_|  @
-        @@
-  _____@
- |__  /@
-   / / @
-  / /_ @
- /____|@
-       @@
-  __ @
- | _|@
- | | @
- | | @
- | | @
- |__|@@
- __    @
- \ \   @
-  \ \  @
-   \ \ @
-    \_\@
-       @@
-  __ @
- |_ |@
-  | |@
-  | |@
-  | |@
- |__|@@
-  /\ @
- |/\|@
-   $ @
-   $ @
-   $ @
-     @@
-        @
-        @
-        @
-        @
-  _____ @
- |_____|@@
-  _ @
- ( )@
-  \|@
-  $ @
-  $ @
-    @@
-        @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-  _     @
- | |__  @
- | '_ \ @
- | |_) |@
- |_.__/ @
-        @@
-       @
-   ___ @
-  / __|@
- | (__ @
-  \___|@
-       @@
-      _ @
-   __| |@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-       @
-   ___ @
-  / _ \@
- |  __/@
-  \___|@
-       @@
-   __ @
-  / _|@
- | |_ @
- |  _|@
- |_|  @
-      @@
-        @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__, |@
-  |___/ @@
-  _     @
- | |__  @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-  _ @
- (_)@
- | |@
- | |@
- |_|@
-    @@
-    _ @
-   (_)@
-   | |@
-   | |@
-  _/ |@
- |__/ @@
-  _    @
- | | __@
- | |/ /@
- |   < @
- |_|\_\@
-       @@
-  _ @
- | |@
- | |@
- | |@
- |_|@
-    @@
-            @
-  _ __ ___  @
- | '_ ` _ \ @
- | | | | | |@
- |_| |_| |_|@
-            @@
-        @
-  _ __  @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-        @
-   ___  @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-        @
-  _ __  @
- | '_ \ @
- | |_) |@
- | .__/ @
- |_|    @@
-        @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__, |@
-     |_|@@
-       @
-  _ __ @
- | '__|@
- | |   @
- |_|   @
-       @@
-      @
-  ___ @
- / __|@
- \__ \@
- |___/@
-      @@
-  _   @
- | |_ @
- | __|@
- | |_ @
-  \__|@
-      @@
-        @
-  _   _ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-        @
- __   __@
- \ \ / /@
-  \ V / @
-   \_/  @
-        @@
-           @
- __      __@
- \ \ /\ / /@
-  \ V  V / @
-   \_/\_/  @
-           @@
-       @
- __  __@
- \ \/ /@
-  >  < @
- /_/\_\@
-       @@
-        @
-  _   _ @
- | | | |@
- | |_| |@
-  \__, |@
-  |___/ @@
-      @
-  ____@
- |_  /@
-  / / @
- /___|@
-      @@
-    __@
-   / /@
-  | | @
- < <  @
-  | | @
-   \_\@@
-  _ @
- | |@
- | |@
- | |@
- | |@
- |_|@@
- __   @
- \ \  @
-  | | @
-   > >@
-  | | @
- /_/  @@
-  /\/|@
- |/\/ @
-   $  @
-   $  @
-   $  @
-      @@
-  _   _ @
- (_)_(_)@
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-  _   _ @
- (_)_(_)@
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-  _   _ @
- (_) (_)@
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-  _   _ @
- (_)_(_)@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-  _   _ @
- (_)_(_)@
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-  _   _ @
- (_) (_)@
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-   ___ @
-  / _ \@
- | |/ /@
- | |\ \@
- | ||_/@
- |_|   @@
-160  NO-BREAK SPACE
- $@
- $@
- $@
- $@
- $@
- $@@
-161  INVERTED EXCLAMATION MARK
-  _ @
- (_)@
- | |@
- | |@
- |_|@
-    @@
-162  CENT SIGN
-    _  @
-   | | @
-  / __)@
- | (__ @
-  \   )@
-   |_| @@
-163  POUND SIGN
-    ___  @
-   / ,_\ @
- _| |_   @
-  | |___ @
- (_,____|@
-         @@
-164  CURRENCY SIGN
- /\___/\@
- \  _  /@
- | (_) |@
- / ___ \@
- \/   \/@
-        @@
-165  YEN SIGN
-  __ __ @
-  \ V / @
- |__ __|@
- |__ __|@
-   |_|  @
-        @@
-166  BROKEN BAR
-  _ @
- | |@
- |_|@
-  _ @
- | |@
- |_|@@
-167  SECTION SIGN
-    __ @
-  _/ _)@
- / \ \ @
- \ \\ \@
-  \ \_/@
- (__/  @@
-168  DIAERESIS
-  _   _ @
- (_) (_)@
-  $   $ @
-  $   $ @
-  $   $ @
-        @@
-169  COPYRIGHT SIGN
-    _____   @
-   / ___ \  @
-  / / __| \ @
- | | (__   |@
-  \ \___| / @
-   \_____/  @@
-170  FEMININE ORDINAL INDICATOR
-  __ _ @
- / _` |@
- \__,_|@
- |____|@
-    $  @
-       @@
-171  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
-   ____@
-  / / /@
- / / / @
- \ \ \ @
-  \_\_\@
-       @@
-172  NOT SIGN
-        @
-  _____ @
- |___  |@
-     |_|@
-    $   @
-        @@
-173  SOFT HYPHEN
-       @
-       @
-  ____ @
- |____|@
-    $  @
-       @@
-174  REGISTERED SIGN
-    _____   @
-   / ___ \  @
-  / | _ \ \ @
- |  |   /  |@
-  \ |_|_\ / @
-   \_____/  @@
-175  MACRON
-  _____ @
- |_____|@
-    $   @
-    $   @
-    $   @
-        @@
-176  DEGREE SIGN
-   __  @
-  /  \ @
- | () |@
-  \__/ @
-    $  @
-       @@
-177  PLUS-MINUS SIGN
-    _   @
-  _| |_ @
- |_   _|@
-  _|_|_ @
- |_____|@
-        @@
-178  SUPERSCRIPT TWO
-  ___ @
- |_  )@
-  / / @
- /___|@
-   $  @
-      @@
-179  SUPERSCRIPT THREE
-  ____@
- |__ /@
-  |_ \@
- |___/@
-   $  @
-      @@
-180  ACUTE ACCENT
-  __@
- /_/@
-  $ @
-  $ @
-  $ @
-    @@
-181  MICRO SIGN
-        @
-  _   _ @
- | | | |@
- | |_| |@
- | ._,_|@
- |_|    @@
-182  PILCROW SIGN
-   _____ @
-  /     |@
- | (| | |@
-  \__ | |@
-    |_|_|@
-         @@
-183  MIDDLE DOT
-    @
-  _ @
- (_)@
-  $ @
-  $ @
-    @@
-184  CEDILLA
-    @
-    @
-    @
-    @
-  _ @
- )_)@@
-185  SUPERSCRIPT ONE
-  _ @
- / |@
- | |@
- |_|@
-  $ @
-    @@
-186  MASCULINE ORDINAL INDICATOR
-  ___ @
- / _ \@
- \___/@
- |___|@
-   $  @
-      @@
-187  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
- ____  @
- \ \ \ @
-  \ \ \@
-  / / /@
- /_/_/ @
-       @@
-188  VULGAR FRACTION ONE QUARTER
-  _   __    @
- / | / / _  @
- | |/ / | | @
- |_/ /|_  _|@
-  /_/   |_| @
-            @@
-189  VULGAR FRACTION ONE HALF
-  _   __   @
- / | / /__ @
- | |/ /_  )@
- |_/ / / / @
-  /_/ /___|@
-           @@
-190  VULGAR FRACTION THREE QUARTERS
-  ____  __    @
- |__ / / / _  @
-  |_ \/ / | | @
- |___/ /|_  _|@
-    /_/   |_| @
-              @@
-191  INVERTED QUESTION MARK
-   _  @
-  (_) @
-  | | @
- / /_ @
- \___|@
-      @@
-192  LATIN CAPITAL LETTER A WITH GRAVE
-   __   @
-   \_\  @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-193  LATIN CAPITAL LETTER A WITH ACUTE
-    __  @
-   /_/  @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-194  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
-   //\  @
-  |/_\| @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-195  LATIN CAPITAL LETTER A WITH TILDE
-   /\/| @
-  |/\/  @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-196  LATIN CAPITAL LETTER A WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-197  LATIN CAPITAL LETTER A WITH RING ABOVE
-    _   @
-   (o)  @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-198  LATIN CAPITAL LETTER AE
-     ______ @
-    /  ____|@
-   / _  _|  @
-  / __ |___ @
- /_/ |_____|@
-            @@
-199  LATIN CAPITAL LETTER C WITH CEDILLA
-   ____ @
-  / ___|@
- | |    @
- | |___ @
-  \____|@
-    )_) @@
-200  LATIN CAPITAL LETTER E WITH GRAVE
-   __   @
-  _\_\_ @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-201  LATIN CAPITAL LETTER E WITH ACUTE
-    __  @
-  _/_/_ @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-202  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
-   //\  @
-  |/_\| @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-203  LATIN CAPITAL LETTER E WITH DIAERESIS
-  _   _ @
- (_)_(_)@
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-204  LATIN CAPITAL LETTER I WITH GRAVE
-  __  @
-  \_\ @
- |_ _|@
-  | | @
- |___|@
-      @@
-205  LATIN CAPITAL LETTER I WITH ACUTE
-   __ @
-  /_/ @
- |_ _|@
-  | | @
- |___|@
-      @@
-206  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
-  //\ @
- |/_\|@
- |_ _|@
-  | | @
- |___|@
-      @@
-207  LATIN CAPITAL LETTER I WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-  |_ _| @
-   | |  @
-  |___| @
-        @@
-208  LATIN CAPITAL LETTER ETH
-    ____  @
-   |  _ \ @
-  _| |_| |@
- |__ __| |@
-   |____/ @
-          @@
-209  LATIN CAPITAL LETTER N WITH TILDE
-   /\/|@
-  |/\/ @
- | \| |@
- | .` |@
- |_|\_|@
-       @@
-210  LATIN CAPITAL LETTER O WITH GRAVE
-   __   @
-   \_\  @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-211  LATIN CAPITAL LETTER O WITH ACUTE
-    __  @
-   /_/  @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-212  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
-   //\  @
-  |/_\| @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-213  LATIN CAPITAL LETTER O WITH TILDE
-   /\/| @
-  |/\/  @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-214  LATIN CAPITAL LETTER O WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-215  MULTIPLICATION SIGN
-     @
-     @
- /\/\@
- >  <@
- \/\/@
-     @@
-216  LATIN CAPITAL LETTER O WITH STROKE
-   ____ @
-  / _// @
- | |// |@
- | //| |@
-  //__/ @
-        @@
-217  LATIN CAPITAL LETTER U WITH GRAVE
-   __   @
-  _\_\_ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-218  LATIN CAPITAL LETTER U WITH ACUTE
-    __  @
-  _/_/_ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-219  LATIN CAPITAL LETTER U WITH CIRCUMFLEX
-   //\  @
-  |/ \| @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-220  LATIN CAPITAL LETTER U WITH DIAERESIS
-  _   _ @
- (_) (_)@
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-221  LATIN CAPITAL LETTER Y WITH ACUTE
-    __  @
- __/_/__@
- \ \ / /@
-  \ V / @
-   |_|  @
-        @@
-222  LATIN CAPITAL LETTER THORN
-  _     @
- | |___ @
- |  __ \@
- |  ___/@
- |_|    @
-        @@
-223  LATIN SMALL LETTER SHARP S
-   ___ @
-  / _ \@
- | |/ /@
- | |\ \@
- | ||_/@
- |_|   @@
-224  LATIN SMALL LETTER A WITH GRAVE
-   __   @
-   \_\_ @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-225  LATIN SMALL LETTER A WITH ACUTE
-    __  @
-   /_/_ @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-226  LATIN SMALL LETTER A WITH CIRCUMFLEX
-   //\  @
-  |/_\| @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-227  LATIN SMALL LETTER A WITH TILDE
-   /\/| @
-  |/\/_ @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-228  LATIN SMALL LETTER A WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-229  LATIN SMALL LETTER A WITH RING ABOVE
-    __  @
-   (()) @
-  / _ '|@
- | (_| |@
-  \__,_|@
-        @@
-230  LATIN SMALL LETTER AE
-           @
-   __ ____ @
-  / _`  _ \@
- | (_|  __/@
-  \__,____|@
-           @@
-231  LATIN SMALL LETTER C WITH CEDILLA
-       @
-   ___ @
-  / __|@
- | (__ @
-  \___|@
-   )_) @@
-232  LATIN SMALL LETTER E WITH GRAVE
-   __  @
-   \_\ @
-  / _ \@
- |  __/@
-  \___|@
-       @@
-233  LATIN SMALL LETTER E WITH ACUTE
-    __ @
-   /_/ @
-  / _ \@
- |  __/@
-  \___|@
-       @@
-234  LATIN SMALL LETTER E WITH CIRCUMFLEX
-   //\ @
-  |/_\|@
-  / _ \@
- |  __/@
-  \___|@
-       @@
-235  LATIN SMALL LETTER E WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-  / _ \ @
- |  __/ @
-  \___| @
-        @@
-236  LATIN SMALL LETTER I WITH GRAVE
- __ @
- \_\@
- | |@
- | |@
- |_|@
-    @@
-237  LATIN SMALL LETTER I WITH ACUTE
-  __@
- /_/@
- | |@
- | |@
- |_|@
-    @@
-238  LATIN SMALL LETTER I WITH CIRCUMFLEX
-  //\ @
- |/_\|@
-  | | @
-  | | @
-  |_| @
-      @@
-239  LATIN SMALL LETTER I WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-   | |  @
-   | |  @
-   |_|  @
-        @@
-240  LATIN SMALL LETTER ETH
-   /\/\ @
-   >  < @
-  _\/\ |@
- / __` |@
- \____/ @
-        @@
-241  LATIN SMALL LETTER N WITH TILDE
-   /\/| @
-  |/\/  @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-242  LATIN SMALL LETTER O WITH GRAVE
-   __   @
-   \_\  @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-243  LATIN SMALL LETTER O WITH ACUTE
-    __  @
-   /_/  @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-244  LATIN SMALL LETTER O WITH CIRCUMFLEX
-   //\  @
-  |/_\| @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-245  LATIN SMALL LETTER O WITH TILDE
-   /\/| @
-  |/\/  @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-246  LATIN SMALL LETTER O WITH DIAERESIS
-  _   _ @
- (_)_(_)@
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-247  DIVISION SIGN
-        @
-    _   @
-  _(_)_ @
- |_____|@
-   (_)  @
-        @@
-248  LATIN SMALL LETTER O WITH STROKE
-         @
-   ____  @
-  / _//\ @
- | (//) |@
-  \//__/ @
-         @@
-249  LATIN SMALL LETTER U WITH GRAVE
-   __   @
-  _\_\_ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-250  LATIN SMALL LETTER U WITH ACUTE
-    __  @
-  _/_/_ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-251  LATIN SMALL LETTER U WITH CIRCUMFLEX
-   //\  @
-  |/ \| @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-252  LATIN SMALL LETTER U WITH DIAERESIS
-  _   _ @
- (_) (_)@
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-253  LATIN SMALL LETTER Y WITH ACUTE
-    __  @
-  _/_/_ @
- | | | |@
- | |_| |@
-  \__, |@
-  |___/ @@
-254  LATIN SMALL LETTER THORN
-  _     @
- | |__  @
- | '_ \ @
- | |_) |@
- | .__/ @
- |_|    @@
-255  LATIN SMALL LETTER Y WITH DIAERESIS
-  _   _ @
- (_) (_)@
- | | | |@
- | |_| |@
-  \__, |@
-  |___/ @@
-0x0100  LATIN CAPITAL LETTER A WITH MACRON
-   ____ @
-  /___/ @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-0x0101  LATIN SMALL LETTER A WITH MACRON
-    ___ @
-   /_ _/@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-0x0102  LATIN CAPITAL LETTER A WITH BREVE
-  _   _ @
-  \\_// @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-        @@
-0x0103  LATIN SMALL LETTER A WITH BREVE
-   \_/  @
-   ___  @
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-0x0104  LATIN CAPITAL LETTER A WITH OGONEK
-        @
-    _   @
-   /_\  @
-  / _ \ @
- /_/ \_\@
-     (_(@@
-0x0105  LATIN SMALL LETTER A WITH OGONEK
-        @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__,_|@
-     (_(@@
-0x0106  LATIN CAPITAL LETTER C WITH ACUTE
-     __ @
-   _/_/ @
-  / ___|@
- | |___ @
-  \____|@
-        @@
-0x0107  LATIN SMALL LETTER C WITH ACUTE
-    __ @
-   /__/@
-  / __|@
- | (__ @
-  \___|@
-       @@
-0x0108  LATIN CAPITAL LETTER C WITH CIRCUMFLEX
-     /\ @
-   _//\\@
-  / ___|@
- | |___ @
-  \____|@
-        @@
-0x0109  LATIN SMALL LETTER C WITH CIRCUMFLEX
-    /\ @
-   /_\ @
-  / __|@
- | (__ @
-  \___|@
-       @@
-0x010A  LATIN CAPITAL LETTER C WITH DOT ABOVE
-    []  @
-   ____ @
-  / ___|@
- | |___ @
-  \____|@
-        @@
-0x010B  LATIN SMALL LETTER C WITH DOT ABOVE
-   []  @
-   ___ @
-  / __|@
- | (__ @
-  \___|@
-       @@
-0x010C  LATIN CAPITAL LETTER C WITH CARON
-   \\// @
-   _\/_ @
-  / ___|@
- | |___ @
-  \____|@
-        @@
-0x010D  LATIN SMALL LETTER C WITH CARON
-   \\//@
-   _\/ @
-  / __|@
- | (__ @
-  \___|@
-       @@
-0x010E  LATIN CAPITAL LETTER D WITH CARON
-   \\// @
-  __\/  @
- |  _ \ @
- | |_| |@
- |____/ @
-        @@
-0x010F  LATIN SMALL LETTER D WITH CARON
-  \/  _ @
-   __| |@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-0x0110  LATIN CAPITAL LETTER D WITH STROKE
-   ____   @
-  |_ __ \ @
- /| |/ | |@
- /|_|/_| |@
-  |_____/ @
-          @@
-0x0111  LATIN SMALL LETTER D WITH STROKE
-    ---|@
-   __| |@
-  / _` |@
- | (_| |@
-  \__,_|@
-        @@
-0x0112  LATIN CAPITAL LETTER E WITH MACRON
-   ____ @
-  /___/ @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-0x0113  LATIN SMALL LETTER E WITH MACRON
-    ____@
-   /_ _/@
-  / _ \ @
- |  __/ @
-  \___| @
-        @@
-0x0114  LATIN CAPITAL LETTER E WITH BREVE
-  _   _ @
-  \\_// @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-0x0115  LATIN SMALL LETTER E WITH BREVE
-  \\  //@
-    --  @
-  / _ \ @
- |  __/ @
-  \___| @
-        @@
-0x0116  LATIN CAPITAL LETTER E WITH DOT ABOVE
-    []  @
-  _____ @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-0x0117  LATIN SMALL LETTER E WITH DOT ABOVE
-    [] @
-    __ @
-  / _ \@
- |  __/@
-  \___|@
-       @@
-0x0118  LATIN CAPITAL LETTER E WITH OGONEK
-        @
-  _____ @
- | ____|@
- |  _|_ @
- |_____|@
-    (__(@@
-0x0119  LATIN SMALL LETTER E WITH OGONEK
-       @
-   ___ @
-  / _ \@
- |  __/@
-  \___|@
-    (_(@@
-0x011A  LATIN CAPITAL LETTER E WITH CARON
-   \\// @
-  __\/_ @
- | ____|@
- |  _|_ @
- |_____|@
-        @@
-0x011B  LATIN SMALL LETTER E WITH CARON
-   \\//@
-    \/ @
-  / _ \@
- |  __/@
-  \___|@
-       @@
-0x011C  LATIN CAPITAL LETTER G WITH CIRCUMFLEX
-   _/\_ @
-  / ___|@
- | |  _ @
- | |_| |@
-  \____|@
-        @@
-0x011D  LATIN SMALL LETTER G WITH CIRCUMFLEX
-     /\ @
-   _/_ \@
-  / _` |@
- | (_| |@
-  \__, |@
-  |___/ @@
-0x011E  LATIN CAPITAL LETTER G WITH BREVE
-   _\/_ @
-  / ___|@
- | |  _ @
- | |_| |@
-  \____|@
-        @@
-0x011F  LATIN SMALL LETTER G WITH BREVE
-  \___/ @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__, |@
-  |___/ @@
-0x0120  LATIN CAPITAL LETTER G WITH DOT ABOVE
-   _[]_ @
-  / ___|@
- | |  _ @
- | |_| |@
-  \____|@
-        @@
-0x0121  LATIN SMALL LETTER G WITH DOT ABOVE
-   []   @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__, |@
-  |___/ @@
-0x0122  LATIN CAPITAL LETTER G WITH CEDILLA
-   ____ @
-  / ___|@
- | |  _ @
- | |_| |@
-  \____|@
-   )__) @@
-0x0123  LATIN SMALL LETTER G WITH CEDILLA
-        @
-   __ _ @
-  / _` |@
- | (_| |@
-  \__, |@
-  |_))))@@
-0x0124  LATIN CAPITAL LETTER H WITH CIRCUMFLEX
-  _/ \_ @
- | / \ |@
- | |_| |@
- |  _  |@
- |_| |_|@
-        @@
-0x0125  LATIN SMALL LETTER H WITH CIRCUMFLEX
-  _  /\ @
- | |//\ @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-0x0126  LATIN CAPITAL LETTER H WITH STROKE
-  _   _ @
- | |=| |@
- | |_| |@
- |  _  |@
- |_| |_|@
-        @@
-0x0127  LATIN SMALL LETTER H WITH STROKE
-  _     @
- |=|__  @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-0x0128  LATIN CAPITAL LETTER I WITH TILDE
-  /\//@
- |_ _|@
-  | | @
-  | | @
- |___|@
-      @@
-0x0129  LATIN SMALL LETTER I WITH TILDE
-    @
- /\/@
- | |@
- | |@
- |_|@
-    @@
-0x012A  LATIN CAPITAL LETTER I WITH MACRON
- /___/@
- |_ _|@
-  | | @
-  | | @
- |___|@
-      @@
-0x012B  LATIN SMALL LETTER I WITH MACRON
-  ____@
- /___/@
-  | | @
-  | | @
-  |_| @
-      @@
-0x012C  LATIN CAPITAL LETTER I WITH BREVE
-  \__/@
- |_ _|@
-  | | @
-  | | @
- |___|@
-      @@
-0x012D  LATIN SMALL LETTER I WITH BREVE
-    @
- \_/@
- | |@
- | |@
- |_|@
-    @@
-0x012E  LATIN CAPITAL LETTER I WITH OGONEK
-  ___ @
- |_ _|@
-  | | @
-  | | @
- |___|@
-  (__(@@
-0x012F  LATIN SMALL LETTER I WITH OGONEK
-  _  @
- (_) @
- | | @
- | | @
- |_|_@
-  (_(@@
-0x0130  LATIN CAPITAL LETTER I WITH DOT ABOVE
-  _[] @
- |_ _|@
-  | | @
-  | | @
- |___|@
-      @@
-0x0131  LATIN SMALL LETTER DOTLESS I
-    @
-  _ @
- | |@
- | |@
- |_|@
-    @@
-0x0132  LATIN CAPITAL LIGATURE IJ
-  ___  _ @
- |_ _|| |@
-  | | | |@
-  | |_| |@
- |__|__/ @
-         @@
-0x0133  LATIN SMALL LIGATURE IJ
-  _   _ @
- (_) (_)@
- | | | |@
- | | | |@
- |_|_/ |@
-   |__/ @@
-0x0134  LATIN CAPITAL LETTER J WITH CIRCUMFLEX
-      /\ @
-     /_\|@
-  _  | | @
- | |_| | @
-  \___/  @
-         @@
-0x0135  LATIN SMALL LETTER J WITH CIRCUMFLEX
-    /\@
-   /_\@
-   | |@
-   | |@
-  _/ |@
- |__/ @@
-0x0136  LATIN CAPITAL LETTER K WITH CEDILLA
-  _  _  @
- | |/ / @
- | ' /  @
- | . \  @
- |_|\_\ @
-    )__)@@
-0x0137  LATIN SMALL LETTER K WITH CEDILLA
-  _    @
- | | __@
- | |/ /@
- |   < @
- |_|\_\@
-    )_)@@
-0x0138  LATIN SMALL LETTER KRA
-       @
-  _ __ @
- | |/ \@
- |   < @
- |_|\_\@
-       @@
-0x0139  LATIN CAPITAL LETTER L WITH ACUTE
-  _   //@
- | | // @
- | |    @
- | |___ @
- |_____|@
-        @@
-0x013A  LATIN SMALL LETTER L WITH ACUTE
-  //@
- | |@
- | |@
- | |@
- |_|@
-    @@
-0x013B  LATIN CAPITAL LETTER L WITH CEDILLA
-  _     @
- | |    @
- | |    @
- | |___ @
- |_____|@
-    )__)@@
-0x013C  LATIN SMALL LETTER L WITH CEDILLA
-  _   @
- | |  @
- | |  @
- | |  @
- |_|  @
-   )_)@@
-0x013D  LATIN CAPITAL LETTER L WITH CARON
-  _ \\//@
- | | \/ @
- | |    @
- | |___ @
- |_____|@
-        @@
-0x013E  LATIN SMALL LETTER L WITH CARON
-  _ \\//@
- | | \/ @
- | |    @
- | |    @
- |_|    @
-        @@
-0x013F  LATIN CAPITAL LETTER L WITH MIDDLE DOT
-  _     @
- | |    @
- | | [] @
- | |___ @
- |_____|@
-        @@
-0x0140  LATIN SMALL LETTER L WITH MIDDLE DOT
-  _    @
- | |   @
- | | []@
- | |   @
- |_|   @
-       @@
-0x0141  LATIN CAPITAL LETTER L WITH STROKE
-  __    @
- | //   @
- |//|   @
- // |__ @
- |_____|@
-        @@
-0x0142  LATIN SMALL LETTER L WITH STROKE
-  _ @
- | |@
- |//@
- //|@
- |_|@
-    @@
-0x0143  LATIN CAPITAL LETTER N WITH ACUTE
-  _/ /_ @
- | \ | |@
- |  \| |@
- | |\  |@
- |_| \_|@
-        @@
-0x0144  LATIN SMALL LETTER N WITH ACUTE
-     _  @
-  _ /_/ @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-0x0145  LATIN CAPITAL LETTER N WITH CEDILLA
-  _   _ @
- | \ | |@
- |  \| |@
- | |\  |@
- |_| \_|@
- )_)    @@
-0x0146  LATIN SMALL LETTER N WITH CEDILLA
-        @
-  _ __  @
- | '_ \ @
- | | | |@
- |_| |_|@
- )_)    @@
-0x0147  LATIN CAPITAL LETTER N WITH CARON
-  _\/ _ @
- | \ | |@
- |  \| |@
- | |\  |@
- |_| \_|@
-        @@
-0x0148  LATIN SMALL LETTER N WITH CARON
-  \\//  @
-  _\/_  @
- | '_ \ @
- | | | |@
- |_| |_|@
-        @@
-0x0149  LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
-          @
-  _  __   @
- ( )| '_\ @
- |/| | | |@
-   |_| |_|@
-          @@
-0x014A  LATIN CAPITAL LETTER ENG
-  _   _ @
- | \ | |@
- |  \| |@
- | |\  |@
- |_| \ |@
-     )_)@@
-0x014B  LATIN SMALL LETTER ENG
-  _ __  @
- | '_ \ @
- | | | |@
- |_| | |@
-     | |@
-    |__ @@
-0x014C  LATIN CAPITAL LETTER O WITH MACRON
-   ____ @
-  /_ _/ @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-0x014D  LATIN SMALL LETTER O WITH MACRON
-   ____ @
-  /_ _/ @
-  / _ \ @
- | (_) |@
-  \___/ @
-        @@
-0x014E  LATIN CAPITAL LETTER O WITH BREVE
-  \   / @
-   _-_  @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-0x014F  LATIN SMALL LETTER O WITH BREVE
-  \   / @
-   _-_  @
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-0x0150  LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
-    ___ @
-   /_/_/@
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-0x0151  LATIN SMALL LETTER O WITH DOUBLE ACUTE
-    ___ @
-   /_/_/@
-  / _ \ @
- | |_| |@
-  \___/ @
-        @@
-0x0152  LATIN CAPITAL LIGATURE OE
-   ___  ___ @
-  / _ \| __|@
- | | | |  | @
- | |_| | |__@
-  \___/|____@
-            @@
-0x0153  LATIN SMALL LIGATURE OE
-             @
-   ___   ___ @
-  / _ \ / _ \@
- | (_) |  __/@
-  \___/ \___|@
-             @@
-0x0154  LATIN CAPITAL LETTER R WITH ACUTE
-  _/_/  @
- |  _ \ @
- | |_) |@
- |  _ < @
- |_| \_\@
-        @@
-0x0155  LATIN SMALL LETTER R WITH ACUTE
-     __@
-  _ /_/@
- | '__|@
- | |   @
- |_|   @
-       @@
-0x0156  LATIN CAPITAL LETTER R WITH CEDILLA
-  ____  @
- |  _ \ @
- | |_) |@
- |  _ < @
- |_| \_\@
- )_)    @@
-0x0157  LATIN SMALL LETTER R WITH CEDILLA
-       @
-  _ __ @
- | '__|@
- | |   @
- |_|   @
-   )_) @@
-0x0158  LATIN CAPITAL LETTER R WITH CARON
-  _\_/  @
- |  _ \ @
- | |_) |@
- |  _ < @
- |_| \_\@
-        @@
-0x0159  LATIN SMALL LETTER R WITH CARON
-  \\// @
-  _\/_ @
- | '__|@
- | |   @
- |_|   @
-       @@
-0x015A  LATIN CAPITAL LETTER S WITH ACUTE
-  _/_/  @
- / ___| @
- \___ \ @
-  ___) |@
- |____/ @
-        @@
-0x015B  LATIN SMALL LETTER S WITH ACUTE
-    __@
-  _/_/@
- / __|@
- \__ \@
- |___/@
-      @@
-0x015C  LATIN CAPITAL LETTER S WITH CIRCUMFLEX
-  _/\_  @
- / ___| @
- \___ \ @
-  ___) |@
- |____/ @
-        @@
-0x015D  LATIN SMALL LETTER S WITH CIRCUMFLEX
-      @
-  /_\_@
- / __|@
- \__ \@
- |___/@
-      @@
-0x015E  LATIN CAPITAL LETTER S WITH CEDILLA
-  ____  @
- / ___| @
- \___ \ @
-  ___) |@
- |____/ @
-    )__)@@
-0x015F  LATIN SMALL LETTER S WITH CEDILLA
-      @
-  ___ @
- / __|@
- \__ \@
- |___/@
-   )_)@@
-0x0160  LATIN CAPITAL LETTER S WITH CARON
-  _\_/  @
- / ___| @
- \___ \ @
-  ___) |@
- |____/ @
-        @@
-0x0161  LATIN SMALL LETTER S WITH CARON
-  \\//@
-  _\/ @
- / __|@
- \__ \@
- |___/@
-      @@
-0x0162  LATIN CAPITAL LETTER T WITH CEDILLA
-  _____ @
- |_   _|@
-   | |  @
-   | |  @
-   |_|  @
-    )__)@@
-0x0163  LATIN SMALL LETTER T WITH CEDILLA
-  _   @
- | |_ @
- | __|@
- | |_ @
-  \__|@
-   )_)@@
-0x0164  LATIN CAPITAL LETTER T WITH CARON
-  _____ @
- |_   _|@
-   | |  @
-   | |  @
-   |_|  @
-        @@
-0x0165  LATIN SMALL LETTER T WITH CARON
-  \/  @
- | |_ @
- | __|@
- | |_ @
-  \__|@
-      @@
-0x0166  LATIN CAPITAL LETTER T WITH STROKE
-  _____ @
- |_   _|@
-   | |  @
-  -|-|- @
-   |_|  @
-        @@
-0x0167  LATIN SMALL LETTER T WITH STROKE
-  _   @
- | |_ @
- | __|@
- |-|_ @
-  \__|@
-      @@
-0x0168  LATIN CAPITAL LETTER U WITH TILDE
-        @
-  _/\/_ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-0x0169  LATIN SMALL LETTER U WITH TILDE
-        @
-  _/\/_ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-0x016A  LATIN CAPITAL LETTER U WITH MACRON
-   ____ @
-  /__ _/@
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-0x016B  LATIN SMALL LETTER U WITH MACRON
-   ____ @
-  / _  /@
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-0x016C  LATIN CAPITAL LETTER U WITH BREVE
-        @
-   \_/_ @
- | | | |@
- | |_| |@
-  \____|@
-        @@
-0x016D  LATIN SMALL LETTER U WITH BREVE
-        @
-   \_/_ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-0x016E  LATIN CAPITAL LETTER U WITH RING ABOVE
-    O   @
-  __  _ @
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-0x016F  LATIN SMALL LETTER U WITH RING ABOVE
-    O   @
-  __ __ @
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-0x0170  LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
-   -- --@
-  /_//_/@
- | | | |@
- | |_| |@
-  \___/ @
-        @@
-0x0171  LATIN SMALL LETTER U WITH DOUBLE ACUTE
-    ____@
-  _/_/_/@
- | | | |@
- | |_| |@
-  \__,_|@
-        @@
-0x0172  LATIN CAPITAL LETTER U WITH OGONEK
-  _   _ @
- | | | |@
- | | | |@
- | |_| |@
-  \___/ @
-    (__(@@
-0x0173  LATIN SMALL LETTER U WITH OGONEK
-        @
-  _   _ @
- | | | |@
- | |_| |@
-  \__,_|@
-     (_(@@
-0x0174  LATIN CAPITAL LETTER W WITH CIRCUMFLEX
- __    /\  __@
- \ \  //\\/ /@
-  \ \ /\ / / @
-   \ V  V /  @
-    \_/\_/   @
-             @@
-0x0175  LATIN SMALL LETTER W WITH CIRCUMFLEX
-      /\   @
- __  //\\__@
- \ \ /\ / /@
-  \ V  V / @
-   \_/\_/  @
-           @@
-0x0176  LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
-    /\  @
- __//\\ @
- \ \ / /@
-  \ V / @
-   |_|  @
-        @@
-0x0177  LATIN SMALL LETTER Y WITH CIRCUMFLEX
-    /\  @
-   //\\ @
- | | | |@
- | |_| |@
-  \__, |@
-  |___/ @@
-0x0178  LATIN CAPITAL LETTER Y WITH DIAERESIS
-  []  []@
- __    _@
- \ \ / /@
-  \ V / @
-   |_|  @
-        @@
-0x0179  LATIN CAPITAL LETTER Z WITH ACUTE
-  __/_/@
- |__  /@
-   / / @
-  / /_ @
- /____|@
-       @@
-0x017A  LATIN SMALL LETTER Z WITH ACUTE
-    _ @
-  _/_/@
- |_  /@
-  / / @
- /___|@
-      @@
-0x017B  LATIN CAPITAL LETTER Z WITH DOT ABOVE
-  __[]_@
- |__  /@
-   / / @
-  / /_ @
- /____|@
-       @@
-0x017C  LATIN SMALL LETTER Z WITH DOT ABOVE
-   [] @
-  ____@
- |_  /@
-  / / @
- /___|@
-      @@
-0x017D  LATIN CAPITAL LETTER Z WITH CARON
-  _\_/_@
- |__  /@
-   / / @
-  / /_ @
- /____|@
-       @@
-0x017E  LATIN SMALL LETTER Z WITH CARON
-  \\//@
-  _\/_@
- |_  /@
-  / / @
- /___|@
-      @@
-0x017F  LATIN SMALL LETTER LONG S
-     __ @
-    / _|@
- |-| |  @
- |-| |  @
-   |_|  @
-        @@
-0x02C7  CARON
- \\//@
-  \/ @
-    $@
-    $@
-    $@
-    $@@
-0x02D8  BREVE
- \\_//@
-  \_/ @
-     $@
-     $@
-     $@
-     $@@
-0x02D9  DOT ABOVE
- []@
-  $@
-  $@
-  $@
-  $@
-  $@@
-0x02DB  OGONEK
-    $@
-    $@
-    $@
-    $@
-    $@
- )_) @@
-0x02DD  DOUBLE ACUTE ACCENT
-  _ _ @
- /_/_/@
-     $@
-     $@
-     $@
-     $@@
diff --git a/xen/tools/xen.flf b/xen/tools/xen.flf
new file mode 100644
index 0000000..e13e842
--- /dev/null
+++ b/xen/tools/xen.flf
@@ -0,0 +1,2230 @@
+flf2a$ 6 5 16 15 14 0 24463 229
+Standard by Glenn Chappell & Ian Chai 3/93 -- based on Frank's .sig
+Includes ISO Latin-1
+figlet release 2.1 -- 12 Aug 1994
+Modified for figlet 2.2 by John Cowan <cowan@ccil.org>
+  to add Latin-{2,3,4,5} support (Unicode U+0100-017F).
+Permission is hereby given to modify this font, as long as the
+modifier's name is placed on a comment line.
+
+Modified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter
+supported by FIGlet and FIGWin.  May also be slightly modified for better use
+of new full-width/kern/smush alternatives, but default output is NOT changed.
+
+Modified by Keir Fraser <kaf24@cl.cam.ac.uk> for Xen build system.
+
+ $@
+ $@
+ $@
+ $@
+ $@
+ $@@
+  _ @
+ | |@
+ | |@
+ |_|@
+ (_)@
+    @@
+  _ _ @
+ ( | )@
+  V V @
+   $  @
+   $  @
+      @@
+    _  _   @
+  _| || |_ @
+ |_  ..  _|@
+ |_      _|@
+   |_||_|  @
+           @@
+   _  @
+  | | @
+ / __)@
+ \__ \@
+ (   /@
+  |_| @@
+  _  __@
+ (_)/ /@
+   / / @
+  / /_ @
+ /_/(_)@
+       @@
+   ___   @
+  ( _ )  @
+  / _ \/\@
+ | (_>  <@
+  \___/\/@
+         @@
+  _ @
+ ( )@
+ |/ @
+  $ @
+  $ @
+    @@
+   __@
+  / /@
+ | | @
+ | | @
+ | | @
+  \_\@@
+ __  @
+ \ \ @
+  | |@
+  | |@
+  | |@
+ /_/ @@
+       @
+ __/\__@
+ \    /@
+ /_  _\@
+   \/  @
+       @@
+        @
+    _   @
+  _| |_ @
+ |_   _|@
+   |_|  @
+        @@
+    @
+    @
+    @
+  _ @
+ ( )@
+ |/ @@
+     @
+     @
+  __ @
+ |__|@
+  $  @
+     @@
+    @
+    @
+    @
+  _ @
+ (_)@
+    @@
+     __@
+    / /@
+   / / @
+  / /  @
+ /_/   @
+       @@
+   ___  @
+  / _ \ @
+ | | | |@
+ | |_| |@
+  \___/ @
+        @@
+  _ @
+ / |@
+ | |@
+ | |@
+ |_|@
+    @@
+  ____  @
+ |___ \ @
+   __) |@
+  / __/ @
+ |_____|@
+        @@
+  _____ @
+ |___ / @
+   |_ \ @
+  ___) |@
+ |____/ @
+        @@
+  _  _   @
+ | || |  @
+ | || |_ @
+ |__   _|@
+    |_|  @
+         @@
+  ____  @
+ | ___| @
+ |___ \ @
+  ___) |@
+ |____/ @
+        @@
+   __   @
+  / /_  @
+ | '_ \ @
+ | (_) |@
+  \___/ @
+        @@
+  _____ @
+ |___  |@
+    / / @
+   / /  @
+  /_/   @
+        @@
+   ___  @
+  ( _ ) @
+  / _ \ @
+ | (_) |@
+  \___/ @
+        @@
+   ___  @
+  / _ \ @
+ | (_) |@
+  \__, |@
+    /_/ @
+        @@
+    @
+  _ @
+ (_)@
+  _ @
+ (_)@
+    @@
+    @
+  _ @
+ (_)@
+  _ @
+ ( )@
+ |/ @@
+   __@
+  / /@
+ / / @
+ \ \ @
+  \_\@
+     @@
+        @
+  _____ @
+ |_____|@
+ |_____|@
+    $   @
+        @@
+ __  @
+ \ \ @
+  \ \@
+  / /@
+ /_/ @
+     @@
+  ___ @
+ |__ \@
+   / /@
+  |_| @
+  (_) @
+      @@
+    ____  @
+   / __ \ @
+  / / _` |@
+ | | (_| |@
+  \ \__,_|@
+   \____/ @@
+     _    @
+    / \   @
+   / _ \  @
+  / ___ \ @
+ /_/   \_\@
+          @@
+  ____  @
+ | __ ) @
+ |  _ \ @
+ | |_) |@
+ |____/ @
+        @@
+   ____ @
+  / ___|@
+ | |    @
+ | |___ @
+  \____|@
+        @@
+  ____  @
+ |  _ \ @
+ | | | |@
+ | |_| |@
+ |____/ @
+        @@
+  _____ @
+ | ____|@
+ |  _|  @
+ | |___ @
+ |_____|@
+        @@
+  _____ @
+ |  ___|@
+ | |_   @
+ |  _|  @
+ |_|    @
+        @@
+   ____ @
+  / ___|@
+ | |  _ @
+ | |_| |@
+  \____|@
+        @@
+  _   _ @
+ | | | |@
+ | |_| |@
+ |  _  |@
+ |_| |_|@
+        @@
+  ___ @
+ |_ _|@
+  | | @
+  | | @
+ |___|@
+      @@
+      _ @
+     | |@
+  _  | |@
+ | |_| |@
+  \___/ @
+        @@
+  _  __@
+ | |/ /@
+ | ' / @
+ | . \ @
+ |_|\_\@
+       @@
+  _     @
+ | |    @
+ | |    @
+ | |___ @
+ |_____|@
+        @@
+  __  __ @
+ |  \/  |@
+ | |\/| |@
+ | |  | |@
+ |_|  |_|@
+         @@
+  _   _ @
+ | \ | |@
+ |  \| |@
+ | |\  |@
+ |_| \_|@
+        @@
+   ___  @
+  / _ \ @
+ | | | |@
+ | |_| |@
+  \___/ @
+        @@
+  ____  @
+ |  _ \ @
+ | |_) |@
+ |  __/ @
+ |_|    @
+        @@
+   ___  @
+  / _ \ @
+ | | | |@
+ | |_| |@
+  \__\_\@
+        @@
+  ____  @
+ |  _ \ @
+ | |_) |@
+ |  _ < @
+ |_| \_\@
+        @@
+  ____  @
+ / ___| @
+ \___ \ @
+  ___) |@
+ |____/ @
+        @@
+  _____ @
+ |_   _|@
+   | |  @
+   | |  @
+   |_|  @
+        @@
+  _   _ @
+ | | | |@
+ | | | |@
+ | |_| |@
+  \___/ @
+        @@
+ __     __@
+ \ \   / /@
+  \ \ / / @
+   \ V /  @
+    \_/   @
+          @@
+ __        __@
+ \ \      / /@
+  \ \ /\ / / @
+   \ V  V /  @
+    \_/\_/   @
+             @@
+ __  __@
+ \ \/ /@
+  \  / @
+  /  \ @
+ /_/\_\@
+       @@
+ __   __@
+ \ \ / /@
+  \ V / @
+   | |  @
+   |_|  @
+        @@
+  _____@
+ |__  /@
+   / / @
+  / /_ @
+ /____|@
+       @@
+  __ @
+ | _|@
+ | | @
+ | | @
+ | | @
+ |__|@@
+ __    @
+ \ \   @
+  \ \  @
+   \ \ @
+    \_\@
+       @@
+  __ @
+ |_ |@
+  | |@
+  | |@
+  | |@
+ |__|@@
+  /\ @
+ |/\|@
+   $ @
+   $ @
+   $ @
+     @@
+        @
+        @
+        @
+        @
+  _____ @
+ |_____|@@
+  _ @
+ ( )@
+  \|@
+  $ @
+  $ @
+    @@
+        @
+   __ _ @
+  / _` |@
+ | (_| |@
+  \__,_|@
+        @@
+  _     @
+ | |__  @
+ | '_ \ @
+ | |_) |@
+ |_.__/ @
+        @@
+       @
+   ___ @
+  / __|@
+ | (__ @
+  \___|@
+       @@
+      _ @
+   __| |@
+  / _` |@
+ | (_| |@
+  \__,_|@
+        @@
+       @
+   ___ @
+  / _ \@
+ |  __/@
+  \___|@
+       @@
+   __ @
+  / _|@
+ | |_ @
+ |  _|@
+ |_|  @
+      @@
+        @
+   __ _ @
+  / _` |@
+ | (_| |@
+  \__, |@
+  |___/ @@
+  _     @
+ | |__  @
+ | '_ \ @
+ | | | |@
+ |_| |_|@
+        @@
+  _ @
+ (_)@
+ | |@
+ | |@
+ |_|@
+    @@
+    _ @
+   (_)@
+   | |@
+   | |@
+  _/ |@
+ |__/ @@
+  _    @
+ | | __@
+ | |/ /@
+ |   < @
+ |_|\_\@
+       @@
+  _ @
+ | |@
+ | |@
+ | |@
+ |_|@
+    @@
+            @
+  _ __ ___  @
+ | '_ ` _ \ @
+ | | | | | |@
+ |_| |_| |_|@
+            @@
+        @
+  _ __  @
+ | '_ \ @
+ | | | |@
+ |_| |_|@
+        @@
+        @
+   ___  @
+  / _ \ @
+ | (_) |@
+  \___/ @
+        @@
+        @
+  _ __  @
+ | '_ \ @
+ | |_) |@
+ | .__/ @
+ |_|    @@
+        @
+   __ _ @
+  / _` |@
+ | (_| |@
+  \__, |@
+     |_|@@
+       @
+  _ __ @
+ | '__|@
+ | |   @
+ |_|   @
+       @@
+      @
+  ___ @
+ / __|@
+ \__ \@
+ |___/@
+      @@
+  _   @
+ | |_ @
+ | __|@
+ | |_ @
+  \__|@
+      @@
+        @
+  _   _ @
+ | | | |@
+ | |_| |@
+  \__,_|@
+        @@
+        @
+ __   __@
+ \ \ / /@
+  \ V / @
+   \_/  @
+        @@
+           @
+ __      __@
+ \ \ /\ / /@
+  \ V  V / @
+   \_/\_/  @
+           @@
+       @
+ __  __@
+ \ \/ /@
+  >  < @
+ /_/\_\@
+       @@
+        @
+  _   _ @
+ | | | |@
+ | |_| |@
+  \__, |@
+  |___/ @@
+      @
+  ____@
+ |_  /@
+  / / @
+ /___|@
+      @@
+    __@
+   / /@
+  | | @
+ < <  @
+  | | @
+   \_\@@
+  _ @
+ | |@
+ | |@
+ | |@
+ | |@
+ |_|@@
+ __   @
+ \ \  @
+  | | @
+   > >@
+  | | @
+ /_/  @@
+  /\/|@
+ |/\/ @
+   $  @
+   $  @
+   $  @
+      @@
+  _   _ @
+ (_)_(_)@
+   /_\  @
+  / _ \ @
+ /_/ \_\@
+        @@
+  _   _ @
+ (_)_(_)@
+  / _ \ @
+ | |_| |@
+  \___/ @
+        @@
+  _   _ @
+ (_) (_)@
+ | | | |@

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

From xen-changelog-bounces@lists.xen.org Wed Dec 04 10:05:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9KF-0003np-9n; Wed, 04 Dec 2013 10:04: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 1Vo9KB-0003n6-K6
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:58 +0000
Received: from [85.158.139.211:45235] by server-10.bemta-5.messagelabs.com id
	4C/EA-01405-54EFE925; Wed, 04 Dec 2013 10:04:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1386151487!937189!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31253 invoked from network); 4 Dec 2013 10:04:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:04: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 1Vo9K3-00081J-Fk
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9K3-0006ZT-Da
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:47 +0000
Date: Wed, 04 Dec 2013 10:04:47 +0000
Message-Id: <E1Vo9K3-0006ZT-Da@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/build: Remove unreferenced figlet
	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 b49827a385716ef94d466aa34640c56824800b90
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Nov 22 21:09:53 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 2 13:47:06 2013 +0000

    xen/build: Remove unreferenced figlet files
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 .gitignore                |    1 -
 xen/tools/figlet/LICENSE  |  111 ---
 xen/tools/figlet/Makefile |    9 -
 xen/tools/figlet/README   |    9 -
 xen/tools/figlet/figlet.c | 2076 ---------------------------------------------
 5 files changed, 0 insertions(+), 2206 deletions(-)

diff --git a/.gitignore b/.gitignore
index 47f92a4..93aae71 100644
--- a/.gitignore
+++ b/.gitignore
@@ -316,7 +316,6 @@ xen/include/public/public
 xen/include/xen/*.new
 xen/include/xen/acm_policy.h
 xen/include/xen/compile.h
-xen/tools/figlet/figlet
 xen/tools/symbols
 xen/xsm/flask/include/av_perm_to_string.h
 xen/xsm/flask/include/av_permissions.h
diff --git a/xen/tools/figlet/LICENSE b/xen/tools/figlet/LICENSE
deleted file mode 100644
index 59fd244..0000000
--- a/xen/tools/figlet/LICENSE
+++ /dev/null
@@ -1,111 +0,0 @@
-http://www.sunsite.unc.edu/pub/Linux/LICENSES/artistic.license
-
-			 The "Artistic License"
-
-				Preamble
-
-The intent of this document is to state the conditions under which a
-Package may be copied, such that the Copyright Holder maintains some
-semblance of artistic control over the development of the package,
-while giving the users of the package the right to use and distribute
-the Package in a more-or-less customary fashion, plus the right to make
-reasonable modifications.
-
-Definitions:
-
-	"Package" refers to the collection of files distributed by the
-	Copyright Holder, and derivatives of that collection of files
-	created through textual modification.
-
-	"Standard Version" refers to such a Package if it has not been
-	modified, or has been modified in accordance with the wishes
-	of the Copyright Holder.
-
-	"Copyright Holder" is whoever is named in the copyright or
-	copyrights for the package.
-
-	"You" is you, if you're thinking about copying or distributing
-	this Package.
-
-	"Reasonable copying fee" is whatever you can justify on the
-	basis of media cost, duplication charges, time of people involved,
-	and so on.  (You will not be required to justify it to the
-	Copyright Holder, but only to the computing community at large
-	as a market that must bear the fee.)
-
-	"Freely Available" means that no fee is charged for the item
-	itself, though there may be fees involved in handling the item.
-	It also means that recipients of the item may redistribute it
-	under the same conditions they received it.
-
-1. You may make and give away verbatim copies of the source form of the
-Standard Version of this Package without restriction, provided that you
-duplicate all of the original copyright notices and associated disclaimers.
-
-2. You may apply bug fixes, portability fixes and other modifications
-derived from the Public Domain or from the Copyright Holder.  A Package
-modified in such a way shall still be considered the Standard Version.
-
-3. You may otherwise modify your copy of this Package in any way, provided
-that you insert a prominent notice in each changed file stating how and
-when you changed that file, and provided that you do at least ONE of the
-following:
-
-    a) place your modifications in the Public Domain or otherwise make them
-    Freely Available, such as by posting said modifications to Usenet or
-    an equivalent medium, or placing the modifications on a major archive
-    site such as ftp.uu.net, or by allowing the Copyright Holder to include
-    your modifications in the Standard Version of the Package.
-
-    b) use the modified Package only within your corporation or organization.
-
-    c) rename any non-standard executables so the names do not conflict
-    with standard executables, which must also be provided, and provide
-    a separate manual page for each non-standard executable that clearly
-    documents how it differs from the Standard Version.
-
-    d) make other distribution arrangements with the Copyright Holder.
-
-4. You may distribute the programs of this Package in object code or
-executable form, provided that you do at least ONE of the following:
-
-    a) distribute a Standard Version of the executables and library files,
-    together with instructions (in the manual page or equivalent) on where
-    to get the Standard Version.
-
-    b) accompany the distribution with the machine-readable source of
-    the Package with your modifications.
-
-    c) accompany any non-standard executables with their corresponding
-    Standard Version executables, giving the non-standard executables
-    non-standard names, and clearly documenting the differences in manual
-    pages (or equivalent), together with instructions on where to get
-    the Standard Version.
-
-    d) make other distribution arrangements with the Copyright Holder.
-
-5. You may charge a reasonable copying fee for any distribution of this
-Package.  You may charge any fee you choose for support of this Package.
-You may not charge a fee for this Package itself.  However,
-you may distribute this Package in aggregate with other (possibly
-commercial) programs as part of a larger (possibly commercial) software
-distribution provided that you do not advertise this Package as a
-product of your own.
-
-6. The scripts and library files supplied as input to or produced as
-output from the programs of this Package do not automatically fall
-under the copyright of this Package, but belong to whomever generated
-them, and may be sold commercially, and may be aggregated with this
-Package.
-
-7. C or perl subroutines supplied by you and linked into this Package
-shall not be considered part of this Package.
-
-8. The name of the Copyright Holder may not be used to endorse or promote
-products derived from this software without specific prior written permission.
-
-9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
-				The End
diff --git a/xen/tools/figlet/Makefile b/xen/tools/figlet/Makefile
deleted file mode 100644
index b1f1045..0000000
--- a/xen/tools/figlet/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-
-include $(XEN_ROOT)/Config.mk
-
-figlet: figlet.c
-	$(HOSTCC) -o $@ $<
-
-.PHONY: clean
-clean:
-	rm -f *.o figlet
diff --git a/xen/tools/figlet/README b/xen/tools/figlet/README
deleted file mode 100644
index b4c58b3..0000000
--- a/xen/tools/figlet/README
+++ /dev/null
@@ -1,9 +0,0 @@
-
-NB. This is a very hacked version of Figlet 2.2.1. 
-
-Don't use this outside the Xen build system. A proper version of Figlet
-can be had from <http://www.figlet.org>.
-
-The distribution license is intact in the LICENSE file.
-
- -- Keir Fraser (2/5/2003)
diff --git a/xen/tools/figlet/figlet.c b/xen/tools/figlet/figlet.c
deleted file mode 100644
index 4232a91..0000000
--- a/xen/tools/figlet/figlet.c
+++ /dev/null
@@ -1,2076 +0,0 @@
-
-/*
- * XXXXXXXXXXXXXXXXXXXXXXXXXXX
- * 
- * This is a HACKED figlet source file for Xen.
- * 
- * Hacked to output C octal strings for inclusion in a header file.
- * Support for opening zipped files is removed.
- * 
- * Go to www.figlet.org for the unhacked Figlet sources.
- */
-
-/****************************************************************************
-
-  FIGlet Copyright 1991, 1993, 1994 Glenn Chappell and Ian Chai
-  FIGlet Copyright 1996, 1997, 1998, 1999, 2000, 2001 John Cowan
-  FIGlet Copyright 2002 Christiaan Keet
-  Portions written by Paul Burton and Christiaan Keet
-  Internet: <info@figlet.org>
-  FIGlet, along with the various FIGlet fonts and documentation, is
-    copyrighted under the provisions of the Artistic License (as listed
-    in the file "Artistic-license.txt" which is included in this package.
-****************************************************************************/
-
-#define DATE "13 July 2002"
-#define VERSION "2.2.1"
-#define VERSION_INT 20201
-
-/* FIGlet (Frank, Ian & Glenn's Letters) */
-/* by Glenn Chappell */
-/* Apr 1991 */
-/* Automatic file addition by Ian Chai May 1991 */
-/* Punctuation and numbers addition by Ian Chai Jan 1993 */
-/* Full ASCII by Glenn Chappell Feb 1993 */
-/* Line-breaking, general rewrite by Glenn Chappell Mar 1993 */
-/* Hard blanks by Glenn Chappell Apr 1993 */
-/* Release 2.0 5 Aug 1993 */
-/* Right-to-left printing, extended char set by Glenn Chappell Dec 1993 */
-/* Control files by Glenn Chappell Feb 1994 */
-/* Release 2.1 12 Aug 1994 */
-/* Release 2.1.1 25 Aug 1994 */
-/* Release 2.1.2 by Gilbert (Mad Programmer) Healton: Add -A command line 
-   option.  Sept 8, 1996 */
-/* Release 2.2 by John Cowan: multibyte inputs, compressed fonts,
-   mapping tables, kerning/smushing options. */
-/* Release 2.2.1 by Christiaan Keet: minor updates including readmes
-   FAQs and comments. 13 July 2002. The new official FIGlet website is 
-   http://www.figlet.org/  */
-
-#define DEFAULTFONTDIR "."
-#define DEFAULTFONTFILE "xen.flf"
-
-#include <stdio.h>
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#include <string.h>
-#include <ctype.h>
-#include <fcntl.h>     /* Needed for get_columns */
-
-#ifdef unix
-#include <sys/ioctl.h> /* Needed for get_columns */
-#endif
-
-
-#define ZFILE FILE
-#define Zopen fopen
-#define Zgetc fgetc
-#define Zungetc(_x,_y) fseek(_y,-1,SEEK_CUR)
-#define Zclose fclose
-
-#define MYSTRLEN(x) ((int)strlen(x)) /* Eliminate ANSI problem */
-
-#define DIRSEP '/'
-#define DIRSEP2 '\\'
-/* Leave alone for Unix and MS-DOS/Windows!
-Note: '/' also used in filename in get_columns(). */
-
-#define FONTFILESUFFIX ".flf"
-#define FONTFILEMAGICNUMBER "flf2"
-#define FSUFFIXLEN MYSTRLEN(FONTFILESUFFIX)
-#define CONTROLFILESUFFIX ".flc"
-#define CONTROLFILEMAGICNUMBER "flc2"   /* no longer used in 2.2 */
-#define CSUFFIXLEN MYSTRLEN(CONTROLFILESUFFIX)
-#define DEFAULTCOLUMNS 80
-
-
-/****************************************************************************
-
-  Globals dealing with chars that are read
-
-****************************************************************************/
-
-typedef long inchr; /* "char" read from stdin */
-
-inchr *inchrline;  /* Alloc'd inchr inchrline[inchrlinelenlimit+1]; */
-                   /* Note: not null-terminated. */
-int inchrlinelen,inchrlinelenlimit;
-inchr deutsch[7] = {196, 214, 220, 228, 246, 252, 223};
-  /* Latin-1 codes for German letters, respectively:
-     LATIN CAPITAL LETTER A WITH DIAERESIS = A-umlaut
-     LATIN CAPITAL LETTER O WITH DIAERESIS = O-umlaut
-     LATIN CAPITAL LETTER U WITH DIAERESIS = U-umlaut
-     LATIN SMALL LETTER A WITH DIAERESIS = a-umlaut
-     LATIN SMALL LETTER O WITH DIAERESIS = o-umlaut
-     LATIN SMALL LETTER U WITH DIAERESIS = u-umlaut
-     LATIN SMALL LETTER SHARP S = ess-zed
-  */
-
-int hzmode;  /* true if reading double-bytes in HZ mode */
-int gndbl[4]; /* gndbl[n] is true if Gn is double-byte */
-inchr gn[4]; /* Gn character sets: ASCII, Latin-1, none, none */
-int gl; /* 0-3 specifies left-half Gn character set */
-int gr; /* 0-3 specifies right-half Gn character set */
-
-int Myargc;  /* to avoid passing around argc and argv */
-char **Myargv;
-
-/****************************************************************************
-
-  Globals dealing with chars that are written
-
-****************************************************************************/
-
-typedef struct fc {
-  inchr ord;
-  char **thechar;  /* Alloc'd char thechar[charheight][]; */
-  struct fc *next;
-  } fcharnode;
-
-fcharnode *fcharlist;
-char **currchar;
-int currcharwidth;
-int previouscharwidth;
-char **outputline;    /* Alloc'd char outputline[charheight][outlinelenlimit+1]; */
-int outlinelen;
-
-
-/****************************************************************************
-
-  Globals dealing with command file storage
-
-****************************************************************************/
-
-typedef struct cfn {
-  char *thename;
-  struct cfn *next;
-  } cfnamenode;
-
-cfnamenode *cfilelist,**cfilelistend;
-
-typedef struct cm {
-  int thecommand;
-  inchr rangelo;
-  inchr rangehi;
-  inchr offset;
-  struct cm *next;
-  } comnode;
-
-comnode *commandlist,**commandlistend;
-
-/****************************************************************************
-
-  Globals affected by command line options
-
-****************************************************************************/
-
-int deutschflag,justification,paragraphflag,right2left,multibyte;
-int cmdinput;
-
-#define SM_SMUSH 128
-#define SM_KERN 64
-#define SM_EQUAL 1
-#define SM_LOWLINE 2
-#define SM_HIERARCHY 4
-#define SM_PAIR 8
-#define SM_BIGX 16
-#define SM_HARDBLANK 32
-
-int smushmode;
-
-#define SMO_NO 0     /* no command-line smushmode */
-#define SMO_YES 1    /* use command-line smushmode, ignore font smushmode */
-#define SMO_FORCE 2  /* logically OR command-line and font smushmodes */
-
-int smushoverride;
-
-int outputwidth;
-int outlinelenlimit;
-char *fontdirname,*fontname;
-
-
-/****************************************************************************
-
-  Globals read from font file
-
-****************************************************************************/
-
-char hardblank;
-int charheight;
-
-
-/****************************************************************************
-
-  Name of program, used in error messages
-
-****************************************************************************/
-
-char *myname;
-
-
-#ifdef TIOCGWINSZ
-/****************************************************************************
-
-  get_columns
-
-  Determines the number of columns of /dev/tty.  Returns the number of
-  columns, or -1 if error.  May return 0 if columns unknown.
-  Requires include files <fcntl.h> and <sys/ioctl.h>.
-  by Glenn Chappell & Ian Chai 14 Apr 1993
-
-****************************************************************************/
-
-int get_columns()
-{
-  struct winsize ws;
-  int fd,result;
-
-  if ((fd = open("/dev/tty",O_WRONLY))<0) return -1;
-  result = ioctl(fd,TIOCGWINSZ,&ws);
-  close(fd);
-  return result?-1:ws.ws_col;
-}
-#endif /* ifdef TIOCGWINSZ */
-
-
-/****************************************************************************
-
-  myalloc
-
-  Calls malloc.  If malloc returns error, prints error message and
-  quits.
-
-****************************************************************************/
-
-#ifdef __STDC__
-char *myalloc(size_t size)
-#else
-char *myalloc(size)
-int size;
-#endif
-{
-  char *ptr;
-#ifndef __STDC__
-  extern void *malloc();
-#endif
-
-  if ((ptr = (char*)malloc(size))==NULL) {
-    fprintf(stderr,"%s: Out of memory\n",myname);
-    exit(1);
-    }
-  else {
-    return ptr;
-    }
-}
-
-
-/****************************************************************************
-
-  hasdirsep
-
-  Returns true if s1 contains a DIRSEP or DIRSEP2 character.
-
-****************************************************************************/
-
-int hasdirsep(s1)
-char *s1;
-{
-  if (strchr(s1, DIRSEP)) return 1;
-  else if (strchr(s1, DIRSEP2)) return 1;
-  else return 0;
-}
-
-/****************************************************************************
-
-  suffixcmp
-
-  Returns true if s2 is a suffix of s1; uses case-blind comparison.
-
-****************************************************************************/
-
-int suffixcmp(s1, s2)
-char *s1;
-char *s2;
-{
-  int len1, len2;
-
-  len1 = MYSTRLEN(s1);
-  len2 = MYSTRLEN(s2);
-  if (len2 > len1) return 0;
-  s1 += len1 - len2;
-  while (*s1) {
-    if (tolower(*s1) != tolower(*s2)) return 0;
-    s1++;
-    s2++;
-    }
-  return 1;
-}
-   
-/****************************************************************************
-
-  skiptoeol
-
-  Skips to the end of a line, given a stream.  Handles \r, \n, or \r\n.
-
-****************************************************************************/
-
-void skiptoeol(fp)
-ZFILE *fp;
-{
-  int dummy;
-
-  while (dummy=Zgetc(fp),dummy!=EOF) {
-    if (dummy == '\n') return;
-    if (dummy == '\r') {
-      dummy = Zgetc(fp);
-      if (dummy != EOF && dummy != '\n') Zungetc(dummy,fp);
-      return;
-      }
-  }
-}
-
-
-/****************************************************************************
-
-  myfgets
-
-  Local version of fgets.  Handles \r, \n, and \r\n terminators.
-
-****************************************************************************/
-
-char *myfgets(line,maxlen,fp)
-char *line;
-int maxlen;
-ZFILE *fp;
-{
-  int c = 0;
-  char *p;
-
-  p = line;
-  while((c=Zgetc(fp))!=EOF&&maxlen) {
-    *p++ = c;
-    maxlen--;
-    if (c=='\n') break;
-    if (c=='\r') {
-      c = Zgetc(fp);
-      if (c != EOF && c != '\n') Zungetc(c,fp);
-      *(p-1) = '\n';
-      break;
-      }
-    }
-  *p = 0;
-  return (c==EOF) ? NULL : line;
-}
-
-/****************************************************************************
-
-  usageerr
-
-  Prints "Usage: ...." line to the given stream.
-
-****************************************************************************/
-
-void printusage(out)
-FILE *out;
-{
-  fprintf(out,
-    "Usage: %s [ -cklnoprstvxDELNRSWX ] [ -d fontdirectory ]\n",
-    myname);
-  fprintf(out,
-    "              [ -f fontfile ] [ -m smushmode ] [ -w outputwidth ]\n");
-  fprintf(out,
-    "              [ -C controlfile ] [ -I infocode ] [ message ]\n");
-}
-
-
-/****************************************************************************
-
-  printinfo
-
-  Prints version and copyright message, or utility information.
-
-****************************************************************************/
-
-void printinfo(infonum)
-int infonum;
-{
-  switch (infonum) {
-    case 0: /* Copyright message */
-      printf("FIGlet Copyright 1991-2002 Glenn Chappell, Ian Chai, ");
-      printf("John Cowan, Christiaan Keet\n");
-      printf("Internet: <info@figlet.org> ");
-      printf("Version: %s, date: %s\n\n",VERSION,DATE);
-      printf("FIGlet, along with the various FIGlet fonts");
-      printf(" and documentation, may be\n");
-      printf("freely copied and distributed.\n\n");
-      printf("If you use FIGlet, please send an");
-      printf(" e-mail message to <info@figlet.org>.\n\n");
-      printf("The latest version of FIGlet is available from the");
-      printf(" web site,\n\thttp://www.figlet.org/\n\n");
-      printusage(stdout);
-      break;
-    case 1: /* Version (integer) */
-      printf("%d\n",VERSION_INT);
-      break;
-    case 2: /* Font directory */
-      printf("%s\n",fontdirname);
-      break;
-    case 3: /* Font */
-      printf("%s\n",fontname);
-      break;
-    case 4: /* Outputwidth */
-      printf("%d\n",outputwidth);
-    }
-}
-
-
-/****************************************************************************
-
-  readmagic
-
-  Reads a four-character magic string from a stream.
-
-****************************************************************************/
-void readmagic(fp,magic)
-ZFILE *fp;
-char *magic;
-{
-  int i;
-
-  for (i=0;i<4;i++) {
-    magic[i] = Zgetc(fp);
-    }
-  magic[4] = 0;
-  }
-  
-/****************************************************************************
-
-  skipws
-
-  Skips whitespace characters from a stream.
-
-****************************************************************************/
-void skipws(fp)
-ZFILE *fp;
-{
-  int c;
-  while (c=Zgetc(fp),isascii(c)&&isspace(c)) ;
-  Zungetc(c,fp);
-  }
-
-/****************************************************************************
-
-  readnum
-
-  Reads a number from a stream.  Accepts "0" prefix for octal and
-  "0x" or "0X" for hexadecimal.  Ignores leading whitespace.
-
-****************************************************************************/
-void readnum(fp,nump)
-ZFILE *fp;
-inchr *nump;
-{
-  int acc = 0;
-  char *p;
-  int c;
-  int base;
-  int sign = 1;
-  char digits[] = "0123456789ABCDEF";
-
-  skipws(fp);
-  c = Zgetc(fp);
-  if (c=='-') {
-    sign = -1;
-    }
-  else {
-    Zungetc(c,fp);
-    }
-  c = Zgetc(fp);
-  if (c=='0') {
-     c = Zgetc(fp);
-     if (c=='x'||c=='X') {
-       base = 16;
-       }
-     else {
-       base = 8;
-       Zungetc(c,fp);
-       }
-    }
-  else {
-    base = 10;
-    Zungetc(c,fp);
-    }
-
-  while((c=Zgetc(fp))!=EOF) {
-    c=toupper(c);
-    p=strchr(digits,c);
-    if (!p) {
-      Zungetc(c,fp);
-      *nump = acc * sign;
-      return;
-      }
-    acc = acc*base+(p-digits);
-    }
-  *nump = acc * sign;
-  }  
-
-/****************************************************************************
-
-  readTchar
-
-  Reads a control file "T" command character specification.
-
-  Character is a single byte, an escape sequence, or
-  an escaped numeric.
-
-****************************************************************************/
-
-inchr readTchar(fp)
-ZFILE *fp;
-{
-  inchr thechar;
-  char next;
-
-  thechar=Zgetc(fp);
-  if (thechar=='\n' || thechar=='\r') { /* Handle badly-formatted file */
-    Zungetc(thechar,fp);
-    return '\0';
-    }
-  if (thechar!='\\') return thechar;
-  next=Zgetc(fp);
-  switch(next) {
-    case 'a':
-      return 7;
-    case 'b':
-      return 8;
-    case 'e':
-      return 27;
-    case 'f':
-      return 12;
-    case 'n':
-      return 10;
-    case 'r':
-      return 13;
-    case 't':
-      return 9;
-    case 'v':
-      return 11;
-    default:
-      if (next=='-' || next=='x' || (next>='0' && next<='9')) {
-        Zungetc(next,fp);
-        readnum(fp,&thechar);
-        return thechar;
-        }
-      return next;
-    }
-}
-
-/****************************************************************************
-
-  charsetname
-
-  Get a Tchar representing a charset name, or 0 if none available.
-  Called in getcharset().
-
-****************************************************************************/
-
-inchr charsetname(fp)
-ZFILE *fp;
-{
-  inchr result;
-
-  result = readTchar(fp);
-  if (result == '\n' || result == '\r') {
-    result = 0;
-    Zungetc(result,fp);
-    }
-  return result;
-  }
-
-/****************************************************************************
-
-  charset
-
-  Processes "g[0123]" character set specifier
-  Called in readcontrol().
-
-****************************************************************************/
-
-void charset(n, controlfile)
-int n;
-ZFILE *controlfile;
-{
-  int ch;
-
-  skipws(controlfile);
-  if (Zgetc(controlfile) != '9') {
-    skiptoeol(controlfile);
-    return;
-    }
-  ch = Zgetc(controlfile);
-  if (ch == '6') {
-     gn[n] = 65536L * charsetname(controlfile) + 0x80;
-     gndbl[n] = 0;
-     skiptoeol(controlfile);
-     return;
-     }
-  if (ch != '4') {
-    skiptoeol(controlfile);
-    return;
-    }
-  ch = Zgetc(controlfile);
-  if (ch == 'x') {
-     if (Zgetc(controlfile) != '9') {
-       skiptoeol(controlfile);
-       return;
-       }
-     if (Zgetc(controlfile) != '4') {
-       skiptoeol(controlfile);
-       return;
-       }
-     skipws(controlfile);
-     gn[n] = 65536L * charsetname(controlfile);
-     gndbl[n] = 1;
-     skiptoeol(controlfile);
-     return;
-     }
-  Zungetc(ch, controlfile);
-  skipws(controlfile);
-  gn[n] = 65536L * charsetname(controlfile);
-  gndbl[n] = 0;
-  return;
-  }
-
-/****************************************************************************
-
-  readcontrol
-
-  Allocates memory and reads in the given control file.
-  Called in readcontrolfiles().
-
-****************************************************************************/
-
-void readcontrol(controlname)
-char *controlname;
-{
-  inchr firstch,lastch;
-  char dashcheck;
-  inchr offset;
-  char *controlpath,magicnum[5];
-  int command;
-  ZFILE *controlfile;
-  int namelen;
-
-  namelen = MYSTRLEN(fontdirname);
-  controlpath = (char*)myalloc(sizeof(char)
-    *(namelen+MYSTRLEN(controlname)+CSUFFIXLEN+2));
-  controlfile = NULL;
-  if (!hasdirsep(controlname)) {
-    strcpy(controlpath,fontdirname);
-    controlpath[namelen] = DIRSEP;
-    controlpath[namelen+1] = '\0';
-    strcat(controlpath,controlname);
-    strcat(controlpath,CONTROLFILESUFFIX);
-    controlfile = Zopen(controlpath,"rb");
-    }
-  if (controlfile==NULL) {
-    strcpy(controlpath,controlname);
-    strcat(controlpath,CONTROLFILESUFFIX);
-    controlfile = Zopen(controlpath,"rb");
-    if (controlfile==NULL) {
-      fprintf(stderr,"%s: %s: Unable to open control file\n",myname,
-        controlpath);
-      exit(1);
-      }
-    }
-
-  free(controlpath);
-
-  (*commandlistend) = (comnode*)myalloc(sizeof(comnode));
-  (*commandlistend)->thecommand = 0; /* Begin with a freeze command */
-  commandlistend = &(*commandlistend)->next;
-  (*commandlistend) = NULL;
-
-  while(command=Zgetc(controlfile),command!=EOF) {
-    switch (command) {
-      case 't': /* Translate */
-        skipws(controlfile);
-        firstch=readTchar(controlfile);
-        if ((dashcheck=Zgetc(controlfile))=='-') {
-          lastch=readTchar(controlfile);
-          }
-        else {
-          Zungetc(dashcheck,controlfile);
-          lastch=firstch;
-          }
-        skipws(controlfile);
-        offset=readTchar(controlfile)-firstch;
-        skiptoeol(controlfile);
-        (*commandlistend) = (comnode*)myalloc(sizeof(comnode));
-        (*commandlistend)->thecommand = 1;
-        (*commandlistend)->rangelo = firstch;
-        (*commandlistend)->rangehi = lastch;
-        (*commandlistend)->offset = offset;
-        commandlistend = &(*commandlistend)->next;
-        (*commandlistend) = NULL;
-        break;
-      case '0': case '1': case '2': case '3': case '4':
-      case '5': case '6': case '7': case '8': case '9':
-      case '-':
-                /* Mapping table entry */
-        Zungetc(command,controlfile);
-        readnum(controlfile,&firstch);
-        skipws(controlfile);
-	readnum(controlfile,&lastch);
-	offset=lastch-firstch;
-        lastch=firstch;
-        skiptoeol(controlfile);
-        (*commandlistend) = (comnode*)myalloc(sizeof(comnode));
-        (*commandlistend)->thecommand = 1;
-        (*commandlistend)->rangelo = firstch;
-        (*commandlistend)->rangehi = lastch;
-        (*commandlistend)->offset = offset;
-        commandlistend = &(*commandlistend)->next;
-        (*commandlistend) = NULL;
-        break;
-      case 'f': /* freeze */
-        skiptoeol(controlfile);
-        (*commandlistend) = (comnode*)myalloc(sizeof(comnode));
-        (*commandlistend)->thecommand = 0;
-        commandlistend = &(*commandlistend)->next;
-        (*commandlistend) = NULL;
-        break;
-      case 'b': /* DBCS input mode */
-        multibyte = 1;
-        break;
-      case 'u': /* UTF-8 input mode */
-        multibyte = 2;
-        break;
-      case 'h': /* HZ input mode */
-        multibyte = 3;
-        break;
-      case 'j': /* Shift-JIS input mode */
-        multibyte = 4;
-        break;
-      case 'g': /* ISO 2022 character set choices */
-        multibyte = 0;
-        skipws(controlfile);
-        command=Zgetc(controlfile);
-        switch (command) {
-          case '0': /* define G0 charset */
-            charset(0, controlfile);
-            break;
-          case '1': /* set G1 charset */
-            charset(1, controlfile);
-            break;
-          case '2': /* set G2 charset */
-            charset(2, controlfile);
-            break;
-          case '3': /* set G3 charset */
-            charset(3, controlfile);
-            break;
-          case 'l': case 'L': /* define left half */
-            skipws(controlfile);
-            gl = Zgetc(controlfile) - '0';
-            skiptoeol(controlfile);
-            break;
-          case 'r': case 'R': /* define right half */
-            skipws(controlfile);
-            gr = Zgetc(controlfile) - '0';
-            skiptoeol(controlfile);
-            break;
-          default: /* meaningless "g" command */
-            skiptoeol(controlfile);
-          }
-      case '\r': case '\n': /* blank line */
-        break;
-      default: /* Includes '#' */
-        skiptoeol(controlfile);
-      }
-    }
-  Zclose(controlfile);
-}
-
-
-/****************************************************************************
-
-  readcontrolfiles
-
-  Reads in the controlfiles names in cfilelist.  Uses readcontrol.
-  Called in main().
-
-****************************************************************************/
-
-void readcontrolfiles()
-{
-  cfnamenode *cfnptr;
-
-  for (cfnptr=cfilelist;cfnptr!=NULL;cfnptr=cfnptr->next) {
-    readcontrol(cfnptr->thename);
-    }
-}
-
-
-/****************************************************************************
-
-  clearcfilelist
-
-  Clears the control file list.  Assumes thename does not need freeing.
-
-****************************************************************************/
-
-void clearcfilelist()
-{
-  cfnamenode *cfnptr1,*cfnptr2;
-
-  cfnptr1 = cfilelist;
-  while (cfnptr1 != NULL) {
-    cfnptr2 = cfnptr1->next;
-    free(cfnptr1);
-    cfnptr1 = cfnptr2;
-    }
-  cfilelist = NULL;
-  cfilelistend = &cfilelist;
-}
-
-
-/****************************************************************************
-
-  getparams
-
-  Handles all command-line parameters.  Puts all parameters within
-  bounds.
-
-****************************************************************************/
-
-void getparams()
-{
-  extern char *optarg;
-  extern int optind;
-  int c; /* "Should" be a char -- need int for "!= -1" test*/
-  int columns,firstfont,infoprint;
-  char *controlname;
-
-  if ((myname = strrchr(Myargv[0],DIRSEP))!=NULL) {
-    myname++;
-    }
-  else {
-    myname = Myargv[0];
-    }
-  fontdirname = DEFAULTFONTDIR;
-  firstfont = 1;
-  fontname = (char*)myalloc(sizeof(char)*(MYSTRLEN(DEFAULTFONTFILE)+1));
-  strcpy(fontname,DEFAULTFONTFILE); /* Some systems don't have strdup() */
-  if (suffixcmp(fontname,FONTFILESUFFIX)) {
-    fontname[MYSTRLEN(fontname)-FSUFFIXLEN]='\0';
-    }
-  cfilelist = NULL;
-  cfilelistend = &cfilelist;
-  commandlist = NULL;
-  commandlistend = &commandlist;
-  smushoverride = SMO_NO;
-  deutschflag = 0;
-  justification = -1;
-  right2left = -1;
-  paragraphflag = 0;
-  infoprint = -1;
-  cmdinput = 0;
-  outputwidth = DEFAULTCOLUMNS;
-  gn[1] = 0x80;
-  gr = 1;
-  while ((c = getopt(Myargc,Myargv,"ADEXLRI:xlcrpntvm:w:d:f:C:NFskSWo"))!= -1) {
-      /* Note: -F is not a legal option -- prints a special err message.  */
-    switch (c) {
-      case 'A':
-        cmdinput = 1;
-        break;
-      case 'D':
-        deutschflag = 1;
-        break;
-      case 'E':
-        deutschflag = 0;
-        break;
-      case 'X':
-        right2left = -1;
-        break;
-      case 'L':
-        right2left = 0;
-        break;
-      case 'R':
-        right2left = 1;
-        break;
-      case 'x':
-        justification = -1;
-        break;
-      case 'l':
-        justification = 0;
-        break;
-      case 'c':
-        justification = 1;
-        break;
-      case 'r':
-        justification = 2;
-        break;
-      case 'p':
-        paragraphflag = 1;
-        break;
-      case 'n':
-        paragraphflag = 0;
-        break;
-      case 's':
-        smushoverride = SMO_NO;
-        break;
-      case 'k':
-        smushmode = SM_KERN;
-        smushoverride = SMO_YES;
-        break;
-      case 'S':
-        smushmode = SM_SMUSH;
-	smushoverride = SMO_FORCE;
-        break;
-      case 'o':
-        smushmode = SM_SMUSH;
-	smushoverride = SMO_YES;
-        break;
-      case 'W':
-        smushmode = 0;
-	smushoverride = SMO_YES;
-        break;
-      case 't':
-#ifdef TIOCGWINSZ
-        columns = get_columns();
-        if (columns>0) {
-          outputwidth = columns;
-          }
-#else /* ifdef TIOCGWINSZ */
-        fprintf(stderr,
-          "%s: \"-t\" is disabled, since ioctl is not fully implemented.\n",
-          myname);
-#endif /* ifdef TIOCGWINSZ */
-        break;
-      case 'v':
-        infoprint = 0;
-        break;
-      case 'I':
-        infoprint = atoi(optarg);
-        break;
-      case 'm':
-        smushmode = atoi(optarg);
-        if (smushmode < -1) {
-          smushoverride = SMO_NO;
-          break;
-          }
-	if (smushmode == 0) smushmode = SM_KERN;
-	else if (smushmode == -1) smushmode = 0;
-	else smushmode = (smushmode & 63) | SM_SMUSH;
-	smushoverride = SMO_YES;
-        break;
-      case 'w':
-        columns = atoi(optarg);
-        if (columns>0) {
-          outputwidth = columns;
-          }
-        break;
-      case 'd':
-        fontdirname = optarg;
-        break;
-      case 'f':
-        if (firstfont) {
-          free(fontname);
-          firstfont = 0;
-          }
-        fontname = optarg;
-        if (suffixcmp(fontname,FONTFILESUFFIX)) {
-          fontname[MYSTRLEN(fontname)-FSUFFIXLEN] = '\0';
-          }
-        break;
-      case 'C':
-        controlname = optarg;
-        if (suffixcmp(controlname, CONTROLFILESUFFIX)) {
-          controlname[MYSTRLEN(controlname)-CSUFFIXLEN] = '\0';
-          }
-        (*cfilelistend) = (cfnamenode*)myalloc(sizeof(cfnamenode));
-        (*cfilelistend)->thename = controlname;
-        cfilelistend = &(*cfilelistend)->next;
-        (*cfilelistend) = NULL;
-        break;
-      case 'N':
-        clearcfilelist();
-        multibyte = 0;
-        gn[0] = 0;
-        gn[1] = 0x80;
-        gn[2] = gn[3] = 0;
-        gndbl[0] = gndbl[1] = gndbl[2] = gndbl[3] = 0;
-        gl = 0;
-        gr = 1;
-        break;
-      case 'F': /* Not a legal option */
-        fprintf(stderr,"%s: illegal option -- F\n",myname);
-        printusage(stderr);
-        fprintf(stderr,"\nBecause of numerous incompatibilities, the");
-        fprintf(stderr," \"-F\" option has been\n");
-        fprintf(stderr,"removed.  It has been replaced by the \"figlist\"");
-        fprintf(stderr," program, which is now\n");
-        fprintf(stderr,"included in the basic FIGlet package.  \"figlist\"");
-        fprintf(stderr," is also available\n");
-        fprintf(stderr,"from  http://www.figlet.org/");
-        fprintf(stderr,"under UNIX utilities.\n");
-        exit(1);
-        break;
-      default:
-        printusage(stderr);
-        exit(1);
-      }
-    }
-  if (optind!=Myargc) cmdinput = 1; /* force cmdinput if more arguments */
-  outlinelenlimit = outputwidth-1;
-  if (infoprint>=0) {
-    printinfo(infoprint);
-    exit(0);
-    }
-}
-
-
-/****************************************************************************
-
-  clearline
-
-  Clears both the input (inchrline) and output (outputline) storage.
-
-****************************************************************************/
-
-void clearline()
-{
-  int i;
-
-  for (i=0;i<charheight;i++) {
-    outputline[i][0] = '\0';
-    }
-  outlinelen = 0;
-  inchrlinelen = 0;
-}
-
-
-/****************************************************************************
-
-  readfontchar
-
-  Reads a font character from the font file, and places it in a
-  newly-allocated entry in the list.
-
-****************************************************************************/
-
-void readfontchar(file,theord,line,maxlen)
-ZFILE *file;
-inchr theord;
-char *line;
-int maxlen;
-{
-  int row,k;
-  char endchar;
-  fcharnode *fclsave;
-
-  fclsave = fcharlist;
-  fcharlist = (fcharnode*)myalloc(sizeof(fcharnode));
-  fcharlist->ord = theord;
-  fcharlist->thechar = (char**)myalloc(sizeof(char*)*charheight);
-  fcharlist->next = fclsave;
-  for (row=0;row<charheight;row++) {
-    if (myfgets(line,maxlen+1,file)==NULL) {
-      line[0] = '\0';
-      }
-    k = MYSTRLEN(line)-1;
-    while (k>=0 && isspace(line[k])) {
-      k--;
-      }
-    if (k>=0) {
-      endchar = line[k];
-      while (k>=0 ? line[k]==endchar : 0) {
-        k--;
-        }
-      }
-    line[k+1] = '\0';
-    fcharlist->thechar[row] = (char*)myalloc(sizeof(char)*(k+2));
-    strcpy(fcharlist->thechar[row],line);
-    }
-}
-
-
-/****************************************************************************
-
-  readfont
-
-  Allocates memory, initializes variables, and reads in the font.
-  Called near beginning of main().
-
-****************************************************************************/
-
-void readfont()
-{
-#define MAXFIRSTLINELEN 1000
-  int i,row,numsread;
-  inchr theord;
-  int maxlen,cmtlines,ffright2left;
-  int smush,smush2;
-  char *fontpath,*fileline,magicnum[5];
-  ZFILE *fontfile;
-  int namelen;
-
-  namelen = MYSTRLEN(fontdirname);
-  fontpath = (char*)myalloc(sizeof(char)
-    *(namelen+MYSTRLEN(fontname)+FSUFFIXLEN+2));
-  fontfile = NULL;
-  if (!hasdirsep(fontname)) {
-    strcpy(fontpath,fontdirname);
-    fontpath[namelen] = DIRSEP;
-    fontpath[namelen+1] = '\0';
-    strcat(fontpath,fontname);
-    strcat(fontpath,FONTFILESUFFIX);
-    fontfile = Zopen(fontpath,"rb");
-    }
-  if (fontfile==NULL) {
-    strcpy(fontpath,fontname);
-    strcat(fontpath,FONTFILESUFFIX);
-    fontfile = Zopen(fontpath,"rb");
-    if (fontfile==NULL) {
-      fprintf(stderr,"%s: %s: Unable to open font file\n",myname,fontpath);
-      exit(1);
-      }
-    }
-
-  readmagic(fontfile,magicnum);
-  fileline = (char*)myalloc(sizeof(char)*(MAXFIRSTLINELEN+1));
-  if (myfgets(fileline,MAXFIRSTLINELEN+1,fontfile)==NULL) {
-    fileline[0] = '\0';
-    }
-  if (MYSTRLEN(fileline)>0 ? fileline[MYSTRLEN(fileline)-1]!='\n' : 0) {
-    skiptoeol(fontfile);
-    }
-  numsread = sscanf(fileline,"%*c%c %d %*d %d %d %d %d %d",
-    &hardblank,&charheight,&maxlen,&smush,&cmtlines,
-    &ffright2left,&smush2);
-  free(fileline);
-  if (strcmp(magicnum,FONTFILEMAGICNUMBER) || numsread<5) {
-    fprintf(stderr,"%s: %s: Not a FIGlet 2 font file\n",myname,fontpath);
-    exit(1);
-    }
-  for (i=1;i<=cmtlines;i++) {
-    skiptoeol(fontfile);
-    }
-  free(fontpath);
-
-  if (numsread<6) {
-    ffright2left = 0;
-    }
-
-  if (numsread<7) { /* if no smush2, decode smush into smush2 */
-    if (smush == 0) smush2 = SM_KERN;
-    else if (smush < 0) smush2 = 0;
-    else smush2 = (smush & 31) | SM_SMUSH;
-    }
-
-  if (charheight<1) {
-    charheight = 1;
-    }
-
-  if (maxlen<1) {
-    maxlen = 1;
-    }
-
-  maxlen += 100; /* Give ourselves some extra room */
-
-  if (smushoverride == SMO_NO)
-     smushmode = smush2;
-  else if (smushoverride == SMO_FORCE)
-     smushmode |= smush2;
-
-  if (right2left<0) {
-    right2left = ffright2left;
-    }
-
-  if (justification<0) {
-    justification = 2*right2left;
-    }
-
-  fileline = (char*)myalloc(sizeof(char)*(maxlen+1));
-  /* Allocate "missing" character */
-  fcharlist = (fcharnode*)myalloc(sizeof(fcharnode));
-  fcharlist->ord = 0;
-  fcharlist->thechar = (char**)myalloc(sizeof(char*)*charheight);
-  fcharlist->next = NULL;
-  for (row=0;row<charheight;row++) {
-    fcharlist->thechar[row] = (char*)myalloc(sizeof(char));
-    fcharlist->thechar[row][0] = '\0';
-    }
-  for (theord=' ';theord<='~';theord++) {
-    readfontchar(fontfile,theord,fileline,maxlen);
-    }
-  for (theord=0;theord<=6;theord++) {
-    readfontchar(fontfile,deutsch[theord],fileline,maxlen);
-    }
-  while (myfgets(fileline,maxlen+1,fontfile)==NULL?0:
-    sscanf(fileline,"%li",&theord)==1) {
-    readfontchar(fontfile,theord,fileline,maxlen);
-    }
-  Zclose(fontfile);
-  free(fileline);
-}
-
-
-/****************************************************************************
-
-  linealloc
-
-  Allocates & clears outputline, inchrline. Sets inchrlinelenlimit.
-  Called near beginning of main().
-
-****************************************************************************/
-
-void linealloc()
-{
-  int row; 
-
-  outputline = (char**)myalloc(sizeof(char*)*charheight);
-  for (row=0;row<charheight;row++) {
-    outputline[row] = (char*)myalloc(sizeof(char)*(outlinelenlimit+1));
-    }
-  inchrlinelenlimit = outputwidth*4+100;
-  inchrline = (inchr*)myalloc(sizeof(inchr)*(inchrlinelenlimit+1));
-  clearline();
-}
-
-
-/****************************************************************************
-
-  getletter
-
-  Sets currchar to point to the font entry for the given character.
-  Sets currcharwidth to the width of this character.
-
-****************************************************************************/
-
-void getletter(c)
-inchr c;
-{
-  fcharnode *charptr;
-
-  for (charptr=fcharlist;charptr==NULL?0:charptr->ord!=c;
-    charptr=charptr->next) ;
-  if (charptr!=NULL) {
-    currchar = charptr->thechar;
-    }
-  else {
-    for (charptr=fcharlist;charptr==NULL?0:charptr->ord!=0;
-      charptr=charptr->next) ;
-    currchar = charptr->thechar;
-    }
-  previouscharwidth = currcharwidth;
-  currcharwidth = MYSTRLEN(currchar[0]);
-}
-
-
-/****************************************************************************
-
-  smushem
-
-  Given 2 characters, attempts to smush them into 1, according to
-  smushmode.  Returns smushed character or '\0' if no smushing can be
-  done.
-
-  smushmode values are sum of following (all values smush blanks):
-    1: Smush equal chars (not hardblanks)
-    2: Smush '_' with any char in hierarchy below
-    4: hierarchy: "|", "/\", "[]", "{}", "()", "<>"
-       Each class in hier. can be replaced by later class.
-    8: [ + ] -> |, { + } -> |, ( + ) -> |
-   16: / + \ -> X, > + < -> X (only in that order)
-   32: hardblank + hardblank -> hardblank
-
-****************************************************************************/
-
-char smushem(lch,rch)
-char lch,rch;
-{
-  if (lch==' ') return rch;
-  if (rch==' ') return lch;
-
-  if (previouscharwidth<2 || currcharwidth<2) return '\0';
-    /* Disallows overlapping if the previous character */
-    /* or the current character has a width of 1 or zero. */
-
-  if ((smushmode & SM_SMUSH) == 0) return '\0';  /* kerning */
-
-  if ((smushmode & 63) == 0) {
-    /* This is smushing by universal overlapping. */
-    if (lch==' ') return rch;
-    if (rch==' ') return lch;
-    if (lch==hardblank) return rch;
-    if (rch==hardblank) return lch;
-      /* Above four lines ensure overlapping preference to */
-      /* visible characters. */
-    if (right2left==1) return lch;
-      /* Above line ensures that the dominant (foreground) */
-      /* fig-character for overlapping is the latter in the */
-      /* user's text, not necessarily the rightmost character. */
-    return rch;
-      /* Occurs in the absence of above exceptions. */
-    }
-  
-  if (smushmode & SM_HARDBLANK) {
-    if (lch==hardblank && rch==hardblank) return lch;
-    }
-
-  if (lch==hardblank || rch==hardblank) return '\0';
-
-  if (smushmode & SM_EQUAL) {
-    if (lch==rch) return lch;
-    }
-
-  if (smushmode & SM_LOWLINE) {
-    if (lch=='_' && strchr("|/\\[]{}()<>",rch)) return rch;
-    if (rch=='_' && strchr("|/\\[]{}()<>",lch)) return lch;
-    }
-
-  if (smushmode & SM_HIERARCHY) {
-    if (lch=='|' && strchr("/\\[]{}()<>",rch)) return rch;
-    if (rch=='|' && strchr("/\\[]{}()<>",lch)) return lch;
-    if (strchr("/\\",lch) && strchr("[]{}()<>",rch)) return rch;
-    if (strchr("/\\",rch) && strchr("[]{}()<>",lch)) return lch;
-    if (strchr("[]",lch) && strchr("{}()<>",rch)) return rch;
-    if (strchr("[]",rch) && strchr("{}()<>",lch)) return lch;
-    if (strchr("{}",lch) && strchr("()<>",rch)) return rch;
-    if (strchr("{}",rch) && strchr("()<>",lch)) return lch;
-    if (strchr("()",lch) && strchr("<>",rch)) return rch;
-    if (strchr("()",rch) && strchr("<>",lch)) return lch;
-    }
-
-  if (smushmode & SM_PAIR) {
-    if (lch=='[' && rch==']') return '|';
-    if (rch=='[' && lch==']') return '|';
-    if (lch=='{' && rch=='}') return '|';
-    if (rch=='{' && lch=='}') return '|';
-    if (lch=='(' && rch==')') return '|';
-    if (rch=='(' && lch==')') return '|';
-    }
-
-  if (smushmode & SM_BIGX) {
-    if (lch=='/' && rch=='\\') return '|';
-    if (rch=='/' && lch=='\\') return 'Y';
-    if (lch=='>' && rch=='<') return 'X';
-      /* Don't want the reverse of above to give 'X'. */
-    }
-
-  return '\0';
-}
-
-
-/****************************************************************************
-
-  smushamt
-
-  Returns the maximum amount that the current character can be smushed
-  into the current line.
-
-****************************************************************************/
-
-int smushamt()
-{
-  int maxsmush,amt;
-  int row,linebd,charbd;
-  char ch1,ch2;
-
-  if ((smushmode & (SM_SMUSH | SM_KERN)) == 0) {
-    return 0;
-    }
-  maxsmush = currcharwidth;
-  for (row=0;row<charheight;row++) {
-    if (right2left) {
-      for (charbd=MYSTRLEN(currchar[row]);
-        ch1=currchar[row][charbd],(charbd>0&&(!ch1||ch1==' '));charbd--) ;
-      for (linebd=0;ch2=outputline[row][linebd],ch2==' ';linebd++) ;
-      amt = linebd+currcharwidth-1-charbd;
-      }
-    else {
-      for (linebd=MYSTRLEN(outputline[row]);
-        ch1 = outputline[row][linebd],(linebd>0&&(!ch1||ch1==' '));linebd--) ;
-      for (charbd=0;ch2=currchar[row][charbd],ch2==' ';charbd++) ;
-      amt = charbd+outlinelen-1-linebd;
-      }
-    if (!ch1||ch1==' ') {
-      amt++;
-      }
-    else if (ch2) {
-      if (smushem(ch1,ch2)!='\0') {
-        amt++;
-        }
-      }
-    if (amt<maxsmush) {
-      maxsmush = amt;
-      }
-    }
-  return maxsmush;
-}
-
-
-/****************************************************************************
-
-  addchar
-
-  Attempts to add the given character onto the end of the current line.
-  Returns 1 if this can be done, 0 otherwise.
-
-****************************************************************************/
-
-int addchar(c)
-inchr c;
-{
-  int smushamount,row,k;
-  char *templine;
-
-  getletter(c);
-  smushamount = smushamt();
-  if (outlinelen+currcharwidth-smushamount>outlinelenlimit
-      ||inchrlinelen+1>inchrlinelenlimit) {
-    return 0;
-    }
-
-  templine = (char*)myalloc(sizeof(char)*(outlinelenlimit+1));
-  for (row=0;row<charheight;row++) {
-    if (right2left) {
-      strcpy(templine,currchar[row]);
-      for (k=0;k<smushamount;k++) {
-        templine[currcharwidth-smushamount+k] =
-          smushem(templine[currcharwidth-smushamount+k],outputline[row][k]);
-        }
-      strcat(templine,outputline[row]+smushamount);
-      strcpy(outputline[row],templine);
-      }
-    else {
-      for (k=0;k<smushamount;k++) {
-        if (outlinelen-smushamount+k >= 0)
-          outputline[row][outlinelen-smushamount+k] =
-            smushem(outputline[row][outlinelen-smushamount+k],currchar[row][k]);
-        }
-      strcat(outputline[row],currchar[row]+smushamount);
-      }
-    }
-  free(templine);
-  outlinelen = MYSTRLEN(outputline[0]);
-  inchrline[inchrlinelen++] = c;
-  return 1;
-}
-
-
-/****************************************************************************
-
-  putstring
-
-  Prints out the given null-terminated string, substituting blanks
-  for hardblanks.  If outputwidth is 1, prints the entire string;
-  otherwise prints at most outputwidth-1 characters.  Prints a newline
-  at the end of the string.  The string is left-justified, centered or
-  right-justified (taking outputwidth as the screen width) if
-  justification is 0, 1 or 2, respectively.
-
-****************************************************************************/
-
-static int nr_chars=0;
-static void myputchar(unsigned char c)
-{
-    static int startline = 1;
-
-    if ( startline )
-    {
-        startline = 0;
-        myputchar(' ');
-    }
-
-    putc(c, stderr);
-
-    if ( nr_chars == 18 ) 
-    {
-        nr_chars = 0;
-        putchar('"');
-        putchar(' ');
-        putchar('\\');
-        putchar('\n');
-    }
-
-    if ( nr_chars++ == 0 )
-        putchar('"');
-
-    putchar('\\');
-    putchar('0' + ((c>>6)&7));
-    putchar('0' + ((c>>3)&7));
-    putchar('0' + ((c>>0)&7));
-
-    if ( c == '\n' )
-        startline = 1;
-}
-
-void putstring(string)
-char *string;
-{
-  int i,len;
-
-  len = MYSTRLEN(string);
-  if (outputwidth>1) {
-    if (len>outputwidth-1) {
-      len = outputwidth-1;
-      }
-    if (justification>0) {
-      for (i=1;(3-justification)*i+len+justification-2<outputwidth;i++) {
-        myputchar(' ');
-        }
-      }
-    }
-  for (i=0;i<len;i++) {
-    myputchar(string[i]==hardblank?' ':string[i]);
-    }
-  myputchar('\n');
-}
-
-
-/****************************************************************************
-
-  printline
-
-  Prints outputline using putstring, then clears the current line.
-
-****************************************************************************/
-
-void printline()
-{
-  int i;
-
-  for (i=0;i<charheight;i++) {
-    putstring(outputline[i]);
-    }
-  clearline();
-}
-
-
-/****************************************************************************
-
-  splitline
-
-  Splits inchrline at the last word break (bunch of consecutive blanks).
-  Makes a new line out of the first part and prints it using
-  printline.  Makes a new line out of the second part and returns.
-
-****************************************************************************/
-
-void splitline()
-{
-  int i,gotspace,lastspace,len1,len2;
-  inchr *part1,*part2;
-
-  part1 = (inchr*)myalloc(sizeof(inchr)*(inchrlinelen+1));
-  part2 = (inchr*)myalloc(sizeof(inchr)*(inchrlinelen+1));
-  gotspace = 0;
-  for (i=inchrlinelen-1;i>=0;i--) {
-    if (!gotspace && inchrline[i]==' ') {
-      gotspace = 1;
-      lastspace = i;
-      }
-    if (gotspace && inchrline[i]!=' ') {
-      break;
-      }
-    }
-  len1 = i+1;
-  len2 = inchrlinelen-lastspace-1;
-  for (i=0;i<len1;i++) {
-    part1[i] = inchrline[i];
-    }
-  for (i=0;i<len2;i++) {
-    part2[i] = inchrline[lastspace+1+i];
-    }
-  clearline();
-  for (i=0;i<len1;i++) {
-    addchar(part1[i]);
-    }
-  printline();
-  for (i=0;i<len2;i++) {
-    addchar(part2[i]);
-    }
-  free(part1);
-  free(part2);
-}
-
-
-/****************************************************************************
-
-  handlemapping
-
-  Given an input character (type inchr), executes re-mapping commands
-  read from control files.  Returns re-mapped character (inchr).
-
-****************************************************************************/
-
-inchr handlemapping(c)
-inchr c;
-{
-  comnode *cmptr;
-
-  cmptr=commandlist;
-  while (cmptr!=NULL) {
-    if (cmptr->thecommand ?
-      (c >= cmptr->rangelo && c <= cmptr->rangehi) : 0) {
-      c += cmptr->offset;
-      while(cmptr!=NULL ? cmptr->thecommand : 0) {
-        cmptr=cmptr->next;
-        }
-      }
-    else {
-      cmptr=cmptr->next;
-      }
-    }
-  return c;
-}
-
-/****************************************************************************
-
-  Agetchar
-
-  Replacement to getchar().
-  Acts exactly like getchar if -A is NOT specified,
-  else obtains input from All remaining command line words.
-
-****************************************************************************/
-
-int Agetchar()
-{
-    extern int optind;		/* current argv[] element under study */
-    static AgetMode = 0;	/* >= 0 for displacement into argv[n], <0 EOF */
-    char   *arg;		/* pointer to active character */
-    int    c;			/* current character */
-
-    if ( ! cmdinput )		/* is -A active? */
-	return( getchar() );	/* no: return stdin character */
-
-    if ( AgetMode < 0 || optind >= Myargc )		/* EOF is sticky: */
-	return( EOF );		/* **ensure it now and forever more */
-
-    /* find next character */
-    arg = Myargv[optind];		/* pointer to active arg */
-    c = arg[AgetMode++]&0xFF;	/* get appropriate char of arg */
-
-    if ( ! c )			/* at '\0' that terminates word? */
-    {   /* at end of word: return ' ' if normal word, '\n' if empty */
-	c = ' ';		/* suppose normal word and return blank */
-	if ( AgetMode == 1 )	/* if ran out in very 1st char, force \n */
-	    c = '\n';		/* (allows "hello '' world" to do \n at '') */
-	AgetMode = 0;		/* return to char 0 in NEXT word */
-	if ( ++optind >= Myargc )	/* run up word count and check if at "EOF" */
-	{   /* just ran out of arguments */
-	    c = EOF;		/* return EOF */
-	    AgetMode = -1;	/* ensure all future returns return EOF */
-	}
-    }
-
-    return( c );		/* return appropriate character */
-
-}	/* end: Agetchar() */
-
-
-/****************************************************************************
-
-  iso2022
-
-  Called by getinchr.  Interprets ISO 2022 sequences
-
-******************************************************************************/
-
-inchr iso2022()
-{
-  inchr ch;
-  inchr ch2;
-  int save_gl;
-  int save_gr;
-
-  ch = Agetchar();
-  if (ch == EOF) return ch;
-  if (ch == 27) ch = Agetchar() + 0x100; /* ESC x */
-  if (ch == 0x100 + '$') ch = Agetchar() + 0x200; /* ESC $ x */
-  switch (ch) {
-    case 14: /* invoke G0 into GL */
-      gl = 0;
-      return iso2022();
-    case 15: /* invoke G1 into GL */
-      gl = 1;
-      return iso2022();
-    case 142: case 'N' + 0x100: /* invoke G2 into GL for next char */
-      save_gl = gl; save_gr = gr;
-      gl = gr = 2;
-      ch = iso2022();
-      gl = save_gl; gr = save_gr;
-      return ch;
-    case 143: case 'O' + 0x100: /* invoke G3 into GL for next char */
-      save_gl = gl; save_gr = gr;
-      gl = gr = 3;
-      ch = iso2022();
-      gl = save_gl; gr = save_gr;
-      return ch;
-    case 'n' + 0x100: /* invoke G2 into GL */
-      gl = 2;
-      return iso2022();
-    case 'o' + 0x100: /* invoke G3 into GL */
-      gl = 3;
-      return iso2022();
-    case '~' + 0x100: /* invoke G1 into GR */
-      gr = 1;
-      return iso2022();
-    case '}' + 0x100: /* invoke G2 into GR */
-      gr = 2;
-      return iso2022();
-    case '|' + 0x100: /* invoke G3 into GR */
-      gr = 3;
-      return iso2022();
-    case '(' + 0x100: /* set G0 to 94-char set */
-      ch = Agetchar();
-      if (ch == 'B') ch = 0; /* ASCII */
-      gn[0] = ch << 16;
-      gndbl[0] = 0;
-      return iso2022();
-    case ')' + 0x100: /* set G1 to 94-char set */
-      ch = Agetchar();
-      if (ch == 'B') ch = 0;
-      gn[1] = ch << 16;
-      gndbl[1] = 0;
-      return iso2022();
-    case '*' + 0x100: /* set G2 to 94-char set */
-      ch = Agetchar();
-      if (ch == 'B') ch = 0;
-      gn[2] = ch << 16;
-      gndbl[2] = 0;
-      return iso2022();
-    case '+' + 0x100: /* set G3 to 94-char set */
-      ch = Agetchar();
-      if (ch == 'B') ch = 0;
-      gn[3] = ch << 16;
-      gndbl[3] = 0;
-      return iso2022();
-    case '-' + 0x100: /* set G1 to 96-char set */
-      ch = Agetchar();
-      if (ch == 'A') ch = 0; /* Latin-1 top half */
-      gn[1] = (ch << 16) | 0x80;
-      gndbl[1] = 0;
-      return iso2022();
-    case '.' + 0x100: /* set G2 to 96-char set */
-      ch = Agetchar();
-      if (ch == 'A') ch = 0;
-      gn[2] = (ch << 16) | 0x80;
-      gndbl[2] = 0;
-      return iso2022();
-    case '/' + 0x100: /* set G3 to 96-char set */
-      ch = Agetchar();
-      if (ch == 'A') ch = 0;
-      gn[3] = (ch << 16) | 0x80;
-      gndbl[3] = 0;
-      return iso2022();
-    case '(' + 0x200: /* set G0 to 94 x 94 char set */
-      ch = Agetchar();
-      gn[0] = ch << 16;
-      gndbl[0] = 1;
-      return iso2022();
-    case ')' + 0x200: /* set G1 to 94 x 94 char set */
-      ch = Agetchar();
-      gn[1] = ch << 16;
-      gndbl[1] = 1;
-      return iso2022();
-    case '*' + 0x200: /* set G2 to 94 x 94 char set */
-      ch = Agetchar();
-      gn[2] = ch << 16;
-      gndbl[2] = 1;
-      return iso2022();
-    case '+' + 0x200: /* set G3 to 94 x 94 char set */
-      ch = Agetchar();
-      gn[3] = ch << 16;
-      gndbl[3] = 1;
-      return iso2022();
-    default:
-      if (ch & 0x200) { /* set G0 to 94 x 94 char set (deprecated) */
-        gn[0] = (ch & ~0x200) << 16;
-        gndbl[0] = 1;
-        return iso2022();
-        }
-      }
-
-  if (ch >= 0x21 && ch <= 0x7E) { /* process GL */
-    if (gndbl[gl]) {
-      ch2 = Agetchar();
-      return gn[gl] | (ch << 8) | ch2;
-      }
-    else return gn[gl] | ch;
-    }
-  else if (ch >= 0xA0 && ch <= 0xFF) { /* process GR */
-    if (gndbl[gr]) {
-      ch2 = Agetchar();
-      return gn[gr] | (ch << 8) | ch2;
-      }
-    else return gn[gr] | (ch & ~0x80);
-    }
-  else return ch;
-  }
-
-/****************************************************************************
-
-  ungetinchr
-
-  Called by main.  Pushes back an "inchr" to be read by getinchr
-  on the next call.
-
-******************************************************************************/
-inchr getinchr_buffer;
-int getinchr_flag;
-
-inchr ungetinchr(c)
-inchr c;
-{
-  getinchr_buffer = c;
-  getinchr_flag = 1;
-  return c;
-}
-
-/*****************************************************************************
-
-  getinchr
-
-  Called by main.  Processes multibyte characters.  Invokes Agetchar.
-  If multibyte = 0, ISO 2022 mode (see iso2022 routine).
-  If multibyte = 1,  double-byte mode (0x00-0x7f bytes are characters,
-    0x80-0xFF bytes are first byte of a double-byte character).
-  If multibyte = 2, Unicode UTF-8 mode (0x00-0x7F bytes are characters,
-    0x80-0xBF bytes are nonfirst byte of a multibyte character,
-    0xC0-0xFD bytes are first byte of a multibyte character,
-    0xFE-0xFF bytes are errors (all errors return code 0x0080)).
-  If multibyte = 3, HZ mode ("~{" starts double-byte mode, "}~" ends it,
-    "~~" is a tilde, "~x" for all other x is ignored).
-  If multibyte = 4, Shift-JIS mode (0x80-0x9F and 0xE0-0xEF are first byte
-    of a double-byte character, all other bytes are characters).
- 
-
-*****************************************************************************/
-
-inchr getinchr()
-{
-  int ch, ch2, ch3, ch4, ch5, ch6;
-
-  if (getinchr_flag) {
-    getinchr_flag = 0;
-    return getinchr_buffer;
-    }
-
-  switch(multibyte) {
-    case 0: /* single-byte */
-      return iso2022();
-   case 1: /* DBCS */
-     ch = Agetchar();
-     if ((ch >= 0x80 && ch <= 0x9F) ||
-         (ch >= 0xE0 && ch <= 0xEF)) {
-       ch = (ch << 8) + Agetchar();
-       }
-     return ch;
-   case 2: /* UTF-8 */
-      ch = Agetchar();
-      if (ch < 0x80) return ch;  /* handles EOF, too */
-      if (ch < 0xC0 || ch > 0xFD)
-        return 0x0080;  /* illegal first character */
-      ch2 = Agetchar() & 0x3F;
-      if (ch < 0xE0) return ((ch & 0x1F) << 6) + ch2;
-      ch3 = Agetchar() & 0x3F;
-      if (ch < 0xF0)
-        return ((ch & 0x0F) << 12) + (ch2 << 6) + ch3;
-      ch4 = Agetchar() & 0x3F;
-      if (ch < 0xF8)
-        return ((ch & 0x07) << 18) + (ch2 << 12) + (ch3 << 6) + ch4;
-      ch5 = Agetchar() & 0x3F;
-      if (ch < 0xFC)
-        return ((ch & 0x03) << 24) + (ch2 << 18) + (ch3 << 12) +
-          (ch4 << 6) + ch5;
-      ch6 = Agetchar() & 0x3F;
-      return ((ch & 0x01) << 30) + (ch2 << 24) + (ch3 << 18) +
-        (ch4 << 12) + (ch5 << 6) + ch6;
-   case 3: /* HZ */
-     ch = Agetchar();
-     if (ch == EOF) return ch;
-     if (hzmode) {
-       ch = (ch << 8) + Agetchar();
-       if (ch == ('}' << 8) + '~') {
-         hzmode = 0;
-         return getinchr();
-         }
-       return ch;
-       }
-     else if (ch == '~') {
-       ch = Agetchar();
-       if (ch == '{') {
-          hzmode = 1;
-          return getinchr();
-          }
-      else if (ch == '~') {
-        return ch;
-        }
-      else {
-        return getinchr();
-        }
-      }
-     else return ch;
-   case 4: /* Shift-JIS */
-     ch = Agetchar();
-     if ((ch >= 0x80 && ch <= 0x9F) ||
-         (ch >= 0xE0 && ch <= 0xEF)) {
-       ch = (ch << 8) + Agetchar();
-       }
-     return ch;
-   default:
-     return 0x80;
-    }
-  }
-
-/****************************************************************************
-
-  main
-
-  The main program, of course.
-  Reads characters 1 by 1 from stdin, and makes lines out of them using
-  addchar. Handles line breaking, (which accounts for most of the
-  complexity in this function).
-
-****************************************************************************/
-
-int main(argc,argv)
-int argc;
-char *argv[];
-{
-  inchr c,c2;
-  int i;
-  int last_was_eol_flag;
-/*---------------------------------------------------------------------------
-  wordbreakmode:
-    -1: /^$/ and blanks are to be absorbed (when line break was forced
-      by a blank or character larger than outlinelenlimit)
-    0: /^ *$/ and blanks are not to be absorbed
-    1: /[^ ]$/ no word break yet
-    2: /[^ ]  *$/
-    3: /[^ ]$/ had a word break
----------------------------------------------------------------------------*/
-  int wordbreakmode;
-  int char_not_added;
-
-  Myargc = argc;
-  Myargv = argv;
-  getparams();
-  readcontrolfiles();
-  readfont();
-  linealloc();
-
-  wordbreakmode = 0;
-  last_was_eol_flag = 0;
-
-  while ((c = getinchr())!=EOF) {
-
-    if (c=='\n'&&paragraphflag&&!last_was_eol_flag) {
-      ungetinchr(c2 = getinchr());
-      c = ((isascii(c2)&&isspace(c2))?'\n':' ');
-      }
-    last_was_eol_flag = (isascii(c)&&isspace(c)&&c!='\t'&&c!=' ');
-
-    if (deutschflag) {
-      if (c>='[' && c<=']') {
-        c = deutsch[c-'['];
-        }
-      else if (c >='{' && c <= '~') {
-        c = deutsch[c-'{'+3];
-        }
-      }
-
-    c = handlemapping(c);
-
-    if (isascii(c)&&isspace(c)) {
-      c = (c=='\t'||c==' ') ? ' ' : '\n';
-      }
-
-    if ((c>'\0' && c<' ' && c!='\n') || c==127) continue;
-
-/*
-  Note: The following code is complex and thoroughly tested.
-  Be careful when modifying!
-*/
-
-    do {
-      char_not_added = 0;
-
-      if (wordbreakmode== -1) {
-        if (c==' ') {
-          break;
-          }
-        else if (c=='\n') {
-          wordbreakmode = 0;
-          break;
-          }
-        wordbreakmode = 0;
-        }
-
-      if (c=='\n') {
-        printline();
-        wordbreakmode = 0;
-        }
-
-      else if (addchar(c)) {
-        if (c!=' ') {
-          wordbreakmode = (wordbreakmode>=2)?3:1;
-          }
-        else {
-          wordbreakmode = (wordbreakmode>0)?2:0;
-          }
-        }
-
-      else if (outlinelen==0) {
-        for (i=0;i<charheight;i++) {
-          if (right2left && outputwidth>1) {
-            putstring(currchar[i]+MYSTRLEN(currchar[i])-outlinelenlimit);
-            }
-          else {
-            putstring(currchar[i]);
-            }
-          }
-        wordbreakmode = -1;
-        }
-
-      else if (c==' ') {
-        if (wordbreakmode==2) {
-          splitline();
-          }
-        else {
-          printline();
-          }
-        wordbreakmode = -1;
-        }
-
-      else {
-        if (wordbreakmode>=2) {
-          splitline();
-          }
-        else {
-          printline();
-          }
-        wordbreakmode = (wordbreakmode==3)?1:0;
-        char_not_added = 1;
-        }
-
-      } while (char_not_added);
-    }
-
-  if (outlinelen!=0) {
-    printline();
-    }
-
-  /* XXX Xen hack -- finish off the C macro output */
-  if ( nr_chars != 0 )
-      putchar('"');
-  putchar('\n');
-
-  exit(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 Dec 04 10:05:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9KF-0003np-9n; Wed, 04 Dec 2013 10:04: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 1Vo9KB-0003n6-K6
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:58 +0000
Received: from [85.158.139.211:45235] by server-10.bemta-5.messagelabs.com id
	4C/EA-01405-54EFE925; Wed, 04 Dec 2013 10:04:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1386151487!937189!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31253 invoked from network); 4 Dec 2013 10:04:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:04: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 1Vo9K3-00081J-Fk
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9K3-0006ZT-Da
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:47 +0000
Date: Wed, 04 Dec 2013 10:04:47 +0000
Message-Id: <E1Vo9K3-0006ZT-Da@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/build: Remove unreferenced figlet
	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 b49827a385716ef94d466aa34640c56824800b90
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Nov 22 21:09:53 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 2 13:47:06 2013 +0000

    xen/build: Remove unreferenced figlet files
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 .gitignore                |    1 -
 xen/tools/figlet/LICENSE  |  111 ---
 xen/tools/figlet/Makefile |    9 -
 xen/tools/figlet/README   |    9 -
 xen/tools/figlet/figlet.c | 2076 ---------------------------------------------
 5 files changed, 0 insertions(+), 2206 deletions(-)

diff --git a/.gitignore b/.gitignore
index 47f92a4..93aae71 100644
--- a/.gitignore
+++ b/.gitignore
@@ -316,7 +316,6 @@ xen/include/public/public
 xen/include/xen/*.new
 xen/include/xen/acm_policy.h
 xen/include/xen/compile.h
-xen/tools/figlet/figlet
 xen/tools/symbols
 xen/xsm/flask/include/av_perm_to_string.h
 xen/xsm/flask/include/av_permissions.h
diff --git a/xen/tools/figlet/LICENSE b/xen/tools/figlet/LICENSE
deleted file mode 100644
index 59fd244..0000000
--- a/xen/tools/figlet/LICENSE
+++ /dev/null
@@ -1,111 +0,0 @@
-http://www.sunsite.unc.edu/pub/Linux/LICENSES/artistic.license
-
-			 The "Artistic License"
-
-				Preamble
-
-The intent of this document is to state the conditions under which a
-Package may be copied, such that the Copyright Holder maintains some
-semblance of artistic control over the development of the package,
-while giving the users of the package the right to use and distribute
-the Package in a more-or-less customary fashion, plus the right to make
-reasonable modifications.
-
-Definitions:
-
-	"Package" refers to the collection of files distributed by the
-	Copyright Holder, and derivatives of that collection of files
-	created through textual modification.
-
-	"Standard Version" refers to such a Package if it has not been
-	modified, or has been modified in accordance with the wishes
-	of the Copyright Holder.
-
-	"Copyright Holder" is whoever is named in the copyright or
-	copyrights for the package.
-
-	"You" is you, if you're thinking about copying or distributing
-	this Package.
-
-	"Reasonable copying fee" is whatever you can justify on the
-	basis of media cost, duplication charges, time of people involved,
-	and so on.  (You will not be required to justify it to the
-	Copyright Holder, but only to the computing community at large
-	as a market that must bear the fee.)
-
-	"Freely Available" means that no fee is charged for the item
-	itself, though there may be fees involved in handling the item.
-	It also means that recipients of the item may redistribute it
-	under the same conditions they received it.
-
-1. You may make and give away verbatim copies of the source form of the
-Standard Version of this Package without restriction, provided that you
-duplicate all of the original copyright notices and associated disclaimers.
-
-2. You may apply bug fixes, portability fixes and other modifications
-derived from the Public Domain or from the Copyright Holder.  A Package
-modified in such a way shall still be considered the Standard Version.
-
-3. You may otherwise modify your copy of this Package in any way, provided
-that you insert a prominent notice in each changed file stating how and
-when you changed that file, and provided that you do at least ONE of the
-following:
-
-    a) place your modifications in the Public Domain or otherwise make them
-    Freely Available, such as by posting said modifications to Usenet or
-    an equivalent medium, or placing the modifications on a major archive
-    site such as ftp.uu.net, or by allowing the Copyright Holder to include
-    your modifications in the Standard Version of the Package.
-
-    b) use the modified Package only within your corporation or organization.
-
-    c) rename any non-standard executables so the names do not conflict
-    with standard executables, which must also be provided, and provide
-    a separate manual page for each non-standard executable that clearly
-    documents how it differs from the Standard Version.
-
-    d) make other distribution arrangements with the Copyright Holder.
-
-4. You may distribute the programs of this Package in object code or
-executable form, provided that you do at least ONE of the following:
-
-    a) distribute a Standard Version of the executables and library files,
-    together with instructions (in the manual page or equivalent) on where
-    to get the Standard Version.
-
-    b) accompany the distribution with the machine-readable source of
-    the Package with your modifications.
-
-    c) accompany any non-standard executables with their corresponding
-    Standard Version executables, giving the non-standard executables
-    non-standard names, and clearly documenting the differences in manual
-    pages (or equivalent), together with instructions on where to get
-    the Standard Version.
-
-    d) make other distribution arrangements with the Copyright Holder.
-
-5. You may charge a reasonable copying fee for any distribution of this
-Package.  You may charge any fee you choose for support of this Package.
-You may not charge a fee for this Package itself.  However,
-you may distribute this Package in aggregate with other (possibly
-commercial) programs as part of a larger (possibly commercial) software
-distribution provided that you do not advertise this Package as a
-product of your own.
-
-6. The scripts and library files supplied as input to or produced as
-output from the programs of this Package do not automatically fall
-under the copyright of this Package, but belong to whomever generated
-them, and may be sold commercially, and may be aggregated with this
-Package.
-
-7. C or perl subroutines supplied by you and linked into this Package
-shall not be considered part of this Package.
-
-8. The name of the Copyright Holder may not be used to endorse or promote
-products derived from this software without specific prior written permission.
-
-9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-
-				The End
diff --git a/xen/tools/figlet/Makefile b/xen/tools/figlet/Makefile
deleted file mode 100644
index b1f1045..0000000
--- a/xen/tools/figlet/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-
-include $(XEN_ROOT)/Config.mk
-
-figlet: figlet.c
-	$(HOSTCC) -o $@ $<
-
-.PHONY: clean
-clean:
-	rm -f *.o figlet
diff --git a/xen/tools/figlet/README b/xen/tools/figlet/README
deleted file mode 100644
index b4c58b3..0000000
--- a/xen/tools/figlet/README
+++ /dev/null
@@ -1,9 +0,0 @@
-
-NB. This is a very hacked version of Figlet 2.2.1. 
-
-Don't use this outside the Xen build system. A proper version of Figlet
-can be had from <http://www.figlet.org>.
-
-The distribution license is intact in the LICENSE file.
-
- -- Keir Fraser (2/5/2003)
diff --git a/xen/tools/figlet/figlet.c b/xen/tools/figlet/figlet.c
deleted file mode 100644
index 4232a91..0000000
--- a/xen/tools/figlet/figlet.c
+++ /dev/null
@@ -1,2076 +0,0 @@
-
-/*
- * XXXXXXXXXXXXXXXXXXXXXXXXXXX
- * 
- * This is a HACKED figlet source file for Xen.
- * 
- * Hacked to output C octal strings for inclusion in a header file.
- * Support for opening zipped files is removed.
- * 
- * Go to www.figlet.org for the unhacked Figlet sources.
- */
-
-/****************************************************************************
-
-  FIGlet Copyright 1991, 1993, 1994 Glenn Chappell and Ian Chai
-  FIGlet Copyright 1996, 1997, 1998, 1999, 2000, 2001 John Cowan
-  FIGlet Copyright 2002 Christiaan Keet
-  Portions written by Paul Burton and Christiaan Keet
-  Internet: <info@figlet.org>
-  FIGlet, along with the various FIGlet fonts and documentation, is
-    copyrighted under the provisions of the Artistic License (as listed
-    in the file "Artistic-license.txt" which is included in this package.
-****************************************************************************/
-
-#define DATE "13 July 2002"
-#define VERSION "2.2.1"
-#define VERSION_INT 20201
-
-/* FIGlet (Frank, Ian & Glenn's Letters) */
-/* by Glenn Chappell */
-/* Apr 1991 */
-/* Automatic file addition by Ian Chai May 1991 */
-/* Punctuation and numbers addition by Ian Chai Jan 1993 */
-/* Full ASCII by Glenn Chappell Feb 1993 */
-/* Line-breaking, general rewrite by Glenn Chappell Mar 1993 */
-/* Hard blanks by Glenn Chappell Apr 1993 */
-/* Release 2.0 5 Aug 1993 */
-/* Right-to-left printing, extended char set by Glenn Chappell Dec 1993 */
-/* Control files by Glenn Chappell Feb 1994 */
-/* Release 2.1 12 Aug 1994 */
-/* Release 2.1.1 25 Aug 1994 */
-/* Release 2.1.2 by Gilbert (Mad Programmer) Healton: Add -A command line 
-   option.  Sept 8, 1996 */
-/* Release 2.2 by John Cowan: multibyte inputs, compressed fonts,
-   mapping tables, kerning/smushing options. */
-/* Release 2.2.1 by Christiaan Keet: minor updates including readmes
-   FAQs and comments. 13 July 2002. The new official FIGlet website is 
-   http://www.figlet.org/  */
-
-#define DEFAULTFONTDIR "."
-#define DEFAULTFONTFILE "xen.flf"
-
-#include <stdio.h>
-#ifdef __STDC__
-#include <stdlib.h>
-#endif
-#include <string.h>
-#include <ctype.h>
-#include <fcntl.h>     /* Needed for get_columns */
-
-#ifdef unix
-#include <sys/ioctl.h> /* Needed for get_columns */
-#endif
-
-
-#define ZFILE FILE
-#define Zopen fopen
-#define Zgetc fgetc
-#define Zungetc(_x,_y) fseek(_y,-1,SEEK_CUR)
-#define Zclose fclose
-
-#define MYSTRLEN(x) ((int)strlen(x)) /* Eliminate ANSI problem */
-
-#define DIRSEP '/'
-#define DIRSEP2 '\\'
-/* Leave alone for Unix and MS-DOS/Windows!
-Note: '/' also used in filename in get_columns(). */
-
-#define FONTFILESUFFIX ".flf"
-#define FONTFILEMAGICNUMBER "flf2"
-#define FSUFFIXLEN MYSTRLEN(FONTFILESUFFIX)
-#define CONTROLFILESUFFIX ".flc"
-#define CONTROLFILEMAGICNUMBER "flc2"   /* no longer used in 2.2 */
-#define CSUFFIXLEN MYSTRLEN(CONTROLFILESUFFIX)
-#define DEFAULTCOLUMNS 80
-
-
-/****************************************************************************
-
-  Globals dealing with chars that are read
-
-****************************************************************************/
-
-typedef long inchr; /* "char" read from stdin */
-
-inchr *inchrline;  /* Alloc'd inchr inchrline[inchrlinelenlimit+1]; */
-                   /* Note: not null-terminated. */
-int inchrlinelen,inchrlinelenlimit;
-inchr deutsch[7] = {196, 214, 220, 228, 246, 252, 223};
-  /* Latin-1 codes for German letters, respectively:
-     LATIN CAPITAL LETTER A WITH DIAERESIS = A-umlaut
-     LATIN CAPITAL LETTER O WITH DIAERESIS = O-umlaut
-     LATIN CAPITAL LETTER U WITH DIAERESIS = U-umlaut
-     LATIN SMALL LETTER A WITH DIAERESIS = a-umlaut
-     LATIN SMALL LETTER O WITH DIAERESIS = o-umlaut
-     LATIN SMALL LETTER U WITH DIAERESIS = u-umlaut
-     LATIN SMALL LETTER SHARP S = ess-zed
-  */
-
-int hzmode;  /* true if reading double-bytes in HZ mode */
-int gndbl[4]; /* gndbl[n] is true if Gn is double-byte */
-inchr gn[4]; /* Gn character sets: ASCII, Latin-1, none, none */
-int gl; /* 0-3 specifies left-half Gn character set */
-int gr; /* 0-3 specifies right-half Gn character set */
-
-int Myargc;  /* to avoid passing around argc and argv */
-char **Myargv;
-
-/****************************************************************************
-
-  Globals dealing with chars that are written
-
-****************************************************************************/
-
-typedef struct fc {
-  inchr ord;
-  char **thechar;  /* Alloc'd char thechar[charheight][]; */
-  struct fc *next;
-  } fcharnode;
-
-fcharnode *fcharlist;
-char **currchar;
-int currcharwidth;
-int previouscharwidth;
-char **outputline;    /* Alloc'd char outputline[charheight][outlinelenlimit+1]; */
-int outlinelen;
-
-
-/****************************************************************************
-
-  Globals dealing with command file storage
-
-****************************************************************************/
-
-typedef struct cfn {
-  char *thename;
-  struct cfn *next;
-  } cfnamenode;
-
-cfnamenode *cfilelist,**cfilelistend;
-
-typedef struct cm {
-  int thecommand;
-  inchr rangelo;
-  inchr rangehi;
-  inchr offset;
-  struct cm *next;
-  } comnode;
-
-comnode *commandlist,**commandlistend;
-
-/****************************************************************************
-
-  Globals affected by command line options
-
-****************************************************************************/
-
-int deutschflag,justification,paragraphflag,right2left,multibyte;
-int cmdinput;
-
-#define SM_SMUSH 128
-#define SM_KERN 64
-#define SM_EQUAL 1
-#define SM_LOWLINE 2
-#define SM_HIERARCHY 4
-#define SM_PAIR 8
-#define SM_BIGX 16
-#define SM_HARDBLANK 32
-
-int smushmode;
-
-#define SMO_NO 0     /* no command-line smushmode */
-#define SMO_YES 1    /* use command-line smushmode, ignore font smushmode */
-#define SMO_FORCE 2  /* logically OR command-line and font smushmodes */
-
-int smushoverride;
-
-int outputwidth;
-int outlinelenlimit;
-char *fontdirname,*fontname;
-
-
-/****************************************************************************
-
-  Globals read from font file
-
-****************************************************************************/
-
-char hardblank;
-int charheight;
-
-
-/****************************************************************************
-
-  Name of program, used in error messages
-
-****************************************************************************/
-
-char *myname;
-
-
-#ifdef TIOCGWINSZ
-/****************************************************************************
-
-  get_columns
-
-  Determines the number of columns of /dev/tty.  Returns the number of
-  columns, or -1 if error.  May return 0 if columns unknown.
-  Requires include files <fcntl.h> and <sys/ioctl.h>.
-  by Glenn Chappell & Ian Chai 14 Apr 1993
-
-****************************************************************************/
-
-int get_columns()
-{
-  struct winsize ws;
-  int fd,result;
-
-  if ((fd = open("/dev/tty",O_WRONLY))<0) return -1;
-  result = ioctl(fd,TIOCGWINSZ,&ws);
-  close(fd);
-  return result?-1:ws.ws_col;
-}
-#endif /* ifdef TIOCGWINSZ */
-
-
-/****************************************************************************
-
-  myalloc
-
-  Calls malloc.  If malloc returns error, prints error message and
-  quits.
-
-****************************************************************************/
-
-#ifdef __STDC__
-char *myalloc(size_t size)
-#else
-char *myalloc(size)
-int size;
-#endif
-{
-  char *ptr;
-#ifndef __STDC__
-  extern void *malloc();
-#endif
-
-  if ((ptr = (char*)malloc(size))==NULL) {
-    fprintf(stderr,"%s: Out of memory\n",myname);
-    exit(1);
-    }
-  else {
-    return ptr;
-    }
-}
-
-
-/****************************************************************************
-
-  hasdirsep
-
-  Returns true if s1 contains a DIRSEP or DIRSEP2 character.
-
-****************************************************************************/
-
-int hasdirsep(s1)
-char *s1;
-{
-  if (strchr(s1, DIRSEP)) return 1;
-  else if (strchr(s1, DIRSEP2)) return 1;
-  else return 0;
-}
-
-/****************************************************************************
-
-  suffixcmp
-
-  Returns true if s2 is a suffix of s1; uses case-blind comparison.
-
-****************************************************************************/
-
-int suffixcmp(s1, s2)
-char *s1;
-char *s2;
-{
-  int len1, len2;
-
-  len1 = MYSTRLEN(s1);
-  len2 = MYSTRLEN(s2);
-  if (len2 > len1) return 0;
-  s1 += len1 - len2;
-  while (*s1) {
-    if (tolower(*s1) != tolower(*s2)) return 0;
-    s1++;
-    s2++;
-    }
-  return 1;
-}
-   
-/****************************************************************************
-
-  skiptoeol
-
-  Skips to the end of a line, given a stream.  Handles \r, \n, or \r\n.
-
-****************************************************************************/
-
-void skiptoeol(fp)
-ZFILE *fp;
-{
-  int dummy;
-
-  while (dummy=Zgetc(fp),dummy!=EOF) {
-    if (dummy == '\n') return;
-    if (dummy == '\r') {
-      dummy = Zgetc(fp);
-      if (dummy != EOF && dummy != '\n') Zungetc(dummy,fp);
-      return;
-      }
-  }
-}
-
-
-/****************************************************************************
-
-  myfgets
-
-  Local version of fgets.  Handles \r, \n, and \r\n terminators.
-
-****************************************************************************/
-
-char *myfgets(line,maxlen,fp)
-char *line;
-int maxlen;
-ZFILE *fp;
-{
-  int c = 0;
-  char *p;
-
-  p = line;
-  while((c=Zgetc(fp))!=EOF&&maxlen) {
-    *p++ = c;
-    maxlen--;
-    if (c=='\n') break;
-    if (c=='\r') {
-      c = Zgetc(fp);
-      if (c != EOF && c != '\n') Zungetc(c,fp);
-      *(p-1) = '\n';
-      break;
-      }
-    }
-  *p = 0;
-  return (c==EOF) ? NULL : line;
-}
-
-/****************************************************************************
-
-  usageerr
-
-  Prints "Usage: ...." line to the given stream.
-
-****************************************************************************/
-
-void printusage(out)
-FILE *out;
-{
-  fprintf(out,
-    "Usage: %s [ -cklnoprstvxDELNRSWX ] [ -d fontdirectory ]\n",
-    myname);
-  fprintf(out,
-    "              [ -f fontfile ] [ -m smushmode ] [ -w outputwidth ]\n");
-  fprintf(out,
-    "              [ -C controlfile ] [ -I infocode ] [ message ]\n");
-}
-
-
-/****************************************************************************
-
-  printinfo
-
-  Prints version and copyright message, or utility information.
-
-****************************************************************************/
-
-void printinfo(infonum)
-int infonum;
-{
-  switch (infonum) {
-    case 0: /* Copyright message */
-      printf("FIGlet Copyright 1991-2002 Glenn Chappell, Ian Chai, ");
-      printf("John Cowan, Christiaan Keet\n");
-      printf("Internet: <info@figlet.org> ");
-      printf("Version: %s, date: %s\n\n",VERSION,DATE);
-      printf("FIGlet, along with the various FIGlet fonts");
-      printf(" and documentation, may be\n");
-      printf("freely copied and distributed.\n\n");
-      printf("If you use FIGlet, please send an");
-      printf(" e-mail message to <info@figlet.org>.\n\n");
-      printf("The latest version of FIGlet is available from the");
-      printf(" web site,\n\thttp://www.figlet.org/\n\n");
-      printusage(stdout);
-      break;
-    case 1: /* Version (integer) */
-      printf("%d\n",VERSION_INT);
-      break;
-    case 2: /* Font directory */
-      printf("%s\n",fontdirname);
-      break;
-    case 3: /* Font */
-      printf("%s\n",fontname);
-      break;
-    case 4: /* Outputwidth */
-      printf("%d\n",outputwidth);
-    }
-}
-
-
-/****************************************************************************
-
-  readmagic
-
-  Reads a four-character magic string from a stream.
-
-****************************************************************************/
-void readmagic(fp,magic)
-ZFILE *fp;
-char *magic;
-{
-  int i;
-
-  for (i=0;i<4;i++) {
-    magic[i] = Zgetc(fp);
-    }
-  magic[4] = 0;
-  }
-  
-/****************************************************************************
-
-  skipws
-
-  Skips whitespace characters from a stream.
-
-****************************************************************************/
-void skipws(fp)
-ZFILE *fp;
-{
-  int c;
-  while (c=Zgetc(fp),isascii(c)&&isspace(c)) ;
-  Zungetc(c,fp);
-  }
-
-/****************************************************************************
-
-  readnum
-
-  Reads a number from a stream.  Accepts "0" prefix for octal and
-  "0x" or "0X" for hexadecimal.  Ignores leading whitespace.
-
-****************************************************************************/
-void readnum(fp,nump)
-ZFILE *fp;
-inchr *nump;
-{
-  int acc = 0;
-  char *p;
-  int c;
-  int base;
-  int sign = 1;
-  char digits[] = "0123456789ABCDEF";
-
-  skipws(fp);
-  c = Zgetc(fp);
-  if (c=='-') {
-    sign = -1;
-    }
-  else {
-    Zungetc(c,fp);
-    }
-  c = Zgetc(fp);
-  if (c=='0') {
-     c = Zgetc(fp);
-     if (c=='x'||c=='X') {
-       base = 16;
-       }
-     else {
-       base = 8;
-       Zungetc(c,fp);
-       }
-    }
-  else {
-    base = 10;
-    Zungetc(c,fp);
-    }
-
-  while((c=Zgetc(fp))!=EOF) {
-    c=toupper(c);
-    p=strchr(digits,c);
-    if (!p) {
-      Zungetc(c,fp);
-      *nump = acc * sign;
-      return;
-      }
-    acc = acc*base+(p-digits);
-    }
-  *nump = acc * sign;
-  }  
-
-/****************************************************************************
-
-  readTchar
-
-  Reads a control file "T" command character specification.
-
-  Character is a single byte, an escape sequence, or
-  an escaped numeric.
-
-****************************************************************************/
-
-inchr readTchar(fp)
-ZFILE *fp;
-{
-  inchr thechar;
-  char next;
-
-  thechar=Zgetc(fp);
-  if (thechar=='\n' || thechar=='\r') { /* Handle badly-formatted file */
-    Zungetc(thechar,fp);
-    return '\0';
-    }
-  if (thechar!='\\') return thechar;
-  next=Zgetc(fp);
-  switch(next) {
-    case 'a':
-      return 7;
-    case 'b':
-      return 8;
-    case 'e':
-      return 27;
-    case 'f':
-      return 12;
-    case 'n':
-      return 10;
-    case 'r':
-      return 13;
-    case 't':
-      return 9;
-    case 'v':
-      return 11;
-    default:
-      if (next=='-' || next=='x' || (next>='0' && next<='9')) {
-        Zungetc(next,fp);
-        readnum(fp,&thechar);
-        return thechar;
-        }
-      return next;
-    }
-}
-
-/****************************************************************************
-
-  charsetname
-
-  Get a Tchar representing a charset name, or 0 if none available.
-  Called in getcharset().
-
-****************************************************************************/
-
-inchr charsetname(fp)
-ZFILE *fp;
-{
-  inchr result;
-
-  result = readTchar(fp);
-  if (result == '\n' || result == '\r') {
-    result = 0;
-    Zungetc(result,fp);
-    }
-  return result;
-  }
-
-/****************************************************************************
-
-  charset
-
-  Processes "g[0123]" character set specifier
-  Called in readcontrol().
-
-****************************************************************************/
-
-void charset(n, controlfile)
-int n;
-ZFILE *controlfile;
-{
-  int ch;
-
-  skipws(controlfile);
-  if (Zgetc(controlfile) != '9') {
-    skiptoeol(controlfile);
-    return;
-    }
-  ch = Zgetc(controlfile);
-  if (ch == '6') {
-     gn[n] = 65536L * charsetname(controlfile) + 0x80;
-     gndbl[n] = 0;
-     skiptoeol(controlfile);
-     return;
-     }
-  if (ch != '4') {
-    skiptoeol(controlfile);
-    return;
-    }
-  ch = Zgetc(controlfile);
-  if (ch == 'x') {
-     if (Zgetc(controlfile) != '9') {
-       skiptoeol(controlfile);
-       return;
-       }
-     if (Zgetc(controlfile) != '4') {
-       skiptoeol(controlfile);
-       return;
-       }
-     skipws(controlfile);
-     gn[n] = 65536L * charsetname(controlfile);
-     gndbl[n] = 1;
-     skiptoeol(controlfile);
-     return;
-     }
-  Zungetc(ch, controlfile);
-  skipws(controlfile);
-  gn[n] = 65536L * charsetname(controlfile);
-  gndbl[n] = 0;
-  return;
-  }
-
-/****************************************************************************
-
-  readcontrol
-
-  Allocates memory and reads in the given control file.
-  Called in readcontrolfiles().
-
-****************************************************************************/
-
-void readcontrol(controlname)
-char *controlname;
-{
-  inchr firstch,lastch;
-  char dashcheck;
-  inchr offset;
-  char *controlpath,magicnum[5];
-  int command;
-  ZFILE *controlfile;
-  int namelen;
-
-  namelen = MYSTRLEN(fontdirname);
-  controlpath = (char*)myalloc(sizeof(char)
-    *(namelen+MYSTRLEN(controlname)+CSUFFIXLEN+2));
-  controlfile = NULL;
-  if (!hasdirsep(controlname)) {
-    strcpy(controlpath,fontdirname);
-    controlpath[namelen] = DIRSEP;
-    controlpath[namelen+1] = '\0';
-    strcat(controlpath,controlname);
-    strcat(controlpath,CONTROLFILESUFFIX);
-    controlfile = Zopen(controlpath,"rb");
-    }
-  if (controlfile==NULL) {
-    strcpy(controlpath,controlname);
-    strcat(controlpath,CONTROLFILESUFFIX);
-    controlfile = Zopen(controlpath,"rb");
-    if (controlfile==NULL) {
-      fprintf(stderr,"%s: %s: Unable to open control file\n",myname,
-        controlpath);
-      exit(1);
-      }
-    }
-
-  free(controlpath);
-
-  (*commandlistend) = (comnode*)myalloc(sizeof(comnode));
-  (*commandlistend)->thecommand = 0; /* Begin with a freeze command */
-  commandlistend = &(*commandlistend)->next;
-  (*commandlistend) = NULL;
-
-  while(command=Zgetc(controlfile),command!=EOF) {
-    switch (command) {
-      case 't': /* Translate */
-        skipws(controlfile);
-        firstch=readTchar(controlfile);
-        if ((dashcheck=Zgetc(controlfile))=='-') {
-          lastch=readTchar(controlfile);
-          }
-        else {
-          Zungetc(dashcheck,controlfile);
-          lastch=firstch;
-          }
-        skipws(controlfile);
-        offset=readTchar(controlfile)-firstch;
-        skiptoeol(controlfile);
-        (*commandlistend) = (comnode*)myalloc(sizeof(comnode));
-        (*commandlistend)->thecommand = 1;
-        (*commandlistend)->rangelo = firstch;
-        (*commandlistend)->rangehi = lastch;
-        (*commandlistend)->offset = offset;
-        commandlistend = &(*commandlistend)->next;
-        (*commandlistend) = NULL;
-        break;
-      case '0': case '1': case '2': case '3': case '4':
-      case '5': case '6': case '7': case '8': case '9':
-      case '-':
-                /* Mapping table entry */
-        Zungetc(command,controlfile);
-        readnum(controlfile,&firstch);
-        skipws(controlfile);
-	readnum(controlfile,&lastch);
-	offset=lastch-firstch;
-        lastch=firstch;
-        skiptoeol(controlfile);
-        (*commandlistend) = (comnode*)myalloc(sizeof(comnode));
-        (*commandlistend)->thecommand = 1;
-        (*commandlistend)->rangelo = firstch;
-        (*commandlistend)->rangehi = lastch;
-        (*commandlistend)->offset = offset;
-        commandlistend = &(*commandlistend)->next;
-        (*commandlistend) = NULL;
-        break;
-      case 'f': /* freeze */
-        skiptoeol(controlfile);
-        (*commandlistend) = (comnode*)myalloc(sizeof(comnode));
-        (*commandlistend)->thecommand = 0;
-        commandlistend = &(*commandlistend)->next;
-        (*commandlistend) = NULL;
-        break;
-      case 'b': /* DBCS input mode */
-        multibyte = 1;
-        break;
-      case 'u': /* UTF-8 input mode */
-        multibyte = 2;
-        break;
-      case 'h': /* HZ input mode */
-        multibyte = 3;
-        break;
-      case 'j': /* Shift-JIS input mode */
-        multibyte = 4;
-        break;
-      case 'g': /* ISO 2022 character set choices */
-        multibyte = 0;
-        skipws(controlfile);
-        command=Zgetc(controlfile);
-        switch (command) {
-          case '0': /* define G0 charset */
-            charset(0, controlfile);
-            break;
-          case '1': /* set G1 charset */
-            charset(1, controlfile);
-            break;
-          case '2': /* set G2 charset */
-            charset(2, controlfile);
-            break;
-          case '3': /* set G3 charset */
-            charset(3, controlfile);
-            break;
-          case 'l': case 'L': /* define left half */
-            skipws(controlfile);
-            gl = Zgetc(controlfile) - '0';
-            skiptoeol(controlfile);
-            break;
-          case 'r': case 'R': /* define right half */
-            skipws(controlfile);
-            gr = Zgetc(controlfile) - '0';
-            skiptoeol(controlfile);
-            break;
-          default: /* meaningless "g" command */
-            skiptoeol(controlfile);
-          }
-      case '\r': case '\n': /* blank line */
-        break;
-      default: /* Includes '#' */
-        skiptoeol(controlfile);
-      }
-    }
-  Zclose(controlfile);
-}
-
-
-/****************************************************************************
-
-  readcontrolfiles
-
-  Reads in the controlfiles names in cfilelist.  Uses readcontrol.
-  Called in main().
-
-****************************************************************************/
-
-void readcontrolfiles()
-{
-  cfnamenode *cfnptr;
-
-  for (cfnptr=cfilelist;cfnptr!=NULL;cfnptr=cfnptr->next) {
-    readcontrol(cfnptr->thename);
-    }
-}
-
-
-/****************************************************************************
-
-  clearcfilelist
-
-  Clears the control file list.  Assumes thename does not need freeing.
-
-****************************************************************************/
-
-void clearcfilelist()
-{
-  cfnamenode *cfnptr1,*cfnptr2;
-
-  cfnptr1 = cfilelist;
-  while (cfnptr1 != NULL) {
-    cfnptr2 = cfnptr1->next;
-    free(cfnptr1);
-    cfnptr1 = cfnptr2;
-    }
-  cfilelist = NULL;
-  cfilelistend = &cfilelist;
-}
-
-
-/****************************************************************************
-
-  getparams
-
-  Handles all command-line parameters.  Puts all parameters within
-  bounds.
-
-****************************************************************************/
-
-void getparams()
-{
-  extern char *optarg;
-  extern int optind;
-  int c; /* "Should" be a char -- need int for "!= -1" test*/
-  int columns,firstfont,infoprint;
-  char *controlname;
-
-  if ((myname = strrchr(Myargv[0],DIRSEP))!=NULL) {
-    myname++;
-    }
-  else {
-    myname = Myargv[0];
-    }
-  fontdirname = DEFAULTFONTDIR;
-  firstfont = 1;
-  fontname = (char*)myalloc(sizeof(char)*(MYSTRLEN(DEFAULTFONTFILE)+1));
-  strcpy(fontname,DEFAULTFONTFILE); /* Some systems don't have strdup() */
-  if (suffixcmp(fontname,FONTFILESUFFIX)) {
-    fontname[MYSTRLEN(fontname)-FSUFFIXLEN]='\0';
-    }
-  cfilelist = NULL;
-  cfilelistend = &cfilelist;
-  commandlist = NULL;
-  commandlistend = &commandlist;
-  smushoverride = SMO_NO;
-  deutschflag = 0;
-  justification = -1;
-  right2left = -1;
-  paragraphflag = 0;
-  infoprint = -1;
-  cmdinput = 0;
-  outputwidth = DEFAULTCOLUMNS;
-  gn[1] = 0x80;
-  gr = 1;
-  while ((c = getopt(Myargc,Myargv,"ADEXLRI:xlcrpntvm:w:d:f:C:NFskSWo"))!= -1) {
-      /* Note: -F is not a legal option -- prints a special err message.  */
-    switch (c) {
-      case 'A':
-        cmdinput = 1;
-        break;
-      case 'D':
-        deutschflag = 1;
-        break;
-      case 'E':
-        deutschflag = 0;
-        break;
-      case 'X':
-        right2left = -1;
-        break;
-      case 'L':
-        right2left = 0;
-        break;
-      case 'R':
-        right2left = 1;
-        break;
-      case 'x':
-        justification = -1;
-        break;
-      case 'l':
-        justification = 0;
-        break;
-      case 'c':
-        justification = 1;
-        break;
-      case 'r':
-        justification = 2;
-        break;
-      case 'p':
-        paragraphflag = 1;
-        break;
-      case 'n':
-        paragraphflag = 0;
-        break;
-      case 's':
-        smushoverride = SMO_NO;
-        break;
-      case 'k':
-        smushmode = SM_KERN;
-        smushoverride = SMO_YES;
-        break;
-      case 'S':
-        smushmode = SM_SMUSH;
-	smushoverride = SMO_FORCE;
-        break;
-      case 'o':
-        smushmode = SM_SMUSH;
-	smushoverride = SMO_YES;
-        break;
-      case 'W':
-        smushmode = 0;
-	smushoverride = SMO_YES;
-        break;
-      case 't':
-#ifdef TIOCGWINSZ
-        columns = get_columns();
-        if (columns>0) {
-          outputwidth = columns;
-          }
-#else /* ifdef TIOCGWINSZ */
-        fprintf(stderr,
-          "%s: \"-t\" is disabled, since ioctl is not fully implemented.\n",
-          myname);
-#endif /* ifdef TIOCGWINSZ */
-        break;
-      case 'v':
-        infoprint = 0;
-        break;
-      case 'I':
-        infoprint = atoi(optarg);
-        break;
-      case 'm':
-        smushmode = atoi(optarg);
-        if (smushmode < -1) {
-          smushoverride = SMO_NO;
-          break;
-          }
-	if (smushmode == 0) smushmode = SM_KERN;
-	else if (smushmode == -1) smushmode = 0;
-	else smushmode = (smushmode & 63) | SM_SMUSH;
-	smushoverride = SMO_YES;
-        break;
-      case 'w':
-        columns = atoi(optarg);
-        if (columns>0) {
-          outputwidth = columns;
-          }
-        break;
-      case 'd':
-        fontdirname = optarg;
-        break;
-      case 'f':
-        if (firstfont) {
-          free(fontname);
-          firstfont = 0;
-          }
-        fontname = optarg;
-        if (suffixcmp(fontname,FONTFILESUFFIX)) {
-          fontname[MYSTRLEN(fontname)-FSUFFIXLEN] = '\0';
-          }
-        break;
-      case 'C':
-        controlname = optarg;
-        if (suffixcmp(controlname, CONTROLFILESUFFIX)) {
-          controlname[MYSTRLEN(controlname)-CSUFFIXLEN] = '\0';
-          }
-        (*cfilelistend) = (cfnamenode*)myalloc(sizeof(cfnamenode));
-        (*cfilelistend)->thename = controlname;
-        cfilelistend = &(*cfilelistend)->next;
-        (*cfilelistend) = NULL;
-        break;
-      case 'N':
-        clearcfilelist();
-        multibyte = 0;
-        gn[0] = 0;
-        gn[1] = 0x80;
-        gn[2] = gn[3] = 0;
-        gndbl[0] = gndbl[1] = gndbl[2] = gndbl[3] = 0;
-        gl = 0;
-        gr = 1;
-        break;
-      case 'F': /* Not a legal option */
-        fprintf(stderr,"%s: illegal option -- F\n",myname);
-        printusage(stderr);
-        fprintf(stderr,"\nBecause of numerous incompatibilities, the");
-        fprintf(stderr," \"-F\" option has been\n");
-        fprintf(stderr,"removed.  It has been replaced by the \"figlist\"");
-        fprintf(stderr," program, which is now\n");
-        fprintf(stderr,"included in the basic FIGlet package.  \"figlist\"");
-        fprintf(stderr," is also available\n");
-        fprintf(stderr,"from  http://www.figlet.org/");
-        fprintf(stderr,"under UNIX utilities.\n");
-        exit(1);
-        break;
-      default:
-        printusage(stderr);
-        exit(1);
-      }
-    }
-  if (optind!=Myargc) cmdinput = 1; /* force cmdinput if more arguments */
-  outlinelenlimit = outputwidth-1;
-  if (infoprint>=0) {
-    printinfo(infoprint);
-    exit(0);
-    }
-}
-
-
-/****************************************************************************
-
-  clearline
-
-  Clears both the input (inchrline) and output (outputline) storage.
-
-****************************************************************************/
-
-void clearline()
-{
-  int i;
-
-  for (i=0;i<charheight;i++) {
-    outputline[i][0] = '\0';
-    }
-  outlinelen = 0;
-  inchrlinelen = 0;
-}
-
-
-/****************************************************************************
-
-  readfontchar
-
-  Reads a font character from the font file, and places it in a
-  newly-allocated entry in the list.
-
-****************************************************************************/
-
-void readfontchar(file,theord,line,maxlen)
-ZFILE *file;
-inchr theord;
-char *line;
-int maxlen;
-{
-  int row,k;
-  char endchar;
-  fcharnode *fclsave;
-
-  fclsave = fcharlist;
-  fcharlist = (fcharnode*)myalloc(sizeof(fcharnode));
-  fcharlist->ord = theord;
-  fcharlist->thechar = (char**)myalloc(sizeof(char*)*charheight);
-  fcharlist->next = fclsave;
-  for (row=0;row<charheight;row++) {
-    if (myfgets(line,maxlen+1,file)==NULL) {
-      line[0] = '\0';
-      }
-    k = MYSTRLEN(line)-1;
-    while (k>=0 && isspace(line[k])) {
-      k--;
-      }
-    if (k>=0) {
-      endchar = line[k];
-      while (k>=0 ? line[k]==endchar : 0) {
-        k--;
-        }
-      }
-    line[k+1] = '\0';
-    fcharlist->thechar[row] = (char*)myalloc(sizeof(char)*(k+2));
-    strcpy(fcharlist->thechar[row],line);
-    }
-}
-
-
-/****************************************************************************
-
-  readfont
-
-  Allocates memory, initializes variables, and reads in the font.
-  Called near beginning of main().
-
-****************************************************************************/
-
-void readfont()
-{
-#define MAXFIRSTLINELEN 1000
-  int i,row,numsread;
-  inchr theord;
-  int maxlen,cmtlines,ffright2left;
-  int smush,smush2;
-  char *fontpath,*fileline,magicnum[5];
-  ZFILE *fontfile;
-  int namelen;
-
-  namelen = MYSTRLEN(fontdirname);
-  fontpath = (char*)myalloc(sizeof(char)
-    *(namelen+MYSTRLEN(fontname)+FSUFFIXLEN+2));
-  fontfile = NULL;
-  if (!hasdirsep(fontname)) {
-    strcpy(fontpath,fontdirname);
-    fontpath[namelen] = DIRSEP;
-    fontpath[namelen+1] = '\0';
-    strcat(fontpath,fontname);
-    strcat(fontpath,FONTFILESUFFIX);
-    fontfile = Zopen(fontpath,"rb");
-    }
-  if (fontfile==NULL) {
-    strcpy(fontpath,fontname);
-    strcat(fontpath,FONTFILESUFFIX);
-    fontfile = Zopen(fontpath,"rb");
-    if (fontfile==NULL) {
-      fprintf(stderr,"%s: %s: Unable to open font file\n",myname,fontpath);
-      exit(1);
-      }
-    }
-
-  readmagic(fontfile,magicnum);
-  fileline = (char*)myalloc(sizeof(char)*(MAXFIRSTLINELEN+1));
-  if (myfgets(fileline,MAXFIRSTLINELEN+1,fontfile)==NULL) {
-    fileline[0] = '\0';
-    }
-  if (MYSTRLEN(fileline)>0 ? fileline[MYSTRLEN(fileline)-1]!='\n' : 0) {
-    skiptoeol(fontfile);
-    }
-  numsread = sscanf(fileline,"%*c%c %d %*d %d %d %d %d %d",
-    &hardblank,&charheight,&maxlen,&smush,&cmtlines,
-    &ffright2left,&smush2);
-  free(fileline);
-  if (strcmp(magicnum,FONTFILEMAGICNUMBER) || numsread<5) {
-    fprintf(stderr,"%s: %s: Not a FIGlet 2 font file\n",myname,fontpath);
-    exit(1);
-    }
-  for (i=1;i<=cmtlines;i++) {
-    skiptoeol(fontfile);
-    }
-  free(fontpath);
-
-  if (numsread<6) {
-    ffright2left = 0;
-    }
-
-  if (numsread<7) { /* if no smush2, decode smush into smush2 */
-    if (smush == 0) smush2 = SM_KERN;
-    else if (smush < 0) smush2 = 0;
-    else smush2 = (smush & 31) | SM_SMUSH;
-    }
-
-  if (charheight<1) {
-    charheight = 1;
-    }
-
-  if (maxlen<1) {
-    maxlen = 1;
-    }
-
-  maxlen += 100; /* Give ourselves some extra room */
-
-  if (smushoverride == SMO_NO)
-     smushmode = smush2;
-  else if (smushoverride == SMO_FORCE)
-     smushmode |= smush2;
-
-  if (right2left<0) {
-    right2left = ffright2left;
-    }
-
-  if (justification<0) {
-    justification = 2*right2left;
-    }
-
-  fileline = (char*)myalloc(sizeof(char)*(maxlen+1));
-  /* Allocate "missing" character */
-  fcharlist = (fcharnode*)myalloc(sizeof(fcharnode));
-  fcharlist->ord = 0;
-  fcharlist->thechar = (char**)myalloc(sizeof(char*)*charheight);
-  fcharlist->next = NULL;
-  for (row=0;row<charheight;row++) {
-    fcharlist->thechar[row] = (char*)myalloc(sizeof(char));
-    fcharlist->thechar[row][0] = '\0';
-    }
-  for (theord=' ';theord<='~';theord++) {
-    readfontchar(fontfile,theord,fileline,maxlen);
-    }
-  for (theord=0;theord<=6;theord++) {
-    readfontchar(fontfile,deutsch[theord],fileline,maxlen);
-    }
-  while (myfgets(fileline,maxlen+1,fontfile)==NULL?0:
-    sscanf(fileline,"%li",&theord)==1) {
-    readfontchar(fontfile,theord,fileline,maxlen);
-    }
-  Zclose(fontfile);
-  free(fileline);
-}
-
-
-/****************************************************************************
-
-  linealloc
-
-  Allocates & clears outputline, inchrline. Sets inchrlinelenlimit.
-  Called near beginning of main().
-
-****************************************************************************/
-
-void linealloc()
-{
-  int row; 
-
-  outputline = (char**)myalloc(sizeof(char*)*charheight);
-  for (row=0;row<charheight;row++) {
-    outputline[row] = (char*)myalloc(sizeof(char)*(outlinelenlimit+1));
-    }
-  inchrlinelenlimit = outputwidth*4+100;
-  inchrline = (inchr*)myalloc(sizeof(inchr)*(inchrlinelenlimit+1));
-  clearline();
-}
-
-
-/****************************************************************************
-
-  getletter
-
-  Sets currchar to point to the font entry for the given character.
-  Sets currcharwidth to the width of this character.
-
-****************************************************************************/
-
-void getletter(c)
-inchr c;
-{
-  fcharnode *charptr;
-
-  for (charptr=fcharlist;charptr==NULL?0:charptr->ord!=c;
-    charptr=charptr->next) ;
-  if (charptr!=NULL) {
-    currchar = charptr->thechar;
-    }
-  else {
-    for (charptr=fcharlist;charptr==NULL?0:charptr->ord!=0;
-      charptr=charptr->next) ;
-    currchar = charptr->thechar;
-    }
-  previouscharwidth = currcharwidth;
-  currcharwidth = MYSTRLEN(currchar[0]);
-}
-
-
-/****************************************************************************
-
-  smushem
-
-  Given 2 characters, attempts to smush them into 1, according to
-  smushmode.  Returns smushed character or '\0' if no smushing can be
-  done.
-
-  smushmode values are sum of following (all values smush blanks):
-    1: Smush equal chars (not hardblanks)
-    2: Smush '_' with any char in hierarchy below
-    4: hierarchy: "|", "/\", "[]", "{}", "()", "<>"
-       Each class in hier. can be replaced by later class.
-    8: [ + ] -> |, { + } -> |, ( + ) -> |
-   16: / + \ -> X, > + < -> X (only in that order)
-   32: hardblank + hardblank -> hardblank
-
-****************************************************************************/
-
-char smushem(lch,rch)
-char lch,rch;
-{
-  if (lch==' ') return rch;
-  if (rch==' ') return lch;
-
-  if (previouscharwidth<2 || currcharwidth<2) return '\0';
-    /* Disallows overlapping if the previous character */
-    /* or the current character has a width of 1 or zero. */
-
-  if ((smushmode & SM_SMUSH) == 0) return '\0';  /* kerning */
-
-  if ((smushmode & 63) == 0) {
-    /* This is smushing by universal overlapping. */
-    if (lch==' ') return rch;
-    if (rch==' ') return lch;
-    if (lch==hardblank) return rch;
-    if (rch==hardblank) return lch;
-      /* Above four lines ensure overlapping preference to */
-      /* visible characters. */
-    if (right2left==1) return lch;
-      /* Above line ensures that the dominant (foreground) */
-      /* fig-character for overlapping is the latter in the */
-      /* user's text, not necessarily the rightmost character. */
-    return rch;
-      /* Occurs in the absence of above exceptions. */
-    }
-  
-  if (smushmode & SM_HARDBLANK) {
-    if (lch==hardblank && rch==hardblank) return lch;
-    }
-
-  if (lch==hardblank || rch==hardblank) return '\0';
-
-  if (smushmode & SM_EQUAL) {
-    if (lch==rch) return lch;
-    }
-
-  if (smushmode & SM_LOWLINE) {
-    if (lch=='_' && strchr("|/\\[]{}()<>",rch)) return rch;
-    if (rch=='_' && strchr("|/\\[]{}()<>",lch)) return lch;
-    }
-
-  if (smushmode & SM_HIERARCHY) {
-    if (lch=='|' && strchr("/\\[]{}()<>",rch)) return rch;
-    if (rch=='|' && strchr("/\\[]{}()<>",lch)) return lch;
-    if (strchr("/\\",lch) && strchr("[]{}()<>",rch)) return rch;
-    if (strchr("/\\",rch) && strchr("[]{}()<>",lch)) return lch;
-    if (strchr("[]",lch) && strchr("{}()<>",rch)) return rch;
-    if (strchr("[]",rch) && strchr("{}()<>",lch)) return lch;
-    if (strchr("{}",lch) && strchr("()<>",rch)) return rch;
-    if (strchr("{}",rch) && strchr("()<>",lch)) return lch;
-    if (strchr("()",lch) && strchr("<>",rch)) return rch;
-    if (strchr("()",rch) && strchr("<>",lch)) return lch;
-    }
-
-  if (smushmode & SM_PAIR) {
-    if (lch=='[' && rch==']') return '|';
-    if (rch=='[' && lch==']') return '|';
-    if (lch=='{' && rch=='}') return '|';
-    if (rch=='{' && lch=='}') return '|';
-    if (lch=='(' && rch==')') return '|';
-    if (rch=='(' && lch==')') return '|';
-    }
-
-  if (smushmode & SM_BIGX) {
-    if (lch=='/' && rch=='\\') return '|';
-    if (rch=='/' && lch=='\\') return 'Y';
-    if (lch=='>' && rch=='<') return 'X';
-      /* Don't want the reverse of above to give 'X'. */
-    }
-
-  return '\0';
-}
-
-
-/****************************************************************************
-
-  smushamt
-
-  Returns the maximum amount that the current character can be smushed
-  into the current line.
-
-****************************************************************************/
-
-int smushamt()
-{
-  int maxsmush,amt;
-  int row,linebd,charbd;
-  char ch1,ch2;
-
-  if ((smushmode & (SM_SMUSH | SM_KERN)) == 0) {
-    return 0;
-    }
-  maxsmush = currcharwidth;
-  for (row=0;row<charheight;row++) {
-    if (right2left) {
-      for (charbd=MYSTRLEN(currchar[row]);
-        ch1=currchar[row][charbd],(charbd>0&&(!ch1||ch1==' '));charbd--) ;
-      for (linebd=0;ch2=outputline[row][linebd],ch2==' ';linebd++) ;
-      amt = linebd+currcharwidth-1-charbd;
-      }
-    else {
-      for (linebd=MYSTRLEN(outputline[row]);
-        ch1 = outputline[row][linebd],(linebd>0&&(!ch1||ch1==' '));linebd--) ;
-      for (charbd=0;ch2=currchar[row][charbd],ch2==' ';charbd++) ;
-      amt = charbd+outlinelen-1-linebd;
-      }
-    if (!ch1||ch1==' ') {
-      amt++;
-      }
-    else if (ch2) {
-      if (smushem(ch1,ch2)!='\0') {
-        amt++;
-        }
-      }
-    if (amt<maxsmush) {
-      maxsmush = amt;
-      }
-    }
-  return maxsmush;
-}
-
-
-/****************************************************************************
-
-  addchar
-
-  Attempts to add the given character onto the end of the current line.
-  Returns 1 if this can be done, 0 otherwise.
-
-****************************************************************************/
-
-int addchar(c)
-inchr c;
-{
-  int smushamount,row,k;
-  char *templine;
-
-  getletter(c);
-  smushamount = smushamt();
-  if (outlinelen+currcharwidth-smushamount>outlinelenlimit
-      ||inchrlinelen+1>inchrlinelenlimit) {
-    return 0;
-    }
-
-  templine = (char*)myalloc(sizeof(char)*(outlinelenlimit+1));
-  for (row=0;row<charheight;row++) {
-    if (right2left) {
-      strcpy(templine,currchar[row]);
-      for (k=0;k<smushamount;k++) {
-        templine[currcharwidth-smushamount+k] =
-          smushem(templine[currcharwidth-smushamount+k],outputline[row][k]);
-        }
-      strcat(templine,outputline[row]+smushamount);
-      strcpy(outputline[row],templine);
-      }
-    else {
-      for (k=0;k<smushamount;k++) {
-        if (outlinelen-smushamount+k >= 0)
-          outputline[row][outlinelen-smushamount+k] =
-            smushem(outputline[row][outlinelen-smushamount+k],currchar[row][k]);
-        }
-      strcat(outputline[row],currchar[row]+smushamount);
-      }
-    }
-  free(templine);
-  outlinelen = MYSTRLEN(outputline[0]);
-  inchrline[inchrlinelen++] = c;
-  return 1;
-}
-
-
-/****************************************************************************
-
-  putstring
-
-  Prints out the given null-terminated string, substituting blanks
-  for hardblanks.  If outputwidth is 1, prints the entire string;
-  otherwise prints at most outputwidth-1 characters.  Prints a newline
-  at the end of the string.  The string is left-justified, centered or
-  right-justified (taking outputwidth as the screen width) if
-  justification is 0, 1 or 2, respectively.
-
-****************************************************************************/
-
-static int nr_chars=0;
-static void myputchar(unsigned char c)
-{
-    static int startline = 1;
-
-    if ( startline )
-    {
-        startline = 0;
-        myputchar(' ');
-    }
-
-    putc(c, stderr);
-
-    if ( nr_chars == 18 ) 
-    {
-        nr_chars = 0;
-        putchar('"');
-        putchar(' ');
-        putchar('\\');
-        putchar('\n');
-    }
-
-    if ( nr_chars++ == 0 )
-        putchar('"');
-
-    putchar('\\');
-    putchar('0' + ((c>>6)&7));
-    putchar('0' + ((c>>3)&7));
-    putchar('0' + ((c>>0)&7));
-
-    if ( c == '\n' )
-        startline = 1;
-}
-
-void putstring(string)
-char *string;
-{
-  int i,len;
-
-  len = MYSTRLEN(string);
-  if (outputwidth>1) {
-    if (len>outputwidth-1) {
-      len = outputwidth-1;
-      }
-    if (justification>0) {
-      for (i=1;(3-justification)*i+len+justification-2<outputwidth;i++) {
-        myputchar(' ');
-        }
-      }
-    }
-  for (i=0;i<len;i++) {
-    myputchar(string[i]==hardblank?' ':string[i]);
-    }
-  myputchar('\n');
-}
-
-
-/****************************************************************************
-
-  printline
-
-  Prints outputline using putstring, then clears the current line.
-
-****************************************************************************/
-
-void printline()
-{
-  int i;
-
-  for (i=0;i<charheight;i++) {
-    putstring(outputline[i]);
-    }
-  clearline();
-}
-
-
-/****************************************************************************
-
-  splitline
-
-  Splits inchrline at the last word break (bunch of consecutive blanks).
-  Makes a new line out of the first part and prints it using
-  printline.  Makes a new line out of the second part and returns.
-
-****************************************************************************/
-
-void splitline()
-{
-  int i,gotspace,lastspace,len1,len2;
-  inchr *part1,*part2;
-
-  part1 = (inchr*)myalloc(sizeof(inchr)*(inchrlinelen+1));
-  part2 = (inchr*)myalloc(sizeof(inchr)*(inchrlinelen+1));
-  gotspace = 0;
-  for (i=inchrlinelen-1;i>=0;i--) {
-    if (!gotspace && inchrline[i]==' ') {
-      gotspace = 1;
-      lastspace = i;
-      }
-    if (gotspace && inchrline[i]!=' ') {
-      break;
-      }
-    }
-  len1 = i+1;
-  len2 = inchrlinelen-lastspace-1;
-  for (i=0;i<len1;i++) {
-    part1[i] = inchrline[i];
-    }
-  for (i=0;i<len2;i++) {
-    part2[i] = inchrline[lastspace+1+i];
-    }
-  clearline();
-  for (i=0;i<len1;i++) {
-    addchar(part1[i]);
-    }
-  printline();
-  for (i=0;i<len2;i++) {
-    addchar(part2[i]);
-    }
-  free(part1);
-  free(part2);
-}
-
-
-/****************************************************************************
-
-  handlemapping
-
-  Given an input character (type inchr), executes re-mapping commands
-  read from control files.  Returns re-mapped character (inchr).
-
-****************************************************************************/
-
-inchr handlemapping(c)
-inchr c;
-{
-  comnode *cmptr;
-
-  cmptr=commandlist;
-  while (cmptr!=NULL) {
-    if (cmptr->thecommand ?
-      (c >= cmptr->rangelo && c <= cmptr->rangehi) : 0) {
-      c += cmptr->offset;
-      while(cmptr!=NULL ? cmptr->thecommand : 0) {
-        cmptr=cmptr->next;
-        }
-      }
-    else {
-      cmptr=cmptr->next;
-      }
-    }
-  return c;
-}
-
-/****************************************************************************
-
-  Agetchar
-
-  Replacement to getchar().
-  Acts exactly like getchar if -A is NOT specified,
-  else obtains input from All remaining command line words.
-
-****************************************************************************/
-
-int Agetchar()
-{
-    extern int optind;		/* current argv[] element under study */
-    static AgetMode = 0;	/* >= 0 for displacement into argv[n], <0 EOF */
-    char   *arg;		/* pointer to active character */
-    int    c;			/* current character */
-
-    if ( ! cmdinput )		/* is -A active? */
-	return( getchar() );	/* no: return stdin character */
-
-    if ( AgetMode < 0 || optind >= Myargc )		/* EOF is sticky: */
-	return( EOF );		/* **ensure it now and forever more */
-
-    /* find next character */
-    arg = Myargv[optind];		/* pointer to active arg */
-    c = arg[AgetMode++]&0xFF;	/* get appropriate char of arg */
-
-    if ( ! c )			/* at '\0' that terminates word? */
-    {   /* at end of word: return ' ' if normal word, '\n' if empty */
-	c = ' ';		/* suppose normal word and return blank */
-	if ( AgetMode == 1 )	/* if ran out in very 1st char, force \n */
-	    c = '\n';		/* (allows "hello '' world" to do \n at '') */
-	AgetMode = 0;		/* return to char 0 in NEXT word */
-	if ( ++optind >= Myargc )	/* run up word count and check if at "EOF" */
-	{   /* just ran out of arguments */
-	    c = EOF;		/* return EOF */
-	    AgetMode = -1;	/* ensure all future returns return EOF */
-	}
-    }
-
-    return( c );		/* return appropriate character */
-
-}	/* end: Agetchar() */
-
-
-/****************************************************************************
-
-  iso2022
-
-  Called by getinchr.  Interprets ISO 2022 sequences
-
-******************************************************************************/
-
-inchr iso2022()
-{
-  inchr ch;
-  inchr ch2;
-  int save_gl;
-  int save_gr;
-
-  ch = Agetchar();
-  if (ch == EOF) return ch;
-  if (ch == 27) ch = Agetchar() + 0x100; /* ESC x */
-  if (ch == 0x100 + '$') ch = Agetchar() + 0x200; /* ESC $ x */
-  switch (ch) {
-    case 14: /* invoke G0 into GL */
-      gl = 0;
-      return iso2022();
-    case 15: /* invoke G1 into GL */
-      gl = 1;
-      return iso2022();
-    case 142: case 'N' + 0x100: /* invoke G2 into GL for next char */
-      save_gl = gl; save_gr = gr;
-      gl = gr = 2;
-      ch = iso2022();
-      gl = save_gl; gr = save_gr;
-      return ch;
-    case 143: case 'O' + 0x100: /* invoke G3 into GL for next char */
-      save_gl = gl; save_gr = gr;
-      gl = gr = 3;
-      ch = iso2022();
-      gl = save_gl; gr = save_gr;
-      return ch;
-    case 'n' + 0x100: /* invoke G2 into GL */
-      gl = 2;
-      return iso2022();
-    case 'o' + 0x100: /* invoke G3 into GL */
-      gl = 3;
-      return iso2022();
-    case '~' + 0x100: /* invoke G1 into GR */
-      gr = 1;
-      return iso2022();
-    case '}' + 0x100: /* invoke G2 into GR */
-      gr = 2;
-      return iso2022();
-    case '|' + 0x100: /* invoke G3 into GR */
-      gr = 3;
-      return iso2022();
-    case '(' + 0x100: /* set G0 to 94-char set */
-      ch = Agetchar();
-      if (ch == 'B') ch = 0; /* ASCII */
-      gn[0] = ch << 16;
-      gndbl[0] = 0;
-      return iso2022();
-    case ')' + 0x100: /* set G1 to 94-char set */
-      ch = Agetchar();
-      if (ch == 'B') ch = 0;
-      gn[1] = ch << 16;
-      gndbl[1] = 0;
-      return iso2022();
-    case '*' + 0x100: /* set G2 to 94-char set */
-      ch = Agetchar();
-      if (ch == 'B') ch = 0;
-      gn[2] = ch << 16;
-      gndbl[2] = 0;
-      return iso2022();
-    case '+' + 0x100: /* set G3 to 94-char set */
-      ch = Agetchar();
-      if (ch == 'B') ch = 0;
-      gn[3] = ch << 16;
-      gndbl[3] = 0;
-      return iso2022();
-    case '-' + 0x100: /* set G1 to 96-char set */
-      ch = Agetchar();
-      if (ch == 'A') ch = 0; /* Latin-1 top half */
-      gn[1] = (ch << 16) | 0x80;
-      gndbl[1] = 0;
-      return iso2022();
-    case '.' + 0x100: /* set G2 to 96-char set */
-      ch = Agetchar();
-      if (ch == 'A') ch = 0;
-      gn[2] = (ch << 16) | 0x80;
-      gndbl[2] = 0;
-      return iso2022();
-    case '/' + 0x100: /* set G3 to 96-char set */
-      ch = Agetchar();
-      if (ch == 'A') ch = 0;
-      gn[3] = (ch << 16) | 0x80;
-      gndbl[3] = 0;
-      return iso2022();
-    case '(' + 0x200: /* set G0 to 94 x 94 char set */
-      ch = Agetchar();
-      gn[0] = ch << 16;
-      gndbl[0] = 1;
-      return iso2022();
-    case ')' + 0x200: /* set G1 to 94 x 94 char set */
-      ch = Agetchar();
-      gn[1] = ch << 16;
-      gndbl[1] = 1;
-      return iso2022();
-    case '*' + 0x200: /* set G2 to 94 x 94 char set */
-      ch = Agetchar();
-      gn[2] = ch << 16;
-      gndbl[2] = 1;
-      return iso2022();
-    case '+' + 0x200: /* set G3 to 94 x 94 char set */
-      ch = Agetchar();
-      gn[3] = ch << 16;
-      gndbl[3] = 1;
-      return iso2022();
-    default:
-      if (ch & 0x200) { /* set G0 to 94 x 94 char set (deprecated) */
-        gn[0] = (ch & ~0x200) << 16;
-        gndbl[0] = 1;
-        return iso2022();
-        }
-      }
-
-  if (ch >= 0x21 && ch <= 0x7E) { /* process GL */
-    if (gndbl[gl]) {
-      ch2 = Agetchar();
-      return gn[gl] | (ch << 8) | ch2;
-      }
-    else return gn[gl] | ch;
-    }
-  else if (ch >= 0xA0 && ch <= 0xFF) { /* process GR */
-    if (gndbl[gr]) {
-      ch2 = Agetchar();
-      return gn[gr] | (ch << 8) | ch2;
-      }
-    else return gn[gr] | (ch & ~0x80);
-    }
-  else return ch;
-  }
-
-/****************************************************************************
-
-  ungetinchr
-
-  Called by main.  Pushes back an "inchr" to be read by getinchr
-  on the next call.
-
-******************************************************************************/
-inchr getinchr_buffer;
-int getinchr_flag;
-
-inchr ungetinchr(c)
-inchr c;
-{
-  getinchr_buffer = c;
-  getinchr_flag = 1;
-  return c;
-}
-
-/*****************************************************************************
-
-  getinchr
-
-  Called by main.  Processes multibyte characters.  Invokes Agetchar.
-  If multibyte = 0, ISO 2022 mode (see iso2022 routine).
-  If multibyte = 1,  double-byte mode (0x00-0x7f bytes are characters,
-    0x80-0xFF bytes are first byte of a double-byte character).
-  If multibyte = 2, Unicode UTF-8 mode (0x00-0x7F bytes are characters,
-    0x80-0xBF bytes are nonfirst byte of a multibyte character,
-    0xC0-0xFD bytes are first byte of a multibyte character,
-    0xFE-0xFF bytes are errors (all errors return code 0x0080)).
-  If multibyte = 3, HZ mode ("~{" starts double-byte mode, "}~" ends it,
-    "~~" is a tilde, "~x" for all other x is ignored).
-  If multibyte = 4, Shift-JIS mode (0x80-0x9F and 0xE0-0xEF are first byte
-    of a double-byte character, all other bytes are characters).
- 
-
-*****************************************************************************/
-
-inchr getinchr()
-{
-  int ch, ch2, ch3, ch4, ch5, ch6;
-
-  if (getinchr_flag) {
-    getinchr_flag = 0;
-    return getinchr_buffer;
-    }
-
-  switch(multibyte) {
-    case 0: /* single-byte */
-      return iso2022();
-   case 1: /* DBCS */
-     ch = Agetchar();
-     if ((ch >= 0x80 && ch <= 0x9F) ||
-         (ch >= 0xE0 && ch <= 0xEF)) {
-       ch = (ch << 8) + Agetchar();
-       }
-     return ch;
-   case 2: /* UTF-8 */
-      ch = Agetchar();
-      if (ch < 0x80) return ch;  /* handles EOF, too */
-      if (ch < 0xC0 || ch > 0xFD)
-        return 0x0080;  /* illegal first character */
-      ch2 = Agetchar() & 0x3F;
-      if (ch < 0xE0) return ((ch & 0x1F) << 6) + ch2;
-      ch3 = Agetchar() & 0x3F;
-      if (ch < 0xF0)
-        return ((ch & 0x0F) << 12) + (ch2 << 6) + ch3;
-      ch4 = Agetchar() & 0x3F;
-      if (ch < 0xF8)
-        return ((ch & 0x07) << 18) + (ch2 << 12) + (ch3 << 6) + ch4;
-      ch5 = Agetchar() & 0x3F;
-      if (ch < 0xFC)
-        return ((ch & 0x03) << 24) + (ch2 << 18) + (ch3 << 12) +
-          (ch4 << 6) + ch5;
-      ch6 = Agetchar() & 0x3F;
-      return ((ch & 0x01) << 30) + (ch2 << 24) + (ch3 << 18) +
-        (ch4 << 12) + (ch5 << 6) + ch6;
-   case 3: /* HZ */
-     ch = Agetchar();
-     if (ch == EOF) return ch;
-     if (hzmode) {
-       ch = (ch << 8) + Agetchar();
-       if (ch == ('}' << 8) + '~') {
-         hzmode = 0;
-         return getinchr();
-         }
-       return ch;
-       }
-     else if (ch == '~') {
-       ch = Agetchar();
-       if (ch == '{') {
-          hzmode = 1;
-          return getinchr();
-          }
-      else if (ch == '~') {
-        return ch;
-        }
-      else {
-        return getinchr();
-        }
-      }
-     else return ch;
-   case 4: /* Shift-JIS */
-     ch = Agetchar();
-     if ((ch >= 0x80 && ch <= 0x9F) ||
-         (ch >= 0xE0 && ch <= 0xEF)) {
-       ch = (ch << 8) + Agetchar();
-       }
-     return ch;
-   default:
-     return 0x80;
-    }
-  }
-
-/****************************************************************************
-
-  main
-
-  The main program, of course.
-  Reads characters 1 by 1 from stdin, and makes lines out of them using
-  addchar. Handles line breaking, (which accounts for most of the
-  complexity in this function).
-
-****************************************************************************/
-
-int main(argc,argv)
-int argc;
-char *argv[];
-{
-  inchr c,c2;
-  int i;
-  int last_was_eol_flag;
-/*---------------------------------------------------------------------------
-  wordbreakmode:
-    -1: /^$/ and blanks are to be absorbed (when line break was forced
-      by a blank or character larger than outlinelenlimit)
-    0: /^ *$/ and blanks are not to be absorbed
-    1: /[^ ]$/ no word break yet
-    2: /[^ ]  *$/
-    3: /[^ ]$/ had a word break
----------------------------------------------------------------------------*/
-  int wordbreakmode;
-  int char_not_added;
-
-  Myargc = argc;
-  Myargv = argv;
-  getparams();
-  readcontrolfiles();
-  readfont();
-  linealloc();
-
-  wordbreakmode = 0;
-  last_was_eol_flag = 0;
-
-  while ((c = getinchr())!=EOF) {
-
-    if (c=='\n'&&paragraphflag&&!last_was_eol_flag) {
-      ungetinchr(c2 = getinchr());
-      c = ((isascii(c2)&&isspace(c2))?'\n':' ');
-      }
-    last_was_eol_flag = (isascii(c)&&isspace(c)&&c!='\t'&&c!=' ');
-
-    if (deutschflag) {
-      if (c>='[' && c<=']') {
-        c = deutsch[c-'['];
-        }
-      else if (c >='{' && c <= '~') {
-        c = deutsch[c-'{'+3];
-        }
-      }
-
-    c = handlemapping(c);
-
-    if (isascii(c)&&isspace(c)) {
-      c = (c=='\t'||c==' ') ? ' ' : '\n';
-      }
-
-    if ((c>'\0' && c<' ' && c!='\n') || c==127) continue;
-
-/*
-  Note: The following code is complex and thoroughly tested.
-  Be careful when modifying!
-*/
-
-    do {
-      char_not_added = 0;
-
-      if (wordbreakmode== -1) {
-        if (c==' ') {
-          break;
-          }
-        else if (c=='\n') {
-          wordbreakmode = 0;
-          break;
-          }
-        wordbreakmode = 0;
-        }
-
-      if (c=='\n') {
-        printline();
-        wordbreakmode = 0;
-        }
-
-      else if (addchar(c)) {
-        if (c!=' ') {
-          wordbreakmode = (wordbreakmode>=2)?3:1;
-          }
-        else {
-          wordbreakmode = (wordbreakmode>0)?2:0;
-          }
-        }
-
-      else if (outlinelen==0) {
-        for (i=0;i<charheight;i++) {
-          if (right2left && outputwidth>1) {
-            putstring(currchar[i]+MYSTRLEN(currchar[i])-outlinelenlimit);
-            }
-          else {
-            putstring(currchar[i]);
-            }
-          }
-        wordbreakmode = -1;
-        }
-
-      else if (c==' ') {
-        if (wordbreakmode==2) {
-          splitline();
-          }
-        else {
-          printline();
-          }
-        wordbreakmode = -1;
-        }
-
-      else {
-        if (wordbreakmode>=2) {
-          splitline();
-          }
-        else {
-          printline();
-          }
-        wordbreakmode = (wordbreakmode==3)?1:0;
-        char_not_added = 1;
-        }
-
-      } while (char_not_added);
-    }
-
-  if (outlinelen!=0) {
-    printline();
-    }
-
-  /* XXX Xen hack -- finish off the C macro output */
-  if ( nr_chars != 0 )
-      putchar('"');
-  putchar('\n');
-
-  exit(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 Dec 04 10:05:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9KK-0003p6-Fj; Wed, 04 Dec 2013 10:05: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 1Vo9KI-0003o6-Kk
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:03 +0000
Received: from [85.158.139.211:55146] by server-11.bemta-5.messagelabs.com id
	4E/D1-23268-B4EFE925; Wed, 04 Dec 2013 10:04:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386151497!2165668!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14052 invoked from network); 4 Dec 2013 10:04:58 -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;
	4 Dec 2013 10:04: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 1Vo9KD-00081S-MK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9KD-0006a0-Jg
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:57 +0000
Date: Wed, 04 Dec 2013 10:04:57 +0000
Message-Id: <E1Vo9KD-0006a0-Jg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: avoid truncation in mfn to
	paddr conversions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9ca423b1fb164a30f40bfacc6c03106fbe1945b1
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 2 11:11:40 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 2 13:56:24 2013 +0000

    xen: arm: avoid truncation in mfn to paddr conversions
    
    Although MFNs are 64-bit in the hypercall ABI they are most often unsigned
    long internally, and therefore be 32-bit on arm32. Physical addresses are
    always 64-bit via paddr_t.
    
    This means that the common "mfn << PAGE_SHIFT" pattern risks losing some of
    the top bits of the address is high enough. This need not imply a high amount
    of RAM, just a sparse physical address map.
    
    The correct form is ((paddr_t)mfn)<<PAGE_SHIFT and we have the pfn_to_paddr
    macro which implements this. Grep for PAGE_SHIFT and << and switch to the
    macro everywhere we can in the arch specific code. Note that page.h is
    included by mm.h which defines the macro and so remains with the open coded
    cast. I have inspected the common code matching this pattern and it uses the
    correct casts where necessary (x86 also has pfn_to_paddr, so as a further
    cleanup we could fix the common code too, but I haven't done that here).
    
    I observed this as failure to boot a guest on midway, due to trying to map a
    foreign page which belonged to no guest. I think this likely explains the
    crashes which Julien has seen too.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/domain_build.c |    4 ++--
 xen/arch/arm/mm.c           |    4 ++--
 xen/arch/arm/p2m.c          |   16 +++++++++-------
 xen/arch/arm/setup.c        |    9 +++++----
 xen/include/asm-arm/mm.h    |    4 ++--
 5 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 99e785a..7c855cb 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -84,8 +84,8 @@ static void allocate_memory_11(struct domain *d, struct kernel_info *kinfo)
         panic("Failed to allocate contiguous memory for dom0\n");
 
     spfn = page_to_mfn(pg);
-    start = spfn << PAGE_SHIFT;
-    size = (1 << order) << PAGE_SHIFT;
+    start = pfn_to_paddr(spfn);
+    size = pfn_to_paddr((1 << order));
 
     // 1:1 mapping
     printk("Populate P2M %#"PRIx64"->%#"PRIx64" (1:1 mapping for dom0)\n",
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 2de7dc7..8189915 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1032,10 +1032,10 @@ static int xenmem_add_to_physmap_one(
             return rc;
         }
 
-        maddr = p2m_lookup(od, idx << PAGE_SHIFT);
+        maddr = p2m_lookup(od, pfn_to_paddr(idx));
         if ( maddr == INVALID_PADDR )
         {
-            dump_p2m_lookup(od, idx << PAGE_SHIFT);
+            dump_p2m_lookup(od, pfn_to_paddr(idx));
             rcu_unlock_domain(od);
             return -EINVAL;
         }
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index af32511..1d5c841 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -296,18 +296,20 @@ int guest_physmap_add_page(struct domain *d,
                            unsigned long mfn,
                            unsigned int page_order)
 {
-    return create_p2m_entries(d, INSERT, gpfn << PAGE_SHIFT,
-                              (gpfn + (1<<page_order)) << PAGE_SHIFT,
-                              mfn << PAGE_SHIFT, MATTR_MEM);
+    return create_p2m_entries(d, INSERT,
+                              pfn_to_paddr(gpfn),
+                              pfn_to_paddr(gpfn + (1<<page_order)),
+                              pfn_to_paddr(mfn), MATTR_MEM);
 }
 
 void guest_physmap_remove_page(struct domain *d,
                                unsigned long gpfn,
                                unsigned long mfn, unsigned int page_order)
 {
-    create_p2m_entries(d, REMOVE, gpfn << PAGE_SHIFT,
-                       (gpfn + (1<<page_order)) << PAGE_SHIFT,
-                       mfn << PAGE_SHIFT, MATTR_MEM);
+    create_p2m_entries(d, REMOVE,
+                       pfn_to_paddr(gpfn),
+                       pfn_to_paddr(gpfn + (1<<page_order)),
+                       pfn_to_paddr(mfn), MATTR_MEM);
 }
 
 int p2m_alloc_table(struct domain *d)
@@ -450,7 +452,7 @@ err:
 
 unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
 {
-    paddr_t p = p2m_lookup(d, gpfn << PAGE_SHIFT);
+    paddr_t p = p2m_lookup(d, pfn_to_paddr(gpfn));
     return p >> PAGE_SHIFT;
 }
 
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index d252131..0795eb9 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -409,7 +409,8 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 
     do
     {
-        e = consider_modules(ram_start, ram_end, xenheap_pages<<PAGE_SHIFT,
+        e = consider_modules(ram_start, ram_end,
+                             pfn_to_paddr(xenheap_pages),
                              32<<20, 0);
         if ( e )
             break;
@@ -423,7 +424,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     domheap_pages = heap_pages - xenheap_pages;
 
     early_printk("Xen heap: %"PRIpaddr"-%"PRIpaddr" (%lu pages)\n",
-                 e - (xenheap_pages << PAGE_SHIFT), e,
+                 e - (pfn_to_paddr(xenheap_pages)), e,
                  xenheap_pages);
     early_printk("Dom heap: %lu pages\n", domheap_pages);
 
@@ -471,8 +472,8 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
             e = ram_end;
 
         /* Avoid the xenheap */
-        if ( s < ((xenheap_mfn_start+xenheap_pages) << PAGE_SHIFT)
-             && (xenheap_mfn_start << PAGE_SHIFT) < e )
+        if ( s < pfn_to_paddr(xenheap_mfn_start+xenheap_pages)
+             && pfn_to_paddr(xenheap_mfn_start) < e )
         {
             e = pfn_to_paddr(xenheap_mfn_start);
             n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index ce66099..b8d4e7d 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -123,8 +123,8 @@ extern unsigned long xenheap_virt_end;
 #endif
 
 #define is_xen_fixed_mfn(mfn)                                   \
-    ((((mfn) << PAGE_SHIFT) >= virt_to_maddr(&_start)) &&       \
-     (((mfn) << PAGE_SHIFT) <= virt_to_maddr(&_end)))
+    ((pfn_to_paddr(mfn) >= virt_to_maddr(&_start)) &&       \
+     (pfn_to_paddr(mfn) <= virt_to_maddr(&_end)))
 
 #define page_get_owner(_p)    (_p)->v.inuse.domain
 #define page_set_owner(_p,_d) ((_p)->v.inuse.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 Wed Dec 04 10:05:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9KK-0003p6-Fj; Wed, 04 Dec 2013 10:05: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 1Vo9KI-0003o6-Kk
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:03 +0000
Received: from [85.158.139.211:55146] by server-11.bemta-5.messagelabs.com id
	4E/D1-23268-B4EFE925; Wed, 04 Dec 2013 10:04:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386151497!2165668!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14052 invoked from network); 4 Dec 2013 10:04:58 -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;
	4 Dec 2013 10:04: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 1Vo9KD-00081S-MK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9KD-0006a0-Jg
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:04:57 +0000
Date: Wed, 04 Dec 2013 10:04:57 +0000
Message-Id: <E1Vo9KD-0006a0-Jg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: avoid truncation in mfn to
	paddr conversions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9ca423b1fb164a30f40bfacc6c03106fbe1945b1
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 2 11:11:40 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 2 13:56:24 2013 +0000

    xen: arm: avoid truncation in mfn to paddr conversions
    
    Although MFNs are 64-bit in the hypercall ABI they are most often unsigned
    long internally, and therefore be 32-bit on arm32. Physical addresses are
    always 64-bit via paddr_t.
    
    This means that the common "mfn << PAGE_SHIFT" pattern risks losing some of
    the top bits of the address is high enough. This need not imply a high amount
    of RAM, just a sparse physical address map.
    
    The correct form is ((paddr_t)mfn)<<PAGE_SHIFT and we have the pfn_to_paddr
    macro which implements this. Grep for PAGE_SHIFT and << and switch to the
    macro everywhere we can in the arch specific code. Note that page.h is
    included by mm.h which defines the macro and so remains with the open coded
    cast. I have inspected the common code matching this pattern and it uses the
    correct casts where necessary (x86 also has pfn_to_paddr, so as a further
    cleanup we could fix the common code too, but I haven't done that here).
    
    I observed this as failure to boot a guest on midway, due to trying to map a
    foreign page which belonged to no guest. I think this likely explains the
    crashes which Julien has seen too.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/domain_build.c |    4 ++--
 xen/arch/arm/mm.c           |    4 ++--
 xen/arch/arm/p2m.c          |   16 +++++++++-------
 xen/arch/arm/setup.c        |    9 +++++----
 xen/include/asm-arm/mm.h    |    4 ++--
 5 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 99e785a..7c855cb 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -84,8 +84,8 @@ static void allocate_memory_11(struct domain *d, struct kernel_info *kinfo)
         panic("Failed to allocate contiguous memory for dom0\n");
 
     spfn = page_to_mfn(pg);
-    start = spfn << PAGE_SHIFT;
-    size = (1 << order) << PAGE_SHIFT;
+    start = pfn_to_paddr(spfn);
+    size = pfn_to_paddr((1 << order));
 
     // 1:1 mapping
     printk("Populate P2M %#"PRIx64"->%#"PRIx64" (1:1 mapping for dom0)\n",
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 2de7dc7..8189915 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1032,10 +1032,10 @@ static int xenmem_add_to_physmap_one(
             return rc;
         }
 
-        maddr = p2m_lookup(od, idx << PAGE_SHIFT);
+        maddr = p2m_lookup(od, pfn_to_paddr(idx));
         if ( maddr == INVALID_PADDR )
         {
-            dump_p2m_lookup(od, idx << PAGE_SHIFT);
+            dump_p2m_lookup(od, pfn_to_paddr(idx));
             rcu_unlock_domain(od);
             return -EINVAL;
         }
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index af32511..1d5c841 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -296,18 +296,20 @@ int guest_physmap_add_page(struct domain *d,
                            unsigned long mfn,
                            unsigned int page_order)
 {
-    return create_p2m_entries(d, INSERT, gpfn << PAGE_SHIFT,
-                              (gpfn + (1<<page_order)) << PAGE_SHIFT,
-                              mfn << PAGE_SHIFT, MATTR_MEM);
+    return create_p2m_entries(d, INSERT,
+                              pfn_to_paddr(gpfn),
+                              pfn_to_paddr(gpfn + (1<<page_order)),
+                              pfn_to_paddr(mfn), MATTR_MEM);
 }
 
 void guest_physmap_remove_page(struct domain *d,
                                unsigned long gpfn,
                                unsigned long mfn, unsigned int page_order)
 {
-    create_p2m_entries(d, REMOVE, gpfn << PAGE_SHIFT,
-                       (gpfn + (1<<page_order)) << PAGE_SHIFT,
-                       mfn << PAGE_SHIFT, MATTR_MEM);
+    create_p2m_entries(d, REMOVE,
+                       pfn_to_paddr(gpfn),
+                       pfn_to_paddr(gpfn + (1<<page_order)),
+                       pfn_to_paddr(mfn), MATTR_MEM);
 }
 
 int p2m_alloc_table(struct domain *d)
@@ -450,7 +452,7 @@ err:
 
 unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
 {
-    paddr_t p = p2m_lookup(d, gpfn << PAGE_SHIFT);
+    paddr_t p = p2m_lookup(d, pfn_to_paddr(gpfn));
     return p >> PAGE_SHIFT;
 }
 
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index d252131..0795eb9 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -409,7 +409,8 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 
     do
     {
-        e = consider_modules(ram_start, ram_end, xenheap_pages<<PAGE_SHIFT,
+        e = consider_modules(ram_start, ram_end,
+                             pfn_to_paddr(xenheap_pages),
                              32<<20, 0);
         if ( e )
             break;
@@ -423,7 +424,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     domheap_pages = heap_pages - xenheap_pages;
 
     early_printk("Xen heap: %"PRIpaddr"-%"PRIpaddr" (%lu pages)\n",
-                 e - (xenheap_pages << PAGE_SHIFT), e,
+                 e - (pfn_to_paddr(xenheap_pages)), e,
                  xenheap_pages);
     early_printk("Dom heap: %lu pages\n", domheap_pages);
 
@@ -471,8 +472,8 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
             e = ram_end;
 
         /* Avoid the xenheap */
-        if ( s < ((xenheap_mfn_start+xenheap_pages) << PAGE_SHIFT)
-             && (xenheap_mfn_start << PAGE_SHIFT) < e )
+        if ( s < pfn_to_paddr(xenheap_mfn_start+xenheap_pages)
+             && pfn_to_paddr(xenheap_mfn_start) < e )
         {
             e = pfn_to_paddr(xenheap_mfn_start);
             n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index ce66099..b8d4e7d 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -123,8 +123,8 @@ extern unsigned long xenheap_virt_end;
 #endif
 
 #define is_xen_fixed_mfn(mfn)                                   \
-    ((((mfn) << PAGE_SHIFT) >= virt_to_maddr(&_start)) &&       \
-     (((mfn) << PAGE_SHIFT) <= virt_to_maddr(&_end)))
+    ((pfn_to_paddr(mfn) >= virt_to_maddr(&_start)) &&       \
+     (pfn_to_paddr(mfn) <= virt_to_maddr(&_end)))
 
 #define page_get_owner(_p)    (_p)->v.inuse.domain
 #define page_set_owner(_p,_d) ((_p)->v.inuse.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 Wed Dec 04 10:05:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9KT-0003rE-IZ; Wed, 04 Dec 2013 10:05:13 +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 1Vo9KS-0003qh-6r
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:12 +0000
Received: from [85.158.143.35:34669] by server-1.bemta-4.messagelabs.com id
	9E/BE-02132-55EFE925; Wed, 04 Dec 2013 10:05:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1386151508!3226973!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14014 invoked from network); 4 Dec 2013 10:05:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:05: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 1Vo9KO-00081y-1y
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9KN-0006aZ-PP
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:07 +0000
Date: Wed, 04 Dec 2013 10:05:07 +0000
Message-Id: <E1Vo9KN-0006aZ-PP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: work around erratum 793
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 98162f256ee33994a9881a720419dda9ad4c03a8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 09:49:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 09:49:54 2013 +0100

    x86/AMD: work around erratum 793
    
    The recommendation is to set a bit in an MSR - do this if the firmware
    didn't, considering that otherwise we expose ourselves to a guest
    induced DoS.
    
    This is CVE-2013-6885 / XSA-82.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/cpu/amd.c          |   14 ++++++++++++++
 xen/include/asm-x86/msr-index.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 472df68..487ef4d 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -476,6 +476,20 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		       "*** Pass \"allow_unsafe\" if you're trusting"
 		       " all your (PV) guest kernels. ***\n");
 
+	if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+		rdmsrl(MSR_AMD64_LS_CFG, value);
+		if (!(value & (1 << 15))) {
+			static bool_t warned;
+
+			if (c == &boot_cpu_data || opt_cpu_info ||
+			    !test_and_set_bool(warned))
+				printk(KERN_WARNING
+				       "CPU%u: Applying workaround for erratum 793\n",
+				       smp_processor_id());
+			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
+		}
+	}
+
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index e597a28..fc9fbc6 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -213,6 +213,7 @@
 
 /* AMD64 MSRs */
 #define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:05:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9KT-0003rE-IZ; Wed, 04 Dec 2013 10:05:13 +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 1Vo9KS-0003qh-6r
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:12 +0000
Received: from [85.158.143.35:34669] by server-1.bemta-4.messagelabs.com id
	9E/BE-02132-55EFE925; Wed, 04 Dec 2013 10:05:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1386151508!3226973!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14014 invoked from network); 4 Dec 2013 10:05:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:05: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 1Vo9KO-00081y-1y
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9KN-0006aZ-PP
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:07 +0000
Date: Wed, 04 Dec 2013 10:05:07 +0000
Message-Id: <E1Vo9KN-0006aZ-PP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: work around erratum 793
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 98162f256ee33994a9881a720419dda9ad4c03a8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 09:49:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 09:49:54 2013 +0100

    x86/AMD: work around erratum 793
    
    The recommendation is to set a bit in an MSR - do this if the firmware
    didn't, considering that otherwise we expose ourselves to a guest
    induced DoS.
    
    This is CVE-2013-6885 / XSA-82.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/cpu/amd.c          |   14 ++++++++++++++
 xen/include/asm-x86/msr-index.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 472df68..487ef4d 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -476,6 +476,20 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		       "*** Pass \"allow_unsafe\" if you're trusting"
 		       " all your (PV) guest kernels. ***\n");
 
+	if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+		rdmsrl(MSR_AMD64_LS_CFG, value);
+		if (!(value & (1 << 15))) {
+			static bool_t warned;
+
+			if (c == &boot_cpu_data || opt_cpu_info ||
+			    !test_and_set_bool(warned))
+				printk(KERN_WARNING
+				       "CPU%u: Applying workaround for erratum 793\n",
+				       smp_processor_id());
+			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
+		}
+	}
+
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index e597a28..fc9fbc6 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -213,6 +213,7 @@
 
 /* AMD64 MSRs */
 #define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:05:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9Kc-0003so-LW; Wed, 04 Dec 2013 10:05:22 +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 1Vo9Kb-0003sP-Tw
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:22 +0000
Received: from [85.158.139.211:61918] by server-6.bemta-5.messagelabs.com id
	B5/89-16310-06EFE925; Wed, 04 Dec 2013 10:05:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386151518!2158011!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18722 invoked from network); 4 Dec 2013 10:05:19 -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;
	4 Dec 2013 10:05: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 1Vo9KY-000824-BB
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9KY-0006bg-7C
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:18 +0000
Date: Wed, 04 Dec 2013 10:05:18 +0000
Message-Id: <E1Vo9KY-0006bg-7C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] nested vmx: fix I/O port bitmap
	indexing arithmetic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b80e4583501904297d2ff5b0f905e68f81f8f2c9
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 09:51:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 09:51:54 2013 +0100

    nested vmx: fix I/O port bitmap indexing arithmetic
    
    The I/O port bitmap holds 8 ports per element, and hence the port number
    used when indexing into it should be shifted right by 3 bits, not 4.
    
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Yang Zhang <yang.z.zhang@intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 248e975..7fa110e 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -2225,7 +2225,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
             __vmread(EXIT_QUALIFICATION, &qual);
             port = qual >> 16;
             bitmap = nvmx->iobitmap[port >> 15];
-            if ( bitmap[(port & 0x7fff) >> 4] & (1 << (port & 0x7)) )
+            if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 0x7)) )
                 nvcpu->nv_vmexit_pending = 1;
             if ( !nvcpu->nv_vmexit_pending )
                gdprintk(XENLOG_WARNING, "L0 PIO %x.\n", 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 Dec 04 10:05:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9Kc-0003so-LW; Wed, 04 Dec 2013 10:05:22 +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 1Vo9Kb-0003sP-Tw
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:22 +0000
Received: from [85.158.139.211:61918] by server-6.bemta-5.messagelabs.com id
	B5/89-16310-06EFE925; Wed, 04 Dec 2013 10:05:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386151518!2158011!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18722 invoked from network); 4 Dec 2013 10:05:19 -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;
	4 Dec 2013 10:05: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 1Vo9KY-000824-BB
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9KY-0006bg-7C
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:18 +0000
Date: Wed, 04 Dec 2013 10:05:18 +0000
Message-Id: <E1Vo9KY-0006bg-7C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] nested vmx: fix I/O port bitmap
	indexing arithmetic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b80e4583501904297d2ff5b0f905e68f81f8f2c9
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 09:51:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 09:51:54 2013 +0100

    nested vmx: fix I/O port bitmap indexing arithmetic
    
    The I/O port bitmap holds 8 ports per element, and hence the port number
    used when indexing into it should be shifted right by 3 bits, not 4.
    
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Yang Zhang <yang.z.zhang@intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 248e975..7fa110e 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -2225,7 +2225,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
             __vmread(EXIT_QUALIFICATION, &qual);
             port = qual >> 16;
             bitmap = nvmx->iobitmap[port >> 15];
-            if ( bitmap[(port & 0x7fff) >> 4] & (1 << (port & 0x7)) )
+            if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 0x7)) )
                 nvcpu->nv_vmexit_pending = 1;
             if ( !nvcpu->nv_vmexit_pending )
                gdprintk(XENLOG_WARNING, "L0 PIO %x.\n", 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 Dec 04 10:05:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9Ko-0003vI-OK; Wed, 04 Dec 2013 10:05: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 1Vo9Kl-0003uj-Uj
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:33 +0000
Received: from [193.109.254.147:50493] by server-16.bemta-14.messagelabs.com
	id B0/2E-20600-A6EFE925; Wed, 04 Dec 2013 10:05:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1386151528!2782556!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24154 invoked from network); 4 Dec 2013 10:05:29 -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;
	4 Dec 2013 10:05: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 1Vo9Ki-00082I-Gc
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ki-0006c2-Eg
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:28 +0000
Date: Wed, 04 Dec 2013 10:05:28 +0000
Message-Id: <E1Vo9Ki-0006c2-Eg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: be more power-efficient when
	waiting forever
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a5ca03ea2f48ceedd835ba938999dc9c5e6a4690
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 3 09:54:12 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 09:54:12 2013 +0100

    x86: be more power-efficient when waiting forever
    
    The effect is unchanged, but the processor will be spending most of its time
    in the C1 or C1E power state rather than C0.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/traps.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index d8b3eac..8c355e5 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1448,7 +1448,8 @@ void __init do_early_page_fault(struct cpu_user_regs *regs)
         printk("Stack dump: ");
         while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != 0 )
             printk("%p ", _p(*stk++));
-        for ( ; ; ) ;
+        for ( ; ; )
+            halt();
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:05:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9Ko-0003vI-OK; Wed, 04 Dec 2013 10:05: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 1Vo9Kl-0003uj-Uj
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:33 +0000
Received: from [193.109.254.147:50493] by server-16.bemta-14.messagelabs.com
	id B0/2E-20600-A6EFE925; Wed, 04 Dec 2013 10:05:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1386151528!2782556!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24154 invoked from network); 4 Dec 2013 10:05:29 -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;
	4 Dec 2013 10:05: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 1Vo9Ki-00082I-Gc
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ki-0006c2-Eg
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:28 +0000
Date: Wed, 04 Dec 2013 10:05:28 +0000
Message-Id: <E1Vo9Ki-0006c2-Eg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: be more power-efficient when
	waiting forever
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a5ca03ea2f48ceedd835ba938999dc9c5e6a4690
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 3 09:54:12 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 09:54:12 2013 +0100

    x86: be more power-efficient when waiting forever
    
    The effect is unchanged, but the processor will be spending most of its time
    in the C1 or C1E power state rather than C0.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/traps.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index d8b3eac..8c355e5 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1448,7 +1448,8 @@ void __init do_early_page_fault(struct cpu_user_regs *regs)
         printk("Stack dump: ");
         while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != 0 )
             printk("%p ", _p(*stk++));
-        for ( ; ; ) ;
+        for ( ; ; )
+            halt();
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:05:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9Ky-0003xv-8J; Wed, 04 Dec 2013 10:05: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 1Vo9Kv-0003wo-QX
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:42 +0000
Received: from [85.158.137.68:46646] by server-4.bemta-3.messagelabs.com id
	BC/0C-10414-47EFE925; Wed, 04 Dec 2013 10:05:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1386151538!461928!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23055 invoked from network); 4 Dec 2013 10:05:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:05: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 1Vo9Ks-00082L-Kd
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ks-0006cS-JU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:38 +0000
Date: Wed, 04 Dec 2013 10:05:38 +0000
Message-Id: <E1Vo9Ks-0006cS-JU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/vsprintf: fix return value when
	formatting symbolic addresses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd62e281dfe6183cd140cf2cf2bca1a10b574aa7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 09:57:41 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 09:57:41 2013 +0100

    common/vsprintf: fix return value when formatting symbolic addresses
    
    When the buffer to be formatted to is too small, the function return
    value is expected to be the number of characters that would be printed
    (particularly important if that value is then used for allocating a
    buffer). Hence incrementing the active pointer must always be
    independent of actually storing a character.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/vsprintf.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c
index 43dc392..1a6198e 100644
--- a/xen/common/vsprintf.c
+++ b/xen/common/vsprintf.c
@@ -294,7 +294,8 @@ static char *pointer(char *str, char *end, const char **fmt_ptr,
             /* Print '+<offset>/<len>' */
             str = number(str, end, sym_offset, 16, -1, -1, SPECIAL|SIGN|PLUS);
             if ( str <= end )
-                *str++ = '/';
+                *str = '/';
+            ++str;
             str = number(str, end, sym_size, 16, -1, -1, SPECIAL);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:05:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9Ky-0003xv-8J; Wed, 04 Dec 2013 10:05: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 1Vo9Kv-0003wo-QX
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:42 +0000
Received: from [85.158.137.68:46646] by server-4.bemta-3.messagelabs.com id
	BC/0C-10414-47EFE925; Wed, 04 Dec 2013 10:05:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1386151538!461928!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23055 invoked from network); 4 Dec 2013 10:05:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:05: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 1Vo9Ks-00082L-Kd
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Ks-0006cS-JU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:38 +0000
Date: Wed, 04 Dec 2013 10:05:38 +0000
Message-Id: <E1Vo9Ks-0006cS-JU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/vsprintf: fix return value when
	formatting symbolic addresses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd62e281dfe6183cd140cf2cf2bca1a10b574aa7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 09:57:41 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 09:57:41 2013 +0100

    common/vsprintf: fix return value when formatting symbolic addresses
    
    When the buffer to be formatted to is too small, the function return
    value is expected to be the number of characters that would be printed
    (particularly important if that value is then used for allocating a
    buffer). Hence incrementing the active pointer must always be
    independent of actually storing a character.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/vsprintf.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c
index 43dc392..1a6198e 100644
--- a/xen/common/vsprintf.c
+++ b/xen/common/vsprintf.c
@@ -294,7 +294,8 @@ static char *pointer(char *str, char *end, const char **fmt_ptr,
             /* Print '+<offset>/<len>' */
             str = number(str, end, sym_offset, 16, -1, -1, SPECIAL|SIGN|PLUS);
             if ( str <= end )
-                *str++ = '/';
+                *str = '/';
+            ++str;
             str = number(str, end, sym_size, 16, -1, -1, SPECIAL);
         }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:05:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9L8-000412-BU; Wed, 04 Dec 2013 10:05:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9L6-000409-DK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:52 +0000
Received: from [85.158.137.68:11001] by server-16.bemta-3.messagelabs.com id
	94/62-26128-E7EFE925; Wed, 04 Dec 2013 10:05:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1386151549!1593049!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10466 invoked from network); 4 Dec 2013 10:05:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:05: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 1Vo9L2-00082X-Px
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9L2-0006cu-NT
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:48 +0000
Date: Wed, 04 Dec 2013 10:05:48 +0000
Message-Id: <E1Vo9L2-0006cu-NT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blkif: add indirect descriptors
	interface to public headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3519981096744852483=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 5148b7b51be7fc63ed0af9cbf3fe007fa283a219
Author:     Roger Pau MonnÃ© <roger.pau@citrix.com>
AuthorDate: Tue Dec 3 12:33:58 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 12:33:58 2013 +0100

    blkif: add indirect descriptors interface to public headers
    
    Indirect descriptors introduce a new block operation
    (BLKIF_OP_INDIRECT) that passes grant references instead of segments
    in the request. This grant references are filled with arrays of
    blkif_request_segment_aligned, this way we can send more segments in a
    request.
    
    This interface is already implemented in Linux >= 3.11.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/public/io/blkif.h |   51 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/blkif.h b/xen/include/public/io/blkif.h
index b9b9d98..84eb7fd 100644
--- a/xen/include/public/io/blkif.h
+++ b/xen/include/public/io/blkif.h
@@ -468,6 +468,30 @@
 #define BLKIF_OP_DISCARD           5
 
 /*
+ * Recognized if "feature-max-indirect-segments" in present in the backend
+ * xenbus info. The "feature-max-indirect-segments" node contains the maximum
+ * number of segments allowed by the backend per request. If the node is
+ * present, the frontend might use blkif_request_indirect structs in order to
+ * issue requests with more than BLKIF_MAX_SEGMENTS_PER_REQUEST (11). The
+ * maximum number of indirect segments is fixed by the backend, but the
+ * frontend can issue requests with any number of indirect segments as long as
+ * it's less than the number provided by the backend. The indirect_grefs field
+ * in blkif_request_indirect should be filled by the frontend with the
+ * grant references of the pages that are holding the indirect segments.
+ * This pages are filled with an array of blkif_request_segment_aligned
+ * that hold the information about the segments. The number of indirect
+ * pages to use is determined by the maximum number of segments
+ * an indirect request contains. Every indirect page can contain a maximum
+ * of 512 segments (PAGE_SIZE/sizeof(blkif_request_segment_aligned)),
+ * so to calculate the number of indirect pages to use we have to do
+ * ceil(indirect_segments/512).
+ *
+ * If a backend does not recognize BLKIF_OP_INDIRECT, it should *not*
+ * create the "feature-max-indirect-segments" node!
+ */
+#define BLKIF_OP_INDIRECT          6
+
+/*
  * Maximum scatter/gather segments per request.
  * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
  * NB. This could be 12 if the ring indexes weren't stored in the same page.
@@ -475,6 +499,11 @@
 #define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
 
 /*
+ * Maximum number of indirect pages to use per request.
+ */
+#define BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST 8
+
+/*
  * NB. first_sect and last_sect in blkif_request_segment, as well as
  * sector_number in blkif_request, are always expressed in 512-byte units.
  * However they must be properly aligned to the real sector size of the
@@ -517,6 +546,28 @@ struct blkif_request_discard {
 };
 typedef struct blkif_request_discard blkif_request_discard_t;
 
+struct blkif_request_indirect {
+    uint8_t        operation;    /* BLKIF_OP_INDIRECT                    */
+    uint8_t        indirect_op;  /* BLKIF_OP_{READ/WRITE}                */
+    uint16_t       nr_segments;  /* number of segments                   */
+    uint64_t       id;           /* private guest value, echoed in resp  */
+    blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
+    blkif_vdev_t   handle;       /* same as for read/write requests      */
+    grant_ref_t    indirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST];
+#ifdef __i386__
+    uint64_t       pad;          /* Make it 64 byte aligned on i386      */
+#endif
+};
+typedef struct blkif_request_indirect blkif_request_indirect_t;
+
+struct blkif_request_segment_aligned {
+    grant_ref_t gref;            /* reference to I/O buffer frame        */
+    /* @first_sect: first sector in frame to transfer (inclusive).   */
+    /* @last_sect: last sector in frame to transfer (inclusive).     */
+    uint8_t     first_sect, last_sect;
+    uint16_t    _pad; /* padding to make it 8 bytes, so it's cache-aligned */
+};
+
 struct blkif_response {
     uint64_t        id;              /* copied from request */
     uint8_t         operation;       /* copied from request */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Dec 04 10:05:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:05: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 1Vo9L8-000412-BU; Wed, 04 Dec 2013 10:05:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9L6-000409-DK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:52 +0000
Received: from [85.158.137.68:11001] by server-16.bemta-3.messagelabs.com id
	94/62-26128-E7EFE925; Wed, 04 Dec 2013 10:05:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1386151549!1593049!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10466 invoked from network); 4 Dec 2013 10:05:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:05: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 1Vo9L2-00082X-Px
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9L2-0006cu-NT
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:48 +0000
Date: Wed, 04 Dec 2013 10:05:48 +0000
Message-Id: <E1Vo9L2-0006cu-NT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blkif: add indirect descriptors
	interface to public headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3519981096744852483=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 5148b7b51be7fc63ed0af9cbf3fe007fa283a219
Author:     Roger Pau MonnÃ© <roger.pau@citrix.com>
AuthorDate: Tue Dec 3 12:33:58 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 12:33:58 2013 +0100

    blkif: add indirect descriptors interface to public headers
    
    Indirect descriptors introduce a new block operation
    (BLKIF_OP_INDIRECT) that passes grant references instead of segments
    in the request. This grant references are filled with arrays of
    blkif_request_segment_aligned, this way we can send more segments in a
    request.
    
    This interface is already implemented in Linux >= 3.11.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/include/public/io/blkif.h |   51 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/blkif.h b/xen/include/public/io/blkif.h
index b9b9d98..84eb7fd 100644
--- a/xen/include/public/io/blkif.h
+++ b/xen/include/public/io/blkif.h
@@ -468,6 +468,30 @@
 #define BLKIF_OP_DISCARD           5
 
 /*
+ * Recognized if "feature-max-indirect-segments" in present in the backend
+ * xenbus info. The "feature-max-indirect-segments" node contains the maximum
+ * number of segments allowed by the backend per request. If the node is
+ * present, the frontend might use blkif_request_indirect structs in order to
+ * issue requests with more than BLKIF_MAX_SEGMENTS_PER_REQUEST (11). The
+ * maximum number of indirect segments is fixed by the backend, but the
+ * frontend can issue requests with any number of indirect segments as long as
+ * it's less than the number provided by the backend. The indirect_grefs field
+ * in blkif_request_indirect should be filled by the frontend with the
+ * grant references of the pages that are holding the indirect segments.
+ * This pages are filled with an array of blkif_request_segment_aligned
+ * that hold the information about the segments. The number of indirect
+ * pages to use is determined by the maximum number of segments
+ * an indirect request contains. Every indirect page can contain a maximum
+ * of 512 segments (PAGE_SIZE/sizeof(blkif_request_segment_aligned)),
+ * so to calculate the number of indirect pages to use we have to do
+ * ceil(indirect_segments/512).
+ *
+ * If a backend does not recognize BLKIF_OP_INDIRECT, it should *not*
+ * create the "feature-max-indirect-segments" node!
+ */
+#define BLKIF_OP_INDIRECT          6
+
+/*
  * Maximum scatter/gather segments per request.
  * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
  * NB. This could be 12 if the ring indexes weren't stored in the same page.
@@ -475,6 +499,11 @@
 #define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
 
 /*
+ * Maximum number of indirect pages to use per request.
+ */
+#define BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST 8
+
+/*
  * NB. first_sect and last_sect in blkif_request_segment, as well as
  * sector_number in blkif_request, are always expressed in 512-byte units.
  * However they must be properly aligned to the real sector size of the
@@ -517,6 +546,28 @@ struct blkif_request_discard {
 };
 typedef struct blkif_request_discard blkif_request_discard_t;
 
+struct blkif_request_indirect {
+    uint8_t        operation;    /* BLKIF_OP_INDIRECT                    */
+    uint8_t        indirect_op;  /* BLKIF_OP_{READ/WRITE}                */
+    uint16_t       nr_segments;  /* number of segments                   */
+    uint64_t       id;           /* private guest value, echoed in resp  */
+    blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
+    blkif_vdev_t   handle;       /* same as for read/write requests      */
+    grant_ref_t    indirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST];
+#ifdef __i386__
+    uint64_t       pad;          /* Make it 64 byte aligned on i386      */
+#endif
+};
+typedef struct blkif_request_indirect blkif_request_indirect_t;
+
+struct blkif_request_segment_aligned {
+    grant_ref_t gref;            /* reference to I/O buffer frame        */
+    /* @first_sect: first sector in frame to transfer (inclusive).   */
+    /* @last_sect: last sector in frame to transfer (inclusive).     */
+    uint8_t     first_sect, last_sect;
+    uint16_t    _pad; /* padding to make it 8 bytes, so it's cache-aligned */
+};
+
 struct blkif_response {
     uint64_t        id;              /* copied from request */
     uint8_t         operation;       /* copied from request */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Dec 04 10:06:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:06: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 1Vo9LI-00044P-IB; Wed, 04 Dec 2013 10:06: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 1Vo9LH-00043w-Aw
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:03 +0000
Received: from [85.158.139.211:9406] by server-15.bemta-5.messagelabs.com id
	43/5D-08490-A8EFE925; Wed, 04 Dec 2013 10:06:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386151559!2165977!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20352 invoked from network); 4 Dec 2013 10:06:00 -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;
	4 Dec 2013 10:06: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 1Vo9LD-00082g-1W
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9LD-0006dG-07
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:59 +0000
Date: Wed, 04 Dec 2013 10:05:59 +0000
Message-Id: <E1Vo9LD-0006dG-07@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix string inconsistencies in callers
	of panic()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 51ad90aea21c7f5edff71620fe5d2b6543c42cba
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 3 12:39:22 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 12:39:22 2013 +0100

    fix string inconsistencies in callers of panic()
    
    panic() (as well as early_panic() in arm) is inconsistently called with or
    without a trailing newline.  This results in cases where the lower line of
    *****s is not on its own line.
    
    Change panic() to always print a newline itself, and update callers not to.
    
    In addition, panic() was occasionally called with a leading newline, and
    occaionally with trailing punctuation which seems rather redundant given the
    surrounding context.  Fix up these sitiuations as well.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/arm32/vfp.c             |    2 +-
 xen/arch/arm/arm64/traps.c           |    2 +-
 xen/arch/arm/domain_build.c          |   18 +++++++++---------
 xen/arch/arm/early_printk.c          |    2 +-
 xen/arch/arm/gic.c                   |   16 ++++++++--------
 xen/arch/arm/kernel.c                |    8 ++++----
 xen/arch/arm/mm.c                    |    2 +-
 xen/arch/arm/platform.c              |    2 +-
 xen/arch/arm/setup.c                 |   10 +++++-----
 xen/arch/arm/smpboot.c               |    2 +-
 xen/arch/arm/time.c                  |    8 ++++----
 xen/arch/arm/traps.c                 |   10 +++++-----
 xen/arch/x86/apic.c                  |    4 ++--
 xen/arch/x86/bzimage.c               |    2 +-
 xen/arch/x86/cpu/amd.c               |    2 +-
 xen/arch/x86/cpu/mcheck/mce.c        |    4 ++--
 xen/arch/x86/domain_build.c          |   20 ++++++++++----------
 xen/arch/x86/hvm/svm/intr.c          |    2 +-
 xen/arch/x86/io_apic.c               |    4 ++--
 xen/arch/x86/mm/mm-locks.h           |    2 +-
 xen/arch/x86/mpparse.c               |   10 +++++-----
 xen/arch/x86/setup.c                 |    6 +++---
 xen/arch/x86/smpboot.c               |    2 +-
 xen/arch/x86/tboot.c                 |    2 +-
 xen/arch/x86/time.c                  |    2 +-
 xen/arch/x86/traps.c                 |   14 +++++++-------
 xen/arch/x86/x86_64/mm.c             |    2 +-
 xen/arch/x86/x86_64/traps.c          |    2 +-
 xen/common/page_alloc.c              |    2 +-
 xen/common/schedule.c                |    2 +-
 xen/drivers/char/console.c           |    4 ++--
 xen/drivers/passthrough/iommu.c      |    2 +-
 xen/drivers/passthrough/pci.c        |    2 +-
 xen/drivers/passthrough/vtd/dmar.h   |    2 +-
 xen/drivers/passthrough/vtd/iommu.c  |    4 ++--
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 xen/xsm/flask/hooks.c                |    2 +-
 37 files changed, 92 insertions(+), 92 deletions(-)

diff --git a/xen/arch/arm/arm32/vfp.c b/xen/arch/arm/arm32/vfp.c
index 0069acd..5b80053 100644
--- a/xen/arch/arm/arm32/vfp.c
+++ b/xen/arch/arm/arm32/vfp.c
@@ -80,7 +80,7 @@ static __init int vfp_init(void)
 
     vfparch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT;
     if ( vfparch < 2 )
-        panic("Xen only support VFP 3\n");
+        panic("Xen only support VFP 3");
 
     return 0;
 }
diff --git a/xen/arch/arm/arm64/traps.c b/xen/arch/arm/arm64/traps.c
index d778f89..1693b5d 100644
--- a/xen/arch/arm/arm64/traps.c
+++ b/xen/arch/arm/arm64/traps.c
@@ -26,7 +26,7 @@
 
 asmlinkage void do_trap_serror(struct cpu_user_regs *regs)
 {
-    panic("Unhandled serror trap\n");
+    panic("Unhandled serror trap");
 }
 
 static const char *handler[]= {
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 7c855cb..7fa6e02 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -81,7 +81,7 @@ static void allocate_memory_11(struct domain *d, struct kernel_info *kinfo)
     }
 
     if ( !pg )
-        panic("Failed to allocate contiguous memory for dom0\n");
+        panic("Failed to allocate contiguous memory for dom0");
 
     spfn = page_to_mfn(pg);
     start = pfn_to_paddr(spfn);
@@ -93,7 +93,7 @@ static void allocate_memory_11(struct domain *d, struct kernel_info *kinfo)
     res = guest_physmap_add_page(d, spfn, spfn, order);
 
     if ( res )
-        panic("Unable to add pages in DOM0: %d\n", res);
+        panic("Unable to add pages in DOM0: %d", res);
 
     kinfo->mem.bank[0].start = start;
     kinfo->mem.bank[0].size = size;
@@ -123,7 +123,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)
 
         reg = dt_get_property(memory, "reg", &reg_len);
         if ( reg == NULL )
-            panic("Memory node has no reg property!\n");
+            panic("Memory node has no reg property");
 
         for ( l = 0;
               kinfo->unassigned_mem > 0 && l + reg_size <= reg_len
@@ -133,7 +133,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)
             paddr_t start, size;
 
             if ( dt_device_get_address(memory, bank, &start, &size) )
-                panic("Unable to retrieve the bank %u for %s\n",
+                panic("Unable to retrieve the bank %u for %s",
                       bank, dt_node_full_name(memory));
 
             if ( size > kinfo->unassigned_mem )
@@ -142,7 +142,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)
             printk("Populate P2M %#"PRIx64"->%#"PRIx64"\n",
                    start, start + size);
             if ( p2m_populate_ram(d, start, start + size) < 0 )
-                panic("Failed to populate P2M\n");
+                panic("Failed to populate P2M");
             kinfo->mem.bank[kinfo->mem.nr_banks].start = start;
             kinfo->mem.bank[kinfo->mem.nr_banks].size = size;
             kinfo->mem.nr_banks++;
@@ -909,7 +909,7 @@ static void dtb_load(struct kernel_info *kinfo)
     rc = raw_copy_to_guest_flush_dcache(dtb_virt, kinfo->fdt,
                                         fdt_totalsize(kinfo->fdt));
     if ( rc != 0 )
-        panic("Unable to copy the DTB to dom0 memory (rc = %lu)\n", rc);
+        panic("Unable to copy the DTB to dom0 memory (rc = %lu)", rc);
     xfree(kinfo->fdt);
 }
 
@@ -936,12 +936,12 @@ static void initrd_load(struct kernel_info *kinfo)
     res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-start",
                                    load_addr);
     if ( res )
-        panic("Cannot fix up \"linux,initrd-start\" property\n");
+        panic("Cannot fix up \"linux,initrd-start\" property");
 
     res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-end",
                                    load_addr + len);
     if ( res )
-        panic("Cannot fix up \"linux,initrd-end\" property\n");
+        panic("Cannot fix up \"linux,initrd-end\" property");
 
     for ( offs = 0; offs < len; )
     {
@@ -955,7 +955,7 @@ static void initrd_load(struct kernel_info *kinfo)
         rc = gvirt_to_maddr(load_addr + offs, &ma);
         if ( rc )
         {
-            panic("\nUnable to translate guest address\n");
+            panic("Unable to translate guest address");
             return;
         }
 
diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
index 058d044..41938bb 100644
--- a/xen/arch/arm/early_printk.c
+++ b/xen/arch/arm/early_printk.c
@@ -61,7 +61,7 @@ early_panic(const char *fmt, ...)
     early_vprintk(fmt, args);
     va_end(args);
 
-    early_printk("\nEarly Panic: Stopping\n");
+    early_printk("\n\nEarly Panic: Stopping\n");
 
     while(1);
 }
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 0084f50..43c11cb 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -399,29 +399,29 @@ void __init gic_init(void)
 
     node = dt_find_interrupt_controller(gic_ids);
     if ( !node )
-        panic("Unable to find compatible GIC in the device tree\n");
+        panic("Unable to find compatible GIC in the device tree");
 
     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");
+        panic("GIC: Cannot find a valid address for the distributor");
 
     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");
+        panic("GIC: Cannot find a valid address for the CPU");
 
     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");
+        panic("GIC: Cannot find a valid address for the hypervisor");
 
     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");
+        panic("GIC: Cannot find a valid address for the virtual CPU");
 
     res = dt_device_get_irq(node, 0, &gic.maintenance);
     if ( res )
-        panic("GIC: Cannot find the maintenance IRQ\n");
+        panic("GIC: Cannot find the maintenance IRQ");
 
     /* Set the GIC as the primary interrupt controller */
     dt_interrupt_controller = node;
@@ -439,7 +439,7 @@ void __init gic_init(void)
 
     if ( (gic.dbase & ~PAGE_MASK) || (gic.cbase & ~PAGE_MASK) ||
          (gic.hbase & ~PAGE_MASK) || (gic.vbase & ~PAGE_MASK) )
-        panic("GIC interfaces not page aligned.\n");
+        panic("GIC interfaces not page aligned");
 
     set_fixmap(FIXMAP_GICD, gic.dbase >> PAGE_SHIFT, DEV_SHARED);
     BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) !=
@@ -787,7 +787,7 @@ static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)
         smp_call_function_interrupt();
         break;
     default:
-        panic("Unhandled SGI %d on CPU%d\n", sgi, smp_processor_id());
+        panic("Unhandled SGI %d on CPU%d", sgi, smp_processor_id());
         break;
     }
 
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 9c1c1ad..6a5772b 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -87,7 +87,7 @@ static void place_modules(struct kernel_info *info,
     paddr_t addr;
 
     if ( total + kernel_size > mem_size )
-        panic("Not enough memory in the first bank for the dtb+initrd.");
+        panic("Not enough memory in the first bank for the dtb+initrd");
 
     /*
      * DTB must be loaded such that it does not conflict with the
@@ -112,7 +112,7 @@ static void place_modules(struct kernel_info *info,
         addr = kernel_start - total;
     else
     {
-        panic("Unable to find suitable location for dtb+initrd.");
+        panic("Unable to find suitable location for dtb+initrd");
         return;
     }
 
@@ -144,7 +144,7 @@ static void kernel_zimage_load(struct kernel_info *info)
         rc = gvirt_to_maddr(load_addr + offs, &ma);
         if ( rc )
         {
-            panic("\nUnable to map translate guest address\n");
+            panic("Unable to map translate guest address");
             return;
         }
 
@@ -314,7 +314,7 @@ static int kernel_try_elf_prepare(struct kernel_info *info,
     info->kernel_order = get_order_from_bytes(size);
     info->kernel_img = alloc_xenheap_pages(info->kernel_order, 0);
     if ( info->kernel_img == NULL )
-        panic("Cannot allocate temporary buffer for kernel.\n");
+        panic("Cannot allocate temporary buffer for kernel");
 
     copy_from_paddr(info->kernel_img, addr, size, info->load_attr);
 
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 8189915..e6753fe 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -633,7 +633,7 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
         xenheap_mfn_start = base_mfn;
 
     if ( base_mfn < xenheap_mfn_start )
-        early_panic("cannot add xenheap mapping at %lx below heap start %lx\n",
+        early_panic("cannot add xenheap mapping at %lx below heap start %lx",
                     base_mfn, xenheap_mfn_start);
 
     end_mfn = base_mfn + nr_mfns;
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index a7f9ee4..5ed8eb2 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -83,7 +83,7 @@ void __init platform_init(void)
         res = platform->init();
 
     if ( res )
-        panic("Unable to initialize the platform\n");
+        panic("Unable to initialize the platform");
 }
 
 int __init platform_init_time(void)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 0795eb9..3f894b5 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -346,7 +346,7 @@ static paddr_t __init get_xen_paddr(void)
     }
 
     if ( !paddr )
-        early_panic("Not enough memory to relocate Xen\n");
+        early_panic("Not enough memory to relocate Xen");
 
     early_printk("Placing Xen at 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
                  paddr, paddr + min_size);
@@ -373,7 +373,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 
     /* TODO: Handle non-contiguous memory bank */
     if ( !early_info.mem.nr_banks )
-        early_panic("No memory bank\n");
+        early_panic("No memory bank");
     ram_start = early_info.mem.bank[0].start;
     ram_size  = early_info.mem.bank[0].size;
     ram_end = ram_start + ram_size;
@@ -419,7 +419,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     } while ( xenheap_pages > 128<<(20-PAGE_SHIFT) );
 
     if ( ! e )
-        early_panic("Not not enough space for xenheap\n");
+        early_panic("Not not enough space for xenheap");
 
     domheap_pages = heap_pages - xenheap_pages;
 
@@ -697,13 +697,13 @@ void __init start_xen(unsigned long boot_phys_offset,
     /* Create initial domain 0. */
     dom0 = domain_create(0, 0, 0);
     if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
-            panic("Error creating domain 0\n");
+            panic("Error creating domain 0");
 
     dom0->is_privileged = 1;
     dom0->target = NULL;
 
     if ( construct_dom0(dom0) != 0)
-            panic("Could not set up DOM0 guest OS\n");
+            panic("Could not set up DOM0 guest OS");
 
     /* Scrub RAM that is still free and so may go to an unprivileged domain.
        XXX too slow in simulator
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 6b4a18c..bd76d14 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -70,7 +70,7 @@ static void setup_cpu_sibling_map(int cpu)
 {
     if ( !zalloc_cpumask_var(&per_cpu(cpu_sibling_mask, cpu)) ||
          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
-        panic("No memory for CPU sibling/core maps\n");
+        panic("No memory for CPU sibling/core maps");
 
     /* A CPU is a sibling with itself and is always on its own core. */
     cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 938995d..81e3e28 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -113,7 +113,7 @@ int __init init_xen_time(void)
 
     dev = dt_find_matching_node(NULL, timer_ids);
     if ( !dev )
-        panic("Unable to find a compatible timer in the device tree\n");
+        panic("Unable to find a compatible timer in the device tree");
 
     dt_device_set_used_by(dev, DOMID_XEN);
 
@@ -122,7 +122,7 @@ int __init init_xen_time(void)
     {
         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);
+            panic("Timer: Unable to retrieve IRQ %u from the device tree", i);
     }
 
     printk("Generic Timer IRQ: phys=%u hyp=%u virt=%u\n",
@@ -132,11 +132,11 @@ int __init init_xen_time(void)
 
     res = platform_init_time();
     if ( res )
-        panic("Timer: Cannot initialize platform timer\n");
+        panic("Timer: Cannot initialize platform timer");
 
     /* Check that this CPU supports the Generic Timer interface */
     if ( !cpu_has_gentimer )
-        panic("CPU does not support the Generic Timer v1 interface.\n");
+        panic("CPU does not support the Generic Timer v1 interface");
 
     res = dt_property_read_u32(dev, "clock-frequency", &rate);
     if ( res )
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index d39e2d4..8144b2b 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -253,7 +253,7 @@ void panic_PAR(uint64_t par)
            second_in_first ? " during second stage lookup" : "",
            fsc_level_str(level));
 
-    panic("Error during Hypervisor-to-physical address translation\n");
+    panic("Error during Hypervisor-to-physical address translation");
 }
 
 static void cpsr_switch_mode(struct cpu_user_regs *regs, int mode)
@@ -902,7 +902,7 @@ static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
         show_execution_state(regs);
         break;
     default:
-        panic("DOM%d: Unhandled debug trap %#x\n", domid, code);
+        panic("DOM%d: Unhandled debug trap %#x", domid, code);
         break;
     }
 }
@@ -1187,7 +1187,7 @@ static void do_cp15_32(struct cpu_user_regs *regs,
         printk("%s p15, %d, r%d, cr%d, cr%d, %d @ 0x%"PRIregister"\n",
                cp32.read ? "mrc" : "mcr",
                cp32.op1, cp32.reg, cp32.crn, cp32.crm, cp32.op2, regs->pc);
-        panic("unhandled 32-bit CP15 access %#x\n", hsr.bits & HSR_CP32_REGS_MASK);
+        panic("unhandled 32-bit CP15 access %#x", hsr.bits & HSR_CP32_REGS_MASK);
     }
     advance_pc(regs, hsr);
 }
@@ -1217,7 +1217,7 @@ static void do_cp15_64(struct cpu_user_regs *regs,
         printk("%s p15, %d, r%d, r%d, cr%d @ 0x%"PRIregister"\n",
                cp64.read ? "mrrc" : "mcrr",
                cp64.op1, cp64.reg1, cp64.reg2, cp64.crm, regs->pc);
-        panic("unhandled 64-bit CP15 access %#x\n", hsr.bits & HSR_CP64_REGS_MASK);
+        panic("unhandled 64-bit CP15 access %#x", hsr.bits & HSR_CP64_REGS_MASK);
     }
     advance_pc(regs, hsr);
 }
@@ -1247,7 +1247,7 @@ static void do_sysreg(struct cpu_user_regs *regs,
                sysreg.op2,
                sysreg.read ? "=>" : "<=",
                sysreg.reg, regs->pc);
-        panic("unhandled 64-bit sysreg access %#x\n",
+        panic("unhandled 64-bit sysreg access %#x",
               hsr.bits & HSR_SYSREG_REGS_MASK);
     }
 
diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index a52a0e8..0e5e302 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -946,7 +946,7 @@ void __init x2apic_bsp_setup(void)
             return;
         }
         panic("x2APIC: already enabled by BIOS, but "
-              "iommu_supports_eim failed!\n");
+              "iommu_supports_eim failed");
     }
 
     if ( (ioapic_entries = alloc_ioapic_entries()) == NULL )
@@ -968,7 +968,7 @@ void __init x2apic_bsp_setup(void)
     {
         if ( x2apic_enabled )
             panic("Interrupt remapping could not be enabled while "
-                  "x2APIC is already enabled by BIOS!\n");
+                  "x2APIC is already enabled by BIOS");
 
         printk(XENLOG_ERR
                "Failed to enable Interrupt Remapping: Will not enable x2APIC.\n");
diff --git a/xen/arch/x86/bzimage.c b/xen/arch/x86/bzimage.c
index 58fda16..d72b832 100644
--- a/xen/arch/x86/bzimage.c
+++ b/xen/arch/x86/bzimage.c
@@ -62,7 +62,7 @@ static void flush_window(void);
 
 static __init void error(char *x)
 {
-    panic("%s\n", x);
+    panic("%s", x);
 }
 
 static __init int fill_inbuf(void)
diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 487ef4d..3307141 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -465,7 +465,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 	if (!cpu_has_amd_erratum(c, AMD_ERRATUM_121))
 		opt_allow_unsafe = 1;
 	else if (opt_allow_unsafe < 0)
-		panic("Xen will not boot on this CPU for security reasons.\n"
+		panic("Xen will not boot on this CPU for security reasons"
 		      "Pass \"allow_unsafe\" if you're trusting all your"
 		      " (PV) guest kernels.\n");
 	else if (!opt_allow_unsafe && c == &boot_cpu_data)
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 93d7ae1..b375ef7 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -523,7 +523,7 @@ void mcheck_cmn_handler(struct cpu_user_regs *regs, long error_code,
          * recovery job but to reset the system.
          */
         if (atomic_read(&found_error) == 0)
-            mc_panic("MCE: No CPU found valid MCE, need reset\n");
+            mc_panic("MCE: No CPU found valid MCE, need reset");
         if (!cpumask_empty(&mce_fatal_cpus))
         {
             char *ebufp, ebuf[96] = "MCE: Fatal error happened on CPUs ";
@@ -1642,7 +1642,7 @@ static int mce_delayed_action(mctelem_cookie_t mctc)
         dprintk(XENLOG_ERR, "MCE delayed action failed\n");
         is_mc_panic = 1;
         x86_mcinfo_dump(mctelem_dataptr(mctc));
-        panic("MCE: Software recovery failed for the UCR\n");
+        panic("MCE: Software recovery failed for the UCR");
         break;
     case MCER_RECOVERED:
         dprintk(XENLOG_INFO, "MCE: Error is successfully recovered\n");
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 232adf8..84ce392 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -439,7 +439,7 @@ int __init construct_dom0(
         value = (parms.virt_hv_start_low + mask) & ~mask;
         BUG_ON(!is_pv_32bit_domain(d));
         if ( value > __HYPERVISOR_COMPAT_VIRT_START )
-            panic("Domain 0 expects too high a hypervisor start address.\n");
+            panic("Domain 0 expects too high a hypervisor start address");
         HYPERVISOR_COMPAT_VIRT_START(d) =
             max_t(unsigned int, m2p_compat_vstart, value);
     }
@@ -509,7 +509,7 @@ int __init construct_dom0(
         count -= PAGE_ALIGN(initrd_len);
     order = get_order_from_bytes(count);
     if ( (1UL << order) + PFN_UP(initrd_len) > nr_pages )
-        panic("Domain 0 allocation is too small for kernel image.\n");
+        panic("Domain 0 allocation is too small for kernel image");
 
     if ( parms.p2m_base != UNSET_ADDR )
     {
@@ -518,7 +518,7 @@ int __init construct_dom0(
     }
     page = alloc_domheap_pages(d, order, 0);
     if ( page == NULL )
-        panic("Not enough RAM for domain 0 allocation.\n");
+        panic("Not enough RAM for domain 0 allocation");
     alloc_spfn = page_to_mfn(page);
     alloc_epfn = alloc_spfn + d->tot_pages;
 
@@ -535,7 +535,7 @@ int __init construct_dom0(
             order = get_order_from_pages(count);
             page = alloc_domheap_pages(d, order, 0);
             if ( !page )
-                panic("Not enough RAM for domain 0 initrd.\n");
+                panic("Not enough RAM for domain 0 initrd");
             for ( count = -count; order--; )
                 if ( count & (1UL << order) )
                 {
@@ -618,7 +618,7 @@ int __init construct_dom0(
     {
         page = alloc_domheap_page(NULL, 0);
         if ( !page )
-            panic("Not enough RAM for domain 0 PML4.\n");
+            panic("Not enough RAM for domain 0 PML4");
         page->u.inuse.type_info = PGT_l4_page_table|PGT_validated|1;
         l4start = l4tab = page_to_virt(page);
         maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l3_page_table;
@@ -830,7 +830,7 @@ int __init construct_dom0(
         {
             if ( d->tot_pages + ((round_pgup(vphysmap_end) - va)
                                  >> PAGE_SHIFT) + 3 > nr_pages )
-                panic("Dom0 allocation too small for initial P->M table.\n");
+                panic("Dom0 allocation too small for initial P->M table");
 
             if ( l1tab )
             {
@@ -929,7 +929,7 @@ int __init construct_dom0(
             va &= PAGE_MASK;
         }
         if ( !page )
-            panic("Not enough RAM for DOM0 P->M table.\n");
+            panic("Not enough RAM for DOM0 P->M table");
     }
 
     if ( l1tab )
@@ -990,7 +990,7 @@ int __init construct_dom0(
     while ( pfn < nr_pages )
     {
         if ( (page = alloc_chunk(d, nr_pages - d->tot_pages)) == NULL )
-            panic("Not enough RAM for DOM0 reservation.\n");
+            panic("Not enough RAM for DOM0 reservation");
         while ( pfn < d->tot_pages )
         {
             mfn = page_to_mfn(page);
@@ -1072,12 +1072,12 @@ int __init construct_dom0(
         printk("Dom0 runs in ring 0 (supervisor mode)\n");
         if ( !test_bit(XENFEAT_supervisor_mode_kernel,
                        parms.f_supported) )
-            panic("Dom0 does not support supervisor-mode execution\n");
+            panic("Dom0 does not support supervisor-mode execution");
     }
     else
     {
         if ( test_bit(XENFEAT_supervisor_mode_kernel, parms.f_required) )
-            panic("Dom0 requires supervisor-mode execution\n");
+            panic("Dom0 requires supervisor-mode execution");
     }
 
     rc = 0;
diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index da2bcca..023151a 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -175,7 +175,7 @@ void svm_intr_assist(void)
                 /* Guest already enabled an interrupt window. */
                 return;
             default:
-                panic("%s: nestedsvm_vcpu_interrupt can't handle value %#x\n",
+                panic("%s: nestedsvm_vcpu_interrupt can't handle value %#x",
                     __func__, rc);
             }
         }
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 5512cd5..bddc588 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1421,7 +1421,7 @@ static void __init setup_ioapic_ids_from_mpc(void)
                 if (!physid_isset(i, phys_id_present_map))
                     break;
             if (i >= get_physical_broadcast())
-                panic("Max APIC ID exceeded!\n");
+                panic("Max APIC ID exceeded");
             printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
                    i);
             mp_ioapics[apic].mpc_apicid = i;
@@ -2135,7 +2135,7 @@ int __init io_apic_get_unique_id (int ioapic, int apic_id)
         }
 
         if (i == get_physical_broadcast())
-            panic("Max apic_id exceeded!\n");
+            panic("Max apic_id exceeded");
 
         printk(KERN_WARNING "IOAPIC[%d]: apic_id %d already used, "
                "trying %d\n", ioapic, apic_id, i);
diff --git a/xen/arch/x86/mm/mm-locks.h b/xen/arch/x86/mm/mm-locks.h
index 3ce3489..769f7bc 100644
--- a/xen/arch/x86/mm/mm-locks.h
+++ b/xen/arch/x86/mm/mm-locks.h
@@ -73,7 +73,7 @@ static inline void _mm_lock(mm_lock_t *l, const char *func, int level, int rec)
         l->unlock_level = __get_lock_level();
     }
     else if ( (unlikely(!rec)) )
-        panic("mm lock already held by %s\n", l->locker_function);
+        panic("mm lock already held by %s", l->locker_function);
     __set_lock_level(level);
 }
 
diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index 3753704..a38e016 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -221,7 +221,7 @@ static void __init MP_ioapic_info (struct mpc_config_ioapic *m)
 	if (nr_ioapics >= MAX_IO_APICS) {
 		printk(KERN_CRIT "Max # of I/O APICs (%d) exceeded (found %d).\n",
 			MAX_IO_APICS, nr_ioapics);
-		panic("Recompile kernel with bigger MAX_IO_APICS!.\n");
+		panic("Recompile kernel with bigger MAX_IO_APICS");
 	}
 	if (!m->mpc_apicaddr) {
 		printk(KERN_ERR "WARNING: bogus zero I/O APIC address"
@@ -241,7 +241,7 @@ static void __init MP_intsrc_info (struct mpc_config_intsrc *m)
 			(m->mpc_irqflag >> 2) & 3, m->mpc_srcbus,
 			m->mpc_srcbusirq, m->mpc_dstapic, m->mpc_dstirq);
 	if (++mp_irq_entries == MAX_IRQ_SOURCES)
-		panic("Max # of irq sources exceeded!!\n");
+		panic("Max # of irq sources exceeded");
 }
 
 static void __init MP_lintsrc_info (struct mpc_config_lintsrc *m)
@@ -844,7 +844,7 @@ void __init mp_register_ioapic (
 	if (nr_ioapics >= MAX_IO_APICS) {
 		printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
 			"(found %d)\n", MAX_IO_APICS, nr_ioapics);
-		panic("Recompile kernel with bigger MAX_IO_APICS!\n");
+		panic("Recompile kernel with bigger MAX_IO_APICS");
 	}
 	if (!address) {
 		printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
@@ -943,7 +943,7 @@ void __init mp_override_legacy_irq (
 
 	mp_irqs[mp_irq_entries] = intsrc;
 	if (++mp_irq_entries == MAX_IRQ_SOURCES)
-		panic("Max # of irq sources exceeded!\n");
+		panic("Max # of irq sources exceeded");
 
 	return;
 }
@@ -1009,7 +1009,7 @@ void __init mp_config_acpi_legacy_irqs (void)
 
 		mp_irqs[mp_irq_entries] = intsrc;
 		if (++mp_irq_entries == MAX_IRQ_SOURCES)
-			panic("Max # of irq sources exceeded!\n");
+			panic("Max # of irq sources exceeded");
 	}
 }
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index e33c34b..f07ee2b 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1330,12 +1330,12 @@ void __init __start_xen(unsigned long mbi_p)
         watchdog_setup();
 
     if ( !tboot_protect_mem_regions() )
-        panic("Could not protect TXT memory regions\n");
+        panic("Could not protect TXT memory regions");
 
     /* Create initial domain 0. */
     dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
     if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
-        panic("Error creating domain 0\n");
+        panic("Error creating domain 0");
 
     dom0->is_privileged = 1;
     dom0->target = NULL;
@@ -1390,7 +1390,7 @@ void __init __start_xen(unsigned long mbi_p)
                         (initrdidx > 0) && (initrdidx < mbi->mods_count)
                         ? mod + initrdidx : NULL,
                         bootstrap_map, cmdline) != 0)
-        panic("Could not set up DOM0 guest OS\n");
+        panic("Could not set up DOM0 guest OS");
 
     /* Scrub RAM that is still free and so may go to an unprivileged domain. */
     scrub_heap_pages();
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 9f81c7b..42b8a59 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -735,7 +735,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
 
     if ( !zalloc_cpumask_var(&per_cpu(cpu_sibling_mask, 0)) ||
          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, 0)) )
-        panic("No memory for boot CPU sibling/core maps\n");
+        panic("No memory for boot CPU sibling/core maps");
 
     set_cpu_sibling_map(0);
 
diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c
index 1eed2e3..ccde4a0 100644
--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -528,7 +528,7 @@ void tboot_s3_error(int error)
 
     printk("MAC for %s before S3 is: 0x%08"PRIx64"\n", what, orig_mac);
     printk("MAC for %s after S3 is: 0x%08"PRIx64"\n", what, resume_mac);
-    panic("Memory integrity was lost on resume (%d)\n", error);
+    panic("Memory integrity was lost on resume (%d)", error);
 }
 
 int tboot_wake_ap(int apicid, unsigned long sipi_vec)
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 62c3443..e463600 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -690,7 +690,7 @@ static unsigned long get_cmos_time(void)
     }
 
     if ( unlikely(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) )
-        panic("System without CMOS RTC must be booted from EFI\n");
+        panic("System without CMOS RTC must be booted from EFI");
 
     spin_lock_irqsave(&rtc_lock, flags);
 
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8c355e5..940bc33 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -422,7 +422,7 @@ void fatal_trap(int trapnr, struct cpu_user_regs *regs)
     }
 
     panic("FATAL TRAP: vector = %d (%s)\n"
-          "[error_code=%04x] %s\n",
+          "[error_code=%04x] %s",
           trapnr, trapstr(trapnr), regs->error_code,
           (regs->eflags & X86_EFLAGS_IF) ? "" : ", IN INTERRUPT CONTEXT");
 }
@@ -569,7 +569,7 @@ static inline void do_trap(
 
     show_execution_state(regs);
     panic("FATAL TRAP: vector = %d (%s)\n"
-          "[error_code=%04x]\n",
+          "[error_code=%04x]",
           trapnr, trapstr(trapnr), regs->error_code);
 }
 
@@ -1017,7 +1017,7 @@ void do_invalid_op(struct cpu_user_regs *regs)
         printk("Xen BUG at %s%s:%d\n", prefix, filename, lineno);
         DEBUGGER_trap_fatal(TRAP_invalid_op, regs);
         show_execution_state(regs);
-        panic("Xen BUG at %s%s:%d\n", prefix, filename, lineno);
+        panic("Xen BUG at %s%s:%d", prefix, filename, lineno);
 
     case BUGFRAME_assert:
         /* ASSERT: decode the predicate string pointer. */
@@ -1029,7 +1029,7 @@ void do_invalid_op(struct cpu_user_regs *regs)
                predicate, prefix, filename, lineno);
         DEBUGGER_trap_fatal(TRAP_invalid_op, regs);
         show_execution_state(regs);
-        panic("Assertion '%s' failed at %s%s:%d\n",
+        panic("Assertion '%s' failed at %s%s:%d",
               predicate, prefix, filename, lineno);
     }
 
@@ -1042,7 +1042,7 @@ void do_invalid_op(struct cpu_user_regs *regs)
     }
     DEBUGGER_trap_fatal(TRAP_invalid_op, regs);
     show_execution_state(regs);
-    panic("FATAL TRAP: vector = %d (invalid opcode)\n", TRAP_invalid_op);
+    panic("FATAL TRAP: vector = %d (invalid opcode)", TRAP_invalid_op);
 }
 
 void do_int3(struct cpu_user_regs *regs)
@@ -1397,7 +1397,7 @@ void do_page_fault(struct cpu_user_regs *regs)
         show_page_walk(addr);
         panic("FATAL PAGE FAULT\n"
               "[error_code=%04x]\n"
-              "Faulting linear address: %p\n",
+              "Faulting linear address: %p",
               error_code, _p(addr));
     }
 
@@ -3079,7 +3079,7 @@ void do_general_protection(struct cpu_user_regs *regs)
 
  hardware_gp:
     show_execution_state(regs);
-    panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code);
+    panic("GENERAL PROTECTION FAULT\n[error_code=%04x]", regs->error_code);
 }
 
 static DEFINE_PER_CPU(struct softirq_trap, softirq_trap);
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 4a3b3f1..f6ea012 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -740,7 +740,7 @@ void __init paging_init(void)
     return;
 
  nomem:
-    panic("Not enough memory for m2p table\n");    
+    panic("Not enough memory for m2p table");
 }
 
 void __init zap_low_mappings(void)
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index bcf72b6..ad09415 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -250,7 +250,7 @@ void do_double_fault(struct cpu_user_regs *regs)
     _show_registers(regs, crs, CTXT_hypervisor, NULL);
     show_stack_overflow(cpu, regs);
 
-    panic("DOUBLE FAULT -- system shutdown\n");
+    panic("DOUBLE FAULT -- system shutdown");
 }
 
 void toggle_guest_mode(struct vcpu *v)
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 0701333..c82aba6 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -92,7 +92,7 @@ static unsigned int __initdata nr_bootmem_regions;
 
 static void __init boot_bug(int line)
 {
-    panic("Boot BUG at %s:%d\n", __FILE__, line);
+    panic("Boot BUG at %s:%d", __FILE__, line);
 }
 #define BOOT_BUG_ON(p) if ( p ) boot_bug(__LINE__);
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 0f45f07..1192fe2 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1389,7 +1389,7 @@ void __init scheduler_init(void)
 
     printk("Using scheduler: %s (%s)\n", ops.name, ops.opt_name);
     if ( SCHED_OP(&ops, init) )
-        panic("scheduler returned error on init\n");
+        panic("scheduler returned error on init");
 
     if ( sched_ratelimit_us &&
          (sched_ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 508f845..532c426 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1057,7 +1057,7 @@ void panic(const char *fmt, ...)
     console_start_sync();
     printk("\n****************************************\n");
     printk("Panic on CPU %d:\n", smp_processor_id());
-    printk("%s", buf);
+    printk("%s\n", buf);
     printk("****************************************\n\n");
     if ( opt_noreboot )
         printk("Manual reset required ('noreboot' specified)\n");
@@ -1088,7 +1088,7 @@ void __bug(char *file, int line)
     console_start_sync();
     printk("Xen BUG at %s:%d\n", file, line);
     dump_execution_state();
-    panic("Xen BUG at %s:%d\n", file, line);
+    panic("Xen BUG at %s:%d", file, line);
     for ( ; ; ) ;
 }
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 9a1baeb..bdc7261 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -491,7 +491,7 @@ int __init iommu_setup(void)
 
     if ( (force_iommu && !iommu_enabled) ||
          (force_intremap && !iommu_intremap) )
-        panic("Couldn't enable %s and iommu=required/force\n",
+        panic("Couldn't enable %s and iommu=required/force",
               !iommu_enabled ? "IOMMU" : "Interrupt Remapping");
 
     if ( !iommu_enabled )
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 4aa8f64..c5c8344 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -104,7 +104,7 @@ void __init pt_pci_init(void)
 {
     radix_tree_init(&pci_segments);
     if ( !alloc_pseg(0) )
-        panic("Could not initialize PCI segment 0\n");
+        panic("Could not initialize PCI segment 0");
 }
 
 int __init pci_add_segment(u16 seg)
diff --git a/xen/drivers/passthrough/vtd/dmar.h b/xen/drivers/passthrough/vtd/dmar.h
index a2b97d6..af1feef 100644
--- a/xen/drivers/passthrough/vtd/dmar.h
+++ b/xen/drivers/passthrough/vtd/dmar.h
@@ -118,7 +118,7 @@ do {                                                \
             break;                                  \
         if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT ) {    \
             if ( !kexecing )                                    \
-                panic("%s:%d:%s: DMAR hardware is malfunctional\n",\
+                panic("%s:%d:%s: DMAR hardware is malfunctional",\
                       __FILE__, __LINE__, __func__);            \
             else                                                \
                 break;                                          \
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 76d0bfd..b6b48e2 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -722,7 +722,7 @@ static void iommu_enable_translation(struct acpi_drhd_unit *drhd)
     if ( is_igd_drhd(drhd) && !is_igd_vt_enabled_quirk() ) 
     {
         if ( force_iommu )
-            panic("BIOS did not enable IGD for VT properly, crash Xen for security purpose!\n");
+            panic("BIOS did not enable IGD for VT properly, crash Xen for security purpose");
         else
         {
             dprintk(XENLOG_WARNING VTDPREFIX,
@@ -2344,7 +2344,7 @@ static void vtd_resume(void)
         return;
 
     if ( init_vtd_hw() != 0  && force_iommu )
-         panic("IOMMU setup failed, crash Xen for security purpose!\n");
+         panic("IOMMU setup failed, crash Xen for security purpose");
 
     for_each_drhd_unit ( drhd )
     {
diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 6a410d8..ef5de99 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -220,7 +220,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
             if ( NOW() > (start_time + DMAR_OPERATION_TIMEOUT) )
             {
                 print_qi_regs(iommu);
-                panic("queue invalidate wait descriptor was not executed\n");
+                panic("queue invalidate wait descriptor was not executed");
             }
             cpu_relax();
         }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index b1e2593..7cdef04 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1586,7 +1586,7 @@ static __init int flask_init(void)
 
     original_ops = xsm_ops;
     if ( register_xsm(&flask_ops) )
-        panic("Flask: Unable to register with XSM.\n");
+        panic("Flask: Unable to register with XSM");
 
     ret = security_load_policy(policy_buffer, policy_size);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:06:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:06: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 1Vo9LI-00044P-IB; Wed, 04 Dec 2013 10:06: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 1Vo9LH-00043w-Aw
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:03 +0000
Received: from [85.158.139.211:9406] by server-15.bemta-5.messagelabs.com id
	43/5D-08490-A8EFE925; Wed, 04 Dec 2013 10:06:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386151559!2165977!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20352 invoked from network); 4 Dec 2013 10:06:00 -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;
	4 Dec 2013 10:06: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 1Vo9LD-00082g-1W
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9LD-0006dG-07
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:05:59 +0000
Date: Wed, 04 Dec 2013 10:05:59 +0000
Message-Id: <E1Vo9LD-0006dG-07@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix string inconsistencies in callers
	of panic()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 51ad90aea21c7f5edff71620fe5d2b6543c42cba
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 3 12:39:22 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 12:39:22 2013 +0100

    fix string inconsistencies in callers of panic()
    
    panic() (as well as early_panic() in arm) is inconsistently called with or
    without a trailing newline.  This results in cases where the lower line of
    *****s is not on its own line.
    
    Change panic() to always print a newline itself, and update callers not to.
    
    In addition, panic() was occasionally called with a leading newline, and
    occaionally with trailing punctuation which seems rather redundant given the
    surrounding context.  Fix up these sitiuations as well.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/arm32/vfp.c             |    2 +-
 xen/arch/arm/arm64/traps.c           |    2 +-
 xen/arch/arm/domain_build.c          |   18 +++++++++---------
 xen/arch/arm/early_printk.c          |    2 +-
 xen/arch/arm/gic.c                   |   16 ++++++++--------
 xen/arch/arm/kernel.c                |    8 ++++----
 xen/arch/arm/mm.c                    |    2 +-
 xen/arch/arm/platform.c              |    2 +-
 xen/arch/arm/setup.c                 |   10 +++++-----
 xen/arch/arm/smpboot.c               |    2 +-
 xen/arch/arm/time.c                  |    8 ++++----
 xen/arch/arm/traps.c                 |   10 +++++-----
 xen/arch/x86/apic.c                  |    4 ++--
 xen/arch/x86/bzimage.c               |    2 +-
 xen/arch/x86/cpu/amd.c               |    2 +-
 xen/arch/x86/cpu/mcheck/mce.c        |    4 ++--
 xen/arch/x86/domain_build.c          |   20 ++++++++++----------
 xen/arch/x86/hvm/svm/intr.c          |    2 +-
 xen/arch/x86/io_apic.c               |    4 ++--
 xen/arch/x86/mm/mm-locks.h           |    2 +-
 xen/arch/x86/mpparse.c               |   10 +++++-----
 xen/arch/x86/setup.c                 |    6 +++---
 xen/arch/x86/smpboot.c               |    2 +-
 xen/arch/x86/tboot.c                 |    2 +-
 xen/arch/x86/time.c                  |    2 +-
 xen/arch/x86/traps.c                 |   14 +++++++-------
 xen/arch/x86/x86_64/mm.c             |    2 +-
 xen/arch/x86/x86_64/traps.c          |    2 +-
 xen/common/page_alloc.c              |    2 +-
 xen/common/schedule.c                |    2 +-
 xen/drivers/char/console.c           |    4 ++--
 xen/drivers/passthrough/iommu.c      |    2 +-
 xen/drivers/passthrough/pci.c        |    2 +-
 xen/drivers/passthrough/vtd/dmar.h   |    2 +-
 xen/drivers/passthrough/vtd/iommu.c  |    4 ++--
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 xen/xsm/flask/hooks.c                |    2 +-
 37 files changed, 92 insertions(+), 92 deletions(-)

diff --git a/xen/arch/arm/arm32/vfp.c b/xen/arch/arm/arm32/vfp.c
index 0069acd..5b80053 100644
--- a/xen/arch/arm/arm32/vfp.c
+++ b/xen/arch/arm/arm32/vfp.c
@@ -80,7 +80,7 @@ static __init int vfp_init(void)
 
     vfparch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT;
     if ( vfparch < 2 )
-        panic("Xen only support VFP 3\n");
+        panic("Xen only support VFP 3");
 
     return 0;
 }
diff --git a/xen/arch/arm/arm64/traps.c b/xen/arch/arm/arm64/traps.c
index d778f89..1693b5d 100644
--- a/xen/arch/arm/arm64/traps.c
+++ b/xen/arch/arm/arm64/traps.c
@@ -26,7 +26,7 @@
 
 asmlinkage void do_trap_serror(struct cpu_user_regs *regs)
 {
-    panic("Unhandled serror trap\n");
+    panic("Unhandled serror trap");
 }
 
 static const char *handler[]= {
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 7c855cb..7fa6e02 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -81,7 +81,7 @@ static void allocate_memory_11(struct domain *d, struct kernel_info *kinfo)
     }
 
     if ( !pg )
-        panic("Failed to allocate contiguous memory for dom0\n");
+        panic("Failed to allocate contiguous memory for dom0");
 
     spfn = page_to_mfn(pg);
     start = pfn_to_paddr(spfn);
@@ -93,7 +93,7 @@ static void allocate_memory_11(struct domain *d, struct kernel_info *kinfo)
     res = guest_physmap_add_page(d, spfn, spfn, order);
 
     if ( res )
-        panic("Unable to add pages in DOM0: %d\n", res);
+        panic("Unable to add pages in DOM0: %d", res);
 
     kinfo->mem.bank[0].start = start;
     kinfo->mem.bank[0].size = size;
@@ -123,7 +123,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)
 
         reg = dt_get_property(memory, "reg", &reg_len);
         if ( reg == NULL )
-            panic("Memory node has no reg property!\n");
+            panic("Memory node has no reg property");
 
         for ( l = 0;
               kinfo->unassigned_mem > 0 && l + reg_size <= reg_len
@@ -133,7 +133,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)
             paddr_t start, size;
 
             if ( dt_device_get_address(memory, bank, &start, &size) )
-                panic("Unable to retrieve the bank %u for %s\n",
+                panic("Unable to retrieve the bank %u for %s",
                       bank, dt_node_full_name(memory));
 
             if ( size > kinfo->unassigned_mem )
@@ -142,7 +142,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)
             printk("Populate P2M %#"PRIx64"->%#"PRIx64"\n",
                    start, start + size);
             if ( p2m_populate_ram(d, start, start + size) < 0 )
-                panic("Failed to populate P2M\n");
+                panic("Failed to populate P2M");
             kinfo->mem.bank[kinfo->mem.nr_banks].start = start;
             kinfo->mem.bank[kinfo->mem.nr_banks].size = size;
             kinfo->mem.nr_banks++;
@@ -909,7 +909,7 @@ static void dtb_load(struct kernel_info *kinfo)
     rc = raw_copy_to_guest_flush_dcache(dtb_virt, kinfo->fdt,
                                         fdt_totalsize(kinfo->fdt));
     if ( rc != 0 )
-        panic("Unable to copy the DTB to dom0 memory (rc = %lu)\n", rc);
+        panic("Unable to copy the DTB to dom0 memory (rc = %lu)", rc);
     xfree(kinfo->fdt);
 }
 
@@ -936,12 +936,12 @@ static void initrd_load(struct kernel_info *kinfo)
     res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-start",
                                    load_addr);
     if ( res )
-        panic("Cannot fix up \"linux,initrd-start\" property\n");
+        panic("Cannot fix up \"linux,initrd-start\" property");
 
     res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-end",
                                    load_addr + len);
     if ( res )
-        panic("Cannot fix up \"linux,initrd-end\" property\n");
+        panic("Cannot fix up \"linux,initrd-end\" property");
 
     for ( offs = 0; offs < len; )
     {
@@ -955,7 +955,7 @@ static void initrd_load(struct kernel_info *kinfo)
         rc = gvirt_to_maddr(load_addr + offs, &ma);
         if ( rc )
         {
-            panic("\nUnable to translate guest address\n");
+            panic("Unable to translate guest address");
             return;
         }
 
diff --git a/xen/arch/arm/early_printk.c b/xen/arch/arm/early_printk.c
index 058d044..41938bb 100644
--- a/xen/arch/arm/early_printk.c
+++ b/xen/arch/arm/early_printk.c
@@ -61,7 +61,7 @@ early_panic(const char *fmt, ...)
     early_vprintk(fmt, args);
     va_end(args);
 
-    early_printk("\nEarly Panic: Stopping\n");
+    early_printk("\n\nEarly Panic: Stopping\n");
 
     while(1);
 }
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 0084f50..43c11cb 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -399,29 +399,29 @@ void __init gic_init(void)
 
     node = dt_find_interrupt_controller(gic_ids);
     if ( !node )
-        panic("Unable to find compatible GIC in the device tree\n");
+        panic("Unable to find compatible GIC in the device tree");
 
     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");
+        panic("GIC: Cannot find a valid address for the distributor");
 
     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");
+        panic("GIC: Cannot find a valid address for the CPU");
 
     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");
+        panic("GIC: Cannot find a valid address for the hypervisor");
 
     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");
+        panic("GIC: Cannot find a valid address for the virtual CPU");
 
     res = dt_device_get_irq(node, 0, &gic.maintenance);
     if ( res )
-        panic("GIC: Cannot find the maintenance IRQ\n");
+        panic("GIC: Cannot find the maintenance IRQ");
 
     /* Set the GIC as the primary interrupt controller */
     dt_interrupt_controller = node;
@@ -439,7 +439,7 @@ void __init gic_init(void)
 
     if ( (gic.dbase & ~PAGE_MASK) || (gic.cbase & ~PAGE_MASK) ||
          (gic.hbase & ~PAGE_MASK) || (gic.vbase & ~PAGE_MASK) )
-        panic("GIC interfaces not page aligned.\n");
+        panic("GIC interfaces not page aligned");
 
     set_fixmap(FIXMAP_GICD, gic.dbase >> PAGE_SHIFT, DEV_SHARED);
     BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) !=
@@ -787,7 +787,7 @@ static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)
         smp_call_function_interrupt();
         break;
     default:
-        panic("Unhandled SGI %d on CPU%d\n", sgi, smp_processor_id());
+        panic("Unhandled SGI %d on CPU%d", sgi, smp_processor_id());
         break;
     }
 
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 9c1c1ad..6a5772b 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -87,7 +87,7 @@ static void place_modules(struct kernel_info *info,
     paddr_t addr;
 
     if ( total + kernel_size > mem_size )
-        panic("Not enough memory in the first bank for the dtb+initrd.");
+        panic("Not enough memory in the first bank for the dtb+initrd");
 
     /*
      * DTB must be loaded such that it does not conflict with the
@@ -112,7 +112,7 @@ static void place_modules(struct kernel_info *info,
         addr = kernel_start - total;
     else
     {
-        panic("Unable to find suitable location for dtb+initrd.");
+        panic("Unable to find suitable location for dtb+initrd");
         return;
     }
 
@@ -144,7 +144,7 @@ static void kernel_zimage_load(struct kernel_info *info)
         rc = gvirt_to_maddr(load_addr + offs, &ma);
         if ( rc )
         {
-            panic("\nUnable to map translate guest address\n");
+            panic("Unable to map translate guest address");
             return;
         }
 
@@ -314,7 +314,7 @@ static int kernel_try_elf_prepare(struct kernel_info *info,
     info->kernel_order = get_order_from_bytes(size);
     info->kernel_img = alloc_xenheap_pages(info->kernel_order, 0);
     if ( info->kernel_img == NULL )
-        panic("Cannot allocate temporary buffer for kernel.\n");
+        panic("Cannot allocate temporary buffer for kernel");
 
     copy_from_paddr(info->kernel_img, addr, size, info->load_attr);
 
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 8189915..e6753fe 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -633,7 +633,7 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
         xenheap_mfn_start = base_mfn;
 
     if ( base_mfn < xenheap_mfn_start )
-        early_panic("cannot add xenheap mapping at %lx below heap start %lx\n",
+        early_panic("cannot add xenheap mapping at %lx below heap start %lx",
                     base_mfn, xenheap_mfn_start);
 
     end_mfn = base_mfn + nr_mfns;
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index a7f9ee4..5ed8eb2 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -83,7 +83,7 @@ void __init platform_init(void)
         res = platform->init();
 
     if ( res )
-        panic("Unable to initialize the platform\n");
+        panic("Unable to initialize the platform");
 }
 
 int __init platform_init_time(void)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 0795eb9..3f894b5 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -346,7 +346,7 @@ static paddr_t __init get_xen_paddr(void)
     }
 
     if ( !paddr )
-        early_panic("Not enough memory to relocate Xen\n");
+        early_panic("Not enough memory to relocate Xen");
 
     early_printk("Placing Xen at 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
                  paddr, paddr + min_size);
@@ -373,7 +373,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 
     /* TODO: Handle non-contiguous memory bank */
     if ( !early_info.mem.nr_banks )
-        early_panic("No memory bank\n");
+        early_panic("No memory bank");
     ram_start = early_info.mem.bank[0].start;
     ram_size  = early_info.mem.bank[0].size;
     ram_end = ram_start + ram_size;
@@ -419,7 +419,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     } while ( xenheap_pages > 128<<(20-PAGE_SHIFT) );
 
     if ( ! e )
-        early_panic("Not not enough space for xenheap\n");
+        early_panic("Not not enough space for xenheap");
 
     domheap_pages = heap_pages - xenheap_pages;
 
@@ -697,13 +697,13 @@ void __init start_xen(unsigned long boot_phys_offset,
     /* Create initial domain 0. */
     dom0 = domain_create(0, 0, 0);
     if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
-            panic("Error creating domain 0\n");
+            panic("Error creating domain 0");
 
     dom0->is_privileged = 1;
     dom0->target = NULL;
 
     if ( construct_dom0(dom0) != 0)
-            panic("Could not set up DOM0 guest OS\n");
+            panic("Could not set up DOM0 guest OS");
 
     /* Scrub RAM that is still free and so may go to an unprivileged domain.
        XXX too slow in simulator
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 6b4a18c..bd76d14 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -70,7 +70,7 @@ static void setup_cpu_sibling_map(int cpu)
 {
     if ( !zalloc_cpumask_var(&per_cpu(cpu_sibling_mask, cpu)) ||
          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
-        panic("No memory for CPU sibling/core maps\n");
+        panic("No memory for CPU sibling/core maps");
 
     /* A CPU is a sibling with itself and is always on its own core. */
     cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 938995d..81e3e28 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -113,7 +113,7 @@ int __init init_xen_time(void)
 
     dev = dt_find_matching_node(NULL, timer_ids);
     if ( !dev )
-        panic("Unable to find a compatible timer in the device tree\n");
+        panic("Unable to find a compatible timer in the device tree");
 
     dt_device_set_used_by(dev, DOMID_XEN);
 
@@ -122,7 +122,7 @@ int __init init_xen_time(void)
     {
         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);
+            panic("Timer: Unable to retrieve IRQ %u from the device tree", i);
     }
 
     printk("Generic Timer IRQ: phys=%u hyp=%u virt=%u\n",
@@ -132,11 +132,11 @@ int __init init_xen_time(void)
 
     res = platform_init_time();
     if ( res )
-        panic("Timer: Cannot initialize platform timer\n");
+        panic("Timer: Cannot initialize platform timer");
 
     /* Check that this CPU supports the Generic Timer interface */
     if ( !cpu_has_gentimer )
-        panic("CPU does not support the Generic Timer v1 interface.\n");
+        panic("CPU does not support the Generic Timer v1 interface");
 
     res = dt_property_read_u32(dev, "clock-frequency", &rate);
     if ( res )
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index d39e2d4..8144b2b 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -253,7 +253,7 @@ void panic_PAR(uint64_t par)
            second_in_first ? " during second stage lookup" : "",
            fsc_level_str(level));
 
-    panic("Error during Hypervisor-to-physical address translation\n");
+    panic("Error during Hypervisor-to-physical address translation");
 }
 
 static void cpsr_switch_mode(struct cpu_user_regs *regs, int mode)
@@ -902,7 +902,7 @@ static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
         show_execution_state(regs);
         break;
     default:
-        panic("DOM%d: Unhandled debug trap %#x\n", domid, code);
+        panic("DOM%d: Unhandled debug trap %#x", domid, code);
         break;
     }
 }
@@ -1187,7 +1187,7 @@ static void do_cp15_32(struct cpu_user_regs *regs,
         printk("%s p15, %d, r%d, cr%d, cr%d, %d @ 0x%"PRIregister"\n",
                cp32.read ? "mrc" : "mcr",
                cp32.op1, cp32.reg, cp32.crn, cp32.crm, cp32.op2, regs->pc);
-        panic("unhandled 32-bit CP15 access %#x\n", hsr.bits & HSR_CP32_REGS_MASK);
+        panic("unhandled 32-bit CP15 access %#x", hsr.bits & HSR_CP32_REGS_MASK);
     }
     advance_pc(regs, hsr);
 }
@@ -1217,7 +1217,7 @@ static void do_cp15_64(struct cpu_user_regs *regs,
         printk("%s p15, %d, r%d, r%d, cr%d @ 0x%"PRIregister"\n",
                cp64.read ? "mrrc" : "mcrr",
                cp64.op1, cp64.reg1, cp64.reg2, cp64.crm, regs->pc);
-        panic("unhandled 64-bit CP15 access %#x\n", hsr.bits & HSR_CP64_REGS_MASK);
+        panic("unhandled 64-bit CP15 access %#x", hsr.bits & HSR_CP64_REGS_MASK);
     }
     advance_pc(regs, hsr);
 }
@@ -1247,7 +1247,7 @@ static void do_sysreg(struct cpu_user_regs *regs,
                sysreg.op2,
                sysreg.read ? "=>" : "<=",
                sysreg.reg, regs->pc);
-        panic("unhandled 64-bit sysreg access %#x\n",
+        panic("unhandled 64-bit sysreg access %#x",
               hsr.bits & HSR_SYSREG_REGS_MASK);
     }
 
diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index a52a0e8..0e5e302 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -946,7 +946,7 @@ void __init x2apic_bsp_setup(void)
             return;
         }
         panic("x2APIC: already enabled by BIOS, but "
-              "iommu_supports_eim failed!\n");
+              "iommu_supports_eim failed");
     }
 
     if ( (ioapic_entries = alloc_ioapic_entries()) == NULL )
@@ -968,7 +968,7 @@ void __init x2apic_bsp_setup(void)
     {
         if ( x2apic_enabled )
             panic("Interrupt remapping could not be enabled while "
-                  "x2APIC is already enabled by BIOS!\n");
+                  "x2APIC is already enabled by BIOS");
 
         printk(XENLOG_ERR
                "Failed to enable Interrupt Remapping: Will not enable x2APIC.\n");
diff --git a/xen/arch/x86/bzimage.c b/xen/arch/x86/bzimage.c
index 58fda16..d72b832 100644
--- a/xen/arch/x86/bzimage.c
+++ b/xen/arch/x86/bzimage.c
@@ -62,7 +62,7 @@ static void flush_window(void);
 
 static __init void error(char *x)
 {
-    panic("%s\n", x);
+    panic("%s", x);
 }
 
 static __init int fill_inbuf(void)
diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 487ef4d..3307141 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -465,7 +465,7 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 	if (!cpu_has_amd_erratum(c, AMD_ERRATUM_121))
 		opt_allow_unsafe = 1;
 	else if (opt_allow_unsafe < 0)
-		panic("Xen will not boot on this CPU for security reasons.\n"
+		panic("Xen will not boot on this CPU for security reasons"
 		      "Pass \"allow_unsafe\" if you're trusting all your"
 		      " (PV) guest kernels.\n");
 	else if (!opt_allow_unsafe && c == &boot_cpu_data)
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 93d7ae1..b375ef7 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -523,7 +523,7 @@ void mcheck_cmn_handler(struct cpu_user_regs *regs, long error_code,
          * recovery job but to reset the system.
          */
         if (atomic_read(&found_error) == 0)
-            mc_panic("MCE: No CPU found valid MCE, need reset\n");
+            mc_panic("MCE: No CPU found valid MCE, need reset");
         if (!cpumask_empty(&mce_fatal_cpus))
         {
             char *ebufp, ebuf[96] = "MCE: Fatal error happened on CPUs ";
@@ -1642,7 +1642,7 @@ static int mce_delayed_action(mctelem_cookie_t mctc)
         dprintk(XENLOG_ERR, "MCE delayed action failed\n");
         is_mc_panic = 1;
         x86_mcinfo_dump(mctelem_dataptr(mctc));
-        panic("MCE: Software recovery failed for the UCR\n");
+        panic("MCE: Software recovery failed for the UCR");
         break;
     case MCER_RECOVERED:
         dprintk(XENLOG_INFO, "MCE: Error is successfully recovered\n");
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 232adf8..84ce392 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -439,7 +439,7 @@ int __init construct_dom0(
         value = (parms.virt_hv_start_low + mask) & ~mask;
         BUG_ON(!is_pv_32bit_domain(d));
         if ( value > __HYPERVISOR_COMPAT_VIRT_START )
-            panic("Domain 0 expects too high a hypervisor start address.\n");
+            panic("Domain 0 expects too high a hypervisor start address");
         HYPERVISOR_COMPAT_VIRT_START(d) =
             max_t(unsigned int, m2p_compat_vstart, value);
     }
@@ -509,7 +509,7 @@ int __init construct_dom0(
         count -= PAGE_ALIGN(initrd_len);
     order = get_order_from_bytes(count);
     if ( (1UL << order) + PFN_UP(initrd_len) > nr_pages )
-        panic("Domain 0 allocation is too small for kernel image.\n");
+        panic("Domain 0 allocation is too small for kernel image");
 
     if ( parms.p2m_base != UNSET_ADDR )
     {
@@ -518,7 +518,7 @@ int __init construct_dom0(
     }
     page = alloc_domheap_pages(d, order, 0);
     if ( page == NULL )
-        panic("Not enough RAM for domain 0 allocation.\n");
+        panic("Not enough RAM for domain 0 allocation");
     alloc_spfn = page_to_mfn(page);
     alloc_epfn = alloc_spfn + d->tot_pages;
 
@@ -535,7 +535,7 @@ int __init construct_dom0(
             order = get_order_from_pages(count);
             page = alloc_domheap_pages(d, order, 0);
             if ( !page )
-                panic("Not enough RAM for domain 0 initrd.\n");
+                panic("Not enough RAM for domain 0 initrd");
             for ( count = -count; order--; )
                 if ( count & (1UL << order) )
                 {
@@ -618,7 +618,7 @@ int __init construct_dom0(
     {
         page = alloc_domheap_page(NULL, 0);
         if ( !page )
-            panic("Not enough RAM for domain 0 PML4.\n");
+            panic("Not enough RAM for domain 0 PML4");
         page->u.inuse.type_info = PGT_l4_page_table|PGT_validated|1;
         l4start = l4tab = page_to_virt(page);
         maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l3_page_table;
@@ -830,7 +830,7 @@ int __init construct_dom0(
         {
             if ( d->tot_pages + ((round_pgup(vphysmap_end) - va)
                                  >> PAGE_SHIFT) + 3 > nr_pages )
-                panic("Dom0 allocation too small for initial P->M table.\n");
+                panic("Dom0 allocation too small for initial P->M table");
 
             if ( l1tab )
             {
@@ -929,7 +929,7 @@ int __init construct_dom0(
             va &= PAGE_MASK;
         }
         if ( !page )
-            panic("Not enough RAM for DOM0 P->M table.\n");
+            panic("Not enough RAM for DOM0 P->M table");
     }
 
     if ( l1tab )
@@ -990,7 +990,7 @@ int __init construct_dom0(
     while ( pfn < nr_pages )
     {
         if ( (page = alloc_chunk(d, nr_pages - d->tot_pages)) == NULL )
-            panic("Not enough RAM for DOM0 reservation.\n");
+            panic("Not enough RAM for DOM0 reservation");
         while ( pfn < d->tot_pages )
         {
             mfn = page_to_mfn(page);
@@ -1072,12 +1072,12 @@ int __init construct_dom0(
         printk("Dom0 runs in ring 0 (supervisor mode)\n");
         if ( !test_bit(XENFEAT_supervisor_mode_kernel,
                        parms.f_supported) )
-            panic("Dom0 does not support supervisor-mode execution\n");
+            panic("Dom0 does not support supervisor-mode execution");
     }
     else
     {
         if ( test_bit(XENFEAT_supervisor_mode_kernel, parms.f_required) )
-            panic("Dom0 requires supervisor-mode execution\n");
+            panic("Dom0 requires supervisor-mode execution");
     }
 
     rc = 0;
diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index da2bcca..023151a 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -175,7 +175,7 @@ void svm_intr_assist(void)
                 /* Guest already enabled an interrupt window. */
                 return;
             default:
-                panic("%s: nestedsvm_vcpu_interrupt can't handle value %#x\n",
+                panic("%s: nestedsvm_vcpu_interrupt can't handle value %#x",
                     __func__, rc);
             }
         }
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 5512cd5..bddc588 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1421,7 +1421,7 @@ static void __init setup_ioapic_ids_from_mpc(void)
                 if (!physid_isset(i, phys_id_present_map))
                     break;
             if (i >= get_physical_broadcast())
-                panic("Max APIC ID exceeded!\n");
+                panic("Max APIC ID exceeded");
             printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
                    i);
             mp_ioapics[apic].mpc_apicid = i;
@@ -2135,7 +2135,7 @@ int __init io_apic_get_unique_id (int ioapic, int apic_id)
         }
 
         if (i == get_physical_broadcast())
-            panic("Max apic_id exceeded!\n");
+            panic("Max apic_id exceeded");
 
         printk(KERN_WARNING "IOAPIC[%d]: apic_id %d already used, "
                "trying %d\n", ioapic, apic_id, i);
diff --git a/xen/arch/x86/mm/mm-locks.h b/xen/arch/x86/mm/mm-locks.h
index 3ce3489..769f7bc 100644
--- a/xen/arch/x86/mm/mm-locks.h
+++ b/xen/arch/x86/mm/mm-locks.h
@@ -73,7 +73,7 @@ static inline void _mm_lock(mm_lock_t *l, const char *func, int level, int rec)
         l->unlock_level = __get_lock_level();
     }
     else if ( (unlikely(!rec)) )
-        panic("mm lock already held by %s\n", l->locker_function);
+        panic("mm lock already held by %s", l->locker_function);
     __set_lock_level(level);
 }
 
diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index 3753704..a38e016 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -221,7 +221,7 @@ static void __init MP_ioapic_info (struct mpc_config_ioapic *m)
 	if (nr_ioapics >= MAX_IO_APICS) {
 		printk(KERN_CRIT "Max # of I/O APICs (%d) exceeded (found %d).\n",
 			MAX_IO_APICS, nr_ioapics);
-		panic("Recompile kernel with bigger MAX_IO_APICS!.\n");
+		panic("Recompile kernel with bigger MAX_IO_APICS");
 	}
 	if (!m->mpc_apicaddr) {
 		printk(KERN_ERR "WARNING: bogus zero I/O APIC address"
@@ -241,7 +241,7 @@ static void __init MP_intsrc_info (struct mpc_config_intsrc *m)
 			(m->mpc_irqflag >> 2) & 3, m->mpc_srcbus,
 			m->mpc_srcbusirq, m->mpc_dstapic, m->mpc_dstirq);
 	if (++mp_irq_entries == MAX_IRQ_SOURCES)
-		panic("Max # of irq sources exceeded!!\n");
+		panic("Max # of irq sources exceeded");
 }
 
 static void __init MP_lintsrc_info (struct mpc_config_lintsrc *m)
@@ -844,7 +844,7 @@ void __init mp_register_ioapic (
 	if (nr_ioapics >= MAX_IO_APICS) {
 		printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded "
 			"(found %d)\n", MAX_IO_APICS, nr_ioapics);
-		panic("Recompile kernel with bigger MAX_IO_APICS!\n");
+		panic("Recompile kernel with bigger MAX_IO_APICS");
 	}
 	if (!address) {
 		printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address"
@@ -943,7 +943,7 @@ void __init mp_override_legacy_irq (
 
 	mp_irqs[mp_irq_entries] = intsrc;
 	if (++mp_irq_entries == MAX_IRQ_SOURCES)
-		panic("Max # of irq sources exceeded!\n");
+		panic("Max # of irq sources exceeded");
 
 	return;
 }
@@ -1009,7 +1009,7 @@ void __init mp_config_acpi_legacy_irqs (void)
 
 		mp_irqs[mp_irq_entries] = intsrc;
 		if (++mp_irq_entries == MAX_IRQ_SOURCES)
-			panic("Max # of irq sources exceeded!\n");
+			panic("Max # of irq sources exceeded");
 	}
 }
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index e33c34b..f07ee2b 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1330,12 +1330,12 @@ void __init __start_xen(unsigned long mbi_p)
         watchdog_setup();
 
     if ( !tboot_protect_mem_regions() )
-        panic("Could not protect TXT memory regions\n");
+        panic("Could not protect TXT memory regions");
 
     /* Create initial domain 0. */
     dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
     if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
-        panic("Error creating domain 0\n");
+        panic("Error creating domain 0");
 
     dom0->is_privileged = 1;
     dom0->target = NULL;
@@ -1390,7 +1390,7 @@ void __init __start_xen(unsigned long mbi_p)
                         (initrdidx > 0) && (initrdidx < mbi->mods_count)
                         ? mod + initrdidx : NULL,
                         bootstrap_map, cmdline) != 0)
-        panic("Could not set up DOM0 guest OS\n");
+        panic("Could not set up DOM0 guest OS");
 
     /* Scrub RAM that is still free and so may go to an unprivileged domain. */
     scrub_heap_pages();
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 9f81c7b..42b8a59 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -735,7 +735,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
 
     if ( !zalloc_cpumask_var(&per_cpu(cpu_sibling_mask, 0)) ||
          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, 0)) )
-        panic("No memory for boot CPU sibling/core maps\n");
+        panic("No memory for boot CPU sibling/core maps");
 
     set_cpu_sibling_map(0);
 
diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c
index 1eed2e3..ccde4a0 100644
--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -528,7 +528,7 @@ void tboot_s3_error(int error)
 
     printk("MAC for %s before S3 is: 0x%08"PRIx64"\n", what, orig_mac);
     printk("MAC for %s after S3 is: 0x%08"PRIx64"\n", what, resume_mac);
-    panic("Memory integrity was lost on resume (%d)\n", error);
+    panic("Memory integrity was lost on resume (%d)", error);
 }
 
 int tboot_wake_ap(int apicid, unsigned long sipi_vec)
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 62c3443..e463600 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -690,7 +690,7 @@ static unsigned long get_cmos_time(void)
     }
 
     if ( unlikely(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) )
-        panic("System without CMOS RTC must be booted from EFI\n");
+        panic("System without CMOS RTC must be booted from EFI");
 
     spin_lock_irqsave(&rtc_lock, flags);
 
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8c355e5..940bc33 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -422,7 +422,7 @@ void fatal_trap(int trapnr, struct cpu_user_regs *regs)
     }
 
     panic("FATAL TRAP: vector = %d (%s)\n"
-          "[error_code=%04x] %s\n",
+          "[error_code=%04x] %s",
           trapnr, trapstr(trapnr), regs->error_code,
           (regs->eflags & X86_EFLAGS_IF) ? "" : ", IN INTERRUPT CONTEXT");
 }
@@ -569,7 +569,7 @@ static inline void do_trap(
 
     show_execution_state(regs);
     panic("FATAL TRAP: vector = %d (%s)\n"
-          "[error_code=%04x]\n",
+          "[error_code=%04x]",
           trapnr, trapstr(trapnr), regs->error_code);
 }
 
@@ -1017,7 +1017,7 @@ void do_invalid_op(struct cpu_user_regs *regs)
         printk("Xen BUG at %s%s:%d\n", prefix, filename, lineno);
         DEBUGGER_trap_fatal(TRAP_invalid_op, regs);
         show_execution_state(regs);
-        panic("Xen BUG at %s%s:%d\n", prefix, filename, lineno);
+        panic("Xen BUG at %s%s:%d", prefix, filename, lineno);
 
     case BUGFRAME_assert:
         /* ASSERT: decode the predicate string pointer. */
@@ -1029,7 +1029,7 @@ void do_invalid_op(struct cpu_user_regs *regs)
                predicate, prefix, filename, lineno);
         DEBUGGER_trap_fatal(TRAP_invalid_op, regs);
         show_execution_state(regs);
-        panic("Assertion '%s' failed at %s%s:%d\n",
+        panic("Assertion '%s' failed at %s%s:%d",
               predicate, prefix, filename, lineno);
     }
 
@@ -1042,7 +1042,7 @@ void do_invalid_op(struct cpu_user_regs *regs)
     }
     DEBUGGER_trap_fatal(TRAP_invalid_op, regs);
     show_execution_state(regs);
-    panic("FATAL TRAP: vector = %d (invalid opcode)\n", TRAP_invalid_op);
+    panic("FATAL TRAP: vector = %d (invalid opcode)", TRAP_invalid_op);
 }
 
 void do_int3(struct cpu_user_regs *regs)
@@ -1397,7 +1397,7 @@ void do_page_fault(struct cpu_user_regs *regs)
         show_page_walk(addr);
         panic("FATAL PAGE FAULT\n"
               "[error_code=%04x]\n"
-              "Faulting linear address: %p\n",
+              "Faulting linear address: %p",
               error_code, _p(addr));
     }
 
@@ -3079,7 +3079,7 @@ void do_general_protection(struct cpu_user_regs *regs)
 
  hardware_gp:
     show_execution_state(regs);
-    panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code);
+    panic("GENERAL PROTECTION FAULT\n[error_code=%04x]", regs->error_code);
 }
 
 static DEFINE_PER_CPU(struct softirq_trap, softirq_trap);
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 4a3b3f1..f6ea012 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -740,7 +740,7 @@ void __init paging_init(void)
     return;
 
  nomem:
-    panic("Not enough memory for m2p table\n");    
+    panic("Not enough memory for m2p table");
 }
 
 void __init zap_low_mappings(void)
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index bcf72b6..ad09415 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -250,7 +250,7 @@ void do_double_fault(struct cpu_user_regs *regs)
     _show_registers(regs, crs, CTXT_hypervisor, NULL);
     show_stack_overflow(cpu, regs);
 
-    panic("DOUBLE FAULT -- system shutdown\n");
+    panic("DOUBLE FAULT -- system shutdown");
 }
 
 void toggle_guest_mode(struct vcpu *v)
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 0701333..c82aba6 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -92,7 +92,7 @@ static unsigned int __initdata nr_bootmem_regions;
 
 static void __init boot_bug(int line)
 {
-    panic("Boot BUG at %s:%d\n", __FILE__, line);
+    panic("Boot BUG at %s:%d", __FILE__, line);
 }
 #define BOOT_BUG_ON(p) if ( p ) boot_bug(__LINE__);
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 0f45f07..1192fe2 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1389,7 +1389,7 @@ void __init scheduler_init(void)
 
     printk("Using scheduler: %s (%s)\n", ops.name, ops.opt_name);
     if ( SCHED_OP(&ops, init) )
-        panic("scheduler returned error on init\n");
+        panic("scheduler returned error on init");
 
     if ( sched_ratelimit_us &&
          (sched_ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 508f845..532c426 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1057,7 +1057,7 @@ void panic(const char *fmt, ...)
     console_start_sync();
     printk("\n****************************************\n");
     printk("Panic on CPU %d:\n", smp_processor_id());
-    printk("%s", buf);
+    printk("%s\n", buf);
     printk("****************************************\n\n");
     if ( opt_noreboot )
         printk("Manual reset required ('noreboot' specified)\n");
@@ -1088,7 +1088,7 @@ void __bug(char *file, int line)
     console_start_sync();
     printk("Xen BUG at %s:%d\n", file, line);
     dump_execution_state();
-    panic("Xen BUG at %s:%d\n", file, line);
+    panic("Xen BUG at %s:%d", file, line);
     for ( ; ; ) ;
 }
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 9a1baeb..bdc7261 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -491,7 +491,7 @@ int __init iommu_setup(void)
 
     if ( (force_iommu && !iommu_enabled) ||
          (force_intremap && !iommu_intremap) )
-        panic("Couldn't enable %s and iommu=required/force\n",
+        panic("Couldn't enable %s and iommu=required/force",
               !iommu_enabled ? "IOMMU" : "Interrupt Remapping");
 
     if ( !iommu_enabled )
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 4aa8f64..c5c8344 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -104,7 +104,7 @@ void __init pt_pci_init(void)
 {
     radix_tree_init(&pci_segments);
     if ( !alloc_pseg(0) )
-        panic("Could not initialize PCI segment 0\n");
+        panic("Could not initialize PCI segment 0");
 }
 
 int __init pci_add_segment(u16 seg)
diff --git a/xen/drivers/passthrough/vtd/dmar.h b/xen/drivers/passthrough/vtd/dmar.h
index a2b97d6..af1feef 100644
--- a/xen/drivers/passthrough/vtd/dmar.h
+++ b/xen/drivers/passthrough/vtd/dmar.h
@@ -118,7 +118,7 @@ do {                                                \
             break;                                  \
         if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT ) {    \
             if ( !kexecing )                                    \
-                panic("%s:%d:%s: DMAR hardware is malfunctional\n",\
+                panic("%s:%d:%s: DMAR hardware is malfunctional",\
                       __FILE__, __LINE__, __func__);            \
             else                                                \
                 break;                                          \
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 76d0bfd..b6b48e2 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -722,7 +722,7 @@ static void iommu_enable_translation(struct acpi_drhd_unit *drhd)
     if ( is_igd_drhd(drhd) && !is_igd_vt_enabled_quirk() ) 
     {
         if ( force_iommu )
-            panic("BIOS did not enable IGD for VT properly, crash Xen for security purpose!\n");
+            panic("BIOS did not enable IGD for VT properly, crash Xen for security purpose");
         else
         {
             dprintk(XENLOG_WARNING VTDPREFIX,
@@ -2344,7 +2344,7 @@ static void vtd_resume(void)
         return;
 
     if ( init_vtd_hw() != 0  && force_iommu )
-         panic("IOMMU setup failed, crash Xen for security purpose!\n");
+         panic("IOMMU setup failed, crash Xen for security purpose");
 
     for_each_drhd_unit ( drhd )
     {
diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 6a410d8..ef5de99 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -220,7 +220,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
             if ( NOW() > (start_time + DMAR_OPERATION_TIMEOUT) )
             {
                 print_qi_regs(iommu);
-                panic("queue invalidate wait descriptor was not executed\n");
+                panic("queue invalidate wait descriptor was not executed");
             }
             cpu_relax();
         }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index b1e2593..7cdef04 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1586,7 +1586,7 @@ static __init int flask_init(void)
 
     original_ops = xsm_ops;
     if ( register_xsm(&flask_ops) )
-        panic("Flask: Unable to register with XSM.\n");
+        panic("Flask: Unable to register with XSM");
 
     ret = security_load_policy(policy_buffer, policy_size);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:06:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:06: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 1Vo9LR-00046r-OD; Wed, 04 Dec 2013 10:06:13 +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 1Vo9LQ-00046Q-AF
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:12 +0000
Received: from [85.158.143.35:14143] by server-1.bemta-4.messagelabs.com id
	F1/E0-02132-39EFE925; Wed, 04 Dec 2013 10:06:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1386151569!3219819!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3977 invoked from network); 4 Dec 2013 10:06:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:06: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 1Vo9LN-00083F-6t
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9LN-0006ds-4c
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:09 +0000
Date: Wed, 04 Dec 2013 10:06:09 +0000
Message-Id: <E1Vo9LN-0006ds-4c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix locking in offline_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d4837a56da4a59259dd0cf9f3bdc073159d81d7a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 12:40:57 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 12:40:57 2013 +0100

    fix locking in offline_page()
    
    Coverity ID 1055655
    
    Apart from the Coverity-detected lock order reversal (a domain's
    page_alloc_lock taken with the heap lock already held), calling
    put_page() with heap_lock is a bad idea too (as a possible descendant
    from put_page() is free_heap_pages(), which wants to take this very
    lock).
    
    From all I can tell the region over which heap_lock was held was far
    too large: All we need to protect are the call to mark_page_offline()
    and reserve_heap_page() (and I'd even put under question the need for
    the former). Hence by slightly re-arranging the if/else-if chain we
    can drop the lock much earlier, at once no longer covering the two
    put_page() invocations.
    
    Once at it, do a little bit of other cleanup: Put the "pod_replace"
    code path inline rather than at its own label, and drop the effectively
    unused variable "ret".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/page_alloc.c |   39 ++++++++++++++++++---------------------
 1 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index c82aba6..9497623 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -957,7 +957,6 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
 {
     unsigned long old_info = 0;
     struct domain *owner;
-    int ret = 0;
     struct page_info *pg;
 
     if ( !mfn_valid(mfn) )
@@ -1007,16 +1006,28 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( page_state_is(pg, offlined) )
     {
         reserve_heap_page(pg);
-        *status = PG_OFFLINE_OFFLINED;
+
+        spin_unlock(&heap_lock);
+
+        *status = broken ? PG_OFFLINE_OFFLINED | PG_OFFLINE_BROKEN
+                         : PG_OFFLINE_OFFLINED;
+        return 0;
     }
-    else if ( (owner = page_get_owner_and_reference(pg)) )
+
+    spin_unlock(&heap_lock);
+
+    if ( (owner = page_get_owner_and_reference(pg)) )
     {
         if ( p2m_pod_offline_or_broken_hit(pg) )
-            goto pod_replace;
+        {
+            put_page(pg);
+            p2m_pod_offline_or_broken_replace(pg);
+            *status = PG_OFFLINE_OFFLINED;
+        }
         else
         {
             *status = PG_OFFLINE_OWNED | PG_OFFLINE_PENDING |
-              (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
+                      (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
             /* Release the reference since it will not be allocated anymore */
             put_page(pg);
         }
@@ -1024,7 +1035,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     else if ( old_info & PGC_xen_heap )
     {
         *status = PG_OFFLINE_XENPAGE | PG_OFFLINE_PENDING |
-          (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
+                  (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
     }
     else
     {
@@ -1043,21 +1054,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( broken )
         *status |= PG_OFFLINE_BROKEN;
 
-    spin_unlock(&heap_lock);
-
-    return ret;
-
-pod_replace:
-    put_page(pg);
-    spin_unlock(&heap_lock);
-
-    p2m_pod_offline_or_broken_replace(pg);
-    *status = PG_OFFLINE_OFFLINED;
-
-    if ( broken )
-        *status |= PG_OFFLINE_BROKEN;
-
-    return ret;
+    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 Dec 04 10:06:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:06: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 1Vo9LR-00046r-OD; Wed, 04 Dec 2013 10:06:13 +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 1Vo9LQ-00046Q-AF
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:12 +0000
Received: from [85.158.143.35:14143] by server-1.bemta-4.messagelabs.com id
	F1/E0-02132-39EFE925; Wed, 04 Dec 2013 10:06:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1386151569!3219819!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3977 invoked from network); 4 Dec 2013 10:06:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:06: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 1Vo9LN-00083F-6t
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9LN-0006ds-4c
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:09 +0000
Date: Wed, 04 Dec 2013 10:06:09 +0000
Message-Id: <E1Vo9LN-0006ds-4c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix locking in offline_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d4837a56da4a59259dd0cf9f3bdc073159d81d7a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 12:40:57 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 12:40:57 2013 +0100

    fix locking in offline_page()
    
    Coverity ID 1055655
    
    Apart from the Coverity-detected lock order reversal (a domain's
    page_alloc_lock taken with the heap lock already held), calling
    put_page() with heap_lock is a bad idea too (as a possible descendant
    from put_page() is free_heap_pages(), which wants to take this very
    lock).
    
    From all I can tell the region over which heap_lock was held was far
    too large: All we need to protect are the call to mark_page_offline()
    and reserve_heap_page() (and I'd even put under question the need for
    the former). Hence by slightly re-arranging the if/else-if chain we
    can drop the lock much earlier, at once no longer covering the two
    put_page() invocations.
    
    Once at it, do a little bit of other cleanup: Put the "pod_replace"
    code path inline rather than at its own label, and drop the effectively
    unused variable "ret".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/page_alloc.c |   39 ++++++++++++++++++---------------------
 1 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index c82aba6..9497623 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -957,7 +957,6 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
 {
     unsigned long old_info = 0;
     struct domain *owner;
-    int ret = 0;
     struct page_info *pg;
 
     if ( !mfn_valid(mfn) )
@@ -1007,16 +1006,28 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( page_state_is(pg, offlined) )
     {
         reserve_heap_page(pg);
-        *status = PG_OFFLINE_OFFLINED;
+
+        spin_unlock(&heap_lock);
+
+        *status = broken ? PG_OFFLINE_OFFLINED | PG_OFFLINE_BROKEN
+                         : PG_OFFLINE_OFFLINED;
+        return 0;
     }
-    else if ( (owner = page_get_owner_and_reference(pg)) )
+
+    spin_unlock(&heap_lock);
+
+    if ( (owner = page_get_owner_and_reference(pg)) )
     {
         if ( p2m_pod_offline_or_broken_hit(pg) )
-            goto pod_replace;
+        {
+            put_page(pg);
+            p2m_pod_offline_or_broken_replace(pg);
+            *status = PG_OFFLINE_OFFLINED;
+        }
         else
         {
             *status = PG_OFFLINE_OWNED | PG_OFFLINE_PENDING |
-              (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
+                      (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
             /* Release the reference since it will not be allocated anymore */
             put_page(pg);
         }
@@ -1024,7 +1035,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     else if ( old_info & PGC_xen_heap )
     {
         *status = PG_OFFLINE_XENPAGE | PG_OFFLINE_PENDING |
-          (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
+                  (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
     }
     else
     {
@@ -1043,21 +1054,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( broken )
         *status |= PG_OFFLINE_BROKEN;
 
-    spin_unlock(&heap_lock);
-
-    return ret;
-
-pod_replace:
-    put_page(pg);
-    spin_unlock(&heap_lock);
-
-    p2m_pod_offline_or_broken_replace(pg);
-    *status = PG_OFFLINE_OFFLINED;
-
-    if ( broken )
-        *status |= PG_OFFLINE_BROKEN;
-
-    return ret;
+    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 Dec 04 10:06:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:06: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 1Vo9Lb-000494-Ra; Wed, 04 Dec 2013 10:06:23 +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 1Vo9La-00048j-CS
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:22 +0000
Received: from [193.109.254.147:46682] by server-6.bemta-14.messagelabs.com id
	8A/D5-14958-D9EFE925; Wed, 04 Dec 2013 10:06:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1386151579!2765703!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6868 invoked from network); 4 Dec 2013 10:06:20 -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;
	4 Dec 2013 10:06: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 1Vo9LX-00083L-Cz
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9LX-0006ek-AD
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:19 +0000
Date: Wed, 04 Dec 2013 10:06:19 +0000
Message-Id: <E1Vo9LX-0006ek-AD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use return value of
	domain_adjust_tot_pages() where feasible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 69a13bafe6bc9f76a06ff423d7fd52aa6016001f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 12:41:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 12:41:54 2013 +0100

    use return value of domain_adjust_tot_pages() where feasible
    
    This is generally cheaper than re-reading ->tot_pages.
    
    While doing so I also noticed an improper use (lacking error handling)
    of get_domain() as well as lacks of ->is_dying checks in the memory
    sharing code, which the patch fixes at once. In the course of doing
    this I further noticed other error paths there pointlessly calling
    put_page() et al with ->page_alloc_lock still held, which is also being
    reversed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/mm/mem_sharing.c |   27 ++++++++++++++++++++-------
 xen/common/memory.c           |    4 ++--
 xen/common/page_alloc.c       |    6 +++---
 3 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 1e89f6c..c94856b 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -611,9 +611,16 @@ static int page_make_sharable(struct domain *d,
                        struct page_info *page, 
                        int expected_refcnt)
 {
-    int drop_dom_ref;
+    bool_t drop_dom_ref;
+
     spin_lock(&d->page_alloc_lock);
 
+    if ( d->is_dying )
+    {
+        spin_unlock(&d->page_alloc_lock);
+        return -EBUSY;
+    }
+
     /* Change page type and count atomically */
     if ( !get_page_and_type(page, d, PGT_shared_page) )
     {
@@ -624,8 +631,8 @@ static int page_make_sharable(struct domain *d,
     /* Check it wasn't already sharable and undo if it was */
     if ( (page->u.inuse.type_info & PGT_count_mask) != 1 )
     {
-        put_page_and_type(page);
         spin_unlock(&d->page_alloc_lock);
+        put_page_and_type(page);
         return -EEXIST;
     }
 
@@ -633,15 +640,14 @@ static int page_make_sharable(struct domain *d,
      * the second from get_page_and_type at the top of this function */
     if ( page->count_info != (PGC_allocated | (2 + expected_refcnt)) )
     {
+        spin_unlock(&d->page_alloc_lock);
         /* Return type count back to zero */
         put_page_and_type(page);
-        spin_unlock(&d->page_alloc_lock);
         return -E2BIG;
     }
 
     page_set_owner(page, dom_cow);
-    domain_adjust_tot_pages(d, -1);
-    drop_dom_ref = (d->tot_pages == 0);
+    drop_dom_ref = !domain_adjust_tot_pages(d, -1);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
 
@@ -659,6 +665,13 @@ static int page_make_private(struct domain *d, struct page_info *page)
     
     spin_lock(&d->page_alloc_lock);
 
+    if ( d->is_dying )
+    {
+        spin_unlock(&d->page_alloc_lock);
+        put_page(page);
+        return -EBUSY;
+    }
+
     /* We can only change the type if count is one */
     /* Because we are locking pages individually, we need to drop
      * the lock here, while the page is typed. We cannot risk the 
@@ -666,8 +679,8 @@ static int page_make_private(struct domain *d, struct page_info *page)
     expected_type = (PGT_shared_page | PGT_validated | PGT_locked | 2);
     if ( page->u.inuse.type_info != expected_type )
     {
-        put_page(page);
         spin_unlock(&d->page_alloc_lock);
+        put_page(page);
         return -EEXIST;
     }
 
@@ -682,7 +695,7 @@ static int page_make_private(struct domain *d, struct page_info *page)
     page_set_owner(page, d);
 
     if ( domain_adjust_tot_pages(d, 1) == 1 )
-        get_domain(d);
+        get_knownalive_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
 
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 50b740f..eb7b72b 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -475,8 +475,8 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
 
                 spin_lock(&d->page_alloc_lock);
-                domain_adjust_tot_pages(d, -dec_count);
-                drop_dom_ref = (dec_count && !d->tot_pages);
+                drop_dom_ref = (dec_count &&
+                                !domain_adjust_tot_pages(d, -dec_count));
                 spin_unlock(&d->page_alloc_lock);
 
                 if ( drop_dom_ref )
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 9497623..8002bd2 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1519,8 +1519,9 @@ struct page_info *alloc_domheap_pages(
 
 void free_domheap_pages(struct page_info *pg, unsigned int order)
 {
-    int            i, drop_dom_ref;
     struct domain *d = page_get_owner(pg);
+    unsigned int i;
+    bool_t drop_dom_ref;
 
     ASSERT(!in_irq());
 
@@ -1548,8 +1549,7 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
 
-        domain_adjust_tot_pages(d, -(1 << order));
-        drop_dom_ref = (d->tot_pages == 0);
+        drop_dom_ref = !domain_adjust_tot_pages(d, -(1 << order));
 
         spin_unlock_recursive(&d->page_alloc_lock);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:06:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:06: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 1Vo9Lb-000494-Ra; Wed, 04 Dec 2013 10:06:23 +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 1Vo9La-00048j-CS
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:22 +0000
Received: from [193.109.254.147:46682] by server-6.bemta-14.messagelabs.com id
	8A/D5-14958-D9EFE925; Wed, 04 Dec 2013 10:06:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1386151579!2765703!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6868 invoked from network); 4 Dec 2013 10:06:20 -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;
	4 Dec 2013 10:06: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 1Vo9LX-00083L-Cz
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9LX-0006ek-AD
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:19 +0000
Date: Wed, 04 Dec 2013 10:06:19 +0000
Message-Id: <E1Vo9LX-0006ek-AD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] use return value of
	domain_adjust_tot_pages() where feasible
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 69a13bafe6bc9f76a06ff423d7fd52aa6016001f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 12:41:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 12:41:54 2013 +0100

    use return value of domain_adjust_tot_pages() where feasible
    
    This is generally cheaper than re-reading ->tot_pages.
    
    While doing so I also noticed an improper use (lacking error handling)
    of get_domain() as well as lacks of ->is_dying checks in the memory
    sharing code, which the patch fixes at once. In the course of doing
    this I further noticed other error paths there pointlessly calling
    put_page() et al with ->page_alloc_lock still held, which is also being
    reversed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/mm/mem_sharing.c |   27 ++++++++++++++++++++-------
 xen/common/memory.c           |    4 ++--
 xen/common/page_alloc.c       |    6 +++---
 3 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 1e89f6c..c94856b 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -611,9 +611,16 @@ static int page_make_sharable(struct domain *d,
                        struct page_info *page, 
                        int expected_refcnt)
 {
-    int drop_dom_ref;
+    bool_t drop_dom_ref;
+
     spin_lock(&d->page_alloc_lock);
 
+    if ( d->is_dying )
+    {
+        spin_unlock(&d->page_alloc_lock);
+        return -EBUSY;
+    }
+
     /* Change page type and count atomically */
     if ( !get_page_and_type(page, d, PGT_shared_page) )
     {
@@ -624,8 +631,8 @@ static int page_make_sharable(struct domain *d,
     /* Check it wasn't already sharable and undo if it was */
     if ( (page->u.inuse.type_info & PGT_count_mask) != 1 )
     {
-        put_page_and_type(page);
         spin_unlock(&d->page_alloc_lock);
+        put_page_and_type(page);
         return -EEXIST;
     }
 
@@ -633,15 +640,14 @@ static int page_make_sharable(struct domain *d,
      * the second from get_page_and_type at the top of this function */
     if ( page->count_info != (PGC_allocated | (2 + expected_refcnt)) )
     {
+        spin_unlock(&d->page_alloc_lock);
         /* Return type count back to zero */
         put_page_and_type(page);
-        spin_unlock(&d->page_alloc_lock);
         return -E2BIG;
     }
 
     page_set_owner(page, dom_cow);
-    domain_adjust_tot_pages(d, -1);
-    drop_dom_ref = (d->tot_pages == 0);
+    drop_dom_ref = !domain_adjust_tot_pages(d, -1);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
 
@@ -659,6 +665,13 @@ static int page_make_private(struct domain *d, struct page_info *page)
     
     spin_lock(&d->page_alloc_lock);
 
+    if ( d->is_dying )
+    {
+        spin_unlock(&d->page_alloc_lock);
+        put_page(page);
+        return -EBUSY;
+    }
+
     /* We can only change the type if count is one */
     /* Because we are locking pages individually, we need to drop
      * the lock here, while the page is typed. We cannot risk the 
@@ -666,8 +679,8 @@ static int page_make_private(struct domain *d, struct page_info *page)
     expected_type = (PGT_shared_page | PGT_validated | PGT_locked | 2);
     if ( page->u.inuse.type_info != expected_type )
     {
-        put_page(page);
         spin_unlock(&d->page_alloc_lock);
+        put_page(page);
         return -EEXIST;
     }
 
@@ -682,7 +695,7 @@ static int page_make_private(struct domain *d, struct page_info *page)
     page_set_owner(page, d);
 
     if ( domain_adjust_tot_pages(d, 1) == 1 )
-        get_domain(d);
+        get_knownalive_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
 
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 50b740f..eb7b72b 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -475,8 +475,8 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
                              (j * (1UL << exch.out.extent_order)));
 
                 spin_lock(&d->page_alloc_lock);
-                domain_adjust_tot_pages(d, -dec_count);
-                drop_dom_ref = (dec_count && !d->tot_pages);
+                drop_dom_ref = (dec_count &&
+                                !domain_adjust_tot_pages(d, -dec_count));
                 spin_unlock(&d->page_alloc_lock);
 
                 if ( drop_dom_ref )
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 9497623..8002bd2 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1519,8 +1519,9 @@ struct page_info *alloc_domheap_pages(
 
 void free_domheap_pages(struct page_info *pg, unsigned int order)
 {
-    int            i, drop_dom_ref;
     struct domain *d = page_get_owner(pg);
+    unsigned int i;
+    bool_t drop_dom_ref;
 
     ASSERT(!in_irq());
 
@@ -1548,8 +1549,7 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
 
-        domain_adjust_tot_pages(d, -(1 << order));
-        drop_dom_ref = (d->tot_pages == 0);
+        drop_dom_ref = !domain_adjust_tot_pages(d, -(1 << order));
 
         spin_unlock_recursive(&d->page_alloc_lock);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:06:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:06: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 1Vo9Lm-0004Ax-Uu; Wed, 04 Dec 2013 10:06: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 1Vo9Ll-0004AY-UX
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:34 +0000
Received: from [85.158.137.68:4456] by server-16.bemta-3.messagelabs.com id
	AD/F3-26128-7AEFE925; Wed, 04 Dec 2013 10:06:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1386151589!1626435!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13039 invoked from network); 4 Dec 2013 10:06:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:06: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 1Vo9Lh-00083R-Jm
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Lh-0006fA-Gk
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:29 +0000
Date: Wed, 04 Dec 2013 10:06:29 +0000
Message-Id: <E1Vo9Lh-0006fA-Gk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't leak buf in
	libxl_xen_console_read_start error handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 39eaabdf4131b5e64c2d4e370fdecd0cb4f046f1
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 14:01:05 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Dec 3 17:25:44 2013 +0000

    libxl: don't leak buf in libxl_xen_console_read_start error handling
    
    Use libxl__zallocs instead of plain mallocs + memset.
    
    Coverity-ID: 1055889
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index a57d571..771b45b 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5111,29 +5111,18 @@ int libxl_send_debug_keys(libxl_ctx *ctx, char *keys)
 libxl_xen_console_reader *
     libxl_xen_console_read_start(libxl_ctx *ctx, int clear)
 {
+    GC_INIT(ctx);
     libxl_xen_console_reader *cr;
     unsigned int size = 16384;
-    char *buf = malloc(size);
-
-    if (!buf) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "cannot malloc buffer for libxl_xen_console_reader,"
-            " size is %u", size);
-        return NULL;
-    }
 
-    cr = malloc(sizeof(libxl_xen_console_reader));
-    if (!cr) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "cannot malloc libxl_xen_console_reader");
-        return NULL;
-    }
-
-    memset(cr, 0, sizeof(libxl_xen_console_reader));
-    cr->buffer = buf;
+    cr = libxl__zalloc(NOGC, sizeof(libxl_xen_console_reader));
+    cr->buffer = libxl__zalloc(NOGC, size);
     cr->size = size;
     cr->count = size;
     cr->clear = clear;
     cr->incremental = 1;
 
+    GC_FREE;
     return cr;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:06:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:06: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 1Vo9Lm-0004Ax-Uu; Wed, 04 Dec 2013 10:06: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 1Vo9Ll-0004AY-UX
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:34 +0000
Received: from [85.158.137.68:4456] by server-16.bemta-3.messagelabs.com id
	AD/F3-26128-7AEFE925; Wed, 04 Dec 2013 10:06:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1386151589!1626435!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13039 invoked from network); 4 Dec 2013 10:06:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:06: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 1Vo9Lh-00083R-Jm
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Lh-0006fA-Gk
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:29 +0000
Date: Wed, 04 Dec 2013 10:06:29 +0000
Message-Id: <E1Vo9Lh-0006fA-Gk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't leak buf in
	libxl_xen_console_read_start error handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 39eaabdf4131b5e64c2d4e370fdecd0cb4f046f1
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 14:01:05 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Dec 3 17:25:44 2013 +0000

    libxl: don't leak buf in libxl_xen_console_read_start error handling
    
    Use libxl__zallocs instead of plain mallocs + memset.
    
    Coverity-ID: 1055889
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index a57d571..771b45b 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -5111,29 +5111,18 @@ int libxl_send_debug_keys(libxl_ctx *ctx, char *keys)
 libxl_xen_console_reader *
     libxl_xen_console_read_start(libxl_ctx *ctx, int clear)
 {
+    GC_INIT(ctx);
     libxl_xen_console_reader *cr;
     unsigned int size = 16384;
-    char *buf = malloc(size);
-
-    if (!buf) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "cannot malloc buffer for libxl_xen_console_reader,"
-            " size is %u", size);
-        return NULL;
-    }
 
-    cr = malloc(sizeof(libxl_xen_console_reader));
-    if (!cr) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "cannot malloc libxl_xen_console_reader");
-        return NULL;
-    }
-
-    memset(cr, 0, sizeof(libxl_xen_console_reader));
-    cr->buffer = buf;
+    cr = libxl__zalloc(NOGC, sizeof(libxl_xen_console_reader));
+    cr->buffer = libxl__zalloc(NOGC, size);
     cr->size = size;
     cr->count = size;
     cr->clear = clear;
     cr->incremental = 1;
 
+    GC_FREE;
     return cr;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:06:47 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:06: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 1Vo9Lz-0004CP-1x; Wed, 04 Dec 2013 10:06: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 1Vo9Lx-0004Bo-H8
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:46 +0000
Received: from [85.158.137.68:61862] by server-13.bemta-3.messagelabs.com id
	C7/8B-28603-1BEFE925; Wed, 04 Dec 2013 10:06:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1386151600!1627647!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28964 invoked from network); 4 Dec 2013 10:06:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:06: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 1Vo9Lr-00083W-RW
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Lr-0006fa-NK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:39 +0000
Date: Wed, 04 Dec 2013 10:06:39 +0000
Message-Id: <E1Vo9Lr-0006fa-NK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't try to fclose file twice
	on error in libxl_userdata_store
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4b07b3cbf29f66da6090d52e75b5fdae592c6441
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 13:00:37 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Dec 3 17:27:39 2013 +0000

    libxl: don't try to fclose file twice on error in libxl_userdata_store
    
    Do this by changing the function to not use stdio file operations, but
    just use the fd directly with libxl_write_exactly.
    
    While at it, tidy up the function's style issues.
    
    Coverity-ID: 1056195
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
---
 tools/libxl/libxl_dom.c |   35 ++++++++++++++---------------------
 1 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 72489f8..078cff1 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1599,8 +1599,6 @@ int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
     const char *newfilename;
     int e, rc;
     int fd = -1;
-    FILE *f = NULL;
-    size_t rs;
 
     filename = userdata_path(gc, domid, userdata_userid, "d");
     if (!filename) {
@@ -1621,38 +1619,33 @@ int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
 
     rc = ERROR_FAIL;
 
-    fd= open(newfilename, O_RDWR|O_CREAT|O_TRUNC, 0600);
-    if (fd<0)
+    fd = open(newfilename, O_RDWR | O_CREAT | O_TRUNC, 0600);
+    if (fd < 0)
         goto err;
 
-    f= fdopen(fd, "wb");
-    if (!f)
+    if (libxl_write_exactly(ctx, fd, data, datalen, "userdata", newfilename))
         goto err;
-    fd = -1;
 
-    rs = fwrite(data, 1, datalen, f);
-    if (rs != datalen) {
-        assert(ferror(f));
+    if (close(fd) < 0) {
+        fd = -1;
         goto err;
     }
+    fd = -1;
 
-    if (fclose(f))
-        goto err;
-    f = 0;
-
-    if (rename(newfilename,filename))
+    if (rename(newfilename, filename))
         goto err;
 
     rc = 0;
 
 err:
-    e = errno;
-    if (f) fclose(f);
-    if (fd>=0) close(fd);
+    if (fd >= 0) {
+        e = errno;
+        close(fd);
+        errno = e;
+    }
 
-    errno = e;
-    if ( rc )
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "cannot write %s for %s",
+    if (rc)
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "cannot write/rename %s for %s",
                  newfilename, filename);
 out:
     GC_FREE;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 10:06:47 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 10:06: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 1Vo9Lz-0004CP-1x; Wed, 04 Dec 2013 10:06: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 1Vo9Lx-0004Bo-H8
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:46 +0000
Received: from [85.158.137.68:61862] by server-13.bemta-3.messagelabs.com id
	C7/8B-28603-1BEFE925; Wed, 04 Dec 2013 10:06:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1386151600!1627647!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28964 invoked from network); 4 Dec 2013 10:06:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 10:06: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 1Vo9Lr-00083W-RW
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vo9Lr-0006fa-NK
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 10:06:39 +0000
Date: Wed, 04 Dec 2013 10:06:39 +0000
Message-Id: <E1Vo9Lr-0006fa-NK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't try to fclose file twice
	on error in libxl_userdata_store
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4b07b3cbf29f66da6090d52e75b5fdae592c6441
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 13:00:37 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Dec 3 17:27:39 2013 +0000

    libxl: don't try to fclose file twice on error in libxl_userdata_store
    
    Do this by changing the function to not use stdio file operations, but
    just use the fd directly with libxl_write_exactly.
    
    While at it, tidy up the function's style issues.
    
    Coverity-ID: 1056195
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
---
 tools/libxl/libxl_dom.c |   35 ++++++++++++++---------------------
 1 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 72489f8..078cff1 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1599,8 +1599,6 @@ int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
     const char *newfilename;
     int e, rc;
     int fd = -1;
-    FILE *f = NULL;
-    size_t rs;
 
     filename = userdata_path(gc, domid, userdata_userid, "d");
     if (!filename) {
@@ -1621,38 +1619,33 @@ int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
 
     rc = ERROR_FAIL;
 
-    fd= open(newfilename, O_RDWR|O_CREAT|O_TRUNC, 0600);
-    if (fd<0)
+    fd = open(newfilename, O_RDWR | O_CREAT | O_TRUNC, 0600);
+    if (fd < 0)
         goto err;
 
-    f= fdopen(fd, "wb");
-    if (!f)
+    if (libxl_write_exactly(ctx, fd, data, datalen, "userdata", newfilename))
         goto err;
-    fd = -1;
 
-    rs = fwrite(data, 1, datalen, f);
-    if (rs != datalen) {
-        assert(ferror(f));
+    if (close(fd) < 0) {
+        fd = -1;
         goto err;
     }
+    fd = -1;
 
-    if (fclose(f))
-        goto err;
-    f = 0;
-
-    if (rename(newfilename,filename))
+    if (rename(newfilename, filename))
         goto err;
 
     rc = 0;
 
 err:
-    e = errno;
-    if (f) fclose(f);
-    if (fd>=0) close(fd);
+    if (fd >= 0) {
+        e = errno;
+        close(fd);
+        errno = e;
+    }
 
-    errno = e;
-    if ( rc )
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "cannot write %s for %s",
+    if (rc)
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "cannot write/rename %s for %s",
                  newfilename, filename);
 out:
     GC_FREE;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 04 14:55:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 14:55: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 1VoDr2-00007H-Oo; Wed, 04 Dec 2013 14:55:08 +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 1VoDr0-00006j-La
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 14:55:06 +0000
Received: from [85.158.139.211:21527] by server-11.bemta-5.messagelabs.com id
	AF/17-23268-9424F925; Wed, 04 Dec 2013 14:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386168904!2262053!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2561 invoked from network); 4 Dec 2013 14:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 14: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 1VoDqx-0002k5-Nk
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 14:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VoDqx-000620-FU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 14:55:03 +0000
Date: Wed, 04 Dec 2013 14:55:03 +0000
Message-Id: <E1VoDqx-000620-FU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] xen_disk: fix memory leak
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7786354785043197712=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 96b58a44756a8821c108358439b0f2c06e531159
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Wed Dec 4 15:16:18 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Dec 4 14:44:24 2013 +0000

    xen_disk: fix memory leak
    
    On ioreq_release the full ioreq was memset to 0, losing all the data
    and memory allocations inside the QEMUIOVector, which leads to a
    memory leak. Create a new function to specifically reset ioreq.
    
    Reported-by: Maik Wessler <maik.wessler@yahoo.com>
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    
    Backport to qemu-xen-traditional.
    
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 hw/xen_disk.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index ee8d36f..250d806 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -116,6 +116,29 @@ struct XenBlkDev {
 
 /* ------------------------------------------------------------- */
 
+static void ioreq_reset(struct ioreq *ioreq)
+{
+    memset(&ioreq->req, 0, sizeof(ioreq->req));
+    ioreq->status = 0;
+    ioreq->start = 0;
+    ioreq->presync = 0;
+    ioreq->postsync = 0;
+
+    memset(ioreq->domids, 0, sizeof(ioreq->domids));
+    memset(ioreq->refs, 0, sizeof(ioreq->refs));
+    ioreq->prot = 0;
+    memset(ioreq->page, 0, sizeof(ioreq->page));
+    ioreq->pages = NULL;
+
+    ioreq->aio_inflight = 0;
+    ioreq->aio_errors = 0;
+
+    ioreq->blkdev = NULL;
+    memset(&ioreq->list, 0, sizeof(ioreq->list));
+
+    qemu_iovec_reset(&ioreq->v);
+}
+
 static struct ioreq *ioreq_start(struct XenBlkDev *blkdev)
 {
     struct ioreq *ioreq = NULL;
@@ -132,7 +155,6 @@ static struct ioreq *ioreq_start(struct XenBlkDev *blkdev)
 	/* get one from freelist */
 	ioreq = LIST_FIRST(&blkdev->freelist);
 	LIST_REMOVE(ioreq, list);
-        qemu_iovec_reset(&ioreq->v);
     }
     LIST_INSERT_HEAD(&blkdev->inflight, ioreq, list);
     blkdev->requests_inflight++;
@@ -156,7 +178,7 @@ static void ioreq_release(struct ioreq *ioreq, bool finish)
     struct XenBlkDev *blkdev = ioreq->blkdev;
 
     LIST_REMOVE(ioreq, list);
-    memset(ioreq, 0, sizeof(*ioreq));
+    ioreq_reset(ioreq);
     ioreq->blkdev = blkdev;
     LIST_INSERT_HEAD(&blkdev->freelist, ioreq, list);
     if (finish) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git


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

From xen-changelog-bounces@lists.xen.org Wed Dec 04 14:55:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Dec 2013 14:55: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 1VoDr2-00007H-Oo; Wed, 04 Dec 2013 14:55:08 +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 1VoDr0-00006j-La
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 14:55:06 +0000
Received: from [85.158.139.211:21527] by server-11.bemta-5.messagelabs.com id
	AF/17-23268-9424F925; Wed, 04 Dec 2013 14:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386168904!2262053!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2561 invoked from network); 4 Dec 2013 14:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2013 14: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 1VoDqx-0002k5-Nk
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 14:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VoDqx-000620-FU
	for xen-changelog@lists.xensource.com; Wed, 04 Dec 2013 14:55:03 +0000
Date: Wed, 04 Dec 2013 14:55:03 +0000
Message-Id: <E1VoDqx-000620-FU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] xen_disk: fix memory leak
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============7786354785043197712=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 96b58a44756a8821c108358439b0f2c06e531159
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Wed Dec 4 15:16:18 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Dec 4 14:44:24 2013 +0000

    xen_disk: fix memory leak
    
    On ioreq_release the full ioreq was memset to 0, losing all the data
    and memory allocations inside the QEMUIOVector, which leads to a
    memory leak. Create a new function to specifically reset ioreq.
    
    Reported-by: Maik Wessler <maik.wessler@yahoo.com>
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    
    Backport to qemu-xen-traditional.
    
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 hw/xen_disk.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index ee8d36f..250d806 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -116,6 +116,29 @@ struct XenBlkDev {
 
 /* ------------------------------------------------------------- */
 
+static void ioreq_reset(struct ioreq *ioreq)
+{
+    memset(&ioreq->req, 0, sizeof(ioreq->req));
+    ioreq->status = 0;
+    ioreq->start = 0;
+    ioreq->presync = 0;
+    ioreq->postsync = 0;
+
+    memset(ioreq->domids, 0, sizeof(ioreq->domids));
+    memset(ioreq->refs, 0, sizeof(ioreq->refs));
+    ioreq->prot = 0;
+    memset(ioreq->page, 0, sizeof(ioreq->page));
+    ioreq->pages = NULL;
+
+    ioreq->aio_inflight = 0;
+    ioreq->aio_errors = 0;
+
+    ioreq->blkdev = NULL;
+    memset(&ioreq->list, 0, sizeof(ioreq->list));
+
+    qemu_iovec_reset(&ioreq->v);
+}
+
 static struct ioreq *ioreq_start(struct XenBlkDev *blkdev)
 {
     struct ioreq *ioreq = NULL;
@@ -132,7 +155,6 @@ static struct ioreq *ioreq_start(struct XenBlkDev *blkdev)
 	/* get one from freelist */
 	ioreq = LIST_FIRST(&blkdev->freelist);
 	LIST_REMOVE(ioreq, list);
-        qemu_iovec_reset(&ioreq->v);
     }
     LIST_INSERT_HEAD(&blkdev->inflight, ioreq, list);
     blkdev->requests_inflight++;
@@ -156,7 +178,7 @@ static void ioreq_release(struct ioreq *ioreq, bool finish)
     struct XenBlkDev *blkdev = ioreq->blkdev;
 
     LIST_REMOVE(ioreq, list);
-    memset(ioreq, 0, sizeof(*ioreq));
+    ioreq_reset(ioreq);
     ioreq->blkdev = blkdev;
     LIST_INSERT_HEAD(&blkdev->freelist, ioreq, list);
     if (finish) {
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git


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

From xen-changelog-bounces@lists.xen.org Thu Dec 05 11:11:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Dec 2013 11:11: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 1VoWpn-00048Z-66; Thu, 05 Dec 2013 11:11:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VoWpl-00048L-HI
	for xen-changelog@lists.xensource.com; Thu, 05 Dec 2013 11:11:05 +0000
Received: from [85.158.143.35:20322] by server-1.bemta-4.messagelabs.com id
	E2/92-02132-84F50A25; Thu, 05 Dec 2013 11:11:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1386241863!3579690!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20090 invoked from network); 5 Dec 2013 11:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2013 11:11: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 1VoWpj-0007EB-1G
	for xen-changelog@lists.xensource.com; Thu, 05 Dec 2013 11:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VoWpi-0006xe-Qa
	for xen-changelog@lists.xensource.com; Thu, 05 Dec 2013 11:11:02 +0000
Date: Thu, 05 Dec 2013 11:11:02 +0000
Message-Id: <E1VoWpi-0006xe-Qa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/AMD: work around erratum 793
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 922dc04b354fdf45dfd176552098853c79e3033a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 14:12:34 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 14:12:34 2013 +0100

    x86/AMD: work around erratum 793
    
    The recommendation is to set a bit in an MSR - do this if the firmware
    didn't, considering that otherwise we expose ourselves to a guest
    induced DoS.
    
    This is CVE-2013-6885 / XSA-82.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 98162f256ee33994a9881a720419dda9ad4c03a8
    master date: 2013-12-03 09:49:54 +0100
---
 xen/arch/x86/cpu/amd.c          |   14 ++++++++++++++
 xen/include/asm-x86/msr-index.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 27b7f71..dbe7398 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -476,6 +476,20 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		       "*** Pass \"allow_unsafe\" if you're trusting"
 		       " all your (PV) guest kernels. ***\n");
 
+	if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+		rdmsrl(MSR_AMD64_LS_CFG, value);
+		if (!(value & (1 << 15))) {
+			static bool_t warned;
+
+			if (c == &boot_cpu_data || opt_cpu_info ||
+			    !test_and_set_bool(warned))
+				printk(KERN_WARNING
+				       "CPU%u: Applying workaround for erratum 793\n",
+				       smp_processor_id());
+			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
+		}
+	}
+
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index f500efd..3356c6e 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -211,6 +211,7 @@
 
 /* AMD64 MSRs */
 #define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Dec 05 11:11:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Dec 2013 11:11: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 1VoWpn-00048Z-66; Thu, 05 Dec 2013 11:11:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VoWpl-00048L-HI
	for xen-changelog@lists.xensource.com; Thu, 05 Dec 2013 11:11:05 +0000
Received: from [85.158.143.35:20322] by server-1.bemta-4.messagelabs.com id
	E2/92-02132-84F50A25; Thu, 05 Dec 2013 11:11:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1386241863!3579690!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20090 invoked from network); 5 Dec 2013 11:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2013 11:11: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 1VoWpj-0007EB-1G
	for xen-changelog@lists.xensource.com; Thu, 05 Dec 2013 11:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VoWpi-0006xe-Qa
	for xen-changelog@lists.xensource.com; Thu, 05 Dec 2013 11:11:02 +0000
Date: Thu, 05 Dec 2013 11:11:02 +0000
Message-Id: <E1VoWpi-0006xe-Qa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/AMD: work around erratum 793
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 922dc04b354fdf45dfd176552098853c79e3033a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 3 14:12:34 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 3 14:12:34 2013 +0100

    x86/AMD: work around erratum 793
    
    The recommendation is to set a bit in an MSR - do this if the firmware
    didn't, considering that otherwise we expose ourselves to a guest
    induced DoS.
    
    This is CVE-2013-6885 / XSA-82.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 98162f256ee33994a9881a720419dda9ad4c03a8
    master date: 2013-12-03 09:49:54 +0100
---
 xen/arch/x86/cpu/amd.c          |   14 ++++++++++++++
 xen/include/asm-x86/msr-index.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 27b7f71..dbe7398 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -476,6 +476,20 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
 		       "*** Pass \"allow_unsafe\" if you're trusting"
 		       " all your (PV) guest kernels. ***\n");
 
+	if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+		rdmsrl(MSR_AMD64_LS_CFG, value);
+		if (!(value & (1 << 15))) {
+			static bool_t warned;
+
+			if (c == &boot_cpu_data || opt_cpu_info ||
+			    !test_and_set_bool(warned))
+				printk(KERN_WARNING
+				       "CPU%u: Applying workaround for erratum 793\n",
+				       smp_processor_id());
+			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
+		}
+	}
+
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index f500efd..3356c6e 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -211,6 +211,7 @@
 
 /* AMD64 MSRs */
 #define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_LS_CFG		0xc0011020
 #define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Dec 06 11:22:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Dec 2013 11:22: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 1VotTy-00028h-3e; Fri, 06 Dec 2013 11:22:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VotTx-00028c-Ky
	for xen-changelog@lists.xensource.com; Fri, 06 Dec 2013 11:22:05 +0000
Received: from [85.158.137.68:43013] by server-15.bemta-3.messagelabs.com id
	39/18-11556-C53B1A25; Fri, 06 Dec 2013 11:22:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-31.messagelabs.com!1386328923!2210561!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18181 invoked from network); 6 Dec 2013 11:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Dec 2013 11:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VotTu-0005oi-QU
	for xen-changelog@lists.xensource.com; Fri, 06 Dec 2013 11:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VotTu-00057h-Ke
	for xen-changelog@lists.xensource.com; Fri, 06 Dec 2013 11:22:02 +0000
Message-Id: <E1VotTu-00057h-Ke@xenbits.xen.org>
Date: Fri, 06 Dec 2013 11:22:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] netfront: fix missing
	rx_refill_timer when allocate memory 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

# HG changeset patch
# User Ma JieYue <jieyue.majy@alibaba-inc.com>
# Date 1386328625 -3600
# Node ID 2993033a77ca312a3370f0e77d74b68a9d0df708
# Parent  2427f3a0bac88b02829e4c3d75a349c596fa0dd7
netfront: fix missing rx_refill_timer when allocate memory failed

There was a bug in xennet_alloc_rx_buffers, when allocating page or
sk_buff failed, and at the same time rx_batch queue not empty,
the rx_refill_timer timer won't be scheduled. If finally the remaining
request buffers in rx ring less than what backend driver expected,
the backend driver would think of rx ring as full and start dropping packets.
In such situation, there is no way for the netfront driver to recover
automatically, so that the device can not work properly.

The patch fixes the problem by always scheduling rx_refill_timer timer when
alloc_page or __netdev_alloc_skb fails, no matter whether rx_batch queue is
empty or not. It ensures that the rx ring request buffers will finally meet
the backend needs.

Signed-off-by: Ma JieYue <jieyue.majy@alibaba-inc.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 2427f3a0bac8 -r 2993033a77ca drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Mon Oct 21 11:47:32 2013 +0200
+++ b/drivers/xen/netfront/netfront.c	Fri Dec 06 12:17:05 2013 +0100
@@ -756,12 +756,13 @@ static void network_alloc_rx_buffers(str
 		if (!page) {
 			kfree_skb(skb);
 no_skb:
+			/* Could not allocate enough skbuffs. Try again later. */
+			mod_timer(&np->rx_refill_timer,
+				  jiffies + (HZ/10));
+
 			/* Any skbuffs queued for refill? Force them out. */
 			if (i != 0)
 				goto refill;
-			/* Could not allocate any skbuffs. Try again later. */
-			mod_timer(&np->rx_refill_timer,
-				  jiffies + (HZ/10));
 			break;
 		}
 

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

From xen-changelog-bounces@lists.xen.org Fri Dec 06 11:22:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Dec 2013 11:22: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 1VotTy-00028h-3e; Fri, 06 Dec 2013 11:22:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VotTx-00028c-Ky
	for xen-changelog@lists.xensource.com; Fri, 06 Dec 2013 11:22:05 +0000
Received: from [85.158.137.68:43013] by server-15.bemta-3.messagelabs.com id
	39/18-11556-C53B1A25; Fri, 06 Dec 2013 11:22:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-31.messagelabs.com!1386328923!2210561!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18181 invoked from network); 6 Dec 2013 11:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Dec 2013 11:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VotTu-0005oi-QU
	for xen-changelog@lists.xensource.com; Fri, 06 Dec 2013 11:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VotTu-00057h-Ke
	for xen-changelog@lists.xensource.com; Fri, 06 Dec 2013 11:22:02 +0000
Message-Id: <E1VotTu-00057h-Ke@xenbits.xen.org>
Date: Fri, 06 Dec 2013 11:22:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] netfront: fix missing
	rx_refill_timer when allocate memory 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

# HG changeset patch
# User Ma JieYue <jieyue.majy@alibaba-inc.com>
# Date 1386328625 -3600
# Node ID 2993033a77ca312a3370f0e77d74b68a9d0df708
# Parent  2427f3a0bac88b02829e4c3d75a349c596fa0dd7
netfront: fix missing rx_refill_timer when allocate memory failed

There was a bug in xennet_alloc_rx_buffers, when allocating page or
sk_buff failed, and at the same time rx_batch queue not empty,
the rx_refill_timer timer won't be scheduled. If finally the remaining
request buffers in rx ring less than what backend driver expected,
the backend driver would think of rx ring as full and start dropping packets.
In such situation, there is no way for the netfront driver to recover
automatically, so that the device can not work properly.

The patch fixes the problem by always scheduling rx_refill_timer timer when
alloc_page or __netdev_alloc_skb fails, no matter whether rx_batch queue is
empty or not. It ensures that the rx ring request buffers will finally meet
the backend needs.

Signed-off-by: Ma JieYue <jieyue.majy@alibaba-inc.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 2427f3a0bac8 -r 2993033a77ca drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Mon Oct 21 11:47:32 2013 +0200
+++ b/drivers/xen/netfront/netfront.c	Fri Dec 06 12:17:05 2013 +0100
@@ -756,12 +756,13 @@ static void network_alloc_rx_buffers(str
 		if (!page) {
 			kfree_skb(skb);
 no_skb:
+			/* Could not allocate enough skbuffs. Try again later. */
+			mod_timer(&np->rx_refill_timer,
+				  jiffies + (HZ/10));
+
 			/* Any skbuffs queued for refill? Force them out. */
 			if (i != 0)
 				goto refill;
-			/* Could not allocate any skbuffs. Try again later. */
-			mod_timer(&np->rx_refill_timer,
-				  jiffies + (HZ/10));
 			break;
 		}
 

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:44:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:44: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 1VpULo-0002QH-CR; Sun, 08 Dec 2013 02:44:08 +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 1VpULn-0002Q9-0o
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:07 +0000
Received: from [193.109.254.147:25391] by server-7.bemta-14.messagelabs.com id
	BB/3F-15500-6FCD3A25; Sun, 08 Dec 2013 02:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1386470644!3659358!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14526 invoked from network); 8 Dec 2013 02:44:05 -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;
	8 Dec 2013 02:44: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 1VpULk-0004T1-1Q
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpULj-0000ag-Lb
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:03 +0000
Date: Sun, 08 Dec 2013 02:44:03 +0000
Message-Id: <E1VpULj-0000ag-Lb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arinc: Add poolid parameter to
	scheduler get/set functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81dcaaa97a21cb397cd326fdcb8f9953ea23ceff
Author:     Nathan Studer <nate.studer@dornerworks.com>
AuthorDate: Tue Dec 3 17:24:27 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:02:10 2013 +0000

    arinc: Add poolid parameter to scheduler get/set functions
    
    Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_arinc653.c |    6 ++++--
 tools/libxc/xenctrl.h     |    2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_arinc653.c b/tools/libxc/xc_arinc653.c
index fe2ddcb..5d61c1a 100644
--- a/tools/libxc/xc_arinc653.c
+++ b/tools/libxc/xc_arinc653.c
@@ -29,6 +29,7 @@
 int
 xc_sched_arinc653_schedule_set(
     xc_interface *xch,
+    uint32_t cpupool_id,
     struct xen_sysctl_arinc653_schedule *schedule)
 {
     int rc;
@@ -42,7 +43,7 @@ xc_sched_arinc653_schedule_set(
         return -1;
 
     sysctl.cmd = XEN_SYSCTL_scheduler_op;
-    sysctl.u.scheduler_op.cpupool_id = 0;
+    sysctl.u.scheduler_op.cpupool_id = cpupool_id;
     sysctl.u.scheduler_op.sched_id = XEN_SCHEDULER_ARINC653;
     sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_putinfo;
     set_xen_guest_handle(sysctl.u.scheduler_op.u.sched_arinc653.schedule,
@@ -58,6 +59,7 @@ xc_sched_arinc653_schedule_set(
 int
 xc_sched_arinc653_schedule_get(
     xc_interface *xch,
+    uint32_t cpupool_id,
     struct xen_sysctl_arinc653_schedule *schedule)
 {
     int rc;
@@ -71,7 +73,7 @@ xc_sched_arinc653_schedule_get(
         return -1;
 
     sysctl.cmd = XEN_SYSCTL_scheduler_op;
-    sysctl.u.scheduler_op.cpupool_id = 0;
+    sysctl.u.scheduler_op.cpupool_id = cpupool_id;
     sysctl.u.scheduler_op.sched_id = XEN_SCHEDULER_ARINC653;
     sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_getinfo;
     set_xen_guest_handle(sysctl.u.scheduler_op.u.sched_arinc653.schedule,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 4ac6b8a..cced208 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -796,11 +796,13 @@ int xc_sched_credit2_domain_get(xc_interface *xch,
 int
 xc_sched_arinc653_schedule_set(
     xc_interface *xch,
+    uint32_t cpupool_id,
     struct xen_sysctl_arinc653_schedule *schedule);
 
 int
 xc_sched_arinc653_schedule_get(
     xc_interface *xch,
+    uint32_t cpupool_id,
     struct xen_sysctl_arinc653_schedule *schedule);
 
 /**
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:44:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:44: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 1VpULo-0002QH-CR; Sun, 08 Dec 2013 02:44:08 +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 1VpULn-0002Q9-0o
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:07 +0000
Received: from [193.109.254.147:25391] by server-7.bemta-14.messagelabs.com id
	BB/3F-15500-6FCD3A25; Sun, 08 Dec 2013 02:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1386470644!3659358!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14526 invoked from network); 8 Dec 2013 02:44:05 -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;
	8 Dec 2013 02:44: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 1VpULk-0004T1-1Q
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpULj-0000ag-Lb
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:03 +0000
Date: Sun, 08 Dec 2013 02:44:03 +0000
Message-Id: <E1VpULj-0000ag-Lb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arinc: Add poolid parameter to
	scheduler get/set functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81dcaaa97a21cb397cd326fdcb8f9953ea23ceff
Author:     Nathan Studer <nate.studer@dornerworks.com>
AuthorDate: Tue Dec 3 17:24:27 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:02:10 2013 +0000

    arinc: Add poolid parameter to scheduler get/set functions
    
    Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_arinc653.c |    6 ++++--
 tools/libxc/xenctrl.h     |    2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_arinc653.c b/tools/libxc/xc_arinc653.c
index fe2ddcb..5d61c1a 100644
--- a/tools/libxc/xc_arinc653.c
+++ b/tools/libxc/xc_arinc653.c
@@ -29,6 +29,7 @@
 int
 xc_sched_arinc653_schedule_set(
     xc_interface *xch,
+    uint32_t cpupool_id,
     struct xen_sysctl_arinc653_schedule *schedule)
 {
     int rc;
@@ -42,7 +43,7 @@ xc_sched_arinc653_schedule_set(
         return -1;
 
     sysctl.cmd = XEN_SYSCTL_scheduler_op;
-    sysctl.u.scheduler_op.cpupool_id = 0;
+    sysctl.u.scheduler_op.cpupool_id = cpupool_id;
     sysctl.u.scheduler_op.sched_id = XEN_SCHEDULER_ARINC653;
     sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_putinfo;
     set_xen_guest_handle(sysctl.u.scheduler_op.u.sched_arinc653.schedule,
@@ -58,6 +59,7 @@ xc_sched_arinc653_schedule_set(
 int
 xc_sched_arinc653_schedule_get(
     xc_interface *xch,
+    uint32_t cpupool_id,
     struct xen_sysctl_arinc653_schedule *schedule)
 {
     int rc;
@@ -71,7 +73,7 @@ xc_sched_arinc653_schedule_get(
         return -1;
 
     sysctl.cmd = XEN_SYSCTL_scheduler_op;
-    sysctl.u.scheduler_op.cpupool_id = 0;
+    sysctl.u.scheduler_op.cpupool_id = cpupool_id;
     sysctl.u.scheduler_op.sched_id = XEN_SCHEDULER_ARINC653;
     sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_getinfo;
     set_xen_guest_handle(sysctl.u.scheduler_op.u.sched_arinc653.schedule,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 4ac6b8a..cced208 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -796,11 +796,13 @@ int xc_sched_credit2_domain_get(xc_interface *xch,
 int
 xc_sched_arinc653_schedule_set(
     xc_interface *xch,
+    uint32_t cpupool_id,
     struct xen_sysctl_arinc653_schedule *schedule);
 
 int
 xc_sched_arinc653_schedule_get(
     xc_interface *xch,
+    uint32_t cpupool_id,
     struct xen_sysctl_arinc653_schedule *schedule);
 
 /**
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:44:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:44: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 1VpULz-0002Qs-F9; Sun, 08 Dec 2013 02:44: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 1VpULx-0002Qg-Vb
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:18 +0000
Received: from [85.158.137.68:52567] by server-10.bemta-3.messagelabs.com id
	08/6E-23989-00DD3A25; Sun, 08 Dec 2013 02:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1386470654!1298565!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18276 invoked from network); 8 Dec 2013 02:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:44: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 1VpULu-0004T4-HL
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpULu-0000bT-EV
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:14 +0000
Date: Sun, 08 Dec 2013 02:44:14 +0000
Message-Id: <E1VpULu-0000bT-EV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] nested VMX: fix I/O port exit emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e1978480c76e36bc22ec12657121ac91d08aca6b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 4 13:23:27 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 4 13:23:27 2013 +0100

    nested VMX: fix I/O port exit emulation
    
    For multi-byte operations all affected ports' bits in the bitmap need
    to be checked, not just the first port's one.
    
    Reported-by: Matthew Daley <mattd@bugfuzz.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 7fa110e..0cc32e1 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -2134,7 +2134,6 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     u32 ctrl;
-    u8 *bitmap;
 
     nvcpu->nv_vmexit_pending = 0;
     nvmx->intr.intr_info = 0;
@@ -2220,15 +2219,23 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         if ( ctrl & CPU_BASED_ACTIVATE_IO_BITMAP )
         {
             unsigned long qual;
-            u16 port;
+            u16 port, size;
 
             __vmread(EXIT_QUALIFICATION, &qual);
             port = qual >> 16;
-            bitmap = nvmx->iobitmap[port >> 15];
-            if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 0x7)) )
-                nvcpu->nv_vmexit_pending = 1;
+            size = (qual & 7) + 1;
+            do {
+                const u8 *bitmap = nvmx->iobitmap[port >> 15];
+
+                if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 7)) )
+                    nvcpu->nv_vmexit_pending = 1;
+                if ( !--size )
+                    break;
+                if ( !++port )
+                    nvcpu->nv_vmexit_pending = 1;
+            } while ( !nvcpu->nv_vmexit_pending );
             if ( !nvcpu->nv_vmexit_pending )
-               gdprintk(XENLOG_WARNING, "L0 PIO %x.\n", port);
+                printk(XENLOG_G_WARNING "L0 PIO %04x\n", port);
         }
         else if ( ctrl & CPU_BASED_UNCOND_IO_EXITING )
             nvcpu->nv_vmexit_pending = 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 Sun Dec 08 02:44:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:44: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 1VpULz-0002Qs-F9; Sun, 08 Dec 2013 02:44: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 1VpULx-0002Qg-Vb
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:18 +0000
Received: from [85.158.137.68:52567] by server-10.bemta-3.messagelabs.com id
	08/6E-23989-00DD3A25; Sun, 08 Dec 2013 02:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1386470654!1298565!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18276 invoked from network); 8 Dec 2013 02:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:44: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 1VpULu-0004T4-HL
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpULu-0000bT-EV
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:14 +0000
Date: Sun, 08 Dec 2013 02:44:14 +0000
Message-Id: <E1VpULu-0000bT-EV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] nested VMX: fix I/O port exit emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e1978480c76e36bc22ec12657121ac91d08aca6b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 4 13:23:27 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 4 13:23:27 2013 +0100

    nested VMX: fix I/O port exit emulation
    
    For multi-byte operations all affected ports' bits in the bitmap need
    to be checked, not just the first port's one.
    
    Reported-by: Matthew Daley <mattd@bugfuzz.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 7fa110e..0cc32e1 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -2134,7 +2134,6 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     u32 ctrl;
-    u8 *bitmap;
 
     nvcpu->nv_vmexit_pending = 0;
     nvmx->intr.intr_info = 0;
@@ -2220,15 +2219,23 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         if ( ctrl & CPU_BASED_ACTIVATE_IO_BITMAP )
         {
             unsigned long qual;
-            u16 port;
+            u16 port, size;
 
             __vmread(EXIT_QUALIFICATION, &qual);
             port = qual >> 16;
-            bitmap = nvmx->iobitmap[port >> 15];
-            if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 0x7)) )
-                nvcpu->nv_vmexit_pending = 1;
+            size = (qual & 7) + 1;
+            do {
+                const u8 *bitmap = nvmx->iobitmap[port >> 15];
+
+                if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 7)) )
+                    nvcpu->nv_vmexit_pending = 1;
+                if ( !--size )
+                    break;
+                if ( !++port )
+                    nvcpu->nv_vmexit_pending = 1;
+            } while ( !nvcpu->nv_vmexit_pending );
             if ( !nvcpu->nv_vmexit_pending )
-               gdprintk(XENLOG_WARNING, "L0 PIO %x.\n", port);
+                printk(XENLOG_G_WARNING "L0 PIO %04x\n", port);
         }
         else if ( ctrl & CPU_BASED_UNCOND_IO_EXITING )
             nvcpu->nv_vmexit_pending = 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 Sun Dec 08 02:44:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:44: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 1VpUMA-0002Sj-5D; Sun, 08 Dec 2013 02:44: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 1VpUM9-0002SZ-1E
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:29 +0000
Received: from [85.158.139.211:39010] by server-13.bemta-5.messagelabs.com id
	70/AB-11357-C0DD3A25; Sun, 08 Dec 2013 02:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1386470664!2999016!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20776 invoked from network); 8 Dec 2013 02:44:25 -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;
	8 Dec 2013 02:44: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 1VpUM4-0004TD-N2
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUM4-0000bp-Ki
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:24 +0000
Date: Sun, 08 Dec 2013 02:44:24 +0000
Message-Id: <E1VpUM4-0000bp-Ki@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix early boot command line
	parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc37e0bfffc673f4bdce1d69ad86098bfb0ab531
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Wed Dec 4 13:26:37 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 4 13:26:37 2013 +0100

    x86: fix early boot command line parsing
    
    There is no reliable way to encode NUL character as a character so encode
    it as a number. Read: http://sourceware.org/binutils/docs/as/Characters.html.
    Octal and hex encoding do not work on at least one system (GNU assembler
    version 2.22 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.22).
    Without this fix e.g. no-real-mode option at the end of xen.gz command line
    is not detected.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/boot/cmdline.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/cmdline.S b/xen/arch/x86/boot/cmdline.S
index 05ffb94..e1f4595 100644
--- a/xen/arch/x86/boot/cmdline.S
+++ b/xen/arch/x86/boot/cmdline.S
@@ -138,7 +138,8 @@
         call    .Lstrlen
         add     $4,%esp
         xadd    %eax,%ebx
-        cmpb    $'\0',(%ebx)
+        /* NUL check (as $'\0' == 0x30 in GAS) */
+        cmpb    $0,(%ebx)
         je      3f
         cmpb    $' ',(%ebx)
         je      3f
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:44:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:44: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 1VpUMA-0002Sj-5D; Sun, 08 Dec 2013 02:44: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 1VpUM9-0002SZ-1E
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:29 +0000
Received: from [85.158.139.211:39010] by server-13.bemta-5.messagelabs.com id
	70/AB-11357-C0DD3A25; Sun, 08 Dec 2013 02:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1386470664!2999016!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20776 invoked from network); 8 Dec 2013 02:44:25 -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;
	8 Dec 2013 02:44: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 1VpUM4-0004TD-N2
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUM4-0000bp-Ki
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:24 +0000
Date: Sun, 08 Dec 2013 02:44:24 +0000
Message-Id: <E1VpUM4-0000bp-Ki@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix early boot command line
	parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc37e0bfffc673f4bdce1d69ad86098bfb0ab531
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Wed Dec 4 13:26:37 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 4 13:26:37 2013 +0100

    x86: fix early boot command line parsing
    
    There is no reliable way to encode NUL character as a character so encode
    it as a number. Read: http://sourceware.org/binutils/docs/as/Characters.html.
    Octal and hex encoding do not work on at least one system (GNU assembler
    version 2.22 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.22).
    Without this fix e.g. no-real-mode option at the end of xen.gz command line
    is not detected.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/boot/cmdline.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/cmdline.S b/xen/arch/x86/boot/cmdline.S
index 05ffb94..e1f4595 100644
--- a/xen/arch/x86/boot/cmdline.S
+++ b/xen/arch/x86/boot/cmdline.S
@@ -138,7 +138,8 @@
         call    .Lstrlen
         add     $4,%esp
         xadd    %eax,%ebx
-        cmpb    $'\0',(%ebx)
+        /* NUL check (as $'\0' == 0x30 in GAS) */
+        cmpb    $0,(%ebx)
         je      3f
         cmpb    $' ',(%ebx)
         je      3f
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:44:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02: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 1VpUMJ-0002U8-86; Sun, 08 Dec 2013 02:44: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 1VpUMI-0002Ts-9B
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:38 +0000
Received: from [85.158.139.211:61047] by server-16.bemta-5.messagelabs.com id
	99/4E-11843-51DD3A25; Sun, 08 Dec 2013 02:44:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1386470675!2986675!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31016 invoked from network); 8 Dec 2013 02:44:36 -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;
	8 Dec 2013 02:44: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 1VpUME-0004TM-SF
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUME-0000cX-Ph
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:34 +0000
Date: Sun, 08 Dec 2013 02:44:34 +0000
Message-Id: <E1VpUME-0000cX-Ph@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arinc: add cpu-pool support to
	scheduler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9f0c658baedcd0f3f71c35b54965e440ffef0e45
Author:     Nathan Studer <nate.studer@dornerworks.com>
AuthorDate: Wed Dec 4 13:29:00 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 4 13:29:00 2013 +0100

    arinc: add cpu-pool support to scheduler
    
    1.  Remove the restriction that dom0 must be in the schedule, since dom-0 may
    not belong to the scheduler's pool.
    2.  Add a schedule entry for each of dom-0's vcpus as they are created.
    3.  Add code to deal with empty schedules in the do_schedule function.
    4.  Call the correct idle task for the pcpu on which the scheduling decision
    is being made in do_schedule.
    5.  Add code to prevent migration of a vcpu.
    6.  Implement a proper cpu_pick function, which prefers the current processor.
    7.  Add a scheduler lock to protect access to global variables from multiple
        PCPUs.
    
    These changes do not implement arinc653 multicore.  Since the schedule only
    supports 1 vcpu entry per slot, even if the vcpus of a domain are run on
    multiple pcpus, the scheduler will essentially serialize their execution.
    
    Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/common/sched_arinc653.c |  111 ++++++++++++++++++++++++++++++++----------
 1 files changed, 84 insertions(+), 27 deletions(-)

diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index f4eb943..5f09ded 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -41,6 +41,11 @@
  **************************************************************************/
 
 /**
+ * Default timeslice for domain 0.
+ */
+#define DEFAULT_TIMESLICE MILLISECS(10)
+
+/**
  * Retrieve the idle VCPU for a given physical CPU
  */
 #define IDLETASK(cpu)  (idle_vcpu[cpu])
@@ -100,6 +105,9 @@ typedef struct sched_entry_s
  */
 typedef struct a653sched_priv_s
 {
+    /* lock for the whole pluggable scheduler, nests inside cpupool_lock */
+    spinlock_t lock;
+
     /**
      * This array holds the active ARINC 653 schedule.
      *
@@ -119,7 +127,7 @@ typedef struct a653sched_priv_s
      * or a domain with multiple VCPUs could have a different
      * schedule entry for each VCPU.
      */
-    int num_schedule_entries;
+    unsigned int num_schedule_entries;
 
     /**
      * the major frame time for the ARINC 653 schedule.
@@ -224,9 +232,11 @@ arinc653_sched_set(
 {
     a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
     s_time_t total_runtime = 0;
-    bool_t found_dom0 = 0;
-    const static xen_domain_handle_t dom0_handle = {0};
     unsigned int i;
+    unsigned long flags;
+    int rc = -EINVAL;
+
+    spin_lock_irqsave(&sched_priv->lock, flags);
 
     /* Check for valid major frame and number of schedule entries. */
     if ( (schedule->major_frame <= 0)
@@ -236,10 +246,6 @@ arinc653_sched_set(
 
     for ( i = 0; i < schedule->num_sched_entries; i++ )
     {
-        if ( dom_handle_cmp(schedule->sched_entries[i].dom_handle,
-                            dom0_handle) == 0 )
-            found_dom0 = 1;
-
         /* Check for a valid VCPU ID and run time. */
         if ( (schedule->sched_entries[i].vcpu_id >= MAX_VIRT_CPUS)
              || (schedule->sched_entries[i].runtime <= 0) )
@@ -249,10 +255,6 @@ arinc653_sched_set(
         total_runtime += schedule->sched_entries[i].runtime;
     }
 
-    /* Error if the schedule doesn't contain a slot for domain 0. */
-    if ( !found_dom0 )
-        goto fail;
-
     /*
      * Error if the major frame is not large enough to run all entries as
      * indicated by comparing the total run time to the major frame length.
@@ -284,10 +286,11 @@ arinc653_sched_set(
      */
     sched_priv->next_major_frame = NOW();
 
-    return 0;
+    rc = 0;
 
  fail:
-    return -EINVAL;
+    spin_unlock_irqrestore(&sched_priv->lock, flags);
+    return rc;
 }
 
 /**
@@ -307,6 +310,9 @@ arinc653_sched_get(
 {
     a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
     unsigned int i;
+    unsigned long flags;
+
+    spin_lock_irqsave(&sched_priv->lock, flags);
 
     schedule->num_sched_entries = sched_priv->num_schedule_entries;
     schedule->major_frame = sched_priv->major_frame;
@@ -319,6 +325,8 @@ arinc653_sched_get(
         schedule->sched_entries[i].runtime = sched_priv->schedule[i].runtime;
     }
 
+    spin_unlock_irqrestore(&sched_priv->lock, flags);
+
     return 0;
 }
 
@@ -347,13 +355,8 @@ a653sched_init(struct scheduler *ops)
 
     ops->sched_data = prv;
 
-    prv->schedule[0].dom_handle[0] = '\0';
-    prv->schedule[0].vcpu_id = 0;
-    prv->schedule[0].runtime = MILLISECS(10);
-    prv->schedule[0].vc = NULL;
-    prv->num_schedule_entries = 1;
-    prv->major_frame = MILLISECS(10);
     prv->next_major_frame = 0;
+    spin_lock_init(&prv->lock);
     INIT_LIST_HEAD(&prv->vcpu_list);
 
     return 0;
@@ -380,7 +383,10 @@ a653sched_deinit(const struct scheduler *ops)
 static void *
 a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
 {
+    a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
     arinc653_vcpu_t *svc;
+    unsigned int entry;
+    unsigned long flags;
 
     /*
      * Allocate memory for the ARINC 653-specific scheduler data information
@@ -390,6 +396,28 @@ a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
     if ( svc == NULL )
         return NULL;
 
+    spin_lock_irqsave(&sched_priv->lock, flags);
+
+    /* 
+     * Add every one of dom0's vcpus to the schedule, as long as there are
+     * slots available.
+     */
+    if ( vc->domain->domain_id == 0 )
+    {
+        entry = sched_priv->num_schedule_entries;
+
+        if ( entry < ARINC653_MAX_DOMAINS_PER_SCHEDULE )
+        {
+            sched_priv->schedule[entry].dom_handle[0] = '\0';
+            sched_priv->schedule[entry].vcpu_id = vc->vcpu_id;
+            sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
+            sched_priv->schedule[entry].vc = vc;
+
+            sched_priv->major_frame += DEFAULT_TIMESLICE;
+            ++sched_priv->num_schedule_entries;
+        }
+    }
+
     /*
      * Initialize our ARINC 653 scheduler-specific information for the VCPU.
      * The VCPU starts "asleep." When Xen is ready for the VCPU to run, it
@@ -402,6 +430,8 @@ a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
         list_add(&svc->list, &SCHED_PRIV(ops)->vcpu_list);
     update_schedule_vcpus(ops);
 
+    spin_unlock_irqrestore(&sched_priv->lock, flags);
+
     return svc;
 }
 
@@ -535,11 +565,17 @@ a653sched_do_schedule(
 {
     struct task_slice ret;                      /* hold the chosen domain */
     struct vcpu * new_task = NULL;
-    static int sched_index = 0;
+    static unsigned int sched_index = 0;
     static s_time_t next_switch_time;
     a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
+    const unsigned int cpu = smp_processor_id();
+    unsigned long flags;
+
+    spin_lock_irqsave(&sched_priv->lock, flags);
 
-    if ( now >= sched_priv->next_major_frame )
+    if ( sched_priv->num_schedule_entries < 1 )
+        sched_priv->next_major_frame = now + DEFAULT_TIMESLICE;
+    else if ( now >= sched_priv->next_major_frame )
     {
         /* time to enter a new major frame
          * the first time this function is called, this will be true */
@@ -574,14 +610,14 @@ a653sched_do_schedule(
      */
     new_task = (sched_index < sched_priv->num_schedule_entries)
         ? sched_priv->schedule[sched_index].vc
-        : IDLETASK(0);
+        : IDLETASK(cpu);
 
     /* Check to see if the new task can be run (awake & runnable). */
     if ( !((new_task != NULL)
            && (AVCPU(new_task) != NULL)
            && AVCPU(new_task)->awake
            && vcpu_runnable(new_task)) )
-        new_task = IDLETASK(0);
+        new_task = IDLETASK(cpu);
     BUG_ON(new_task == NULL);
 
     /*
@@ -590,9 +626,16 @@ a653sched_do_schedule(
      */
     BUG_ON(now >= sched_priv->next_major_frame);
 
+    spin_unlock_irqrestore(&sched_priv->lock, flags);
+
     /* Tasklet work (which runs in idle VCPU context) overrides all else. */
     if ( tasklet_work_scheduled )
-        new_task = IDLETASK(0);
+        new_task = IDLETASK(cpu);
+
+    /* Running this task would result in a migration */
+    if ( !is_idle_vcpu(new_task)
+         && (new_task->processor != cpu) )
+        new_task = IDLETASK(cpu);
 
     /*
      * Return the amount of time the next domain has to run and the address
@@ -600,7 +643,7 @@ a653sched_do_schedule(
      */
     ret.time = next_switch_time - now;
     ret.task = new_task;
-    ret.migrated = 0;               /* we do not support migration */
+    ret.migrated = 0;
 
     BUG_ON(ret.time <= 0);
 
@@ -618,8 +661,22 @@ a653sched_do_schedule(
 static int
 a653sched_pick_cpu(const struct scheduler *ops, struct vcpu *vc)
 {
-    /* this implementation only supports one physical CPU */
-    return 0;
+    cpumask_t *online;
+    unsigned int cpu;
+
+    /* 
+     * If present, prefer vc's current processor, else
+     * just find the first valid vcpu .
+     */
+    online = cpupool_scheduler_cpumask(vc->domain->cpupool);
+
+    cpu = cpumask_first(online);
+
+    if ( cpumask_test_cpu(vc->processor, online)
+         || (cpu >= nr_cpu_ids) )
+        cpu = vc->processor;
+
+    return 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 Sun Dec 08 02:44:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02: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 1VpUMJ-0002U8-86; Sun, 08 Dec 2013 02:44: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 1VpUMI-0002Ts-9B
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:38 +0000
Received: from [85.158.139.211:61047] by server-16.bemta-5.messagelabs.com id
	99/4E-11843-51DD3A25; Sun, 08 Dec 2013 02:44:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1386470675!2986675!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31016 invoked from network); 8 Dec 2013 02:44:36 -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;
	8 Dec 2013 02:44: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 1VpUME-0004TM-SF
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUME-0000cX-Ph
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:34 +0000
Date: Sun, 08 Dec 2013 02:44:34 +0000
Message-Id: <E1VpUME-0000cX-Ph@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arinc: add cpu-pool support to
	scheduler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9f0c658baedcd0f3f71c35b54965e440ffef0e45
Author:     Nathan Studer <nate.studer@dornerworks.com>
AuthorDate: Wed Dec 4 13:29:00 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 4 13:29:00 2013 +0100

    arinc: add cpu-pool support to scheduler
    
    1.  Remove the restriction that dom0 must be in the schedule, since dom-0 may
    not belong to the scheduler's pool.
    2.  Add a schedule entry for each of dom-0's vcpus as they are created.
    3.  Add code to deal with empty schedules in the do_schedule function.
    4.  Call the correct idle task for the pcpu on which the scheduling decision
    is being made in do_schedule.
    5.  Add code to prevent migration of a vcpu.
    6.  Implement a proper cpu_pick function, which prefers the current processor.
    7.  Add a scheduler lock to protect access to global variables from multiple
        PCPUs.
    
    These changes do not implement arinc653 multicore.  Since the schedule only
    supports 1 vcpu entry per slot, even if the vcpus of a domain are run on
    multiple pcpus, the scheduler will essentially serialize their execution.
    
    Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/common/sched_arinc653.c |  111 ++++++++++++++++++++++++++++++++----------
 1 files changed, 84 insertions(+), 27 deletions(-)

diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index f4eb943..5f09ded 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -41,6 +41,11 @@
  **************************************************************************/
 
 /**
+ * Default timeslice for domain 0.
+ */
+#define DEFAULT_TIMESLICE MILLISECS(10)
+
+/**
  * Retrieve the idle VCPU for a given physical CPU
  */
 #define IDLETASK(cpu)  (idle_vcpu[cpu])
@@ -100,6 +105,9 @@ typedef struct sched_entry_s
  */
 typedef struct a653sched_priv_s
 {
+    /* lock for the whole pluggable scheduler, nests inside cpupool_lock */
+    spinlock_t lock;
+
     /**
      * This array holds the active ARINC 653 schedule.
      *
@@ -119,7 +127,7 @@ typedef struct a653sched_priv_s
      * or a domain with multiple VCPUs could have a different
      * schedule entry for each VCPU.
      */
-    int num_schedule_entries;
+    unsigned int num_schedule_entries;
 
     /**
      * the major frame time for the ARINC 653 schedule.
@@ -224,9 +232,11 @@ arinc653_sched_set(
 {
     a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
     s_time_t total_runtime = 0;
-    bool_t found_dom0 = 0;
-    const static xen_domain_handle_t dom0_handle = {0};
     unsigned int i;
+    unsigned long flags;
+    int rc = -EINVAL;
+
+    spin_lock_irqsave(&sched_priv->lock, flags);
 
     /* Check for valid major frame and number of schedule entries. */
     if ( (schedule->major_frame <= 0)
@@ -236,10 +246,6 @@ arinc653_sched_set(
 
     for ( i = 0; i < schedule->num_sched_entries; i++ )
     {
-        if ( dom_handle_cmp(schedule->sched_entries[i].dom_handle,
-                            dom0_handle) == 0 )
-            found_dom0 = 1;
-
         /* Check for a valid VCPU ID and run time. */
         if ( (schedule->sched_entries[i].vcpu_id >= MAX_VIRT_CPUS)
              || (schedule->sched_entries[i].runtime <= 0) )
@@ -249,10 +255,6 @@ arinc653_sched_set(
         total_runtime += schedule->sched_entries[i].runtime;
     }
 
-    /* Error if the schedule doesn't contain a slot for domain 0. */
-    if ( !found_dom0 )
-        goto fail;
-
     /*
      * Error if the major frame is not large enough to run all entries as
      * indicated by comparing the total run time to the major frame length.
@@ -284,10 +286,11 @@ arinc653_sched_set(
      */
     sched_priv->next_major_frame = NOW();
 
-    return 0;
+    rc = 0;
 
  fail:
-    return -EINVAL;
+    spin_unlock_irqrestore(&sched_priv->lock, flags);
+    return rc;
 }
 
 /**
@@ -307,6 +310,9 @@ arinc653_sched_get(
 {
     a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
     unsigned int i;
+    unsigned long flags;
+
+    spin_lock_irqsave(&sched_priv->lock, flags);
 
     schedule->num_sched_entries = sched_priv->num_schedule_entries;
     schedule->major_frame = sched_priv->major_frame;
@@ -319,6 +325,8 @@ arinc653_sched_get(
         schedule->sched_entries[i].runtime = sched_priv->schedule[i].runtime;
     }
 
+    spin_unlock_irqrestore(&sched_priv->lock, flags);
+
     return 0;
 }
 
@@ -347,13 +355,8 @@ a653sched_init(struct scheduler *ops)
 
     ops->sched_data = prv;
 
-    prv->schedule[0].dom_handle[0] = '\0';
-    prv->schedule[0].vcpu_id = 0;
-    prv->schedule[0].runtime = MILLISECS(10);
-    prv->schedule[0].vc = NULL;
-    prv->num_schedule_entries = 1;
-    prv->major_frame = MILLISECS(10);
     prv->next_major_frame = 0;
+    spin_lock_init(&prv->lock);
     INIT_LIST_HEAD(&prv->vcpu_list);
 
     return 0;
@@ -380,7 +383,10 @@ a653sched_deinit(const struct scheduler *ops)
 static void *
 a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
 {
+    a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
     arinc653_vcpu_t *svc;
+    unsigned int entry;
+    unsigned long flags;
 
     /*
      * Allocate memory for the ARINC 653-specific scheduler data information
@@ -390,6 +396,28 @@ a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
     if ( svc == NULL )
         return NULL;
 
+    spin_lock_irqsave(&sched_priv->lock, flags);
+
+    /* 
+     * Add every one of dom0's vcpus to the schedule, as long as there are
+     * slots available.
+     */
+    if ( vc->domain->domain_id == 0 )
+    {
+        entry = sched_priv->num_schedule_entries;
+
+        if ( entry < ARINC653_MAX_DOMAINS_PER_SCHEDULE )
+        {
+            sched_priv->schedule[entry].dom_handle[0] = '\0';
+            sched_priv->schedule[entry].vcpu_id = vc->vcpu_id;
+            sched_priv->schedule[entry].runtime = DEFAULT_TIMESLICE;
+            sched_priv->schedule[entry].vc = vc;
+
+            sched_priv->major_frame += DEFAULT_TIMESLICE;
+            ++sched_priv->num_schedule_entries;
+        }
+    }
+
     /*
      * Initialize our ARINC 653 scheduler-specific information for the VCPU.
      * The VCPU starts "asleep." When Xen is ready for the VCPU to run, it
@@ -402,6 +430,8 @@ a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
         list_add(&svc->list, &SCHED_PRIV(ops)->vcpu_list);
     update_schedule_vcpus(ops);
 
+    spin_unlock_irqrestore(&sched_priv->lock, flags);
+
     return svc;
 }
 
@@ -535,11 +565,17 @@ a653sched_do_schedule(
 {
     struct task_slice ret;                      /* hold the chosen domain */
     struct vcpu * new_task = NULL;
-    static int sched_index = 0;
+    static unsigned int sched_index = 0;
     static s_time_t next_switch_time;
     a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
+    const unsigned int cpu = smp_processor_id();
+    unsigned long flags;
+
+    spin_lock_irqsave(&sched_priv->lock, flags);
 
-    if ( now >= sched_priv->next_major_frame )
+    if ( sched_priv->num_schedule_entries < 1 )
+        sched_priv->next_major_frame = now + DEFAULT_TIMESLICE;
+    else if ( now >= sched_priv->next_major_frame )
     {
         /* time to enter a new major frame
          * the first time this function is called, this will be true */
@@ -574,14 +610,14 @@ a653sched_do_schedule(
      */
     new_task = (sched_index < sched_priv->num_schedule_entries)
         ? sched_priv->schedule[sched_index].vc
-        : IDLETASK(0);
+        : IDLETASK(cpu);
 
     /* Check to see if the new task can be run (awake & runnable). */
     if ( !((new_task != NULL)
            && (AVCPU(new_task) != NULL)
            && AVCPU(new_task)->awake
            && vcpu_runnable(new_task)) )
-        new_task = IDLETASK(0);
+        new_task = IDLETASK(cpu);
     BUG_ON(new_task == NULL);
 
     /*
@@ -590,9 +626,16 @@ a653sched_do_schedule(
      */
     BUG_ON(now >= sched_priv->next_major_frame);
 
+    spin_unlock_irqrestore(&sched_priv->lock, flags);
+
     /* Tasklet work (which runs in idle VCPU context) overrides all else. */
     if ( tasklet_work_scheduled )
-        new_task = IDLETASK(0);
+        new_task = IDLETASK(cpu);
+
+    /* Running this task would result in a migration */
+    if ( !is_idle_vcpu(new_task)
+         && (new_task->processor != cpu) )
+        new_task = IDLETASK(cpu);
 
     /*
      * Return the amount of time the next domain has to run and the address
@@ -600,7 +643,7 @@ a653sched_do_schedule(
      */
     ret.time = next_switch_time - now;
     ret.task = new_task;
-    ret.migrated = 0;               /* we do not support migration */
+    ret.migrated = 0;
 
     BUG_ON(ret.time <= 0);
 
@@ -618,8 +661,22 @@ a653sched_do_schedule(
 static int
 a653sched_pick_cpu(const struct scheduler *ops, struct vcpu *vc)
 {
-    /* this implementation only supports one physical CPU */
-    return 0;
+    cpumask_t *online;
+    unsigned int cpu;
+
+    /* 
+     * If present, prefer vc's current processor, else
+     * just find the first valid vcpu .
+     */
+    online = cpupool_scheduler_cpumask(vc->domain->cpupool);
+
+    cpu = cpumask_first(online);
+
+    if ( cpumask_test_cpu(vc->processor, online)
+         || (cpu >= nr_cpu_ids) )
+        cpu = vc->processor;
+
+    return 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 Sun Dec 08 02:44:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02: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 1VpUMT-0002Wa-As; Sun, 08 Dec 2013 02:44:49 +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 1VpUMR-0002WC-Po
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:47 +0000
Received: from [193.109.254.147:32254] by server-15.bemta-14.messagelabs.com
	id 5B/49-22186-F1DD3A25; Sun, 08 Dec 2013 02:44:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1386470685!3655364!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5626 invoked from network); 8 Dec 2013 02:44:46 -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 Dec 2013 02:44: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 1VpUMP-0004TU-3j
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUMP-0000ct-1C
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:45 +0000
Date: Sun, 08 Dec 2013 02:44:45 +0000
Message-Id: <E1VpUMP-0000ct-1C@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 375c911acc373b4765c0b6e53203e37ae4eb3745
Merge: 81dcaaa97a21cb397cd326fdcb8f9953ea23ceff 9f0c658baedcd0f3f71c35b54965e440ffef0e45
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 4 14:29:39 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:29:39 2013 +0000

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 tools/libxl/libxl.c                  |   19 +-----
 tools/libxl/libxl_dom.c              |   35 ++++-------
 xen/arch/arm/arm32/vfp.c             |    2 +-
 xen/arch/arm/arm64/traps.c           |    2 +-
 xen/arch/arm/domain_build.c          |   18 +++---
 xen/arch/arm/early_printk.c          |    2 +-
 xen/arch/arm/gic.c                   |   16 +++---
 xen/arch/arm/kernel.c                |    8 +-
 xen/arch/arm/mm.c                    |    2 +-
 xen/arch/arm/platform.c              |    2 +-
 xen/arch/arm/setup.c                 |   10 ++--
 xen/arch/arm/smpboot.c               |    2 +-
 xen/arch/arm/time.c                  |    8 +-
 xen/arch/arm/traps.c                 |   10 ++--
 xen/arch/x86/apic.c                  |    4 +-
 xen/arch/x86/boot/cmdline.S          |    3 +-
 xen/arch/x86/bzimage.c               |    2 +-
 xen/arch/x86/cpu/amd.c               |   16 +++++-
 xen/arch/x86/cpu/mcheck/mce.c        |    4 +-
 xen/arch/x86/domain_build.c          |   20 +++---
 xen/arch/x86/hvm/svm/intr.c          |    2 +-
 xen/arch/x86/hvm/vmx/vvmx.c          |   19 ++++--
 xen/arch/x86/io_apic.c               |    4 +-
 xen/arch/x86/mm/mem_sharing.c        |   27 ++++++--
 xen/arch/x86/mm/mm-locks.h           |    2 +-
 xen/arch/x86/mpparse.c               |   10 ++--
 xen/arch/x86/setup.c                 |    6 +-
 xen/arch/x86/smpboot.c               |    2 +-
 xen/arch/x86/tboot.c                 |    2 +-
 xen/arch/x86/time.c                  |    2 +-
 xen/arch/x86/traps.c                 |   17 +++---
 xen/arch/x86/x86_64/mm.c             |    2 +-
 xen/arch/x86/x86_64/traps.c          |    2 +-
 xen/common/memory.c                  |    4 +-
 xen/common/page_alloc.c              |   47 +++++++--------
 xen/common/sched_arinc653.c          |  111 +++++++++++++++++++++++++--------
 xen/common/schedule.c                |    2 +-
 xen/common/vsprintf.c                |    3 +-
 xen/drivers/char/console.c           |    4 +-
 xen/drivers/passthrough/iommu.c      |    2 +-
 xen/drivers/passthrough/pci.c        |    2 +-
 xen/drivers/passthrough/vtd/dmar.h   |    2 +-
 xen/drivers/passthrough/vtd/iommu.c  |    4 +-
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 xen/include/asm-x86/msr-index.h      |    1 +
 xen/include/public/io/blkif.h        |   51 ++++++++++++++++
 xen/xsm/flask/hooks.c                |    2 +-
 47 files changed, 322 insertions(+), 197 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 Sun Dec 08 02:44:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02: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 1VpUMT-0002Wa-As; Sun, 08 Dec 2013 02:44:49 +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 1VpUMR-0002WC-Po
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:47 +0000
Received: from [193.109.254.147:32254] by server-15.bemta-14.messagelabs.com
	id 5B/49-22186-F1DD3A25; Sun, 08 Dec 2013 02:44:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1386470685!3655364!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5626 invoked from network); 8 Dec 2013 02:44:46 -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 Dec 2013 02:44: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 1VpUMP-0004TU-3j
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUMP-0000ct-1C
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:45 +0000
Date: Sun, 08 Dec 2013 02:44:45 +0000
Message-Id: <E1VpUMP-0000ct-1C@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 375c911acc373b4765c0b6e53203e37ae4eb3745
Merge: 81dcaaa97a21cb397cd326fdcb8f9953ea23ceff 9f0c658baedcd0f3f71c35b54965e440ffef0e45
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 4 14:29:39 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:29:39 2013 +0000

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 tools/libxl/libxl.c                  |   19 +-----
 tools/libxl/libxl_dom.c              |   35 ++++-------
 xen/arch/arm/arm32/vfp.c             |    2 +-
 xen/arch/arm/arm64/traps.c           |    2 +-
 xen/arch/arm/domain_build.c          |   18 +++---
 xen/arch/arm/early_printk.c          |    2 +-
 xen/arch/arm/gic.c                   |   16 +++---
 xen/arch/arm/kernel.c                |    8 +-
 xen/arch/arm/mm.c                    |    2 +-
 xen/arch/arm/platform.c              |    2 +-
 xen/arch/arm/setup.c                 |   10 ++--
 xen/arch/arm/smpboot.c               |    2 +-
 xen/arch/arm/time.c                  |    8 +-
 xen/arch/arm/traps.c                 |   10 ++--
 xen/arch/x86/apic.c                  |    4 +-
 xen/arch/x86/boot/cmdline.S          |    3 +-
 xen/arch/x86/bzimage.c               |    2 +-
 xen/arch/x86/cpu/amd.c               |   16 +++++-
 xen/arch/x86/cpu/mcheck/mce.c        |    4 +-
 xen/arch/x86/domain_build.c          |   20 +++---
 xen/arch/x86/hvm/svm/intr.c          |    2 +-
 xen/arch/x86/hvm/vmx/vvmx.c          |   19 ++++--
 xen/arch/x86/io_apic.c               |    4 +-
 xen/arch/x86/mm/mem_sharing.c        |   27 ++++++--
 xen/arch/x86/mm/mm-locks.h           |    2 +-
 xen/arch/x86/mpparse.c               |   10 ++--
 xen/arch/x86/setup.c                 |    6 +-
 xen/arch/x86/smpboot.c               |    2 +-
 xen/arch/x86/tboot.c                 |    2 +-
 xen/arch/x86/time.c                  |    2 +-
 xen/arch/x86/traps.c                 |   17 +++---
 xen/arch/x86/x86_64/mm.c             |    2 +-
 xen/arch/x86/x86_64/traps.c          |    2 +-
 xen/common/memory.c                  |    4 +-
 xen/common/page_alloc.c              |   47 +++++++--------
 xen/common/sched_arinc653.c          |  111 +++++++++++++++++++++++++--------
 xen/common/schedule.c                |    2 +-
 xen/common/vsprintf.c                |    3 +-
 xen/drivers/char/console.c           |    4 +-
 xen/drivers/passthrough/iommu.c      |    2 +-
 xen/drivers/passthrough/pci.c        |    2 +-
 xen/drivers/passthrough/vtd/dmar.h   |    2 +-
 xen/drivers/passthrough/vtd/iommu.c  |    4 +-
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 xen/include/asm-x86/msr-index.h      |    1 +
 xen/include/public/io/blkif.h        |   51 ++++++++++++++++
 xen/xsm/flask/hooks.c                |    2 +-
 47 files changed, 322 insertions(+), 197 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 Sun Dec 08 02:45:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:45: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 1VpUMf-0002Z0-EZ; Sun, 08 Dec 2013 02:45:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUMd-0002Ya-La
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:59 +0000
Received: from [85.158.143.35:51103] by server-3.bemta-4.messagelabs.com id
	EC/93-32360-A2DD3A25; Sun, 08 Dec 2013 02:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1386470696!4073066!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22800 invoked from network); 8 Dec 2013 02:44:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:44: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 1VpUMa-0004Td-Gy
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUMZ-0000du-7A
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:56 +0000
Date: Sun, 08 Dec 2013 02:44:55 +0000
Message-Id: <E1VpUMZ-0000du-7A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: TCR_EL1 is 64-bit on arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 17d34efd6751f93bec943ccc8f5b8c56c8fbb483
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Dec 3 15:13:36 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:32:19 2013 +0000

    xen: arm: TCR_EL1 is 64-bit on arm64
    
    Storing it in a 32-bit variable in struct arch_vcpu caused breakage over
    context switch.
    
    There were also several other places which stored this as the 32-bit value.
    Update them all.
    
    The "struct vcpu_guest_context" case needs special consideration. This struct
    is in theory is exposed to guests, via the VCPUOP_initialise hypercall.
    However as discussed in
    http://lists.xen.org/archives/html/xen-devel/2013-10/msg00912.html this isn't
    really a guest visible interface since ARM uses PSCI for VCPU bringup
    (VCPUOP_initialise simply isn't available) The other users of this interface
    are the domctls, which are not a stable API. Therefore while fixing the ttbcr
    size also surround the struct in ifdefs to restrict the struct to the
    hypervisor and the tools only (omitting the extra complexity of renaming as I
    suggested in the referenced thread).
    
    NB TCR_EL1 on arm64 is known as TTBCR on arm32, hence the apparent naming
    inconsistencies.
    
    Spotted-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
    Cc: Anup Patel <anup.patel@linaro.org>
    Cc: patches@linaro.org
    Cc: patches@apm.com
---
 tools/include/xen-foreign/reference.size |    2 +-
 tools/xentrace/xenctx.c                  |    2 +-
 xen/arch/arm/traps.c                     |   11 ++++++-----
 xen/include/asm-arm/domain.h             |    2 +-
 xen/include/public/arch-arm.h            |    6 ++++--
 5 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/tools/include/xen-foreign/reference.size b/tools/include/xen-foreign/reference.size
index b3347b4..60ee262 100644
--- a/tools/include/xen-foreign/reference.size
+++ b/tools/include/xen-foreign/reference.size
@@ -5,7 +5,7 @@ start_info                |       -       -    1112    1168
 trap_info                 |       -       -       8      16
 cpu_user_regs             |       -       -      68     200
 vcpu_guest_core_regs      |     304     304       -       -
-vcpu_guest_context        |     336     336    2800    5168
+vcpu_guest_context        |     344     344    2800    5168
 arch_vcpu_info            |       0       0      24      16
 vcpu_time_info            |      32      32      32      32
 vcpu_info                 |      48      48      64      64
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index ba502fd..7275a00 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -578,7 +578,7 @@ static void print_ctx(vcpu_guest_context_any_t *ctx_any)
 #endif
 
     printf("SCTLR: %08"PRIx32"\n", ctx->sctlr);
-    printf("TTBCR: %08"PRIx32"\n", ctx->ttbcr);
+    printf("TTBCR: %016"PRIx64"\n", ctx->ttbcr);
     printf("TTBR0: %016"PRIx64"\n", ctx->ttbr0);
     printf("TTBR1: %016"PRIx64"\n", ctx->ttbr1);
 }
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 8144b2b..458128e 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -330,7 +330,8 @@ static void inject_undef64_exception(struct cpu_user_regs *regs, int instr_len)
 
 struct reg_ctxt {
     /* Guest-side state */
-    uint32_t sctlr_el1, tcr_el1;
+    uint32_t sctlr_el1;
+    register_t tcr_el1;
     uint64_t ttbr0_el1, ttbr1_el1;
 #ifdef CONFIG_ARM_32
     uint32_t dfsr, ifsr;
@@ -433,7 +434,7 @@ static void show_registers_32(struct cpu_user_regs *regs,
     if ( guest_mode )
     {
         printk("     SCTLR: %08"PRIx32"\n", ctxt->sctlr_el1);
-        printk("       TCR: %08"PRIx32"\n", ctxt->tcr_el1);
+        printk("       TCR: %08"PRIregister"\n", ctxt->tcr_el1);
         printk("     TTBR0: %016"PRIx64"\n", ctxt->ttbr0_el1);
         printk("     TTBR1: %016"PRIx64"\n", ctxt->ttbr1_el1);
         printk("      IFAR: %08"PRIx32", IFSR: %08"PRIx32"\n"
@@ -505,7 +506,7 @@ static void show_registers_64(struct cpu_user_regs *regs,
         printk("   FAR_EL1: %016"PRIx64"\n", ctxt->far);
         printk("\n");
         printk(" SCTLR_EL1: %08"PRIx32"\n", ctxt->sctlr_el1);
-        printk("   TCR_EL1: %08"PRIx32"\n", ctxt->tcr_el1);
+        printk("   TCR_EL1: %08"PRIregister"\n", ctxt->tcr_el1);
         printk(" TTBR0_EL1: %016"PRIx64"\n", ctxt->ttbr0_el1);
         printk(" TTBR1_EL1: %016"PRIx64"\n", ctxt->ttbr1_el1);
         printk("\n");
@@ -1257,14 +1258,14 @@ static void do_sysreg(struct cpu_user_regs *regs,
 
 void dump_guest_s1_walk(struct domain *d, vaddr_t addr)
 {
-    uint32_t ttbcr = READ_SYSREG32(TCR_EL1);
+    register_t ttbcr = READ_SYSREG(TCR_EL1);
     uint64_t ttbr0 = READ_SYSREG64(TTBR0_EL1);
     paddr_t paddr;
     uint32_t offset;
     uint32_t *first = NULL, *second = NULL;
 
     printk("dom%d VA 0x%08"PRIvaddr"\n", d->domain_id, addr);
-    printk("    TTBCR: 0x%08"PRIx32"\n", ttbcr);
+    printk("    TTBCR: 0x%08"PRIregister"\n", ttbcr);
     printk("    TTBR0: 0x%016"PRIx64" = 0x%"PRIpaddr"\n",
            ttbr0, p2m_lookup(d, ttbr0 & PAGE_MASK));
 
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index d5cae2e..8ebee3e 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -165,7 +165,7 @@ struct arch_vcpu
 
     /* MMU */
     register_t vbar;
-    uint32_t ttbcr;
+    register_t ttbcr;
     uint64_t ttbr0, ttbr1;
 
     uint32_t dacr; /* 32-bit guests only */
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index cb41ddc..475cb4a 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -278,6 +278,7 @@ typedef uint64_t xen_pfn_t;
 typedef uint64_t xen_ulong_t;
 #define PRI_xen_ulong PRIx64
 
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
 struct vcpu_guest_context {
 #define _VGCF_online                   0
 #define VGCF_online                    (1<<_VGCF_online)
@@ -285,11 +286,12 @@ struct vcpu_guest_context {
 
     struct vcpu_guest_core_regs user_regs;  /* Core CPU registers */
 
-    uint32_t sctlr, ttbcr;
-    uint64_t ttbr0, ttbr1;
+    uint32_t sctlr;
+    uint64_t ttbcr, ttbr0, ttbr1;
 };
 typedef struct vcpu_guest_context vcpu_guest_context_t;
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
+#endif
 
 struct arch_vcpu_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 Sun Dec 08 02:45:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:45: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 1VpUMf-0002Z0-EZ; Sun, 08 Dec 2013 02:45:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUMd-0002Ya-La
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:59 +0000
Received: from [85.158.143.35:51103] by server-3.bemta-4.messagelabs.com id
	EC/93-32360-A2DD3A25; Sun, 08 Dec 2013 02:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1386470696!4073066!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22800 invoked from network); 8 Dec 2013 02:44:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:44: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 1VpUMa-0004Td-Gy
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUMZ-0000du-7A
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:44:56 +0000
Date: Sun, 08 Dec 2013 02:44:55 +0000
Message-Id: <E1VpUMZ-0000du-7A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: TCR_EL1 is 64-bit on arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 17d34efd6751f93bec943ccc8f5b8c56c8fbb483
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Dec 3 15:13:36 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:32:19 2013 +0000

    xen: arm: TCR_EL1 is 64-bit on arm64
    
    Storing it in a 32-bit variable in struct arch_vcpu caused breakage over
    context switch.
    
    There were also several other places which stored this as the 32-bit value.
    Update them all.
    
    The "struct vcpu_guest_context" case needs special consideration. This struct
    is in theory is exposed to guests, via the VCPUOP_initialise hypercall.
    However as discussed in
    http://lists.xen.org/archives/html/xen-devel/2013-10/msg00912.html this isn't
    really a guest visible interface since ARM uses PSCI for VCPU bringup
    (VCPUOP_initialise simply isn't available) The other users of this interface
    are the domctls, which are not a stable API. Therefore while fixing the ttbcr
    size also surround the struct in ifdefs to restrict the struct to the
    hypervisor and the tools only (omitting the extra complexity of renaming as I
    suggested in the referenced thread).
    
    NB TCR_EL1 on arm64 is known as TTBCR on arm32, hence the apparent naming
    inconsistencies.
    
    Spotted-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
    Cc: Anup Patel <anup.patel@linaro.org>
    Cc: patches@linaro.org
    Cc: patches@apm.com
---
 tools/include/xen-foreign/reference.size |    2 +-
 tools/xentrace/xenctx.c                  |    2 +-
 xen/arch/arm/traps.c                     |   11 ++++++-----
 xen/include/asm-arm/domain.h             |    2 +-
 xen/include/public/arch-arm.h            |    6 ++++--
 5 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/tools/include/xen-foreign/reference.size b/tools/include/xen-foreign/reference.size
index b3347b4..60ee262 100644
--- a/tools/include/xen-foreign/reference.size
+++ b/tools/include/xen-foreign/reference.size
@@ -5,7 +5,7 @@ start_info                |       -       -    1112    1168
 trap_info                 |       -       -       8      16
 cpu_user_regs             |       -       -      68     200
 vcpu_guest_core_regs      |     304     304       -       -
-vcpu_guest_context        |     336     336    2800    5168
+vcpu_guest_context        |     344     344    2800    5168
 arch_vcpu_info            |       0       0      24      16
 vcpu_time_info            |      32      32      32      32
 vcpu_info                 |      48      48      64      64
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index ba502fd..7275a00 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -578,7 +578,7 @@ static void print_ctx(vcpu_guest_context_any_t *ctx_any)
 #endif
 
     printf("SCTLR: %08"PRIx32"\n", ctx->sctlr);
-    printf("TTBCR: %08"PRIx32"\n", ctx->ttbcr);
+    printf("TTBCR: %016"PRIx64"\n", ctx->ttbcr);
     printf("TTBR0: %016"PRIx64"\n", ctx->ttbr0);
     printf("TTBR1: %016"PRIx64"\n", ctx->ttbr1);
 }
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 8144b2b..458128e 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -330,7 +330,8 @@ static void inject_undef64_exception(struct cpu_user_regs *regs, int instr_len)
 
 struct reg_ctxt {
     /* Guest-side state */
-    uint32_t sctlr_el1, tcr_el1;
+    uint32_t sctlr_el1;
+    register_t tcr_el1;
     uint64_t ttbr0_el1, ttbr1_el1;
 #ifdef CONFIG_ARM_32
     uint32_t dfsr, ifsr;
@@ -433,7 +434,7 @@ static void show_registers_32(struct cpu_user_regs *regs,
     if ( guest_mode )
     {
         printk("     SCTLR: %08"PRIx32"\n", ctxt->sctlr_el1);
-        printk("       TCR: %08"PRIx32"\n", ctxt->tcr_el1);
+        printk("       TCR: %08"PRIregister"\n", ctxt->tcr_el1);
         printk("     TTBR0: %016"PRIx64"\n", ctxt->ttbr0_el1);
         printk("     TTBR1: %016"PRIx64"\n", ctxt->ttbr1_el1);
         printk("      IFAR: %08"PRIx32", IFSR: %08"PRIx32"\n"
@@ -505,7 +506,7 @@ static void show_registers_64(struct cpu_user_regs *regs,
         printk("   FAR_EL1: %016"PRIx64"\n", ctxt->far);
         printk("\n");
         printk(" SCTLR_EL1: %08"PRIx32"\n", ctxt->sctlr_el1);
-        printk("   TCR_EL1: %08"PRIx32"\n", ctxt->tcr_el1);
+        printk("   TCR_EL1: %08"PRIregister"\n", ctxt->tcr_el1);
         printk(" TTBR0_EL1: %016"PRIx64"\n", ctxt->ttbr0_el1);
         printk(" TTBR1_EL1: %016"PRIx64"\n", ctxt->ttbr1_el1);
         printk("\n");
@@ -1257,14 +1258,14 @@ static void do_sysreg(struct cpu_user_regs *regs,
 
 void dump_guest_s1_walk(struct domain *d, vaddr_t addr)
 {
-    uint32_t ttbcr = READ_SYSREG32(TCR_EL1);
+    register_t ttbcr = READ_SYSREG(TCR_EL1);
     uint64_t ttbr0 = READ_SYSREG64(TTBR0_EL1);
     paddr_t paddr;
     uint32_t offset;
     uint32_t *first = NULL, *second = NULL;
 
     printk("dom%d VA 0x%08"PRIvaddr"\n", d->domain_id, addr);
-    printk("    TTBCR: 0x%08"PRIx32"\n", ttbcr);
+    printk("    TTBCR: 0x%08"PRIregister"\n", ttbcr);
     printk("    TTBR0: 0x%016"PRIx64" = 0x%"PRIpaddr"\n",
            ttbr0, p2m_lookup(d, ttbr0 & PAGE_MASK));
 
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index d5cae2e..8ebee3e 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -165,7 +165,7 @@ struct arch_vcpu
 
     /* MMU */
     register_t vbar;
-    uint32_t ttbcr;
+    register_t ttbcr;
     uint64_t ttbr0, ttbr1;
 
     uint32_t dacr; /* 32-bit guests only */
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index cb41ddc..475cb4a 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -278,6 +278,7 @@ typedef uint64_t xen_pfn_t;
 typedef uint64_t xen_ulong_t;
 #define PRI_xen_ulong PRIx64
 
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
 struct vcpu_guest_context {
 #define _VGCF_online                   0
 #define VGCF_online                    (1<<_VGCF_online)
@@ -285,11 +286,12 @@ struct vcpu_guest_context {
 
     struct vcpu_guest_core_regs user_regs;  /* Core CPU registers */
 
-    uint32_t sctlr, ttbcr;
-    uint64_t ttbr0, ttbr1;
+    uint32_t sctlr;
+    uint64_t ttbcr, ttbr0, ttbr1;
 };
 typedef struct vcpu_guest_context vcpu_guest_context_t;
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
+#endif
 
 struct arch_vcpu_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 Sun Dec 08 02:45:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:45: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 1VpUMp-0002bi-0d; Sun, 08 Dec 2013 02:45: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 1VpUMn-0002bH-O5
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:09 +0000
Received: from [193.109.254.147:32783] by server-3.bemta-14.messagelabs.com id
	97/79-11000-43DD3A25; Sun, 08 Dec 2013 02:45:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1386470707!3645379!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27624 invoked from network); 8 Dec 2013 02:45:08 -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 Dec 2013 02:45: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 1VpUMl-0004Ue-1J
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUMk-0000eT-KY
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:06 +0000
Date: Sun, 08 Dec 2013 02:45:06 +0000
Message-Id: <E1VpUMk-0000eT-KY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxenctrl: Fix xc_interface_close()
	crash if it gets NULL as an argument
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2cebe22e6924439535cbf4a9f82a7d9d30c8f9c7
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Mon Dec 2 20:13:03 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:33:00 2013 +0000

    libxenctrl: Fix xc_interface_close() crash if it gets NULL as an argument
    
    xc_interface_close() crashes if it gets NULL as an argument. However,
    it just calls xc_interface_close_common() which is called by many
    others functions. It means that they are also vulnerable. So fix above
    mentioned issue by adding NULL check in xc_interface_close_common().
    This way we fix similar issue in other functions which calls
    xc_interface_close_common() too.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_private.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 524862e..838fd21 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -198,6 +198,9 @@ static int xc_interface_close_common(xc_interface *xch)
 {
     int rc = 0;
 
+    if (!xch)
+	return 0;
+
     xc__hypercall_buffer_cache_release(xch);
 
     xtl_logger_destroy(xch->dombuild_logger_tofree);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:45:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:45: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 1VpUMp-0002bi-0d; Sun, 08 Dec 2013 02:45: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 1VpUMn-0002bH-O5
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:09 +0000
Received: from [193.109.254.147:32783] by server-3.bemta-14.messagelabs.com id
	97/79-11000-43DD3A25; Sun, 08 Dec 2013 02:45:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1386470707!3645379!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27624 invoked from network); 8 Dec 2013 02:45:08 -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 Dec 2013 02:45: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 1VpUMl-0004Ue-1J
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUMk-0000eT-KY
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:06 +0000
Date: Sun, 08 Dec 2013 02:45:06 +0000
Message-Id: <E1VpUMk-0000eT-KY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxenctrl: Fix xc_interface_close()
	crash if it gets NULL as an argument
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2cebe22e6924439535cbf4a9f82a7d9d30c8f9c7
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Mon Dec 2 20:13:03 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:33:00 2013 +0000

    libxenctrl: Fix xc_interface_close() crash if it gets NULL as an argument
    
    xc_interface_close() crashes if it gets NULL as an argument. However,
    it just calls xc_interface_close_common() which is called by many
    others functions. It means that they are also vulnerable. So fix above
    mentioned issue by adding NULL check in xc_interface_close_common().
    This way we fix similar issue in other functions which calls
    xc_interface_close_common() too.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_private.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 524862e..838fd21 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -198,6 +198,9 @@ static int xc_interface_close_common(xc_interface *xch)
 {
     int rc = 0;
 
+    if (!xch)
+	return 0;
+
     xc__hypercall_buffer_cache_release(xch);
 
     xtl_logger_destroy(xch->dombuild_logger_tofree);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:45:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:45: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 1VpUN0-0002eW-8c; Sun, 08 Dec 2013 02:45:22 +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 1VpUMy-0002e4-GI
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:20 +0000
Received: from [85.158.139.211:4208] by server-17.bemta-5.messagelabs.com id
	13/CD-19152-F3DD3A25; Sun, 08 Dec 2013 02:45:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386470717!332020!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19742 invoked from network); 8 Dec 2013 02:45:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:45: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 1VpUMv-0004Uk-6K
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUMv-0000ev-4M
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:17 +0000
Date: Sun, 08 Dec 2013 02:45:17 +0000
Message-Id: <E1VpUMv-0000ev-4M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Update QEMU_UPSTREAM_REVISION
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fda8904bf3d149296a3dd8d3e7fc835d91b9828e
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Nov 28 19:44:50 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:35:22 2013 +0000

    Update QEMU_UPSTREAM_REVISION
    
    Changing to master, otherwise we don't get the last updates.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 7eeed31..ce20844 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,7 +234,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 ?= a93b0e3f6895a074b99c8817181dfa6dbc7a4807
-QEMU_UPSTREAM_REVISION ?= 1c514a7734b7f98625a0d18d5e8ee7581f26e50c
+QEMU_UPSTREAM_REVISION ?= master
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
 # Fix bug in CBFS file walking with compressed files.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:45:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:45: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 1VpUN0-0002eW-8c; Sun, 08 Dec 2013 02:45:22 +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 1VpUMy-0002e4-GI
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:20 +0000
Received: from [85.158.139.211:4208] by server-17.bemta-5.messagelabs.com id
	13/CD-19152-F3DD3A25; Sun, 08 Dec 2013 02:45:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386470717!332020!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19742 invoked from network); 8 Dec 2013 02:45:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:45: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 1VpUMv-0004Uk-6K
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUMv-0000ev-4M
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:17 +0000
Date: Sun, 08 Dec 2013 02:45:17 +0000
Message-Id: <E1VpUMv-0000ev-4M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Update QEMU_UPSTREAM_REVISION
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fda8904bf3d149296a3dd8d3e7fc835d91b9828e
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Nov 28 19:44:50 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:35:22 2013 +0000

    Update QEMU_UPSTREAM_REVISION
    
    Changing to master, otherwise we don't get the last updates.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 7eeed31..ce20844 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,7 +234,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 ?= a93b0e3f6895a074b99c8817181dfa6dbc7a4807
-QEMU_UPSTREAM_REVISION ?= 1c514a7734b7f98625a0d18d5e8ee7581f26e50c
+QEMU_UPSTREAM_REVISION ?= master
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
 # Fix bug in CBFS file walking with compressed files.
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:45:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02: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 1VpUN9-0002gr-8T; Sun, 08 Dec 2013 02:45:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUN8-0002gW-4z
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:30 +0000
Received: from [85.158.139.211:11605] by server-13.bemta-5.messagelabs.com id
	44/FB-11357-94DD3A25; Sun, 08 Dec 2013 02:45:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386470727!332034!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19957 invoked from network); 8 Dec 2013 02:45:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:45: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 1VpUN5-0004Uq-BW
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUN5-0000fX-9Z
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:27 +0000
Date: Sun, 08 Dec 2013 02:45:27 +0000
Message-Id: <E1VpUN5-0000fX-9Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: clear boot_first instead
	of boot_pgtable twice
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c04fbf58558de544b96c861bb88293524fa30afc
Author:     Dennis Lan (dlan) <dennis.yxun@gmail.com>
AuthorDate: Wed Dec 4 14:37:25 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:37:25 2013 +0000

    xen: arm64: clear boot_first instead of boot_pgtable twice
    
    Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index e6753fe..399e546 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -470,7 +470,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     memset(boot_pgtable, 0x0, PAGE_SIZE);
     flush_xen_dcache(boot_pgtable);
 #ifdef CONFIG_ARM_64
-    memset(boot_pgtable, 0x0, PAGE_SIZE);
+    memset(boot_first, 0x0, PAGE_SIZE);
     flush_xen_dcache(boot_first);
 #endif
     memset(boot_second, 0x0, PAGE_SIZE);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:45:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02: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 1VpUN9-0002gr-8T; Sun, 08 Dec 2013 02:45:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUN8-0002gW-4z
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:30 +0000
Received: from [85.158.139.211:11605] by server-13.bemta-5.messagelabs.com id
	44/FB-11357-94DD3A25; Sun, 08 Dec 2013 02:45:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386470727!332034!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19957 invoked from network); 8 Dec 2013 02:45:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:45: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 1VpUN5-0004Uq-BW
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUN5-0000fX-9Z
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:27 +0000
Date: Sun, 08 Dec 2013 02:45:27 +0000
Message-Id: <E1VpUN5-0000fX-9Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64: clear boot_first instead
	of boot_pgtable twice
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c04fbf58558de544b96c861bb88293524fa30afc
Author:     Dennis Lan (dlan) <dennis.yxun@gmail.com>
AuthorDate: Wed Dec 4 14:37:25 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:37:25 2013 +0000

    xen: arm64: clear boot_first instead of boot_pgtable twice
    
    Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index e6753fe..399e546 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -470,7 +470,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     memset(boot_pgtable, 0x0, PAGE_SIZE);
     flush_xen_dcache(boot_pgtable);
 #ifdef CONFIG_ARM_64
-    memset(boot_pgtable, 0x0, PAGE_SIZE);
+    memset(boot_first, 0x0, PAGE_SIZE);
     flush_xen_dcache(boot_first);
 #endif
     memset(boot_second, 0x0, PAGE_SIZE);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:45:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:45: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 1VpUNJ-0002j9-CV; Sun, 08 Dec 2013 02:45: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 1VpUNI-0002it-GM
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:40 +0000
Received: from [85.158.139.211:4668] by server-8.bemta-5.messagelabs.com id
	8D/C2-29838-35DD3A25; Sun, 08 Dec 2013 02:45:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1386470738!2989784!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18712 invoked from network); 8 Dec 2013 02:45:39 -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;
	8 Dec 2013 02:45: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 1VpUNF-0004Uz-Qh
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUNF-0000g9-Mt
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:37 +0000
Date: Sun, 08 Dec 2013 02:45:37 +0000
Message-Id: <E1VpUNF-0000g9-Mt@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 747fb88881b0c448fa99a94fba3a492066df248a
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Dec 4 14:46:19 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Dec 4 14:46:19 2013 +0000

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 7eeed31..5cbef44 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 832f9bde25542961ea4f768be6e00e4801484e3a
-# Mon Nov 11 13:42:56 2013 -0500
-# hw/piix4acpi: Make writes to ACPI_DBG_IO_ADDR actually work.
+QEMU_TAG ?= 96b58a44756a8821c108358439b0f2c06e531159
+# Wed Dec 4 15:16:18 2013 +1300
+# xen_disk: fix memory leak
 
 # 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 Sun Dec 08 02:45:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:45: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 1VpUNJ-0002j9-CV; Sun, 08 Dec 2013 02:45: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 1VpUNI-0002it-GM
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:40 +0000
Received: from [85.158.139.211:4668] by server-8.bemta-5.messagelabs.com id
	8D/C2-29838-35DD3A25; Sun, 08 Dec 2013 02:45:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1386470738!2989784!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18712 invoked from network); 8 Dec 2013 02:45:39 -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;
	8 Dec 2013 02:45: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 1VpUNF-0004Uz-Qh
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUNF-0000g9-Mt
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:37 +0000
Date: Sun, 08 Dec 2013 02:45:37 +0000
Message-Id: <E1VpUNF-0000g9-Mt@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 747fb88881b0c448fa99a94fba3a492066df248a
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Dec 4 14:46:19 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Dec 4 14:46:19 2013 +0000

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 7eeed31..5cbef44 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 832f9bde25542961ea4f768be6e00e4801484e3a
-# Mon Nov 11 13:42:56 2013 -0500
-# hw/piix4acpi: Make writes to ACPI_DBG_IO_ADDR actually work.
+QEMU_TAG ?= 96b58a44756a8821c108358439b0f2c06e531159
+# Wed Dec 4 15:16:18 2013 +1300
+# xen_disk: fix memory leak
 
 # 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 Sun Dec 08 02:45:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:45:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VpUNT-0002lN-FD; Sun, 08 Dec 2013 02:45: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 1VpUNS-0002l5-J1
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:50 +0000
Received: from [193.109.254.147:33698] by server-6.bemta-14.messagelabs.com id
	9D/6C-14958-D5DD3A25; Sun, 08 Dec 2013 02:45:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1386470748!3659458!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18462 invoked from network); 8 Dec 2013 02:45:49 -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;
	8 Dec 2013 02:45: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 1VpUNP-0004V7-W7
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUNP-0000gc-Tl
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:47 +0000
Date: Sun, 08 Dec 2013 02:45:47 +0000
Message-Id: <E1VpUNP-0000gc-Tl@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 ca5690565784caa53b9889f8539c2dd9b375e419
Merge: c04fbf58558de544b96c861bb88293524fa30afc 747fb88881b0c448fa99a94fba3a492066df248a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 4 14:51:57 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:51:57 2013 +0000

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 Config.mk |    6 +++---
 1 files changed, 3 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 Sun Dec 08 02:45:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:45:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VpUNT-0002lN-FD; Sun, 08 Dec 2013 02:45: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 1VpUNS-0002l5-J1
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:50 +0000
Received: from [193.109.254.147:33698] by server-6.bemta-14.messagelabs.com id
	9D/6C-14958-D5DD3A25; Sun, 08 Dec 2013 02:45:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1386470748!3659458!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18462 invoked from network); 8 Dec 2013 02:45:49 -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;
	8 Dec 2013 02:45: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 1VpUNP-0004V7-W7
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUNP-0000gc-Tl
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:47 +0000
Date: Sun, 08 Dec 2013 02:45:47 +0000
Message-Id: <E1VpUNP-0000gc-Tl@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 ca5690565784caa53b9889f8539c2dd9b375e419
Merge: c04fbf58558de544b96c861bb88293524fa30afc 747fb88881b0c448fa99a94fba3a492066df248a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 4 14:51:57 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 14:51:57 2013 +0000

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 Config.mk |    6 +++---
 1 files changed, 3 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 Sun Dec 08 02:46:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUNf-0002n8-I8; Sun, 08 Dec 2013 02:46: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 1VpUNc-0002mp-Vd
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:01 +0000
Received: from [193.109.254.147:37839] by server-11.bemta-14.messagelabs.com
	id 88/B0-20576-86DD3A25; Sun, 08 Dec 2013 02:46:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1386470758!1362314!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26814 invoked from network); 8 Dec 2013 02:45:59 -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;
	8 Dec 2013 02:45: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 1VpUNa-0004VG-4w
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUNa-0000hh-2x
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:58 +0000
Date: Sun, 08 Dec 2013 02:45:58 +0000
Message-Id: <E1VpUNa-0000hh-2x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Enable 1:1 workaround by
	default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71952bfcbe9187765cf4010b1479af86def4fb1f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 4 14:54:21 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 17:01:51 2013 +0000

    xen: arm: Enable 1:1 workaround by default
    
    I was just about to send out patches adding the 1:1 workaround to vexpress
    (the foundation model is a vexpress platfrom with DMA) and sunxi.
    
    That would have meant that all platforms now implement the quirk. Instead lets
    just make it the default and remove the quirk.
    
    In the future this will likely be set based on the presence absence of an
    IOMMU, perhaps with additional overrides by the platform.
    
    This results in some dead code in domain_build for dealing with the non-1:1
    case. This is deliberate and is left in anticipation of IOMMU support in 4.5.
    
    PLATFORM_QUIRK_GIC_64K_STRIDE is renumbered as a side effect of this change.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c          |    4 +++-
 xen/arch/arm/platforms/exynos5.c     |    6 ------
 xen/arch/arm/platforms/midway.c      |    6 ------
 xen/arch/arm/platforms/omap5.c       |    6 ------
 xen/arch/arm/platforms/xgene-storm.c |    2 +-
 xen/include/asm-arm/platform.h       |    7 +------
 6 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 7fa6e02..532e811 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -22,6 +22,8 @@
 static unsigned int __initdata opt_dom0_max_vcpus;
 integer_param("dom0_max_vcpus", opt_dom0_max_vcpus);
 
+static int dom0_11_mapping = 1;
+
 #define DOM0_MEM_DEFAULT 0x8000000 /* 128 MiB */
 static u64 __initdata dom0_mem = DOM0_MEM_DEFAULT;
 
@@ -110,7 +112,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)
     u32 reg_len, reg_size;
     unsigned int bank = 0;
 
-    if ( platform_has_quirk(PLATFORM_QUIRK_DOM0_MAPPING_11) )
+    if ( dom0_11_mapping )
         return allocate_memory_11(d, kinfo);
 
     while ( (memory = dt_find_node_by_type(memory, "memory")) )
diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
index 0e76cac..fa6b465 100644
--- a/xen/arch/arm/platforms/exynos5.c
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -111,11 +111,6 @@ static void exynos5_reset(void)
     iounmap(pmu);
 }
 
-static uint32_t exynos5_quirks(void)
-{
-    return PLATFORM_QUIRK_DOM0_MAPPING_11;
-}
-
 static const char * const exynos5_dt_compat[] __initconst =
 {
     "samsung,exynos5250",
@@ -139,7 +134,6 @@ PLATFORM_START(exynos5, "SAMSUNG EXYNOS5")
     .smp_init = exynos5_smp_init,
     .cpu_up = exynos5_cpu_up,
     .reset = exynos5_reset,
-    .quirks = exynos5_quirks,
     .blacklist_dev = exynos5_blacklist_dev,
 PLATFORM_END
 
diff --git a/xen/arch/arm/platforms/midway.c b/xen/arch/arm/platforms/midway.c
index 399056b..b221279 100644
--- a/xen/arch/arm/platforms/midway.c
+++ b/xen/arch/arm/platforms/midway.c
@@ -42,11 +42,6 @@ static void midway_reset(void)
     iounmap(pmu);
 }
 
-static uint32_t midway_quirks(void)
-{
-    return PLATFORM_QUIRK_DOM0_MAPPING_11;
-}
-
 static const char * const midway_dt_compat[] __initconst =
 {
     "calxeda,ecx-2000",
@@ -56,7 +51,6 @@ static const char * const midway_dt_compat[] __initconst =
 PLATFORM_START(midway, "CALXEDA MIDWAY")
     .compatible = midway_dt_compat,
     .reset = midway_reset,
-    .quirks = midway_quirks,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index 54fa5ff..3a3b16b 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -153,11 +153,6 @@ static int __init omap5_cpu_up(int cpu)
     return 0;
 }
 
-static uint32_t omap5_quirks(void)
-{
-    return PLATFORM_QUIRK_DOM0_MAPPING_11;
-}
-
 static const char const *omap5_dt_compat[] __initconst =
 {
     "ti,omap5",
@@ -170,7 +165,6 @@ PLATFORM_START(omap5, "TI OMAP5")
     .specific_mapping = omap5_specific_mapping,
     .smp_init = omap5_smp_init,
     .cpu_up = omap5_cpu_up,
-    .quirks = omap5_quirks,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index ea9b0f4..f760fcd 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -24,7 +24,7 @@
 
 static uint32_t xgene_storm_quirks(void)
 {
-    return PLATFORM_QUIRK_DOM0_MAPPING_11|PLATFORM_QUIRK_GIC_64K_STRIDE;
+    return PLATFORM_QUIRK_GIC_64K_STRIDE;
 }
 
 static int map_one_mmio(struct domain *d, const char *what,
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index 5900ee4..edb399b 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -44,15 +44,10 @@ struct platform_desc {
 };
 
 /*
- * Quirk to map dom0 memory in 1:1
- * Useful on platform where System MMU is not yet implemented
- */
-#define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
-/*
  * Quirk for platforms where the 4K GIC register ranges are placed at
  * 64K stride.
  */
-#define PLATFORM_QUIRK_GIC_64K_STRIDE (1 << 1)
+#define PLATFORM_QUIRK_GIC_64K_STRIDE (1 << 0)
 
 void __init platform_init(void);
 int __init platform_init_time(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 Sun Dec 08 02:46:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUNf-0002n8-I8; Sun, 08 Dec 2013 02:46: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 1VpUNc-0002mp-Vd
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:01 +0000
Received: from [193.109.254.147:37839] by server-11.bemta-14.messagelabs.com
	id 88/B0-20576-86DD3A25; Sun, 08 Dec 2013 02:46:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1386470758!1362314!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26814 invoked from network); 8 Dec 2013 02:45:59 -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;
	8 Dec 2013 02:45: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 1VpUNa-0004VG-4w
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUNa-0000hh-2x
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:45:58 +0000
Date: Sun, 08 Dec 2013 02:45:58 +0000
Message-Id: <E1VpUNa-0000hh-2x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: Enable 1:1 workaround by
	default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71952bfcbe9187765cf4010b1479af86def4fb1f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 4 14:54:21 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 4 17:01:51 2013 +0000

    xen: arm: Enable 1:1 workaround by default
    
    I was just about to send out patches adding the 1:1 workaround to vexpress
    (the foundation model is a vexpress platfrom with DMA) and sunxi.
    
    That would have meant that all platforms now implement the quirk. Instead lets
    just make it the default and remove the quirk.
    
    In the future this will likely be set based on the presence absence of an
    IOMMU, perhaps with additional overrides by the platform.
    
    This results in some dead code in domain_build for dealing with the non-1:1
    case. This is deliberate and is left in anticipation of IOMMU support in 4.5.
    
    PLATFORM_QUIRK_GIC_64K_STRIDE is renumbered as a side effect of this change.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c          |    4 +++-
 xen/arch/arm/platforms/exynos5.c     |    6 ------
 xen/arch/arm/platforms/midway.c      |    6 ------
 xen/arch/arm/platforms/omap5.c       |    6 ------
 xen/arch/arm/platforms/xgene-storm.c |    2 +-
 xen/include/asm-arm/platform.h       |    7 +------
 6 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 7fa6e02..532e811 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -22,6 +22,8 @@
 static unsigned int __initdata opt_dom0_max_vcpus;
 integer_param("dom0_max_vcpus", opt_dom0_max_vcpus);
 
+static int dom0_11_mapping = 1;
+
 #define DOM0_MEM_DEFAULT 0x8000000 /* 128 MiB */
 static u64 __initdata dom0_mem = DOM0_MEM_DEFAULT;
 
@@ -110,7 +112,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)
     u32 reg_len, reg_size;
     unsigned int bank = 0;
 
-    if ( platform_has_quirk(PLATFORM_QUIRK_DOM0_MAPPING_11) )
+    if ( dom0_11_mapping )
         return allocate_memory_11(d, kinfo);
 
     while ( (memory = dt_find_node_by_type(memory, "memory")) )
diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
index 0e76cac..fa6b465 100644
--- a/xen/arch/arm/platforms/exynos5.c
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -111,11 +111,6 @@ static void exynos5_reset(void)
     iounmap(pmu);
 }
 
-static uint32_t exynos5_quirks(void)
-{
-    return PLATFORM_QUIRK_DOM0_MAPPING_11;
-}
-
 static const char * const exynos5_dt_compat[] __initconst =
 {
     "samsung,exynos5250",
@@ -139,7 +134,6 @@ PLATFORM_START(exynos5, "SAMSUNG EXYNOS5")
     .smp_init = exynos5_smp_init,
     .cpu_up = exynos5_cpu_up,
     .reset = exynos5_reset,
-    .quirks = exynos5_quirks,
     .blacklist_dev = exynos5_blacklist_dev,
 PLATFORM_END
 
diff --git a/xen/arch/arm/platforms/midway.c b/xen/arch/arm/platforms/midway.c
index 399056b..b221279 100644
--- a/xen/arch/arm/platforms/midway.c
+++ b/xen/arch/arm/platforms/midway.c
@@ -42,11 +42,6 @@ static void midway_reset(void)
     iounmap(pmu);
 }
 
-static uint32_t midway_quirks(void)
-{
-    return PLATFORM_QUIRK_DOM0_MAPPING_11;
-}
-
 static const char * const midway_dt_compat[] __initconst =
 {
     "calxeda,ecx-2000",
@@ -56,7 +51,6 @@ static const char * const midway_dt_compat[] __initconst =
 PLATFORM_START(midway, "CALXEDA MIDWAY")
     .compatible = midway_dt_compat,
     .reset = midway_reset,
-    .quirks = midway_quirks,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index 54fa5ff..3a3b16b 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -153,11 +153,6 @@ static int __init omap5_cpu_up(int cpu)
     return 0;
 }
 
-static uint32_t omap5_quirks(void)
-{
-    return PLATFORM_QUIRK_DOM0_MAPPING_11;
-}
-
 static const char const *omap5_dt_compat[] __initconst =
 {
     "ti,omap5",
@@ -170,7 +165,6 @@ PLATFORM_START(omap5, "TI OMAP5")
     .specific_mapping = omap5_specific_mapping,
     .smp_init = omap5_smp_init,
     .cpu_up = omap5_cpu_up,
-    .quirks = omap5_quirks,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index ea9b0f4..f760fcd 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -24,7 +24,7 @@
 
 static uint32_t xgene_storm_quirks(void)
 {
-    return PLATFORM_QUIRK_DOM0_MAPPING_11|PLATFORM_QUIRK_GIC_64K_STRIDE;
+    return PLATFORM_QUIRK_GIC_64K_STRIDE;
 }
 
 static int map_one_mmio(struct domain *d, const char *what,
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index 5900ee4..edb399b 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -44,15 +44,10 @@ struct platform_desc {
 };
 
 /*
- * Quirk to map dom0 memory in 1:1
- * Useful on platform where System MMU is not yet implemented
- */
-#define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
-/*
  * Quirk for platforms where the 4K GIC register ranges are placed at
  * 64K stride.
  */
-#define PLATFORM_QUIRK_GIC_64K_STRIDE (1 << 1)
+#define PLATFORM_QUIRK_GIC_64K_STRIDE (1 << 0)
 
 void __init platform_init(void);
 int __init platform_init_time(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 Sun Dec 08 02:46:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUNo-0002ov-M4; Sun, 08 Dec 2013 02:46: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 1VpUNn-0002oj-9s
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:11 +0000
Received: from [85.158.137.68:60471] by server-4.bemta-3.messagelabs.com id
	96/5F-10414-27DD3A25; Sun, 08 Dec 2013 02:46:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1386470768!2443721!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27505 invoked from network); 8 Dec 2013 02:46:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:46: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 1VpUNk-0004Vp-8g
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUNk-0000iD-7Z
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:08 +0000
Date: Sun, 08 Dec 2013 02:46:08 +0000
Message-Id: <E1VpUNk-0000iD-7Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxl: testidl: initialise the
	KeyedUnion keyvar before the union
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fba6c4ba5e8563d7ce53750750ac273781bd9398
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 4 17:48:56 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 09:25:35 2013 +0000

    tools: libxl: testidl: initialise the KeyedUnion keyvar before the union
    
    This is Coverity CID 1135378 and 1135379.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxl/gentest.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/gentest.py b/tools/libxl/gentest.py
index 6fab493..722b7f4 100644
--- a/tools/libxl/gentest.py
+++ b/tools/libxl/gentest.py
@@ -42,6 +42,7 @@ def gen_rand_init(ty, v, indent = "    ", parent = None):
     elif isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
+        s += gen_rand_init(ty.keyvar.type, parent + ty.keyvar.name, indent, parent)
         s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:46:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUNo-0002ov-M4; Sun, 08 Dec 2013 02:46: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 1VpUNn-0002oj-9s
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:11 +0000
Received: from [85.158.137.68:60471] by server-4.bemta-3.messagelabs.com id
	96/5F-10414-27DD3A25; Sun, 08 Dec 2013 02:46:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1386470768!2443721!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27505 invoked from network); 8 Dec 2013 02:46:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:46: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 1VpUNk-0004Vp-8g
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUNk-0000iD-7Z
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:08 +0000
Date: Sun, 08 Dec 2013 02:46:08 +0000
Message-Id: <E1VpUNk-0000iD-7Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxl: testidl: initialise the
	KeyedUnion keyvar before the union
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fba6c4ba5e8563d7ce53750750ac273781bd9398
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 4 17:48:56 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 09:25:35 2013 +0000

    tools: libxl: testidl: initialise the KeyedUnion keyvar before the union
    
    This is Coverity CID 1135378 and 1135379.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxl/gentest.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/gentest.py b/tools/libxl/gentest.py
index 6fab493..722b7f4 100644
--- a/tools/libxl/gentest.py
+++ b/tools/libxl/gentest.py
@@ -42,6 +42,7 @@ def gen_rand_init(ty, v, indent = "    ", parent = None):
     elif isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
+        s += gen_rand_init(ty.keyvar.type, parent + ty.keyvar.name, indent, parent)
         s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:46:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUNy-0002ql-Os; Sun, 08 Dec 2013 02:46:22 +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 1VpUNx-0002qQ-Fo
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:21 +0000
Received: from [85.158.139.211:18381] by server-10.bemta-5.messagelabs.com id
	09/97-01405-C7DD3A25; Sun, 08 Dec 2013 02:46:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1386470778!2999131!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23001 invoked from network); 8 Dec 2013 02:46:19 -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;
	8 Dec 2013 02:46: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 1VpUNu-0004Vv-F6
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUNu-0000ib-BN
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:18 +0000
Date: Sun, 08 Dec 2013 02:46:18 +0000
Message-Id: <E1VpUNu-0000ib-BN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: rename xen/arch/arm/psci.c into
	vpsci.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd715d2c958833a8a9bdc41287922a441d66406d
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:07 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:18:54 2013 +0000

    arm: rename xen/arch/arm/psci.c into vpsci.c
    
    Follow the current convention of prefixing guest related names
    with "v" by renaming the guest PSCI functionality into vpsci.c to make
    room for the host PSCI functions.
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile |    2 +-
 xen/arch/arm/psci.c   |   93 -------------------------------------------------
 xen/arch/arm/vpsci.c  |   93 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 94 insertions(+), 94 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 003ac84..11cf663 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -5,7 +5,7 @@ subdir-y += platforms
 obj-$(EARLY_PRINTK) += early_printk.o
 obj-y += cpu.o
 obj-y += domain.o
-obj-y += psci.o
+obj-y += vpsci.o
 obj-y += domctl.o
 obj-y += sysctl.o
 obj-y += domain_build.o
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
deleted file mode 100644
index c82884f..0000000
--- a/xen/arch/arm/psci.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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/gic.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;
-    int is_thumb = entry_point & 1;
-
-    if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
-        return PSCI_EINVAL;
-
-    if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
-        return PSCI_EINVAL;
-
-    /* THUMB set is not allowed with 64-bit domain */
-    if ( is_pv64_domain(d) && is_thumb )
-        return PSCI_EINVAL;
-
-    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_GUEST_INIT;
-    ctxt->ttbr0 = 0;
-    ctxt->ttbr1 = 0;
-    ctxt->ttbcr = 0; /* Defined Reset Value */
-    if ( is_pv32_domain(d) )
-        ctxt->user_regs.cpsr = PSR_GUEST32_INIT;
-#ifdef CONFIG_ARM_64
-    else
-        ctxt->user_regs.cpsr = PSR_GUEST64_INIT;
-#endif
-
-    /* Start the VCPU with THUMB set if it's requested by the kernel */
-    if ( is_thumb )
-        ctxt->user_regs.cpsr |= PSR_THUMB;
-    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/vpsci.c b/xen/arch/arm/vpsci.c
new file mode 100644
index 0000000..c82884f
--- /dev/null
+++ b/xen/arch/arm/vpsci.c
@@ -0,0 +1,93 @@
+/*
+ * 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/gic.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;
+    int is_thumb = entry_point & 1;
+
+    if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
+        return PSCI_EINVAL;
+
+    if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
+        return PSCI_EINVAL;
+
+    /* THUMB set is not allowed with 64-bit domain */
+    if ( is_pv64_domain(d) && is_thumb )
+        return PSCI_EINVAL;
+
+    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_GUEST_INIT;
+    ctxt->ttbr0 = 0;
+    ctxt->ttbr1 = 0;
+    ctxt->ttbcr = 0; /* Defined Reset Value */
+    if ( is_pv32_domain(d) )
+        ctxt->user_regs.cpsr = PSR_GUEST32_INIT;
+#ifdef CONFIG_ARM_64
+    else
+        ctxt->user_regs.cpsr = PSR_GUEST64_INIT;
+#endif
+
+    /* Start the VCPU with THUMB set if it's requested by the kernel */
+    if ( is_thumb )
+        ctxt->user_regs.cpsr |= PSR_THUMB;
+    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:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:46:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUNy-0002ql-Os; Sun, 08 Dec 2013 02:46:22 +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 1VpUNx-0002qQ-Fo
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:21 +0000
Received: from [85.158.139.211:18381] by server-10.bemta-5.messagelabs.com id
	09/97-01405-C7DD3A25; Sun, 08 Dec 2013 02:46:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1386470778!2999131!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23001 invoked from network); 8 Dec 2013 02:46:19 -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;
	8 Dec 2013 02:46: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 1VpUNu-0004Vv-F6
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUNu-0000ib-BN
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:18 +0000
Date: Sun, 08 Dec 2013 02:46:18 +0000
Message-Id: <E1VpUNu-0000ib-BN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: rename xen/arch/arm/psci.c into
	vpsci.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd715d2c958833a8a9bdc41287922a441d66406d
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:07 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:18:54 2013 +0000

    arm: rename xen/arch/arm/psci.c into vpsci.c
    
    Follow the current convention of prefixing guest related names
    with "v" by renaming the guest PSCI functionality into vpsci.c to make
    room for the host PSCI functions.
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile |    2 +-
 xen/arch/arm/psci.c   |   93 -------------------------------------------------
 xen/arch/arm/vpsci.c  |   93 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 94 insertions(+), 94 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 003ac84..11cf663 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -5,7 +5,7 @@ subdir-y += platforms
 obj-$(EARLY_PRINTK) += early_printk.o
 obj-y += cpu.o
 obj-y += domain.o
-obj-y += psci.o
+obj-y += vpsci.o
 obj-y += domctl.o
 obj-y += sysctl.o
 obj-y += domain_build.o
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
deleted file mode 100644
index c82884f..0000000
--- a/xen/arch/arm/psci.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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/gic.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;
-    int is_thumb = entry_point & 1;
-
-    if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
-        return PSCI_EINVAL;
-
-    if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
-        return PSCI_EINVAL;
-
-    /* THUMB set is not allowed with 64-bit domain */
-    if ( is_pv64_domain(d) && is_thumb )
-        return PSCI_EINVAL;
-
-    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_GUEST_INIT;
-    ctxt->ttbr0 = 0;
-    ctxt->ttbr1 = 0;
-    ctxt->ttbcr = 0; /* Defined Reset Value */
-    if ( is_pv32_domain(d) )
-        ctxt->user_regs.cpsr = PSR_GUEST32_INIT;
-#ifdef CONFIG_ARM_64
-    else
-        ctxt->user_regs.cpsr = PSR_GUEST64_INIT;
-#endif
-
-    /* Start the VCPU with THUMB set if it's requested by the kernel */
-    if ( is_thumb )
-        ctxt->user_regs.cpsr |= PSR_THUMB;
-    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/vpsci.c b/xen/arch/arm/vpsci.c
new file mode 100644
index 0000000..c82884f
--- /dev/null
+++ b/xen/arch/arm/vpsci.c
@@ -0,0 +1,93 @@
+/*
+ * 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/gic.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;
+    int is_thumb = entry_point & 1;
+
+    if ( (vcpuid < 0) || (vcpuid >= MAX_VIRT_CPUS) )
+        return PSCI_EINVAL;
+
+    if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
+        return PSCI_EINVAL;
+
+    /* THUMB set is not allowed with 64-bit domain */
+    if ( is_pv64_domain(d) && is_thumb )
+        return PSCI_EINVAL;
+
+    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_GUEST_INIT;
+    ctxt->ttbr0 = 0;
+    ctxt->ttbr1 = 0;
+    ctxt->ttbcr = 0; /* Defined Reset Value */
+    if ( is_pv32_domain(d) )
+        ctxt->user_regs.cpsr = PSR_GUEST32_INIT;
+#ifdef CONFIG_ARM_64
+    else
+        ctxt->user_regs.cpsr = PSR_GUEST64_INIT;
+#endif
+
+    /* Start the VCPU with THUMB set if it's requested by the kernel */
+    if ( is_thumb )
+        ctxt->user_regs.cpsr |= PSR_THUMB;
+    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:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:46:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUO9-0002tF-Tw; Sun, 08 Dec 2013 02:46: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 1VpUO7-0002sm-JM
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:31 +0000
Received: from [85.158.139.211:5527] by server-1.bemta-5.messagelabs.com id
	80/3E-21065-68DD3A25; Sun, 08 Dec 2013 02:46:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1386470788!2973627!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5244 invoked from network); 8 Dec 2013 02:46:29 -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;
	8 Dec 2013 02:46: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 1VpUO4-0004W3-JN
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUO4-0000ix-Hw
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:28 +0000
Date: Sun, 08 Dec 2013 02:46:28 +0000
Message-Id: <E1VpUO4-0000ix-Hw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: move GIC SGI kicking into
	separate 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 4e014d63e3d611efbb5fc971ffccafda9aa2b2bb
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:08 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:19:09 2013 +0000

    arm: move GIC SGI kicking into separate function
    
    Currently we unconditionally send SGIs to all cores on SMP bringup.
    
    Those SGIs (software generated interrupts) are to push a secondary core
    through a gate in the Xen bring up code to filter the right CPU. This gate is
    necessary on platforms which do not allow us to wake up a specific secondary
    processor and will trap all but the CPU we are trying to wake up.
    
    With PSCI we can explicitly specify the core to startup, so we don't need the
    kick here because the CPU will fall straight through Xen's gate.
    
    So we move the GIC kick into a function and call it explicitly from the
    platforms that need it. This gets us get rid of the empty cpu_up() platform
    functions in ARM32 and the comment in there.
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- explain more about the Xen gate in the commit message ]
---
 xen/arch/arm/arm64/smpboot.c      |    2 +-
 xen/arch/arm/platform.c           |    2 +-
 xen/arch/arm/platforms/exynos5.c  |   11 +----------
 xen/arch/arm/platforms/omap5.c    |   11 +----------
 xen/arch/arm/platforms/vexpress.c |   10 +---------
 xen/arch/arm/smpboot.c            |   15 ++++++++++-----
 xen/include/asm-arm/smp.h         |    2 ++
 7 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index 8696ed6..6a34bd4 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -38,7 +38,7 @@ static int __init smp_spin_table_cpu_up(int cpu)
 
     sev();
 
-    return 0;
+    return cpu_up_send_sgi(cpu);
 }
 
 static void __init smp_spin_table_init(int cpu, struct dt_device_node *dn)
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 5ed8eb2..e13a354 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -112,7 +112,7 @@ int __init platform_cpu_up(int cpu)
     if ( platform && platform->cpu_up )
         return platform->cpu_up(cpu);
 
-    return -EAGAIN;
+    return -ENODEV;
 }
 
 int __init platform_smp_init(void)
diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
index fa6b465..65e584f 100644
--- a/xen/arch/arm/platforms/exynos5.c
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -85,15 +85,6 @@ static int __init exynos5_smp_init(void)
     return 0;
 }
 
-static int __init exynos5_cpu_up(int cpu)
-{
-    /* Nothing to do here, the generic sev() will suffice to kick CPUs
-     * out of either the firmware or our own smp_up_cpu gate,
-     * depending on where they have ended up. */
-
-    return 0;
-}
-
 static void exynos5_reset(void)
 {
     void __iomem *pmu;
@@ -132,7 +123,7 @@ PLATFORM_START(exynos5, "SAMSUNG EXYNOS5")
     .init_time = exynos5_init_time,
     .specific_mapping = exynos5_specific_mapping,
     .smp_init = exynos5_smp_init,
-    .cpu_up = exynos5_cpu_up,
+    .cpu_up = cpu_up_send_sgi,
     .reset = exynos5_reset,
     .blacklist_dev = exynos5_blacklist_dev,
 PLATFORM_END
diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index 3a3b16b..423d11b 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -144,15 +144,6 @@ static int __init omap5_smp_init(void)
     return 0;
 }
 
-static int __init omap5_cpu_up(int cpu)
-{
-    /* Nothing to do here, the generic sev() will suffice to kick CPUs
-     * out of either the firmware or our own smp_up_cpu gate,
-     * depending on where they have ended up. */
-
-    return 0;
-}
-
 static const char const *omap5_dt_compat[] __initconst =
 {
     "ti,omap5",
@@ -164,7 +155,7 @@ PLATFORM_START(omap5, "TI OMAP5")
     .init_time = omap5_init_time,
     .specific_mapping = omap5_specific_mapping,
     .smp_init = omap5_smp_init,
-    .cpu_up = omap5_cpu_up,
+    .cpu_up = cpu_up_send_sgi,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/vexpress.c b/xen/arch/arm/platforms/vexpress.c
index 9056366..6132056 100644
--- a/xen/arch/arm/platforms/vexpress.c
+++ b/xen/arch/arm/platforms/vexpress.c
@@ -144,14 +144,6 @@ static int __init vexpress_smp_init(void)
     return 0;
 }
 
-static int __init vexpress_cpu_up(int cpu)
-{
-    /* Nothing to do here, the generic sev() will suffice to kick CPUs
-     * out of either the firmware or our own smp_up_cpu gate,
-     * depending on where they have ended up. */
-
-    return 0;
-}
 #endif
 
 static const char * const vexpress_dt_compat[] __initconst =
@@ -180,7 +172,7 @@ PLATFORM_START(vexpress, "VERSATILE EXPRESS")
     .compatible = vexpress_dt_compat,
 #ifdef CONFIG_ARM_32
     .smp_init = vexpress_smp_init,
-    .cpu_up = vexpress_cpu_up,
+    .cpu_up = cpu_up_send_sgi,
 #endif
     .reset = vexpress_reset,
     .blacklist_dev = vexpress_blacklist_dev,
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index bd76d14..8d96c17 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -343,6 +343,16 @@ void stop_cpu(void)
         wfi();
 }
 
+int __init cpu_up_send_sgi(int cpu)
+{
+    /* We don't know the GIC ID of the CPU until it has woken up, so just
+     * signal everyone and rely on our own smp_up_cpu gate to ensure only
+     * the one we want gets through. */
+    send_SGI_allbutself(GIC_SGI_EVENT_CHECK);
+
+    return 0;
+}
+
 /* Bring up a remote CPU */
 int __cpu_up(unsigned int cpu)
 {
@@ -376,11 +386,6 @@ int __cpu_up(unsigned int cpu)
         return rc;
     }
 
-    /* We don't know the GIC ID of the CPU until it has woken up, so just signal
-     * everyone and rely on our own smp_up_cpu gate to ensure only the one we
-     * want gets through. */
-    send_SGI_allbutself(GIC_SGI_EVENT_CHECK);
-
     while ( !cpu_online(cpu) )
     {
         cpu_relax();
diff --git a/xen/include/asm-arm/smp.h b/xen/include/asm-arm/smp.h
index 1485cc6..a1de03c 100644
--- a/xen/include/asm-arm/smp.h
+++ b/xen/include/asm-arm/smp.h
@@ -21,6 +21,8 @@ extern int arch_smp_init(void);
 extern int arch_cpu_init(int cpu, struct dt_device_node *dn);
 extern int arch_cpu_up(int cpu);
 
+int cpu_up_send_sgi(int cpu);
+
 /* Secondary CPU entry point */
 extern void init_secondary(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 Sun Dec 08 02:46:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUO9-0002tF-Tw; Sun, 08 Dec 2013 02:46: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 1VpUO7-0002sm-JM
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:31 +0000
Received: from [85.158.139.211:5527] by server-1.bemta-5.messagelabs.com id
	80/3E-21065-68DD3A25; Sun, 08 Dec 2013 02:46:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1386470788!2973627!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5244 invoked from network); 8 Dec 2013 02:46:29 -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;
	8 Dec 2013 02:46: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 1VpUO4-0004W3-JN
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUO4-0000ix-Hw
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:28 +0000
Date: Sun, 08 Dec 2013 02:46:28 +0000
Message-Id: <E1VpUO4-0000ix-Hw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: move GIC SGI kicking into
	separate 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 4e014d63e3d611efbb5fc971ffccafda9aa2b2bb
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:08 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:19:09 2013 +0000

    arm: move GIC SGI kicking into separate function
    
    Currently we unconditionally send SGIs to all cores on SMP bringup.
    
    Those SGIs (software generated interrupts) are to push a secondary core
    through a gate in the Xen bring up code to filter the right CPU. This gate is
    necessary on platforms which do not allow us to wake up a specific secondary
    processor and will trap all but the CPU we are trying to wake up.
    
    With PSCI we can explicitly specify the core to startup, so we don't need the
    kick here because the CPU will fall straight through Xen's gate.
    
    So we move the GIC kick into a function and call it explicitly from the
    platforms that need it. This gets us get rid of the empty cpu_up() platform
    functions in ARM32 and the comment in there.
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- explain more about the Xen gate in the commit message ]
---
 xen/arch/arm/arm64/smpboot.c      |    2 +-
 xen/arch/arm/platform.c           |    2 +-
 xen/arch/arm/platforms/exynos5.c  |   11 +----------
 xen/arch/arm/platforms/omap5.c    |   11 +----------
 xen/arch/arm/platforms/vexpress.c |   10 +---------
 xen/arch/arm/smpboot.c            |   15 ++++++++++-----
 xen/include/asm-arm/smp.h         |    2 ++
 7 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index 8696ed6..6a34bd4 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -38,7 +38,7 @@ static int __init smp_spin_table_cpu_up(int cpu)
 
     sev();
 
-    return 0;
+    return cpu_up_send_sgi(cpu);
 }
 
 static void __init smp_spin_table_init(int cpu, struct dt_device_node *dn)
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 5ed8eb2..e13a354 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -112,7 +112,7 @@ int __init platform_cpu_up(int cpu)
     if ( platform && platform->cpu_up )
         return platform->cpu_up(cpu);
 
-    return -EAGAIN;
+    return -ENODEV;
 }
 
 int __init platform_smp_init(void)
diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
index fa6b465..65e584f 100644
--- a/xen/arch/arm/platforms/exynos5.c
+++ b/xen/arch/arm/platforms/exynos5.c
@@ -85,15 +85,6 @@ static int __init exynos5_smp_init(void)
     return 0;
 }
 
-static int __init exynos5_cpu_up(int cpu)
-{
-    /* Nothing to do here, the generic sev() will suffice to kick CPUs
-     * out of either the firmware or our own smp_up_cpu gate,
-     * depending on where they have ended up. */
-
-    return 0;
-}
-
 static void exynos5_reset(void)
 {
     void __iomem *pmu;
@@ -132,7 +123,7 @@ PLATFORM_START(exynos5, "SAMSUNG EXYNOS5")
     .init_time = exynos5_init_time,
     .specific_mapping = exynos5_specific_mapping,
     .smp_init = exynos5_smp_init,
-    .cpu_up = exynos5_cpu_up,
+    .cpu_up = cpu_up_send_sgi,
     .reset = exynos5_reset,
     .blacklist_dev = exynos5_blacklist_dev,
 PLATFORM_END
diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index 3a3b16b..423d11b 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -144,15 +144,6 @@ static int __init omap5_smp_init(void)
     return 0;
 }
 
-static int __init omap5_cpu_up(int cpu)
-{
-    /* Nothing to do here, the generic sev() will suffice to kick CPUs
-     * out of either the firmware or our own smp_up_cpu gate,
-     * depending on where they have ended up. */
-
-    return 0;
-}
-
 static const char const *omap5_dt_compat[] __initconst =
 {
     "ti,omap5",
@@ -164,7 +155,7 @@ PLATFORM_START(omap5, "TI OMAP5")
     .init_time = omap5_init_time,
     .specific_mapping = omap5_specific_mapping,
     .smp_init = omap5_smp_init,
-    .cpu_up = omap5_cpu_up,
+    .cpu_up = cpu_up_send_sgi,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/vexpress.c b/xen/arch/arm/platforms/vexpress.c
index 9056366..6132056 100644
--- a/xen/arch/arm/platforms/vexpress.c
+++ b/xen/arch/arm/platforms/vexpress.c
@@ -144,14 +144,6 @@ static int __init vexpress_smp_init(void)
     return 0;
 }
 
-static int __init vexpress_cpu_up(int cpu)
-{
-    /* Nothing to do here, the generic sev() will suffice to kick CPUs
-     * out of either the firmware or our own smp_up_cpu gate,
-     * depending on where they have ended up. */
-
-    return 0;
-}
 #endif
 
 static const char * const vexpress_dt_compat[] __initconst =
@@ -180,7 +172,7 @@ PLATFORM_START(vexpress, "VERSATILE EXPRESS")
     .compatible = vexpress_dt_compat,
 #ifdef CONFIG_ARM_32
     .smp_init = vexpress_smp_init,
-    .cpu_up = vexpress_cpu_up,
+    .cpu_up = cpu_up_send_sgi,
 #endif
     .reset = vexpress_reset,
     .blacklist_dev = vexpress_blacklist_dev,
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index bd76d14..8d96c17 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -343,6 +343,16 @@ void stop_cpu(void)
         wfi();
 }
 
+int __init cpu_up_send_sgi(int cpu)
+{
+    /* We don't know the GIC ID of the CPU until it has woken up, so just
+     * signal everyone and rely on our own smp_up_cpu gate to ensure only
+     * the one we want gets through. */
+    send_SGI_allbutself(GIC_SGI_EVENT_CHECK);
+
+    return 0;
+}
+
 /* Bring up a remote CPU */
 int __cpu_up(unsigned int cpu)
 {
@@ -376,11 +386,6 @@ int __cpu_up(unsigned int cpu)
         return rc;
     }
 
-    /* We don't know the GIC ID of the CPU until it has woken up, so just signal
-     * everyone and rely on our own smp_up_cpu gate to ensure only the one we
-     * want gets through. */
-    send_SGI_allbutself(GIC_SGI_EVENT_CHECK);
-
     while ( !cpu_online(cpu) )
     {
         cpu_relax();
diff --git a/xen/include/asm-arm/smp.h b/xen/include/asm-arm/smp.h
index 1485cc6..a1de03c 100644
--- a/xen/include/asm-arm/smp.h
+++ b/xen/include/asm-arm/smp.h
@@ -21,6 +21,8 @@ extern int arch_smp_init(void);
 extern int arch_cpu_init(int cpu, struct dt_device_node *dn);
 extern int arch_cpu_up(int cpu);
 
+int cpu_up_send_sgi(int cpu);
+
 /* Secondary CPU entry point */
 extern void init_secondary(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 Sun Dec 08 02:46:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUOJ-0002ux-0d; Sun, 08 Dec 2013 02:46: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 1VpUOH-0002uf-Fq
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:41 +0000
Received: from [85.158.139.211:41579] by server-2.bemta-5.messagelabs.com id
	87/07-29392-09DD3A25; Sun, 08 Dec 2013 02:46:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1386470798!2989843!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19540 invoked from network); 8 Dec 2013 02:46:39 -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;
	8 Dec 2013 02:46: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 1VpUOE-0004W9-NZ
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOE-0000jR-M7
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:38 +0000
Date: Sun, 08 Dec 2013 02:46:38 +0000
Message-Id: <E1VpUOE-0000jR-M7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: parse PSCI node from the host
	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 18a13b96766cfa44c0edb170ed34a1d6bfde9db1
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:09 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:25:09 2013 +0000

    arm: parse PSCI node from the host device-tree
    
    The availability of a PSCI handler is advertised in the DTB.
    Find and parse the node (described in the Linux device-tree binding)
    and save the function number for bringing up a CPU for later usage.
    We do some sanity checks, especially we deny using HVC as a calling
    method, as it does not make much sense currently under Xen.
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile      |    1 +
 xen/arch/arm/psci.c        |   68 ++++++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/smpboot.c     |    4 ++
 xen/include/asm-arm/psci.h |    6 ++++
 4 files changed, 79 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 11cf663..d70f6d5 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -5,6 +5,7 @@ subdir-y += platforms
 obj-$(EARLY_PRINTK) += early_printk.o
 obj-y += cpu.o
 obj-y += domain.o
+obj-y += psci.o
 obj-y += vpsci.o
 obj-y += domctl.o
 obj-y += sysctl.o
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
new file mode 100644
index 0000000..efb514e
--- /dev/null
+++ b/xen/arch/arm/psci.c
@@ -0,0 +1,68 @@
+/*
+ * xen/arch/arm/psci.c
+ *
+ * PSCI host support
+ *
+ * Andre Przywara <andre.przywara@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 <xen/types.h>
+#include <xen/mm.h>
+#include <xen/smp.h>
+#include <asm/psci.h>
+
+bool_t psci_available;
+
+static uint32_t psci_cpu_on_nr;
+
+int __init psci_init(void)
+{
+    const struct dt_device_node *psci;
+    int ret;
+    const char *prop_str;
+
+    psci = dt_find_compatible_node(NULL, NULL, "arm,psci");
+    if ( !psci )
+        return -ENODEV;
+
+    ret = dt_property_read_string(psci, "method", &prop_str);
+    if ( ret )
+    {
+        printk("/psci node does not provide a method (%d)\n", ret);
+        return -EINVAL;
+    }
+
+    /* Since Xen runs in HYP all of the time, it does not make sense to
+     * let it call into HYP for PSCI handling, since the handler just
+     * won't be there. So bail out with an error if "smc" is not used.
+     */
+    if ( strcmp(prop_str, "smc") )
+    {
+        printk("/psci method must be smc, but is: \"%s\"\n", prop_str);
+        return -EINVAL;
+    }
+
+    if ( !dt_property_read_u32(psci, "cpu_on", &psci_cpu_on_nr) )
+    {
+        printk("/psci node is missing the \"cpu_on\" property\n");
+        return -ENOENT;
+    }
+
+    psci_available = 1;
+
+    printk(XENLOG_INFO "Using PSCI for SMP bringup\n");
+
+    return 0;
+}
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 8d96c17..c53c765 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -30,6 +30,7 @@
 #include <xen/irq.h>
 #include <xen/console.h>
 #include <asm/gic.h>
+#include <asm/psci.h>
 
 cpumask_t cpu_online_map;
 cpumask_t cpu_present_map;
@@ -105,6 +106,9 @@ void __init smp_init_cpus(void)
     bool_t bootcpu_valid = 0;
     int rc;
 
+    /* scan the DTB for a PSCI node and set a global variable */
+    psci_init();
+
     if ( (rc = arch_smp_init()) < 0 )
     {
         printk(XENLOG_WARNING "SMP init failed (%d)\n"
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
index 67d4c35..36ce87d 100644
--- a/xen/include/asm-arm/psci.h
+++ b/xen/include/asm-arm/psci.h
@@ -6,6 +6,12 @@
 #define PSCI_EINVAL  -2
 #define PSCI_DENIED  -3
 
+/* availability of PSCI on the host for SMP bringup */
+extern bool_t psci_available;
+
+int psci_init(void);
+
+/* functions to handle guest PSCI requests */
 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);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:46:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUOJ-0002ux-0d; Sun, 08 Dec 2013 02:46: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 1VpUOH-0002uf-Fq
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:41 +0000
Received: from [85.158.139.211:41579] by server-2.bemta-5.messagelabs.com id
	87/07-29392-09DD3A25; Sun, 08 Dec 2013 02:46:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1386470798!2989843!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19540 invoked from network); 8 Dec 2013 02:46:39 -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;
	8 Dec 2013 02:46: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 1VpUOE-0004W9-NZ
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOE-0000jR-M7
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:38 +0000
Date: Sun, 08 Dec 2013 02:46:38 +0000
Message-Id: <E1VpUOE-0000jR-M7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: parse PSCI node from the host
	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 18a13b96766cfa44c0edb170ed34a1d6bfde9db1
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:09 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:25:09 2013 +0000

    arm: parse PSCI node from the host device-tree
    
    The availability of a PSCI handler is advertised in the DTB.
    Find and parse the node (described in the Linux device-tree binding)
    and save the function number for bringing up a CPU for later usage.
    We do some sanity checks, especially we deny using HVC as a calling
    method, as it does not make much sense currently under Xen.
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile      |    1 +
 xen/arch/arm/psci.c        |   68 ++++++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/smpboot.c     |    4 ++
 xen/include/asm-arm/psci.h |    6 ++++
 4 files changed, 79 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 11cf663..d70f6d5 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -5,6 +5,7 @@ subdir-y += platforms
 obj-$(EARLY_PRINTK) += early_printk.o
 obj-y += cpu.o
 obj-y += domain.o
+obj-y += psci.o
 obj-y += vpsci.o
 obj-y += domctl.o
 obj-y += sysctl.o
diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
new file mode 100644
index 0000000..efb514e
--- /dev/null
+++ b/xen/arch/arm/psci.c
@@ -0,0 +1,68 @@
+/*
+ * xen/arch/arm/psci.c
+ *
+ * PSCI host support
+ *
+ * Andre Przywara <andre.przywara@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 <xen/types.h>
+#include <xen/mm.h>
+#include <xen/smp.h>
+#include <asm/psci.h>
+
+bool_t psci_available;
+
+static uint32_t psci_cpu_on_nr;
+
+int __init psci_init(void)
+{
+    const struct dt_device_node *psci;
+    int ret;
+    const char *prop_str;
+
+    psci = dt_find_compatible_node(NULL, NULL, "arm,psci");
+    if ( !psci )
+        return -ENODEV;
+
+    ret = dt_property_read_string(psci, "method", &prop_str);
+    if ( ret )
+    {
+        printk("/psci node does not provide a method (%d)\n", ret);
+        return -EINVAL;
+    }
+
+    /* Since Xen runs in HYP all of the time, it does not make sense to
+     * let it call into HYP for PSCI handling, since the handler just
+     * won't be there. So bail out with an error if "smc" is not used.
+     */
+    if ( strcmp(prop_str, "smc") )
+    {
+        printk("/psci method must be smc, but is: \"%s\"\n", prop_str);
+        return -EINVAL;
+    }
+
+    if ( !dt_property_read_u32(psci, "cpu_on", &psci_cpu_on_nr) )
+    {
+        printk("/psci node is missing the \"cpu_on\" property\n");
+        return -ENOENT;
+    }
+
+    psci_available = 1;
+
+    printk(XENLOG_INFO "Using PSCI for SMP bringup\n");
+
+    return 0;
+}
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 8d96c17..c53c765 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -30,6 +30,7 @@
 #include <xen/irq.h>
 #include <xen/console.h>
 #include <asm/gic.h>
+#include <asm/psci.h>
 
 cpumask_t cpu_online_map;
 cpumask_t cpu_present_map;
@@ -105,6 +106,9 @@ void __init smp_init_cpus(void)
     bool_t bootcpu_valid = 0;
     int rc;
 
+    /* scan the DTB for a PSCI node and set a global variable */
+    psci_init();
+
     if ( (rc = arch_smp_init()) < 0 )
     {
         printk(XENLOG_WARNING "SMP init failed (%d)\n"
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
index 67d4c35..36ce87d 100644
--- a/xen/include/asm-arm/psci.h
+++ b/xen/include/asm-arm/psci.h
@@ -6,6 +6,12 @@
 #define PSCI_EINVAL  -2
 #define PSCI_DENIED  -3
 
+/* availability of PSCI on the host for SMP bringup */
+extern bool_t psci_available;
+
+int psci_init(void);
+
+/* functions to handle guest PSCI requests */
 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);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:46:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUOS-0002wd-3b; Sun, 08 Dec 2013 02:46:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOR-0002wT-Kp
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:51 +0000
Received: from [85.158.143.35:7012] by server-1.bemta-4.messagelabs.com id
	CC/E4-02132-B9DD3A25; Sun, 08 Dec 2013 02:46:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1386470809!4036223!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1746 invoked from network); 8 Dec 2013 02:46:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:46: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 1VpUOO-0004WF-Sr
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOO-0000k0-QX
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:48 +0000
Date: Sun, 08 Dec 2013 02:46:48 +0000
Message-Id: <E1VpUOO-0000k0-QX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: add a function to invoke the PSCI
	handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3702d92fe4540f52032281c88182e48962c08f57
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:25:13 2013 +0000

    arm: add a function to invoke the PSCI handler
    
    The PSCI handler is invoked via a secure monitor call with the
    arguments defined in registers. Copy the function from the
    Linux code and adjust it to work on both ARM32 and ARM64.
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/psci.c        |   30 ++++++++++++++++++++++++++++++
 xen/include/asm-arm/psci.h |    1 +
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index efb514e..25a8697 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -25,8 +25,38 @@
 
 bool_t psci_available;
 
+#ifdef CONFIG_ARM_32
+#define REG_PREFIX "r"
+#else
+#define REG_PREFIX "x"
+#endif
+
+static noinline int __invoke_psci_fn_smc(register_t function_id,
+                                         register_t arg0,
+                                         register_t arg1,
+                                         register_t arg2)
+{
+    asm volatile(
+        __asmeq("%0", REG_PREFIX"0")
+        __asmeq("%1", REG_PREFIX"1")
+        __asmeq("%2", REG_PREFIX"2")
+        __asmeq("%3", REG_PREFIX"3")
+        "smc #0"
+        : "+r" (function_id)
+        : "r" (arg0), "r" (arg1), "r" (arg2));
+
+    return function_id;
+}
+
+#undef REG_PREFIX
+
 static uint32_t psci_cpu_on_nr;
 
+int call_psci_cpu_on(int cpu)
+{
+    return __invoke_psci_fn_smc(psci_cpu_on_nr, cpu, __pa(init_secondary), 0);
+}
+
 int __init psci_init(void)
 {
     const struct dt_device_node *psci;
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
index 36ce87d..189964b 100644
--- a/xen/include/asm-arm/psci.h
+++ b/xen/include/asm-arm/psci.h
@@ -10,6 +10,7 @@
 extern bool_t psci_available;
 
 int psci_init(void);
+int call_psci_cpu_on(int cpu);
 
 /* functions to handle guest PSCI requests */
 int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:46:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:46: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 1VpUOS-0002wd-3b; Sun, 08 Dec 2013 02:46:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOR-0002wT-Kp
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:51 +0000
Received: from [85.158.143.35:7012] by server-1.bemta-4.messagelabs.com id
	CC/E4-02132-B9DD3A25; Sun, 08 Dec 2013 02:46:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1386470809!4036223!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1746 invoked from network); 8 Dec 2013 02:46:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:46: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 1VpUOO-0004WF-Sr
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOO-0000k0-QX
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:48 +0000
Date: Sun, 08 Dec 2013 02:46:48 +0000
Message-Id: <E1VpUOO-0000k0-QX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: add a function to invoke the PSCI
	handler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3702d92fe4540f52032281c88182e48962c08f57
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:10 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:25:13 2013 +0000

    arm: add a function to invoke the PSCI handler
    
    The PSCI handler is invoked via a secure monitor call with the
    arguments defined in registers. Copy the function from the
    Linux code and adjust it to work on both ARM32 and ARM64.
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/psci.c        |   30 ++++++++++++++++++++++++++++++
 xen/include/asm-arm/psci.h |    1 +
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index efb514e..25a8697 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -25,8 +25,38 @@
 
 bool_t psci_available;
 
+#ifdef CONFIG_ARM_32
+#define REG_PREFIX "r"
+#else
+#define REG_PREFIX "x"
+#endif
+
+static noinline int __invoke_psci_fn_smc(register_t function_id,
+                                         register_t arg0,
+                                         register_t arg1,
+                                         register_t arg2)
+{
+    asm volatile(
+        __asmeq("%0", REG_PREFIX"0")
+        __asmeq("%1", REG_PREFIX"1")
+        __asmeq("%2", REG_PREFIX"2")
+        __asmeq("%3", REG_PREFIX"3")
+        "smc #0"
+        : "+r" (function_id)
+        : "r" (arg0), "r" (arg1), "r" (arg2));
+
+    return function_id;
+}
+
+#undef REG_PREFIX
+
 static uint32_t psci_cpu_on_nr;
 
+int call_psci_cpu_on(int cpu)
+{
+    return __invoke_psci_fn_smc(psci_cpu_on_nr, cpu, __pa(init_secondary), 0);
+}
+
 int __init psci_init(void)
 {
     const struct dt_device_node *psci;
diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
index 36ce87d..189964b 100644
--- a/xen/include/asm-arm/psci.h
+++ b/xen/include/asm-arm/psci.h
@@ -10,6 +10,7 @@
 extern bool_t psci_available;
 
 int psci_init(void);
+int call_psci_cpu_on(int cpu);
 
 /* functions to handle guest PSCI requests */
 int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:47:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUOc-0002yH-6J; Sun, 08 Dec 2013 02:47:02 +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 1VpUOb-0002y6-K3
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:01 +0000
Received: from [193.109.254.147:28348] by server-8.bemta-14.messagelabs.com id
	84/B9-30921-5ADD3A25; Sun, 08 Dec 2013 02:47:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1386470819!3665480!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24285 invoked from network); 8 Dec 2013 02:47: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;
	8 Dec 2013 02:47: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 1VpUOZ-0004WO-3D
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOY-0000kt-WF
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:59 +0000
Date: Sun, 08 Dec 2013 02:46:59 +0000
Message-Id: <E1VpUOY-0000kt-WF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm32: enable PSCI secondary CPU
	bringup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 875c495af5f2f07d98348d1ff19277f49d18be92
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:25:16 2013 +0000

    arm32: enable PSCI secondary CPU bringup
    
    If the device tree contains a PSCI node, we bring up secondary CPUs
    by invoking the appropriate PSCI handler.
    This will take priority over platform specific functions (which could
    call the PSCI wrapper themselves if needed), so any PSCI enablement
    of a platform will automatically be used (as on Linux).
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/smpboot.c |    4 +++-
 xen/arch/arm/platform.c      |    4 ++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm32/smpboot.c b/xen/arch/arm/arm32/smpboot.c
index 88fe8fb..2a77f29 100644
--- a/xen/arch/arm/arm32/smpboot.c
+++ b/xen/arch/arm/arm32/smpboot.c
@@ -10,7 +10,9 @@ int __init arch_smp_init(void)
 
 int __init arch_cpu_init(int cpu, struct dt_device_node *dn)
 {
-    /* TODO handle PSCI init */
+    /* Not needed on ARM32, as there is no relevant information in
+     * the CPU device tree node for ARMv7 CPUs.
+     */
     return 0;
 }
 
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index e13a354..1122bbd 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -20,6 +20,7 @@
 #include <asm/platform.h>
 #include <xen/device_tree.h>
 #include <xen/init.h>
+#include <asm/psci.h>
 
 extern const struct platform_desc _splatform[], _eplatform[];
 
@@ -109,6 +110,9 @@ int __init platform_specific_mapping(struct domain *d)
 #ifdef CONFIG_ARM_32
 int __init platform_cpu_up(int cpu)
 {
+    if ( psci_available )
+        return call_psci_cpu_on(cpu);
+
     if ( platform && platform->cpu_up )
         return platform->cpu_up(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 Sun Dec 08 02:47:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUOc-0002yH-6J; Sun, 08 Dec 2013 02:47:02 +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 1VpUOb-0002y6-K3
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:01 +0000
Received: from [193.109.254.147:28348] by server-8.bemta-14.messagelabs.com id
	84/B9-30921-5ADD3A25; Sun, 08 Dec 2013 02:47:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1386470819!3665480!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24285 invoked from network); 8 Dec 2013 02:47: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;
	8 Dec 2013 02:47: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 1VpUOZ-0004WO-3D
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOY-0000kt-WF
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:46:59 +0000
Date: Sun, 08 Dec 2013 02:46:59 +0000
Message-Id: <E1VpUOY-0000kt-WF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm32: enable PSCI secondary CPU
	bringup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 875c495af5f2f07d98348d1ff19277f49d18be92
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:25:16 2013 +0000

    arm32: enable PSCI secondary CPU bringup
    
    If the device tree contains a PSCI node, we bring up secondary CPUs
    by invoking the appropriate PSCI handler.
    This will take priority over platform specific functions (which could
    call the PSCI wrapper themselves if needed), so any PSCI enablement
    of a platform will automatically be used (as on Linux).
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/smpboot.c |    4 +++-
 xen/arch/arm/platform.c      |    4 ++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm32/smpboot.c b/xen/arch/arm/arm32/smpboot.c
index 88fe8fb..2a77f29 100644
--- a/xen/arch/arm/arm32/smpboot.c
+++ b/xen/arch/arm/arm32/smpboot.c
@@ -10,7 +10,9 @@ int __init arch_smp_init(void)
 
 int __init arch_cpu_init(int cpu, struct dt_device_node *dn)
 {
-    /* TODO handle PSCI init */
+    /* Not needed on ARM32, as there is no relevant information in
+     * the CPU device tree node for ARMv7 CPUs.
+     */
     return 0;
 }
 
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index e13a354..1122bbd 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -20,6 +20,7 @@
 #include <asm/platform.h>
 #include <xen/device_tree.h>
 #include <xen/init.h>
+#include <asm/psci.h>
 
 extern const struct platform_desc _splatform[], _eplatform[];
 
@@ -109,6 +110,9 @@ int __init platform_specific_mapping(struct domain *d)
 #ifdef CONFIG_ARM_32
 int __init platform_cpu_up(int cpu)
 {
+    if ( psci_available )
+        return call_psci_cpu_on(cpu);
+
     if ( platform && platform->cpu_up )
         return platform->cpu_up(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 Sun Dec 08 02:47:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUOm-00030D-9F; Sun, 08 Dec 2013 02:47: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 1VpUOl-000302-P8
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:11 +0000
Received: from [85.158.143.35:7360] by server-1.bemta-4.messagelabs.com id
	8D/F4-02132-FADD3A25; Sun, 08 Dec 2013 02:47:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1386470829!4094342!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24709 invoked from network); 8 Dec 2013 02:47:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:47: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 1VpUOj-0004Wx-7g
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOj-0000ld-67
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:09 +0000
Date: Sun, 08 Dec 2013 02:47:09 +0000
Message-Id: <E1VpUOj-0000ld-67@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm64: enable PSCI secondary CPU
	bringup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d65da94e03935878d84818a6890403997027cfa4
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:12 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:25:19 2013 +0000

    arm64: enable PSCI secondary CPU bringup
    
    If the device tree contains a PSCI node and the DTB CPU node tells us
    to use PSCI for enabling secondary cores, we set the function pointer
    to the PSCI wrapper function to enable PSCI SMP bringup.
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm64/smpboot.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index 6a34bd4..1287c72 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -6,6 +6,7 @@
 #include <xen/smp.h>
 #include <xen/vmap.h>
 #include <asm/io.h>
+#include <asm/psci.h>
 
 struct smp_enable_ops {
         int             (*prepare_cpu)(int);
@@ -52,6 +53,18 @@ static void __init smp_spin_table_init(int cpu, struct dt_device_node *dn)
     smp_enable_ops[cpu].prepare_cpu = smp_spin_table_cpu_up;
 }
 
+static int __init smp_psci_init(int cpu)
+{
+    if ( !psci_available )
+    {
+        printk("CPU%d asks for PSCI, but DTB has no PSCI node\n", cpu);
+        return -ENODEV;
+    }
+
+    smp_enable_ops[cpu].prepare_cpu = call_psci_cpu_on;
+    return 0;
+}
+
 int __init arch_smp_init(void)
 {
     /* Nothing */
@@ -71,7 +84,8 @@ int __init arch_cpu_init(int cpu, struct dt_device_node *dn)
 
     if ( !strcmp(enable_method, "spin-table") )
         smp_spin_table_init(cpu, dn);
-    /* TODO: method "psci" */
+    else if ( !strcmp(enable_method, "psci") )
+        return smp_psci_init(cpu);
     else
     {
         printk("CPU%d has unknown enable method \"%s\"\n", cpu, enable_method);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:47:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUOm-00030D-9F; Sun, 08 Dec 2013 02:47: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 1VpUOl-000302-P8
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:11 +0000
Received: from [85.158.143.35:7360] by server-1.bemta-4.messagelabs.com id
	8D/F4-02132-FADD3A25; Sun, 08 Dec 2013 02:47:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1386470829!4094342!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24709 invoked from network); 8 Dec 2013 02:47:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:47: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 1VpUOj-0004Wx-7g
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOj-0000ld-67
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:09 +0000
Date: Sun, 08 Dec 2013 02:47:09 +0000
Message-Id: <E1VpUOj-0000ld-67@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm64: enable PSCI secondary CPU
	bringup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d65da94e03935878d84818a6890403997027cfa4
Author:     Andre Przywara <andre.przywara@linaro.org>
AuthorDate: Thu Dec 5 11:08:12 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 5 12:25:19 2013 +0000

    arm64: enable PSCI secondary CPU bringup
    
    If the device tree contains a PSCI node and the DTB CPU node tells us
    to use PSCI for enabling secondary cores, we set the function pointer
    to the PSCI wrapper function to enable PSCI SMP bringup.
    
    Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm64/smpboot.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index 6a34bd4..1287c72 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -6,6 +6,7 @@
 #include <xen/smp.h>
 #include <xen/vmap.h>
 #include <asm/io.h>
+#include <asm/psci.h>
 
 struct smp_enable_ops {
         int             (*prepare_cpu)(int);
@@ -52,6 +53,18 @@ static void __init smp_spin_table_init(int cpu, struct dt_device_node *dn)
     smp_enable_ops[cpu].prepare_cpu = smp_spin_table_cpu_up;
 }
 
+static int __init smp_psci_init(int cpu)
+{
+    if ( !psci_available )
+    {
+        printk("CPU%d asks for PSCI, but DTB has no PSCI node\n", cpu);
+        return -ENODEV;
+    }
+
+    smp_enable_ops[cpu].prepare_cpu = call_psci_cpu_on;
+    return 0;
+}
+
 int __init arch_smp_init(void)
 {
     /* Nothing */
@@ -71,7 +84,8 @@ int __init arch_cpu_init(int cpu, struct dt_device_node *dn)
 
     if ( !strcmp(enable_method, "spin-table") )
         smp_spin_table_init(cpu, dn);
-    /* TODO: method "psci" */
+    else if ( !strcmp(enable_method, "psci") )
+        return smp_psci_init(cpu);
     else
     {
         printk("CPU%d has unknown enable method \"%s\"\n", cpu, enable_method);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:47:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUOx-00032M-DI; Sun, 08 Dec 2013 02:47: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 1VpUOw-00032B-IL
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:22 +0000
Received: from [85.158.139.211:46334] by server-9.bemta-5.messagelabs.com id
	FE/7B-15098-9BDD3A25; Sun, 08 Dec 2013 02:47:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386470839!2992683!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28891 invoked from network); 8 Dec 2013 02:47:20 -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;
	8 Dec 2013 02:47: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 1VpUOt-0004X3-CZ
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOt-0000lz-B0
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:19 +0000
Date: Sun, 08 Dec 2013 02:47:19 +0000
Message-Id: <E1VpUOt-0000lz-B0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Nested VMX: CR emulation fix up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef17e127c4111d8e01fe208495d83d15e8834cce
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Fri Dec 6 11:08:20 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 6 11:08:20 2013 +0100

    Nested VMX: CR emulation fix up
    
    This patch fixs two issues:
    1. The CR_READ_SHADOW should only cover the value that L2 wirtes to
    CR when L2 is running. But currently, L0 wirtes wrong value to
    it during virtual vmentry and L2's CR access emualtion.
    
    2. L2 changed cr[0/4] in a way that did not change any of L1's shadowed
    bits, but did change L0 shadowed bits. In this case, the effective cr[0/4]
    value that L1 would like to write into the hardware is consist of
    the L2-owned bits from the new value combined with the L1-owned bits
    from L1's guest cr[0/4].
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/hvm.c              |   13 +++++++---
 xen/arch/x86/hvm/vmx/vmx.c          |   13 ++++++++-
 xen/arch/x86/hvm/vmx/vvmx.c         |   44 +++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/hvm/nestedhvm.h |    8 ++++++
 xen/include/asm-x86/hvm/vcpu.h      |    3 ++
 xen/include/asm-x86/hvm/vmx/vvmx.h  |    1 +
 6 files changed, 76 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e2ba9de..b1f8dfe 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1810,6 +1810,13 @@ void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value)
     }
 }
 
+static void hvm_update_cr(struct vcpu *v, unsigned int cr, unsigned long value)
+{
+    v->arch.hvm_vcpu.guest_cr[cr] = value;
+    nestedhvm_set_cr(v, cr, value);
+    hvm_update_guest_cr(v, cr);
+}
+
 int hvm_set_cr0(unsigned long value)
 {
     struct vcpu *v = current;
@@ -1915,8 +1922,7 @@ int hvm_set_cr0(unsigned long value)
            hvm_funcs.handle_cd )
         hvm_funcs.handle_cd(v, value);
 
-    v->arch.hvm_vcpu.guest_cr[0] = value;
-    hvm_update_guest_cr(v, 0);
+    hvm_update_cr(v, 0, value);
 
     if ( (value ^ old_value) & X86_CR0_PG ) {
         if ( !nestedhvm_vmswitch_in_progress(v) && nestedhvm_vcpu_in_guestmode(v) )
@@ -1997,8 +2003,7 @@ int hvm_set_cr4(unsigned long value)
         goto gpf;
     }
 
-    v->arch.hvm_vcpu.guest_cr[4] = value;
-    hvm_update_guest_cr(v, 4);
+    hvm_update_cr(v, 4, value);
     hvm_memory_event_cr4(value, old_cr);
 
     /*
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 8d923e7..4ab15bc 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1171,6 +1171,11 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             vmx_update_cpu_exec_control(v);
         }
 
+        if ( !nestedhvm_vcpu_in_guestmode(v) )
+            __vmwrite(CR0_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[0]);
+        else
+            nvmx_set_cr_read_shadow(v, 0);
+
         if ( !(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_TS) )
         {
             if ( v != current )
@@ -1219,7 +1224,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         v->arch.hvm_vcpu.hw_cr[0] =
             v->arch.hvm_vcpu.guest_cr[0] | hw_cr0_mask;
         __vmwrite(GUEST_CR0, v->arch.hvm_vcpu.hw_cr[0]);
-        __vmwrite(CR0_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[0]);
 
         /* Changing CR0 can change some bits in real CR4. */
         vmx_update_guest_cr(v, 4);
@@ -1244,6 +1248,12 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         v->arch.hvm_vcpu.hw_cr[4] = HVM_CR4_HOST_MASK;
         if ( paging_mode_hap(v->domain) )
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+
+        if ( !nestedhvm_vcpu_in_guestmode(v) )
+            __vmwrite(CR4_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[4]);
+        else
+            nvmx_set_cr_read_shadow(v, 4);
+
         v->arch.hvm_vcpu.hw_cr[4] |= v->arch.hvm_vcpu.guest_cr[4];
         if ( v->arch.hvm_vmx.vmx_realmode ) 
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_VME;
@@ -1263,7 +1273,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
         __vmwrite(GUEST_CR4, v->arch.hvm_vcpu.hw_cr[4]);
-        __vmwrite(CR4_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[4]);
         break;
     default:
         BUG();
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 0cc32e1..0daad79 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1046,6 +1046,8 @@ static void load_shadow_guest_state(struct vcpu *v)
     vvmcs_to_shadow_bulk(v, ARRAY_SIZE(vmcs_gstate_field),
                          vmcs_gstate_field);
 
+    nvcpu->guest_cr[0] = __get_vvmcs(vvmcs, CR0_READ_SHADOW);
+    nvcpu->guest_cr[4] = __get_vvmcs(vvmcs, CR4_READ_SHADOW);
     hvm_set_cr0(__get_vvmcs(vvmcs, GUEST_CR0));
     hvm_set_cr4(__get_vvmcs(vvmcs, GUEST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, GUEST_CR3));
@@ -2461,3 +2463,45 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     return ( nvcpu->nv_vmexit_pending == 1 );
 }
 
+void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int cr)
+{
+    unsigned long cr_field, read_shadow_field, mask_field;
+
+    switch ( cr )
+    {
+    case 0:
+        cr_field = GUEST_CR0;
+        read_shadow_field = CR0_READ_SHADOW;
+        mask_field = CR0_GUEST_HOST_MASK;
+        break;
+    case 4:
+        cr_field = GUEST_CR4;
+        read_shadow_field = CR4_READ_SHADOW;
+        mask_field = CR4_GUEST_HOST_MASK;
+        break;
+    default:
+        gdprintk(XENLOG_WARNING, "Set read shadow for CR%d.\n", cr);
+        return;
+    }
+
+    if ( !nestedhvm_vmswitch_in_progress(v) )
+    {
+        unsigned long virtual_cr_mask = 
+            __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, mask_field);
+
+        /*
+         * We get here when L2 changed cr in a way that did not change
+         * any of L1's shadowed bits (see nvmx_n2_vmexit_handler),
+         * but did change L0 shadowed bits. So we first calculate the
+         * effective cr value that L1 would like to write into the
+         * hardware. It consists of the L2-owned bits from the new
+         * value combined with the L1-owned bits from L1's guest cr.
+         */
+        v->arch.hvm_vcpu.guest_cr[cr] &= ~virtual_cr_mask;
+        v->arch.hvm_vcpu.guest_cr[cr] |= virtual_cr_mask &
+            __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, cr_field);
+    }
+
+    /* nvcpu.guest_cr is what L2 write to cr actually. */
+    __vmwrite(read_shadow_field, v->arch.hvm_vcpu.nvcpu.guest_cr[cr]);
+}
diff --git a/xen/include/asm-x86/hvm/nestedhvm.h b/xen/include/asm-x86/hvm/nestedhvm.h
index 649c511..d8124cf 100644
--- a/xen/include/asm-x86/hvm/nestedhvm.h
+++ b/xen/include/asm-x86/hvm/nestedhvm.h
@@ -68,4 +68,12 @@ void nestedhvm_vmcx_flushtlb(struct p2m_domain *p2m);
 
 bool_t nestedhvm_is_n2(struct vcpu *v);
 
+static inline void nestedhvm_set_cr(struct vcpu *v, unsigned int cr,
+                                    unsigned long value)
+{
+    if ( !nestedhvm_vmswitch_in_progress(v) &&
+         nestedhvm_vcpu_in_guestmode(v) )
+        v->arch.hvm_vcpu.nvcpu.guest_cr[cr] = value;
+}
+
 #endif /* _HVM_NESTEDHVM_H */
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index 4f45060..c1abcec 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -110,6 +110,9 @@ struct nestedvcpu {
      */
     bool_t nv_ioport80;
     bool_t nv_ioportED;
+
+    /* L2's control-resgister, just as the L2 sees them. */
+    unsigned long       guest_cr[5];
 };
 
 #define vcpu_nestedhvm(v) ((v)->arch.hvm_vcpu.nvcpu)
diff --git a/xen/include/asm-x86/hvm/vmx/vvmx.h b/xen/include/asm-x86/hvm/vmx/vvmx.h
index 848be75..c17a440 100644
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h
@@ -223,6 +223,7 @@ void nvmx_idtv_handling(void);
 u64 nvmx_get_tsc_offset(struct vcpu *v);
 int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                           unsigned int exit_reason);
+void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int cr);
 
 uint64_t nept_get_ept_vpid_cap(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 Sun Dec 08 02:47:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUOx-00032M-DI; Sun, 08 Dec 2013 02:47: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 1VpUOw-00032B-IL
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:22 +0000
Received: from [85.158.139.211:46334] by server-9.bemta-5.messagelabs.com id
	FE/7B-15098-9BDD3A25; Sun, 08 Dec 2013 02:47:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386470839!2992683!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28891 invoked from network); 8 Dec 2013 02:47:20 -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;
	8 Dec 2013 02:47: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 1VpUOt-0004X3-CZ
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUOt-0000lz-B0
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:19 +0000
Date: Sun, 08 Dec 2013 02:47:19 +0000
Message-Id: <E1VpUOt-0000lz-B0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Nested VMX: CR emulation fix up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef17e127c4111d8e01fe208495d83d15e8834cce
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Fri Dec 6 11:08:20 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 6 11:08:20 2013 +0100

    Nested VMX: CR emulation fix up
    
    This patch fixs two issues:
    1. The CR_READ_SHADOW should only cover the value that L2 wirtes to
    CR when L2 is running. But currently, L0 wirtes wrong value to
    it during virtual vmentry and L2's CR access emualtion.
    
    2. L2 changed cr[0/4] in a way that did not change any of L1's shadowed
    bits, but did change L0 shadowed bits. In this case, the effective cr[0/4]
    value that L1 would like to write into the hardware is consist of
    the L2-owned bits from the new value combined with the L1-owned bits
    from L1's guest cr[0/4].
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/hvm.c              |   13 +++++++---
 xen/arch/x86/hvm/vmx/vmx.c          |   13 ++++++++-
 xen/arch/x86/hvm/vmx/vvmx.c         |   44 +++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/hvm/nestedhvm.h |    8 ++++++
 xen/include/asm-x86/hvm/vcpu.h      |    3 ++
 xen/include/asm-x86/hvm/vmx/vvmx.h  |    1 +
 6 files changed, 76 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e2ba9de..b1f8dfe 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1810,6 +1810,13 @@ void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value)
     }
 }
 
+static void hvm_update_cr(struct vcpu *v, unsigned int cr, unsigned long value)
+{
+    v->arch.hvm_vcpu.guest_cr[cr] = value;
+    nestedhvm_set_cr(v, cr, value);
+    hvm_update_guest_cr(v, cr);
+}
+
 int hvm_set_cr0(unsigned long value)
 {
     struct vcpu *v = current;
@@ -1915,8 +1922,7 @@ int hvm_set_cr0(unsigned long value)
            hvm_funcs.handle_cd )
         hvm_funcs.handle_cd(v, value);
 
-    v->arch.hvm_vcpu.guest_cr[0] = value;
-    hvm_update_guest_cr(v, 0);
+    hvm_update_cr(v, 0, value);
 
     if ( (value ^ old_value) & X86_CR0_PG ) {
         if ( !nestedhvm_vmswitch_in_progress(v) && nestedhvm_vcpu_in_guestmode(v) )
@@ -1997,8 +2003,7 @@ int hvm_set_cr4(unsigned long value)
         goto gpf;
     }
 
-    v->arch.hvm_vcpu.guest_cr[4] = value;
-    hvm_update_guest_cr(v, 4);
+    hvm_update_cr(v, 4, value);
     hvm_memory_event_cr4(value, old_cr);
 
     /*
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 8d923e7..4ab15bc 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1171,6 +1171,11 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             vmx_update_cpu_exec_control(v);
         }
 
+        if ( !nestedhvm_vcpu_in_guestmode(v) )
+            __vmwrite(CR0_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[0]);
+        else
+            nvmx_set_cr_read_shadow(v, 0);
+
         if ( !(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_TS) )
         {
             if ( v != current )
@@ -1219,7 +1224,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         v->arch.hvm_vcpu.hw_cr[0] =
             v->arch.hvm_vcpu.guest_cr[0] | hw_cr0_mask;
         __vmwrite(GUEST_CR0, v->arch.hvm_vcpu.hw_cr[0]);
-        __vmwrite(CR0_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[0]);
 
         /* Changing CR0 can change some bits in real CR4. */
         vmx_update_guest_cr(v, 4);
@@ -1244,6 +1248,12 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         v->arch.hvm_vcpu.hw_cr[4] = HVM_CR4_HOST_MASK;
         if ( paging_mode_hap(v->domain) )
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+
+        if ( !nestedhvm_vcpu_in_guestmode(v) )
+            __vmwrite(CR4_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[4]);
+        else
+            nvmx_set_cr_read_shadow(v, 4);
+
         v->arch.hvm_vcpu.hw_cr[4] |= v->arch.hvm_vcpu.guest_cr[4];
         if ( v->arch.hvm_vmx.vmx_realmode ) 
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_VME;
@@ -1263,7 +1273,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
         __vmwrite(GUEST_CR4, v->arch.hvm_vcpu.hw_cr[4]);
-        __vmwrite(CR4_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[4]);
         break;
     default:
         BUG();
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 0cc32e1..0daad79 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1046,6 +1046,8 @@ static void load_shadow_guest_state(struct vcpu *v)
     vvmcs_to_shadow_bulk(v, ARRAY_SIZE(vmcs_gstate_field),
                          vmcs_gstate_field);
 
+    nvcpu->guest_cr[0] = __get_vvmcs(vvmcs, CR0_READ_SHADOW);
+    nvcpu->guest_cr[4] = __get_vvmcs(vvmcs, CR4_READ_SHADOW);
     hvm_set_cr0(__get_vvmcs(vvmcs, GUEST_CR0));
     hvm_set_cr4(__get_vvmcs(vvmcs, GUEST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, GUEST_CR3));
@@ -2461,3 +2463,45 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     return ( nvcpu->nv_vmexit_pending == 1 );
 }
 
+void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int cr)
+{
+    unsigned long cr_field, read_shadow_field, mask_field;
+
+    switch ( cr )
+    {
+    case 0:
+        cr_field = GUEST_CR0;
+        read_shadow_field = CR0_READ_SHADOW;
+        mask_field = CR0_GUEST_HOST_MASK;
+        break;
+    case 4:
+        cr_field = GUEST_CR4;
+        read_shadow_field = CR4_READ_SHADOW;
+        mask_field = CR4_GUEST_HOST_MASK;
+        break;
+    default:
+        gdprintk(XENLOG_WARNING, "Set read shadow for CR%d.\n", cr);
+        return;
+    }
+
+    if ( !nestedhvm_vmswitch_in_progress(v) )
+    {
+        unsigned long virtual_cr_mask = 
+            __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, mask_field);
+
+        /*
+         * We get here when L2 changed cr in a way that did not change
+         * any of L1's shadowed bits (see nvmx_n2_vmexit_handler),
+         * but did change L0 shadowed bits. So we first calculate the
+         * effective cr value that L1 would like to write into the
+         * hardware. It consists of the L2-owned bits from the new
+         * value combined with the L1-owned bits from L1's guest cr.
+         */
+        v->arch.hvm_vcpu.guest_cr[cr] &= ~virtual_cr_mask;
+        v->arch.hvm_vcpu.guest_cr[cr] |= virtual_cr_mask &
+            __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, cr_field);
+    }
+
+    /* nvcpu.guest_cr is what L2 write to cr actually. */
+    __vmwrite(read_shadow_field, v->arch.hvm_vcpu.nvcpu.guest_cr[cr]);
+}
diff --git a/xen/include/asm-x86/hvm/nestedhvm.h b/xen/include/asm-x86/hvm/nestedhvm.h
index 649c511..d8124cf 100644
--- a/xen/include/asm-x86/hvm/nestedhvm.h
+++ b/xen/include/asm-x86/hvm/nestedhvm.h
@@ -68,4 +68,12 @@ void nestedhvm_vmcx_flushtlb(struct p2m_domain *p2m);
 
 bool_t nestedhvm_is_n2(struct vcpu *v);
 
+static inline void nestedhvm_set_cr(struct vcpu *v, unsigned int cr,
+                                    unsigned long value)
+{
+    if ( !nestedhvm_vmswitch_in_progress(v) &&
+         nestedhvm_vcpu_in_guestmode(v) )
+        v->arch.hvm_vcpu.nvcpu.guest_cr[cr] = value;
+}
+
 #endif /* _HVM_NESTEDHVM_H */
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index 4f45060..c1abcec 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -110,6 +110,9 @@ struct nestedvcpu {
      */
     bool_t nv_ioport80;
     bool_t nv_ioportED;
+
+    /* L2's control-resgister, just as the L2 sees them. */
+    unsigned long       guest_cr[5];
 };
 
 #define vcpu_nestedhvm(v) ((v)->arch.hvm_vcpu.nvcpu)
diff --git a/xen/include/asm-x86/hvm/vmx/vvmx.h b/xen/include/asm-x86/hvm/vmx/vvmx.h
index 848be75..c17a440 100644
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h
@@ -223,6 +223,7 @@ void nvmx_idtv_handling(void);
 u64 nvmx_get_tsc_offset(struct vcpu *v);
 int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                           unsigned int exit_reason);
+void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int cr);
 
 uint64_t nept_get_ept_vpid_cap(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 Sun Dec 08 02:47:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUP7-00034S-Hu; Sun, 08 Dec 2013 02:47: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 1VpUP6-00034F-7K
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:32 +0000
Received: from [193.109.254.147:39715] by server-7.bemta-14.messagelabs.com id
	EB/00-15500-3CDD3A25; Sun, 08 Dec 2013 02:47:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1386470849!3665511!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25483 invoked from network); 8 Dec 2013 02:47:30 -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;
	8 Dec 2013 02:47: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 1VpUP3-0004XB-Hi
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUP3-0000mN-Fw
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:29 +0000
Date: Sun, 08 Dec 2013 02:47:29 +0000
Message-Id: <E1VpUP3-0000mN-Fw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "VMX: flush cache when vmentry
	back to UC guest"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f1c9658d6802c4332f8bafdb049811bad5c9a786
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 6 11:10:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 6 11:10:54 2013 +0100

    Revert "VMX: flush cache when vmentry back to UC guest"
    
    This reverts commit 86d60e85 as well as one related change from
    62652c00 ("VMX: fix cr0.cd handling"), on the basis that all of this
    flushing is still insufficient and, while not known to fix anything, is
    known to negatively affect performance.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Liu Jinsong <jinsong.liu@intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/hvm.c         |    6 ------
 xen/arch/x86/hvm/vmx/vmx.c     |   11 -----------
 xen/include/asm-x86/hvm/vcpu.h |    1 -
 3 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index b1f8dfe..69f7e74 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2571,9 +2571,6 @@ static enum hvm_copy_result __hvm_copy(
         return HVMCOPY_unhandleable;
 #endif
 
-    if ( unlikely(curr->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory = 1;
-
     while ( todo > 0 )
     {
         count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo);
@@ -2685,9 +2682,6 @@ static enum hvm_copy_result __hvm_clear(paddr_t addr, int size)
         return HVMCOPY_unhandleable;
 #endif
 
-    if ( unlikely(curr->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory = 1;
-
     while ( todo > 0 )
     {
         count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 4ab15bc..dfff628 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -643,10 +643,6 @@ static void vmx_ctxt_switch_to(struct vcpu *v)
             __invept(INVEPT_SINGLE_CONTEXT, ept_get_eptp(ept_data), 0);
     }
 
-    /* For guest cr0.cd setting, do not use potentially polluted cache */
-    if ( unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        wbinvd();
-
     vmx_restore_guest_msrs(v);
     vmx_restore_dr(v);
 }
@@ -3008,13 +3004,6 @@ void vmx_vmenter_helper(const struct cpu_user_regs *regs)
     struct hvm_vcpu_asid *p_asid;
     bool_t need_flush;
 
-    /* In case hypervisor access hvm memory when guest uc mode */
-    if ( unlikely(curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory) )
-    {
-        curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory = 0;
-        wbinvd();
-    }
-
     if ( !cpu_has_vmx_vpid )
         goto out;
     if ( nestedhvm_vcpu_in_guestmode(curr) )
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index c1abcec..122ab0d 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -172,7 +172,6 @@ struct hvm_vcpu {
 
     /* Which cache mode is this VCPU in (CR0:CD/NW)? */
     u8                  cache_mode;
-    bool_t              hypervisor_access_uc_hvm_memory;
 
     struct hvm_vcpu_io  hvm_io;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:47:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUP7-00034S-Hu; Sun, 08 Dec 2013 02:47: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 1VpUP6-00034F-7K
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:32 +0000
Received: from [193.109.254.147:39715] by server-7.bemta-14.messagelabs.com id
	EB/00-15500-3CDD3A25; Sun, 08 Dec 2013 02:47:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1386470849!3665511!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25483 invoked from network); 8 Dec 2013 02:47:30 -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;
	8 Dec 2013 02:47: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 1VpUP3-0004XB-Hi
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUP3-0000mN-Fw
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:29 +0000
Date: Sun, 08 Dec 2013 02:47:29 +0000
Message-Id: <E1VpUP3-0000mN-Fw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "VMX: flush cache when vmentry
	back to UC guest"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f1c9658d6802c4332f8bafdb049811bad5c9a786
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 6 11:10:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 6 11:10:54 2013 +0100

    Revert "VMX: flush cache when vmentry back to UC guest"
    
    This reverts commit 86d60e85 as well as one related change from
    62652c00 ("VMX: fix cr0.cd handling"), on the basis that all of this
    flushing is still insufficient and, while not known to fix anything, is
    known to negatively affect performance.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Liu Jinsong <jinsong.liu@intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/hvm.c         |    6 ------
 xen/arch/x86/hvm/vmx/vmx.c     |   11 -----------
 xen/include/asm-x86/hvm/vcpu.h |    1 -
 3 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index b1f8dfe..69f7e74 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2571,9 +2571,6 @@ static enum hvm_copy_result __hvm_copy(
         return HVMCOPY_unhandleable;
 #endif
 
-    if ( unlikely(curr->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory = 1;
-
     while ( todo > 0 )
     {
         count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo);
@@ -2685,9 +2682,6 @@ static enum hvm_copy_result __hvm_clear(paddr_t addr, int size)
         return HVMCOPY_unhandleable;
 #endif
 
-    if ( unlikely(curr->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory = 1;
-
     while ( todo > 0 )
     {
         count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 4ab15bc..dfff628 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -643,10 +643,6 @@ static void vmx_ctxt_switch_to(struct vcpu *v)
             __invept(INVEPT_SINGLE_CONTEXT, ept_get_eptp(ept_data), 0);
     }
 
-    /* For guest cr0.cd setting, do not use potentially polluted cache */
-    if ( unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        wbinvd();
-
     vmx_restore_guest_msrs(v);
     vmx_restore_dr(v);
 }
@@ -3008,13 +3004,6 @@ void vmx_vmenter_helper(const struct cpu_user_regs *regs)
     struct hvm_vcpu_asid *p_asid;
     bool_t need_flush;
 
-    /* In case hypervisor access hvm memory when guest uc mode */
-    if ( unlikely(curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory) )
-    {
-        curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory = 0;
-        wbinvd();
-    }
-
     if ( !cpu_has_vmx_vpid )
         goto out;
     if ( nestedhvm_vcpu_in_guestmode(curr) )
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index c1abcec..122ab0d 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -172,7 +172,6 @@ struct hvm_vcpu {
 
     /* Which cache mode is this VCPU in (CR0:CD/NW)? */
     u8                  cache_mode;
-    bool_t              hypervisor_access_uc_hvm_memory;
 
     struct hvm_vcpu_io  hvm_io;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:47:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUPH-00035z-Kt; Sun, 08 Dec 2013 02:47: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 1VpUPG-00035m-Gs
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:42 +0000
Received: from [85.158.137.68:53639] by server-8.bemta-3.messagelabs.com id
	C3/48-31081-DCDD3A25; Sun, 08 Dec 2013 02:47:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1386470859!2456877!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7463 invoked from network); 8 Dec 2013 02:47:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:47: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 1VpUPD-0004XH-Mc
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUPD-0000nG-Kx
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:39 +0000
Date: Sun, 08 Dec 2013 02:47:39 +0000
Message-Id: <E1VpUPD-0000nG-Kx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: fix BIOS memory corruption
	on certain IBM 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 1ed76797439e384de18fcd6810bd4743d4f38b1e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 6 11:28:00 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 6 11:28:00 2013 +0100

    x86/boot: fix BIOS memory corruption on certain IBM systems
    
    IBM System x3530 M4 BIOSes (including the latest available at the time of this
    patch) will corrupt a byte at physical address 0x105ff1 to the value of 0x86
    if %esp has the value 0x00080000 when issuing an `int $0x15 (ax=0xec00)` to
    inform the system about our intended operating mode.
    
    Xen gets unhappy when the bootloader has placed it's .text section in over
    this specific region of RAM.
    
    After dropping into 16bit mode, clear all 32 bits of %esp, and for the BIOS
    call already documented to be affected by BIOS bugs clear all GPRs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/boot/trampoline.S |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 827f412..4f5f8d7 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -143,7 +143,7 @@ trampoline_boot_cpu_entry:
         mov     %ax,%ss
 
         /* Initialise stack pointer and IDT, and enable irqs. */
-        xor     %sp,%sp
+        xor     %esp,%esp
         lidt    bootsym(rm_idt)
         sti
 
@@ -151,6 +151,11 @@ trampoline_boot_cpu_entry:
          * Declare that our target operating mode is long mode.
          * Initialise 32-bit registers since some buggy BIOSes depend on it.
          */
+        xor     %ecx,%ecx
+        xor     %edx,%edx
+        xor     %esi,%esi
+        xor     %edi,%edi
+        xor     %ebp,%ebp
         movl    $0xec00,%eax      # declare target operating mode
         movl    $0x0002,%ebx      # long mode
         int     $0x15
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:47:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUPH-00035z-Kt; Sun, 08 Dec 2013 02:47: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 1VpUPG-00035m-Gs
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:42 +0000
Received: from [85.158.137.68:53639] by server-8.bemta-3.messagelabs.com id
	C3/48-31081-DCDD3A25; Sun, 08 Dec 2013 02:47:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1386470859!2456877!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7463 invoked from network); 8 Dec 2013 02:47:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:47: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 1VpUPD-0004XH-Mc
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUPD-0000nG-Kx
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:39 +0000
Date: Sun, 08 Dec 2013 02:47:39 +0000
Message-Id: <E1VpUPD-0000nG-Kx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: fix BIOS memory corruption
	on certain IBM 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 1ed76797439e384de18fcd6810bd4743d4f38b1e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 6 11:28:00 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 6 11:28:00 2013 +0100

    x86/boot: fix BIOS memory corruption on certain IBM systems
    
    IBM System x3530 M4 BIOSes (including the latest available at the time of this
    patch) will corrupt a byte at physical address 0x105ff1 to the value of 0x86
    if %esp has the value 0x00080000 when issuing an `int $0x15 (ax=0xec00)` to
    inform the system about our intended operating mode.
    
    Xen gets unhappy when the bootloader has placed it's .text section in over
    this specific region of RAM.
    
    After dropping into 16bit mode, clear all 32 bits of %esp, and for the BIOS
    call already documented to be affected by BIOS bugs clear all GPRs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/boot/trampoline.S |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 827f412..4f5f8d7 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -143,7 +143,7 @@ trampoline_boot_cpu_entry:
         mov     %ax,%ss
 
         /* Initialise stack pointer and IDT, and enable irqs. */
-        xor     %sp,%sp
+        xor     %esp,%esp
         lidt    bootsym(rm_idt)
         sti
 
@@ -151,6 +151,11 @@ trampoline_boot_cpu_entry:
          * Declare that our target operating mode is long mode.
          * Initialise 32-bit registers since some buggy BIOSes depend on it.
          */
+        xor     %ecx,%ecx
+        xor     %edx,%edx
+        xor     %esi,%esi
+        xor     %edi,%edi
+        xor     %ebp,%ebp
         movl    $0xec00,%eax      # declare target operating mode
         movl    $0x0002,%ebx      # long mode
         int     $0x15
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:47:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUPT-00037j-Nk; Sun, 08 Dec 2013 02:47:55 +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 1VpUPS-00037W-BW
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:54 +0000
Received: from [85.158.139.211:46955] by server-9.bemta-5.messagelabs.com id
	F3/AB-15098-9DDD3A25; Sun, 08 Dec 2013 02:47:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386470870!332164!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21954 invoked from network); 8 Dec 2013 02:47:51 -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;
	8 Dec 2013 02:47: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 1VpUPN-0004XR-Rd
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUPN-0000nc-PV
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:49 +0000
Date: Sun, 08 Dec 2013 02:47:49 +0000
Message-Id: <E1VpUPN-0000nc-PV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: remove hardcoded gnttab
	location from 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 b490724477f9215bb7a0a3e3b1ebe01e0fc20c17
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 4 17:03:02 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:45:21 2013 +0000

    xen: arm: remove hardcoded gnttab location from dom0
    
    The DT provided to guests (including dom0) includes a Xen node which, among
    other things, describes an MMIO region which can be safely used for grant
    table mappings (i.e. it is a hole in the physical address space). For domU we
    provide a hardcoded values based on our hardcoded guest virtual machine
    layout. However for dom0 we need to fit in with the underlying platform.
    Leaving this hardcoded was an oversight which on some platforms could result
    in the grant table overlaying RAM or MMIO regions which are in use by domain
    0.
    
    For the 4.4 release do as we did with the dom0 evtchn PPI and provide a hook
    for the platform code to supply a suitable hardcoded address for the platform
    (derived from reading the data sheet). Platforms which do not provide the hook
    get the existing address as a default.
    
    After 4.4 we should switch to selecting a region of host RAM which is not RAM
    in the guest address map. This should be more flexible and safer but the patch
    was looking too complex for 4.4.
    
    Platform        Gnttab Address
    ========        ==============
    exynos5.c       0xb0000000, confirmed and tested by Julien.
    sunxi.c         0x01d00000, confirmed in data sheet.
    midway.c        0xff800000, confirmed by Andre, boot tested by Ian.
    vexpress.c      0xb0000000, existing hardcoded value was selected for vexpress.
    omap5.c         0x4b000000, confirmed by Baozi
    xgene-storm.c   0x1f800000, confirmed by Pranavkumar
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Tested-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Julien.Grall@linaro.org
    Cc: Stefano.Stabellini@eu.citrix.com
    Cc: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Chen Baozi <baozich@gmail.com>
    Acked-by: Pranavkumar Sawargaonkar <psawargaonkar@apm.com>
    Cc: Anup Patel <apatel@apm.com>
---
 xen/arch/arm/domain_build.c          |    7 +++++--
 xen/arch/arm/platform.c              |   14 ++++++++++++++
 xen/arch/arm/platforms/midway.c      |    3 +++
 xen/arch/arm/platforms/omap5.c       |    3 +++
 xen/arch/arm/platforms/sunxi.c       |    3 +++
 xen/arch/arm/platforms/xgene-storm.c |    3 +++
 xen/include/asm-arm/platform.h       |    7 +++++++
 7 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 532e811..d50658b 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -331,6 +331,7 @@ static int make_hypervisor_node(struct domain *d,
     int res;
     int addrcells = dt_n_addr_cells(parent);
     int sizecells = dt_n_size_cells(parent);
+    paddr_t gnttab_start, gnttab_size;
 
     DPRINT("Create hypervisor node\n");
 
@@ -352,10 +353,12 @@ static int make_hypervisor_node(struct domain *d,
     if ( res )
         return res;
 
-    DPRINT("  Grant table range: 0xb0000000-0x20000\n");
+    platform_dom0_gnttab(&gnttab_start, &gnttab_size);
+    DPRINT("  Grant table range: %#"PRIpaddr"-%#"PRIpaddr"\n",
+           gnttab_start, gnttab_start + gnttab_size);
     /* reg 0 is grant table space */
     cells = &reg[0];
-    dt_set_range(&cells, parent, 0xb0000000, 0x20000);
+    dt_set_range(&cells, parent, gnttab_start, gnttab_size);
     res = fdt_property(fdt, "reg", reg,
                        dt_cells_to_size(addrcells + sizecells));
     if ( res )
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 1122bbd..74c3328 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -167,6 +167,20 @@ unsigned int platform_dom0_evtchn_ppi(void)
     return GUEST_EVTCHN_PPI;
 }
 
+void platform_dom0_gnttab(paddr_t *start, paddr_t *size)
+{
+    if ( platform && platform->dom0_gnttab_size )
+    {
+        *start = platform->dom0_gnttab_start;
+        *size = platform->dom0_gnttab_size;
+    }
+    else
+    {
+        *start = 0xb0000000;
+        *size = 0x20000;
+    }
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/platforms/midway.c b/xen/arch/arm/platforms/midway.c
index b221279..42f7697 100644
--- a/xen/arch/arm/platforms/midway.c
+++ b/xen/arch/arm/platforms/midway.c
@@ -51,6 +51,9 @@ static const char * const midway_dt_compat[] __initconst =
 PLATFORM_START(midway, "CALXEDA MIDWAY")
     .compatible = midway_dt_compat,
     .reset = midway_reset,
+
+    .dom0_gnttab_start = 0xff800000,
+    .dom0_gnttab_size = 0x20000,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index 423d11b..76d4d9b 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -156,6 +156,9 @@ PLATFORM_START(omap5, "TI OMAP5")
     .specific_mapping = omap5_specific_mapping,
     .smp_init = omap5_smp_init,
     .cpu_up = cpu_up_send_sgi,
+
+    .dom0_gnttab_start = 0x4b000000,
+    .dom0_gnttab_size = 0x20000,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/sunxi.c b/xen/arch/arm/platforms/sunxi.c
index b466518..fb12801 100644
--- a/xen/arch/arm/platforms/sunxi.c
+++ b/xen/arch/arm/platforms/sunxi.c
@@ -37,6 +37,9 @@ static const struct dt_device_match sunxi_blacklist_dev[] __initconst =
 PLATFORM_START(sunxi, "Allwinner A20")
     .compatible = sunxi_dt_compat,
     .blacklist_dev = sunxi_blacklist_dev,
+
+    .dom0_gnttab_start = 0x01d00000,
+    .dom0_gnttab_size = 0x20000,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index f760fcd..5b0bd5f 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -118,7 +118,10 @@ PLATFORM_START(xgene_storm, "APM X-GENE STORM")
     .compatible = xgene_storm_dt_compat,
     .quirks = xgene_storm_quirks,
     .specific_mapping = xgene_storm_specific_mapping,
+
     .dom0_evtchn_ppi = 24,
+    .dom0_gnttab_start = 0x1f800000,
+    .dom0_gnttab_size = 0x20000,
 PLATFORM_END
 
 /*
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index edb399b..bcd2097 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -41,6 +41,12 @@ struct platform_desc {
      * The IRQ (PPI) to use to inject event channels to dom0.
      */
     unsigned int dom0_evtchn_ppi;
+    /*
+     * The location of a region of physical address space which dom0
+     * can use for grant table mappings. If size is zero defaults to
+     * 0xb0000000-0xb0020000.
+     */
+    paddr_t dom0_gnttab_start, dom0_gnttab_size;
 };
 
 /*
@@ -61,6 +67,7 @@ void platform_poweroff(void);
 bool_t platform_has_quirk(uint32_t quirk);
 bool_t platform_device_is_blacklisted(const struct dt_device_node *node);
 unsigned int platform_dom0_evtchn_ppi(void);
+void platform_dom0_gnttab(paddr_t *start, paddr_t *size);
 
 #define PLATFORM_START(_name, _namestr)                         \
 static const struct platform_desc  __plat_desc_##_name __used   \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:47:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:47: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 1VpUPT-00037j-Nk; Sun, 08 Dec 2013 02:47:55 +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 1VpUPS-00037W-BW
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:54 +0000
Received: from [85.158.139.211:46955] by server-9.bemta-5.messagelabs.com id
	F3/AB-15098-9DDD3A25; Sun, 08 Dec 2013 02:47:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386470870!332164!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21954 invoked from network); 8 Dec 2013 02:47:51 -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;
	8 Dec 2013 02:47: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 1VpUPN-0004XR-Rd
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUPN-0000nc-PV
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:49 +0000
Date: Sun, 08 Dec 2013 02:47:49 +0000
Message-Id: <E1VpUPN-0000nc-PV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: remove hardcoded gnttab
	location from 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 b490724477f9215bb7a0a3e3b1ebe01e0fc20c17
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 4 17:03:02 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:45:21 2013 +0000

    xen: arm: remove hardcoded gnttab location from dom0
    
    The DT provided to guests (including dom0) includes a Xen node which, among
    other things, describes an MMIO region which can be safely used for grant
    table mappings (i.e. it is a hole in the physical address space). For domU we
    provide a hardcoded values based on our hardcoded guest virtual machine
    layout. However for dom0 we need to fit in with the underlying platform.
    Leaving this hardcoded was an oversight which on some platforms could result
    in the grant table overlaying RAM or MMIO regions which are in use by domain
    0.
    
    For the 4.4 release do as we did with the dom0 evtchn PPI and provide a hook
    for the platform code to supply a suitable hardcoded address for the platform
    (derived from reading the data sheet). Platforms which do not provide the hook
    get the existing address as a default.
    
    After 4.4 we should switch to selecting a region of host RAM which is not RAM
    in the guest address map. This should be more flexible and safer but the patch
    was looking too complex for 4.4.
    
    Platform        Gnttab Address
    ========        ==============
    exynos5.c       0xb0000000, confirmed and tested by Julien.
    sunxi.c         0x01d00000, confirmed in data sheet.
    midway.c        0xff800000, confirmed by Andre, boot tested by Ian.
    vexpress.c      0xb0000000, existing hardcoded value was selected for vexpress.
    omap5.c         0x4b000000, confirmed by Baozi
    xgene-storm.c   0x1f800000, confirmed by Pranavkumar
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Tested-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Julien.Grall@linaro.org
    Cc: Stefano.Stabellini@eu.citrix.com
    Cc: Andre Przywara <andre.przywara@linaro.org>
    Acked-by: Chen Baozi <baozich@gmail.com>
    Acked-by: Pranavkumar Sawargaonkar <psawargaonkar@apm.com>
    Cc: Anup Patel <apatel@apm.com>
---
 xen/arch/arm/domain_build.c          |    7 +++++--
 xen/arch/arm/platform.c              |   14 ++++++++++++++
 xen/arch/arm/platforms/midway.c      |    3 +++
 xen/arch/arm/platforms/omap5.c       |    3 +++
 xen/arch/arm/platforms/sunxi.c       |    3 +++
 xen/arch/arm/platforms/xgene-storm.c |    3 +++
 xen/include/asm-arm/platform.h       |    7 +++++++
 7 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 532e811..d50658b 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -331,6 +331,7 @@ static int make_hypervisor_node(struct domain *d,
     int res;
     int addrcells = dt_n_addr_cells(parent);
     int sizecells = dt_n_size_cells(parent);
+    paddr_t gnttab_start, gnttab_size;
 
     DPRINT("Create hypervisor node\n");
 
@@ -352,10 +353,12 @@ static int make_hypervisor_node(struct domain *d,
     if ( res )
         return res;
 
-    DPRINT("  Grant table range: 0xb0000000-0x20000\n");
+    platform_dom0_gnttab(&gnttab_start, &gnttab_size);
+    DPRINT("  Grant table range: %#"PRIpaddr"-%#"PRIpaddr"\n",
+           gnttab_start, gnttab_start + gnttab_size);
     /* reg 0 is grant table space */
     cells = &reg[0];
-    dt_set_range(&cells, parent, 0xb0000000, 0x20000);
+    dt_set_range(&cells, parent, gnttab_start, gnttab_size);
     res = fdt_property(fdt, "reg", reg,
                        dt_cells_to_size(addrcells + sizecells));
     if ( res )
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 1122bbd..74c3328 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -167,6 +167,20 @@ unsigned int platform_dom0_evtchn_ppi(void)
     return GUEST_EVTCHN_PPI;
 }
 
+void platform_dom0_gnttab(paddr_t *start, paddr_t *size)
+{
+    if ( platform && platform->dom0_gnttab_size )
+    {
+        *start = platform->dom0_gnttab_start;
+        *size = platform->dom0_gnttab_size;
+    }
+    else
+    {
+        *start = 0xb0000000;
+        *size = 0x20000;
+    }
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/platforms/midway.c b/xen/arch/arm/platforms/midway.c
index b221279..42f7697 100644
--- a/xen/arch/arm/platforms/midway.c
+++ b/xen/arch/arm/platforms/midway.c
@@ -51,6 +51,9 @@ static const char * const midway_dt_compat[] __initconst =
 PLATFORM_START(midway, "CALXEDA MIDWAY")
     .compatible = midway_dt_compat,
     .reset = midway_reset,
+
+    .dom0_gnttab_start = 0xff800000,
+    .dom0_gnttab_size = 0x20000,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index 423d11b..76d4d9b 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -156,6 +156,9 @@ PLATFORM_START(omap5, "TI OMAP5")
     .specific_mapping = omap5_specific_mapping,
     .smp_init = omap5_smp_init,
     .cpu_up = cpu_up_send_sgi,
+
+    .dom0_gnttab_start = 0x4b000000,
+    .dom0_gnttab_size = 0x20000,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/sunxi.c b/xen/arch/arm/platforms/sunxi.c
index b466518..fb12801 100644
--- a/xen/arch/arm/platforms/sunxi.c
+++ b/xen/arch/arm/platforms/sunxi.c
@@ -37,6 +37,9 @@ static const struct dt_device_match sunxi_blacklist_dev[] __initconst =
 PLATFORM_START(sunxi, "Allwinner A20")
     .compatible = sunxi_dt_compat,
     .blacklist_dev = sunxi_blacklist_dev,
+
+    .dom0_gnttab_start = 0x01d00000,
+    .dom0_gnttab_size = 0x20000,
 PLATFORM_END
 
 /*
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index f760fcd..5b0bd5f 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -118,7 +118,10 @@ PLATFORM_START(xgene_storm, "APM X-GENE STORM")
     .compatible = xgene_storm_dt_compat,
     .quirks = xgene_storm_quirks,
     .specific_mapping = xgene_storm_specific_mapping,
+
     .dom0_evtchn_ppi = 24,
+    .dom0_gnttab_start = 0x1f800000,
+    .dom0_gnttab_size = 0x20000,
 PLATFORM_END
 
 /*
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index edb399b..bcd2097 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -41,6 +41,12 @@ struct platform_desc {
      * The IRQ (PPI) to use to inject event channels to dom0.
      */
     unsigned int dom0_evtchn_ppi;
+    /*
+     * The location of a region of physical address space which dom0
+     * can use for grant table mappings. If size is zero defaults to
+     * 0xb0000000-0xb0020000.
+     */
+    paddr_t dom0_gnttab_start, dom0_gnttab_size;
 };
 
 /*
@@ -61,6 +67,7 @@ void platform_poweroff(void);
 bool_t platform_has_quirk(uint32_t quirk);
 bool_t platform_device_is_blacklisted(const struct dt_device_node *node);
 unsigned int platform_dom0_evtchn_ppi(void);
+void platform_dom0_gnttab(paddr_t *start, paddr_t *size);
 
 #define PLATFORM_START(_name, _namestr)                         \
 static const struct platform_desc  __plat_desc_##_name __used   \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:48:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUPc-00039I-Qk; Sun, 08 Dec 2013 02:48: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 1VpUPb-000393-B0
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:03 +0000
Received: from [85.158.139.211:7159] by server-7.bemta-5.messagelabs.com id
	29/5B-23516-2EDD3A25; Sun, 08 Dec 2013 02:48:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1386470880!2931430!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27586 invoked from network); 8 Dec 2013 02:48:01 -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 Dec 2013 02:48: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 1VpUPX-0004Xa-W0
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUPX-0000om-Ub
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:59 +0000
Date: Sun, 08 Dec 2013 02:47:59 +0000
Message-Id: <E1VpUPX-0000om-Ub@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: improve handling of system
	with non-contiguous RAM regions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d02b05c77fc5e7c76bf6f112db84bbaa44fdcb5
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 2 14:39:05 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:47:46 2013 +0000

    xen: arm: improve handling of system with non-contiguous RAM regions
    
    arm32 currently only makes use of memory which is contiguous with the first
    bank. On the Midway platform this means that we only use 4GB of the 8GB
    available.
    
    Change things to make use of non-contiguous memory regions with the
    restriction that we require that at least half of the total span of the RAM
    addresses contain RAM. The frametable is currently not sparse and so this
    restriction avoids problems with allocating enormous amounts of memory for the
    frametable to cover holes in the address space and exhausting the actual RAM.
    
    50% is arguably too restrictive. 4GB of RAM requires 32MB of frametable on
    arm32 and 56M on arm64, so we could probably cope with a lower ratio of actual
    RAM. However half is nice and conservative.
    
    arm64 currently uses all banks without regard for the size of the frametable,
    which I have observed causing problems on models. Implement that same
    restriction as arm32 there.
    
    Long term we should look at moving to a pfn compression based scheme similar
    to x86, which removes the holes from the frametable.
    
    There were some bogus/outdated comments scattered around this code which I
    have removed.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Tested-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Cc: George Dunlap <George.Dunlap@eu.citrix.com>
---
 xen/arch/arm/setup.c |  185 +++++++++++++++++++++++++++++++++-----------------
 1 files changed, 122 insertions(+), 63 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 3f894b5..840b04b 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -360,35 +360,80 @@ static paddr_t __init get_xen_paddr(void)
 #ifdef CONFIG_ARM_32
 static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 {
-    paddr_t ram_start;
-    paddr_t ram_end;
-    paddr_t ram_size;
+    paddr_t ram_start, ram_end, ram_size;
+    paddr_t contig_start, contig_end;
     paddr_t s, e;
     unsigned long ram_pages;
     unsigned long heap_pages, xenheap_pages, domheap_pages;
     unsigned long dtb_pages;
     unsigned long boot_mfn_start, boot_mfn_end;
-    int i = 0;
+    int i;
     void *fdt;
 
-    /* TODO: Handle non-contiguous memory bank */
     if ( !early_info.mem.nr_banks )
         early_panic("No memory bank");
-    ram_start = early_info.mem.bank[0].start;
+
+    /*
+     * We are going to accumulate two regions here.
+     *
+     * The first is the bounds of the initial memory region which is
+     * contiguous with the first bank. For simplicity the xenheap is
+     * always allocated from this region.
+     *
+     * The second is the complete bounds of the regions containing RAM
+     * (ie. from the lowest RAM address to the highest), which
+     * includes any holes.
+     *
+     * We also track the number of actual RAM pages (i.e. not counting
+     * the holes).
+     */
     ram_size  = early_info.mem.bank[0].size;
-    ram_end = ram_start + ram_size;
+
+    contig_start = ram_start = early_info.mem.bank[0].start;
+    contig_end   = ram_end = ram_start + ram_size;
 
     for ( i = 1; i < early_info.mem.nr_banks; i++ )
     {
-        if ( ram_end != early_info.mem.bank[i].start )
+        paddr_t bank_start = early_info.mem.bank[i].start;
+        paddr_t bank_size = early_info.mem.bank[i].size;
+        paddr_t bank_end = bank_start + bank_size;
+
+        paddr_t new_ram_size = ram_size + bank_size;
+        paddr_t new_ram_start = min(ram_start,bank_start);
+        paddr_t new_ram_end = max(ram_end,bank_end);
+
+        /*
+         * If the new bank is contiguous with the initial contiguous
+         * region then incorporate it into the contiguous region.
+         *
+         * Otherwise we allow non-contigious regions so long as at
+         * least half of the total RAM region actually contains
+         * RAM. We actually fudge this slightly and require that
+         * adding the current bank does not cause us to violate this
+         * restriction.
+         *
+         * This restriction ensures that the frametable (which is not
+         * currently sparse) does not consume all available RAM.
+         */
+        if ( bank_start == contig_end )
+            contig_end = bank_end;
+        else if ( bank_end == contig_start )
+            contig_start = bank_start;
+        else if ( 2 * new_ram_size < new_ram_end - new_ram_start )
+            /* Would create memory map which is too sparse, so stop here. */
             break;
 
-        ram_size += early_info.mem.bank[i].size;
-        ram_end += early_info.mem.bank[i].size;
+        ram_size = new_ram_size;
+        ram_start = new_ram_start;
+        ram_end = new_ram_end;
     }
 
     if ( i != early_info.mem.nr_banks )
-        early_printk("WARNING: some memory banks are not used\n");
+    {
+        early_printk("WARNING: only using %d out of %d memory banks\n",
+                     i, early_info.mem.nr_banks);
+        early_info.mem.nr_banks = i;
+    }
 
     total_pages = ram_pages = ram_size >> PAGE_SHIFT;
 
@@ -403,13 +448,14 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
      * We try to allocate the largest xenheap possible within these
      * constraints.
      */
-    heap_pages = (ram_size >> PAGE_SHIFT);
+    heap_pages = ram_pages;
     xenheap_pages = (heap_pages/8 + 0x1fffUL) & ~0x1fffUL;
     xenheap_pages = max(xenheap_pages, 128UL<<(20-PAGE_SHIFT));
 
     do
     {
-        e = consider_modules(ram_start, ram_end,
+        /* xenheap is always in the initial contiguous region */
+        e = consider_modules(contig_start, contig_end,
                              pfn_to_paddr(xenheap_pages),
                              32<<20, 0);
         if ( e )
@@ -433,9 +479,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     /*
      * Need a single mapped page for populating bootmem_region_list
      * and enough mapped pages for copying the DTB.
-     *
-     * TODO: The DTB (and other payloads) are assumed to be towards
-     * the start of RAM.
      */
     dtb_pages = (dtb_size + PAGE_SIZE-1) >> PAGE_SHIFT;
     boot_mfn_start = xenheap_mfn_end - dtb_pages - 1;
@@ -443,47 +486,51 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 
     init_boot_pages(pfn_to_paddr(boot_mfn_start), pfn_to_paddr(boot_mfn_end));
 
-    /*
-     * Copy the DTB.
-     *
-     * TODO: handle other payloads too.
-     */
+    /* Copy the DTB. */
     fdt = mfn_to_virt(alloc_boot_pages(dtb_pages, 1));
     copy_from_paddr(fdt, dtb_paddr, dtb_size, BUFFERABLE);
     device_tree_flattened = fdt;
 
     /* Add non-xenheap memory */
-    s = ram_start;
-    while ( s < ram_end )
+    for ( i = 0; i < early_info.mem.nr_banks; i++ )
     {
-        paddr_t n = ram_end;
+        paddr_t bank_start = early_info.mem.bank[i].start;
+        paddr_t bank_end = bank_start + early_info.mem.bank[i].size;
 
-        e = next_module(s, &n);
-
-        if ( e == ~(paddr_t)0 )
+        s = bank_start;
+        while ( s < bank_end )
         {
-            e = n = ram_end;
-        }
+            paddr_t n = bank_end;
 
-        /* Module in RAM which we cannot see here, due to not handling
-         * non-contiguous memory regions yet
-         */
-        if ( e > ram_end )
-            e = ram_end;
+            e = next_module(s, &n);
 
-        /* Avoid the xenheap */
-        if ( s < pfn_to_paddr(xenheap_mfn_start+xenheap_pages)
-             && pfn_to_paddr(xenheap_mfn_start) < e )
-        {
-            e = pfn_to_paddr(xenheap_mfn_start);
-            n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
-        }
+            if ( e == ~(paddr_t)0 )
+            {
+                e = n = ram_end;
+            }
+
+            /*
+             * Module in a RAM bank other than the one which we are
+             * not dealing with here.
+             */
+            if ( e > bank_end )
+                e = bank_end;
 
-        dt_unreserved_regions(s, e, init_boot_pages, 0);
+            /* Avoid the xenheap */
+            if ( s < pfn_to_paddr(xenheap_mfn_start+xenheap_pages)
+                 && pfn_to_paddr(xenheap_mfn_start) < e )
+            {
+                e = pfn_to_paddr(xenheap_mfn_start);
+                n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
+            }
+
+            dt_unreserved_regions(s, e, init_boot_pages, 0);
 
-        s = n;
+            s = n;
+        }
     }
 
+    /* Frame table covers all of RAM region, including holes */
     setup_frametable_mappings(ram_start, ram_end);
     max_page = PFN_DOWN(ram_end);
 
@@ -499,8 +546,8 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 {
     paddr_t ram_start = ~0;
     paddr_t ram_end = 0;
+    paddr_t ram_size = 0;
     int bank;
-    unsigned long  xenheap_pages = 0;
     unsigned long dtb_pages;
     void *fdt;
 
@@ -508,23 +555,33 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     for ( bank = 0 ; bank < early_info.mem.nr_banks; bank++ )
     {
         paddr_t bank_start = early_info.mem.bank[bank].start;
-        paddr_t bank_size  = early_info.mem.bank[bank].size;
-        paddr_t  bank_end = bank_start + bank_size;
-        unsigned long bank_pages = bank_size >> PAGE_SHIFT;
+        paddr_t bank_size = early_info.mem.bank[bank].size;
+        paddr_t bank_end = bank_start + bank_size;
         paddr_t s, e;
 
-        total_pages += bank_pages;
-
-        if ( bank_start < ram_start )
-            ram_start = bank_start;
-        if ( bank_end > ram_end )
-            ram_end = bank_end;
+        paddr_t new_ram_size = ram_size + bank_size;
+        paddr_t new_ram_start = min(ram_start,bank_start);
+        paddr_t new_ram_end = max(ram_end,bank_end);
+
+        /*
+         * We allow non-contigious regions so long as at least half of
+         * the total RAM region actually contains RAM. We actually
+         * fudge this slightly and require that adding the current
+         * bank does not cause us to violate this restriction.
+         *
+         * This restriction ensures that the frametable (which is not
+         * currently sparse) does not consume all available RAM.
+         */
+        if ( bank > 0 && 2 * new_ram_size < new_ram_end - new_ram_start )
+            /* Would create memory map which is too sparse, so stop here. */
+            break;
 
-        xenheap_pages += (bank_size >> PAGE_SHIFT);
+        ram_start = new_ram_start;
+        ram_end = new_ram_end;
+        ram_size = new_ram_size;
 
         setup_xenheap_mappings(bank_start>>PAGE_SHIFT, bank_size>>PAGE_SHIFT);
 
-        /* XXX we assume that the ram regions are ordered */
         s = bank_start;
         while ( s < bank_end )
         {
@@ -547,6 +604,15 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
         }
     }
 
+    if ( bank != early_info.mem.nr_banks )
+    {
+        early_printk("WARNING: only using %d out of %d memory banks\n",
+                     bank, early_info.mem.nr_banks);
+        early_info.mem.nr_banks = bank;
+    }
+
+    total_pages += ram_size >> PAGE_SHIFT;
+
     xenheap_virt_end = XENHEAP_VIRT_START + ram_end - ram_start;
     xenheap_mfn_start = ram_start >> PAGE_SHIFT;
     xenheap_mfn_end = ram_end >> PAGE_SHIFT;
@@ -554,17 +620,10 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 
     /*
      * Need enough mapped pages for copying the DTB.
-     *
-     * TODO: The DTB (and other payloads) are assumed to be towards
-     * the start of RAM.
      */
     dtb_pages = (dtb_size + PAGE_SIZE-1) >> PAGE_SHIFT;
 
-    /*
-     * Copy the DTB.
-     *
-     * TODO: handle other payloads too.
-     */
+    /* Copy the DTB. */
     fdt = mfn_to_virt(alloc_boot_pages(dtb_pages, 1));
     copy_from_paddr(fdt, dtb_paddr, dtb_size, BUFFERABLE);
     device_tree_flattened = fdt;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:48:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUPc-00039I-Qk; Sun, 08 Dec 2013 02:48: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 1VpUPb-000393-B0
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:03 +0000
Received: from [85.158.139.211:7159] by server-7.bemta-5.messagelabs.com id
	29/5B-23516-2EDD3A25; Sun, 08 Dec 2013 02:48:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1386470880!2931430!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27586 invoked from network); 8 Dec 2013 02:48:01 -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 Dec 2013 02:48: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 1VpUPX-0004Xa-W0
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUPX-0000om-Ub
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:47:59 +0000
Date: Sun, 08 Dec 2013 02:47:59 +0000
Message-Id: <E1VpUPX-0000om-Ub@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: improve handling of system
	with non-contiguous RAM regions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d02b05c77fc5e7c76bf6f112db84bbaa44fdcb5
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 2 14:39:05 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:47:46 2013 +0000

    xen: arm: improve handling of system with non-contiguous RAM regions
    
    arm32 currently only makes use of memory which is contiguous with the first
    bank. On the Midway platform this means that we only use 4GB of the 8GB
    available.
    
    Change things to make use of non-contiguous memory regions with the
    restriction that we require that at least half of the total span of the RAM
    addresses contain RAM. The frametable is currently not sparse and so this
    restriction avoids problems with allocating enormous amounts of memory for the
    frametable to cover holes in the address space and exhausting the actual RAM.
    
    50% is arguably too restrictive. 4GB of RAM requires 32MB of frametable on
    arm32 and 56M on arm64, so we could probably cope with a lower ratio of actual
    RAM. However half is nice and conservative.
    
    arm64 currently uses all banks without regard for the size of the frametable,
    which I have observed causing problems on models. Implement that same
    restriction as arm32 there.
    
    Long term we should look at moving to a pfn compression based scheme similar
    to x86, which removes the holes from the frametable.
    
    There were some bogus/outdated comments scattered around this code which I
    have removed.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Tested-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Cc: George Dunlap <George.Dunlap@eu.citrix.com>
---
 xen/arch/arm/setup.c |  185 +++++++++++++++++++++++++++++++++-----------------
 1 files changed, 122 insertions(+), 63 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 3f894b5..840b04b 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -360,35 +360,80 @@ static paddr_t __init get_xen_paddr(void)
 #ifdef CONFIG_ARM_32
 static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 {
-    paddr_t ram_start;
-    paddr_t ram_end;
-    paddr_t ram_size;
+    paddr_t ram_start, ram_end, ram_size;
+    paddr_t contig_start, contig_end;
     paddr_t s, e;
     unsigned long ram_pages;
     unsigned long heap_pages, xenheap_pages, domheap_pages;
     unsigned long dtb_pages;
     unsigned long boot_mfn_start, boot_mfn_end;
-    int i = 0;
+    int i;
     void *fdt;
 
-    /* TODO: Handle non-contiguous memory bank */
     if ( !early_info.mem.nr_banks )
         early_panic("No memory bank");
-    ram_start = early_info.mem.bank[0].start;
+
+    /*
+     * We are going to accumulate two regions here.
+     *
+     * The first is the bounds of the initial memory region which is
+     * contiguous with the first bank. For simplicity the xenheap is
+     * always allocated from this region.
+     *
+     * The second is the complete bounds of the regions containing RAM
+     * (ie. from the lowest RAM address to the highest), which
+     * includes any holes.
+     *
+     * We also track the number of actual RAM pages (i.e. not counting
+     * the holes).
+     */
     ram_size  = early_info.mem.bank[0].size;
-    ram_end = ram_start + ram_size;
+
+    contig_start = ram_start = early_info.mem.bank[0].start;
+    contig_end   = ram_end = ram_start + ram_size;
 
     for ( i = 1; i < early_info.mem.nr_banks; i++ )
     {
-        if ( ram_end != early_info.mem.bank[i].start )
+        paddr_t bank_start = early_info.mem.bank[i].start;
+        paddr_t bank_size = early_info.mem.bank[i].size;
+        paddr_t bank_end = bank_start + bank_size;
+
+        paddr_t new_ram_size = ram_size + bank_size;
+        paddr_t new_ram_start = min(ram_start,bank_start);
+        paddr_t new_ram_end = max(ram_end,bank_end);
+
+        /*
+         * If the new bank is contiguous with the initial contiguous
+         * region then incorporate it into the contiguous region.
+         *
+         * Otherwise we allow non-contigious regions so long as at
+         * least half of the total RAM region actually contains
+         * RAM. We actually fudge this slightly and require that
+         * adding the current bank does not cause us to violate this
+         * restriction.
+         *
+         * This restriction ensures that the frametable (which is not
+         * currently sparse) does not consume all available RAM.
+         */
+        if ( bank_start == contig_end )
+            contig_end = bank_end;
+        else if ( bank_end == contig_start )
+            contig_start = bank_start;
+        else if ( 2 * new_ram_size < new_ram_end - new_ram_start )
+            /* Would create memory map which is too sparse, so stop here. */
             break;
 
-        ram_size += early_info.mem.bank[i].size;
-        ram_end += early_info.mem.bank[i].size;
+        ram_size = new_ram_size;
+        ram_start = new_ram_start;
+        ram_end = new_ram_end;
     }
 
     if ( i != early_info.mem.nr_banks )
-        early_printk("WARNING: some memory banks are not used\n");
+    {
+        early_printk("WARNING: only using %d out of %d memory banks\n",
+                     i, early_info.mem.nr_banks);
+        early_info.mem.nr_banks = i;
+    }
 
     total_pages = ram_pages = ram_size >> PAGE_SHIFT;
 
@@ -403,13 +448,14 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
      * We try to allocate the largest xenheap possible within these
      * constraints.
      */
-    heap_pages = (ram_size >> PAGE_SHIFT);
+    heap_pages = ram_pages;
     xenheap_pages = (heap_pages/8 + 0x1fffUL) & ~0x1fffUL;
     xenheap_pages = max(xenheap_pages, 128UL<<(20-PAGE_SHIFT));
 
     do
     {
-        e = consider_modules(ram_start, ram_end,
+        /* xenheap is always in the initial contiguous region */
+        e = consider_modules(contig_start, contig_end,
                              pfn_to_paddr(xenheap_pages),
                              32<<20, 0);
         if ( e )
@@ -433,9 +479,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     /*
      * Need a single mapped page for populating bootmem_region_list
      * and enough mapped pages for copying the DTB.
-     *
-     * TODO: The DTB (and other payloads) are assumed to be towards
-     * the start of RAM.
      */
     dtb_pages = (dtb_size + PAGE_SIZE-1) >> PAGE_SHIFT;
     boot_mfn_start = xenheap_mfn_end - dtb_pages - 1;
@@ -443,47 +486,51 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 
     init_boot_pages(pfn_to_paddr(boot_mfn_start), pfn_to_paddr(boot_mfn_end));
 
-    /*
-     * Copy the DTB.
-     *
-     * TODO: handle other payloads too.
-     */
+    /* Copy the DTB. */
     fdt = mfn_to_virt(alloc_boot_pages(dtb_pages, 1));
     copy_from_paddr(fdt, dtb_paddr, dtb_size, BUFFERABLE);
     device_tree_flattened = fdt;
 
     /* Add non-xenheap memory */
-    s = ram_start;
-    while ( s < ram_end )
+    for ( i = 0; i < early_info.mem.nr_banks; i++ )
     {
-        paddr_t n = ram_end;
+        paddr_t bank_start = early_info.mem.bank[i].start;
+        paddr_t bank_end = bank_start + early_info.mem.bank[i].size;
 
-        e = next_module(s, &n);
-
-        if ( e == ~(paddr_t)0 )
+        s = bank_start;
+        while ( s < bank_end )
         {
-            e = n = ram_end;
-        }
+            paddr_t n = bank_end;
 
-        /* Module in RAM which we cannot see here, due to not handling
-         * non-contiguous memory regions yet
-         */
-        if ( e > ram_end )
-            e = ram_end;
+            e = next_module(s, &n);
 
-        /* Avoid the xenheap */
-        if ( s < pfn_to_paddr(xenheap_mfn_start+xenheap_pages)
-             && pfn_to_paddr(xenheap_mfn_start) < e )
-        {
-            e = pfn_to_paddr(xenheap_mfn_start);
-            n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
-        }
+            if ( e == ~(paddr_t)0 )
+            {
+                e = n = ram_end;
+            }
+
+            /*
+             * Module in a RAM bank other than the one which we are
+             * not dealing with here.
+             */
+            if ( e > bank_end )
+                e = bank_end;
 
-        dt_unreserved_regions(s, e, init_boot_pages, 0);
+            /* Avoid the xenheap */
+            if ( s < pfn_to_paddr(xenheap_mfn_start+xenheap_pages)
+                 && pfn_to_paddr(xenheap_mfn_start) < e )
+            {
+                e = pfn_to_paddr(xenheap_mfn_start);
+                n = pfn_to_paddr(xenheap_mfn_start+xenheap_pages);
+            }
+
+            dt_unreserved_regions(s, e, init_boot_pages, 0);
 
-        s = n;
+            s = n;
+        }
     }
 
+    /* Frame table covers all of RAM region, including holes */
     setup_frametable_mappings(ram_start, ram_end);
     max_page = PFN_DOWN(ram_end);
 
@@ -499,8 +546,8 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 {
     paddr_t ram_start = ~0;
     paddr_t ram_end = 0;
+    paddr_t ram_size = 0;
     int bank;
-    unsigned long  xenheap_pages = 0;
     unsigned long dtb_pages;
     void *fdt;
 
@@ -508,23 +555,33 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
     for ( bank = 0 ; bank < early_info.mem.nr_banks; bank++ )
     {
         paddr_t bank_start = early_info.mem.bank[bank].start;
-        paddr_t bank_size  = early_info.mem.bank[bank].size;
-        paddr_t  bank_end = bank_start + bank_size;
-        unsigned long bank_pages = bank_size >> PAGE_SHIFT;
+        paddr_t bank_size = early_info.mem.bank[bank].size;
+        paddr_t bank_end = bank_start + bank_size;
         paddr_t s, e;
 
-        total_pages += bank_pages;
-
-        if ( bank_start < ram_start )
-            ram_start = bank_start;
-        if ( bank_end > ram_end )
-            ram_end = bank_end;
+        paddr_t new_ram_size = ram_size + bank_size;
+        paddr_t new_ram_start = min(ram_start,bank_start);
+        paddr_t new_ram_end = max(ram_end,bank_end);
+
+        /*
+         * We allow non-contigious regions so long as at least half of
+         * the total RAM region actually contains RAM. We actually
+         * fudge this slightly and require that adding the current
+         * bank does not cause us to violate this restriction.
+         *
+         * This restriction ensures that the frametable (which is not
+         * currently sparse) does not consume all available RAM.
+         */
+        if ( bank > 0 && 2 * new_ram_size < new_ram_end - new_ram_start )
+            /* Would create memory map which is too sparse, so stop here. */
+            break;
 
-        xenheap_pages += (bank_size >> PAGE_SHIFT);
+        ram_start = new_ram_start;
+        ram_end = new_ram_end;
+        ram_size = new_ram_size;
 
         setup_xenheap_mappings(bank_start>>PAGE_SHIFT, bank_size>>PAGE_SHIFT);
 
-        /* XXX we assume that the ram regions are ordered */
         s = bank_start;
         while ( s < bank_end )
         {
@@ -547,6 +604,15 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
         }
     }
 
+    if ( bank != early_info.mem.nr_banks )
+    {
+        early_printk("WARNING: only using %d out of %d memory banks\n",
+                     bank, early_info.mem.nr_banks);
+        early_info.mem.nr_banks = bank;
+    }
+
+    total_pages += ram_size >> PAGE_SHIFT;
+
     xenheap_virt_end = XENHEAP_VIRT_START + ram_end - ram_start;
     xenheap_mfn_start = ram_start >> PAGE_SHIFT;
     xenheap_mfn_end = ram_end >> PAGE_SHIFT;
@@ -554,17 +620,10 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
 
     /*
      * Need enough mapped pages for copying the DTB.
-     *
-     * TODO: The DTB (and other payloads) are assumed to be towards
-     * the start of RAM.
      */
     dtb_pages = (dtb_size + PAGE_SIZE-1) >> PAGE_SHIFT;
 
-    /*
-     * Copy the DTB.
-     *
-     * TODO: handle other payloads too.
-     */
+    /* Copy the DTB. */
     fdt = mfn_to_virt(alloc_boot_pages(dtb_pages, 1));
     copy_from_paddr(fdt, dtb_paddr, dtb_size, BUFFERABLE);
     device_tree_flattened = fdt;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:48:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUPm-0003BG-28; Sun, 08 Dec 2013 02:48: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 1VpUPk-0003B1-Vj
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:13 +0000
Received: from [85.158.139.211:26197] by server-6.bemta-5.messagelabs.com id
	CA/C2-16310-CEDD3A25; Sun, 08 Dec 2013 02:48:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1386470890!2973726!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8780 invoked from network); 8 Dec 2013 02:48:11 -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;
	8 Dec 2013 02:48: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 1VpUPi-0004Y9-4A
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUPi-0000pJ-2L
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:10 +0000
Date: Sun, 08 Dec 2013 02:48:10 +0000
Message-Id: <E1VpUPi-0000pJ-2L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/ovmf: setup ovmf_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 054f628d3c2de4c403631a5b0686a288a1fc1bdf
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Dec 5 17:29:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:51:32 2013 +0000

    hvmloader/ovmf: setup ovmf_info
    
    OVMF info contains E820 map allocated by hvmloader. This info is passed
    to OVMF to help it do proper initialization.
    
    Currently only E820 is necessary, but we reserve spaces for other tables
    in ovmf_info for later usage.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/ovmf.c |   48 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/tools/firmware/hvmloader/ovmf.c b/tools/firmware/hvmloader/ovmf.c
index a67a2de..d50e2b2 100644
--- a/tools/firmware/hvmloader/ovmf.c
+++ b/tools/firmware/hvmloader/ovmf.c
@@ -46,10 +46,54 @@
 #define LOWCHUNK_SIZE           0x00010000
 #define LOWCHUNK_MAXOFFSET      0x0000FFFF
 #define LOWCHUNK_END            (OVMF_BEGIN + OVMF_SIZE)
+#define OVMF_INFO_PHYSICAL_ADDRESS 0x00001000
 
 extern unsigned char dsdt_anycpu[];
 extern int dsdt_anycpu_len;
 
+#define OVMF_INFO_MAX_TABLES 4
+struct ovmf_info {
+    char signature[14]; /* XenHVMOVMF\0\0\0\0 */
+    uint8_t length;     /* Length of this struct */
+    uint8_t checksum;   /* Set such that the sum over bytes 0..length == 0 */
+    /*
+     * Physical address of an array of tables_nr elements.
+     *
+     * Each element is a 64 bit value containing the physical address
+     * of a BIOS table.
+     */
+    uint64_t tables;
+    uint32_t tables_nr;
+    /*
+     * Physical address of the e820 table, contains e820_nr entries.
+     */
+    uint64_t e820;
+    uint32_t e820_nr;
+} __attribute__ ((packed));
+
+static void ovmf_setup_bios_info(void)
+{
+    struct ovmf_info *info = (void *)OVMF_INFO_PHYSICAL_ADDRESS;
+
+    memset(info, 0, sizeof(*info));
+
+    memcpy(info->signature, "XenHVMOVMF", sizeof(info->signature));
+    info->length = sizeof(*info);
+}
+
+static void ovmf_finish_bios_info(void)
+{
+    struct ovmf_info *info = (void *)OVMF_INFO_PHYSICAL_ADDRESS;
+    uint32_t i;
+    uint8_t checksum;
+
+    checksum = 0;
+    for ( i = 0; i < info->length; i++ )
+        checksum += ((uint8_t *)(info))[i];
+
+    info->checksum = -checksum;
+}
+
 static void ovmf_load(const struct bios_config *config)
 {
     xen_pfn_t mfn;
@@ -104,8 +148,8 @@ struct bios_config ovmf_config =  {
 
     .load_roms = 0,
 
-    .bios_info_setup = NULL,
-    .bios_info_finish = NULL,
+    .bios_info_setup = ovmf_setup_bios_info,
+    .bios_info_finish = ovmf_finish_bios_info,
 
     .e820_setup = 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 Sun Dec 08 02:48:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUPm-0003BG-28; Sun, 08 Dec 2013 02:48: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 1VpUPk-0003B1-Vj
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:13 +0000
Received: from [85.158.139.211:26197] by server-6.bemta-5.messagelabs.com id
	CA/C2-16310-CEDD3A25; Sun, 08 Dec 2013 02:48:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1386470890!2973726!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8780 invoked from network); 8 Dec 2013 02:48:11 -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;
	8 Dec 2013 02:48: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 1VpUPi-0004Y9-4A
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUPi-0000pJ-2L
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:10 +0000
Date: Sun, 08 Dec 2013 02:48:10 +0000
Message-Id: <E1VpUPi-0000pJ-2L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/ovmf: setup ovmf_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 054f628d3c2de4c403631a5b0686a288a1fc1bdf
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Dec 5 17:29:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:51:32 2013 +0000

    hvmloader/ovmf: setup ovmf_info
    
    OVMF info contains E820 map allocated by hvmloader. This info is passed
    to OVMF to help it do proper initialization.
    
    Currently only E820 is necessary, but we reserve spaces for other tables
    in ovmf_info for later usage.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/ovmf.c |   48 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/tools/firmware/hvmloader/ovmf.c b/tools/firmware/hvmloader/ovmf.c
index a67a2de..d50e2b2 100644
--- a/tools/firmware/hvmloader/ovmf.c
+++ b/tools/firmware/hvmloader/ovmf.c
@@ -46,10 +46,54 @@
 #define LOWCHUNK_SIZE           0x00010000
 #define LOWCHUNK_MAXOFFSET      0x0000FFFF
 #define LOWCHUNK_END            (OVMF_BEGIN + OVMF_SIZE)
+#define OVMF_INFO_PHYSICAL_ADDRESS 0x00001000
 
 extern unsigned char dsdt_anycpu[];
 extern int dsdt_anycpu_len;
 
+#define OVMF_INFO_MAX_TABLES 4
+struct ovmf_info {
+    char signature[14]; /* XenHVMOVMF\0\0\0\0 */
+    uint8_t length;     /* Length of this struct */
+    uint8_t checksum;   /* Set such that the sum over bytes 0..length == 0 */
+    /*
+     * Physical address of an array of tables_nr elements.
+     *
+     * Each element is a 64 bit value containing the physical address
+     * of a BIOS table.
+     */
+    uint64_t tables;
+    uint32_t tables_nr;
+    /*
+     * Physical address of the e820 table, contains e820_nr entries.
+     */
+    uint64_t e820;
+    uint32_t e820_nr;
+} __attribute__ ((packed));
+
+static void ovmf_setup_bios_info(void)
+{
+    struct ovmf_info *info = (void *)OVMF_INFO_PHYSICAL_ADDRESS;
+
+    memset(info, 0, sizeof(*info));
+
+    memcpy(info->signature, "XenHVMOVMF", sizeof(info->signature));
+    info->length = sizeof(*info);
+}
+
+static void ovmf_finish_bios_info(void)
+{
+    struct ovmf_info *info = (void *)OVMF_INFO_PHYSICAL_ADDRESS;
+    uint32_t i;
+    uint8_t checksum;
+
+    checksum = 0;
+    for ( i = 0; i < info->length; i++ )
+        checksum += ((uint8_t *)(info))[i];
+
+    info->checksum = -checksum;
+}
+
 static void ovmf_load(const struct bios_config *config)
 {
     xen_pfn_t mfn;
@@ -104,8 +148,8 @@ struct bios_config ovmf_config =  {
 
     .load_roms = 0,
 
-    .bios_info_setup = NULL,
-    .bios_info_finish = NULL,
+    .bios_info_setup = ovmf_setup_bios_info,
+    .bios_info_finish = ovmf_finish_bios_info,
 
     .e820_setup = 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 Sun Dec 08 02:48:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUPx-0003O2-8p; Sun, 08 Dec 2013 02:48: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 1VpUPu-0003Kp-VP
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:23 +0000
Received: from [85.158.139.211:7519] by server-4.bemta-5.messagelabs.com id
	D7/76-26791-6FDD3A25; Sun, 08 Dec 2013 02:48:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386470900!2992723!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29405 invoked from network); 8 Dec 2013 02:48:21 -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;
	8 Dec 2013 02:48: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 1VpUPs-0004YF-7n
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUPs-0000pg-6n
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:20 +0000
Date: Sun, 08 Dec 2013 02:48:20 +0000
Message-Id: <E1VpUPs-0000pg-6n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/ovmf: setup E820 map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7bea9c593aa1dd4db9a05a196ce186a232ec8fe
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Dec 5 17:29:31 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:51:43 2013 +0000

    hvmloader/ovmf: setup E820 map
    
    E820 map will be used by OVMF to create memory map.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/ovmf.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/hvmloader/ovmf.c b/tools/firmware/hvmloader/ovmf.c
index d50e2b2..28dd7bc 100644
--- a/tools/firmware/hvmloader/ovmf.c
+++ b/tools/firmware/hvmloader/ovmf.c
@@ -137,6 +137,17 @@ static void ovmf_create_smbios_tables(void)
         SMBIOS_PHYSICAL_END);
 }
 
+static void ovmf_setup_e820(void)
+{
+    struct ovmf_info *info = (void *)OVMF_INFO_PHYSICAL_ADDRESS;
+    struct e820entry *e820 = scratch_alloc(sizeof(struct e820entry)*16, 0);
+    info->e820 = (uint32_t)e820;
+
+    /* Reserve LOWCHUNK_BEGIN to 0x100000 as well, that's reset vector. */
+    info->e820_nr = build_e820_table(e820, 0, LOWCHUNK_BEGIN);
+    dump_e820_table(e820, info->e820_nr);
+}
+
 struct bios_config ovmf_config =  {
     .name = "OVMF",
 
@@ -151,7 +162,7 @@ struct bios_config ovmf_config =  {
     .bios_info_setup = ovmf_setup_bios_info,
     .bios_info_finish = ovmf_finish_bios_info,
 
-    .e820_setup = NULL,
+    .e820_setup = ovmf_setup_e820,
 
     .acpi_build_tables = ovmf_acpi_build_tables,
     .create_mp_tables = 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 Sun Dec 08 02:48:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUPx-0003O2-8p; Sun, 08 Dec 2013 02:48: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 1VpUPu-0003Kp-VP
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:23 +0000
Received: from [85.158.139.211:7519] by server-4.bemta-5.messagelabs.com id
	D7/76-26791-6FDD3A25; Sun, 08 Dec 2013 02:48:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386470900!2992723!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29405 invoked from network); 8 Dec 2013 02:48:21 -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;
	8 Dec 2013 02:48: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 1VpUPs-0004YF-7n
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUPs-0000pg-6n
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:20 +0000
Date: Sun, 08 Dec 2013 02:48:20 +0000
Message-Id: <E1VpUPs-0000pg-6n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader/ovmf: setup E820 map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7bea9c593aa1dd4db9a05a196ce186a232ec8fe
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Dec 5 17:29:31 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:51:43 2013 +0000

    hvmloader/ovmf: setup E820 map
    
    E820 map will be used by OVMF to create memory map.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/ovmf.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/hvmloader/ovmf.c b/tools/firmware/hvmloader/ovmf.c
index d50e2b2..28dd7bc 100644
--- a/tools/firmware/hvmloader/ovmf.c
+++ b/tools/firmware/hvmloader/ovmf.c
@@ -137,6 +137,17 @@ static void ovmf_create_smbios_tables(void)
         SMBIOS_PHYSICAL_END);
 }
 
+static void ovmf_setup_e820(void)
+{
+    struct ovmf_info *info = (void *)OVMF_INFO_PHYSICAL_ADDRESS;
+    struct e820entry *e820 = scratch_alloc(sizeof(struct e820entry)*16, 0);
+    info->e820 = (uint32_t)e820;
+
+    /* Reserve LOWCHUNK_BEGIN to 0x100000 as well, that's reset vector. */
+    info->e820_nr = build_e820_table(e820, 0, LOWCHUNK_BEGIN);
+    dump_e820_table(e820, info->e820_nr);
+}
+
 struct bios_config ovmf_config =  {
     .name = "OVMF",
 
@@ -151,7 +162,7 @@ struct bios_config ovmf_config =  {
     .bios_info_setup = ovmf_setup_bios_info,
     .bios_info_finish = ovmf_finish_bios_info,
 
-    .e820_setup = NULL,
+    .e820_setup = ovmf_setup_e820,
 
     .acpi_build_tables = ovmf_acpi_build_tables,
     .create_mp_tables = 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 Sun Dec 08 02:48:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUQ5-0003Wc-Lw; Sun, 08 Dec 2013 02:48: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 1VpUQ4-0003Um-SO
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:32 +0000
Received: from [85.158.139.211:7716] by server-6.bemta-5.messagelabs.com id
	FC/D2-16310-00ED3A25; Sun, 08 Dec 2013 02:48:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1386470910!2989926!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20672 invoked from network); 8 Dec 2013 02:48:31 -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;
	8 Dec 2013 02:48: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 1VpUQ2-0004YN-BV
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQ2-0000q4-AO
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:30 +0000
Date: Sun, 08 Dec 2013 02:48:30 +0000
Message-Id: <E1VpUQ2-0000q4-AO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ovmf-makefile: only build debug
	target when specified
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1eb91ed58f9cf9d3144424810752807eab27f57
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Dec 5 17:29:33 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:51:45 2013 +0000

    tools/ovmf-makefile: only build debug target when specified
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/ovmf-makefile |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/tools/firmware/ovmf-makefile b/tools/firmware/ovmf-makefile
index 073ed44..1ad041f 100644
--- a/tools/firmware/ovmf-makefile
+++ b/tools/firmware/ovmf-makefile
@@ -1,16 +1,25 @@
 # OVMF building system is not ready yet to run in parallel.
 # Force it to be serial in order to exploit parallelism for neighbors.
 
+XEN_ROOT=$(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+ifeq ($(debug),y)
+TARGET=DEBUG
+else
+TARGET=RELEASE
+endif
+
 .NOTPARALLEL:
 MAKEFLAGS  += -j1
 
 .PHONY: all
-all: ovmf.bin
+all: build
 
-.PHONY: ovmf.bin
-ovmf.bin:
-	OvmfPkg/build.sh -a X64
-	cp Build/OvmfX64/DEBUG_GCC*/FV/OVMF.fd ovmf.bin
+.PHONY: build
+build:
+	OvmfPkg/build.sh -a X64 -b $(TARGET)
+	cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin
 
 .PHONY: clean
 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 Sun Dec 08 02:48:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUQ5-0003Wc-Lw; Sun, 08 Dec 2013 02:48: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 1VpUQ4-0003Um-SO
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:32 +0000
Received: from [85.158.139.211:7716] by server-6.bemta-5.messagelabs.com id
	FC/D2-16310-00ED3A25; Sun, 08 Dec 2013 02:48:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1386470910!2989926!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20672 invoked from network); 8 Dec 2013 02:48:31 -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;
	8 Dec 2013 02:48: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 1VpUQ2-0004YN-BV
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQ2-0000q4-AO
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:30 +0000
Date: Sun, 08 Dec 2013 02:48:30 +0000
Message-Id: <E1VpUQ2-0000q4-AO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ovmf-makefile: only build debug
	target when specified
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1eb91ed58f9cf9d3144424810752807eab27f57
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Dec 5 17:29:33 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:51:45 2013 +0000

    tools/ovmf-makefile: only build debug target when specified
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/ovmf-makefile |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/tools/firmware/ovmf-makefile b/tools/firmware/ovmf-makefile
index 073ed44..1ad041f 100644
--- a/tools/firmware/ovmf-makefile
+++ b/tools/firmware/ovmf-makefile
@@ -1,16 +1,25 @@
 # OVMF building system is not ready yet to run in parallel.
 # Force it to be serial in order to exploit parallelism for neighbors.
 
+XEN_ROOT=$(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+ifeq ($(debug),y)
+TARGET=DEBUG
+else
+TARGET=RELEASE
+endif
+
 .NOTPARALLEL:
 MAKEFLAGS  += -j1
 
 .PHONY: all
-all: ovmf.bin
+all: build
 
-.PHONY: ovmf.bin
-ovmf.bin:
-	OvmfPkg/build.sh -a X64
-	cp Build/OvmfX64/DEBUG_GCC*/FV/OVMF.fd ovmf.bin
+.PHONY: build
+build:
+	OvmfPkg/build.sh -a X64 -b $(TARGET)
+	cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin
 
 .PHONY: clean
 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 Sun Dec 08 02:48:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUQG-0003at-PE; Sun, 08 Dec 2013 02:48: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 1VpUQF-0003ac-DG
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:43 +0000
Received: from [85.158.139.211:26645] by server-14.bemta-5.messagelabs.com id
	65/2F-24200-A0ED3A25; Sun, 08 Dec 2013 02:48:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386470920!3000425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15745 invoked from network); 8 Dec 2013 02:48:41 -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;
	8 Dec 2013 02:48: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 1VpUQC-0004YT-IF
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQC-0000qT-G4
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:40 +0000
Date: Sun, 08 Dec 2013 02:48:40 +0000
Message-Id: <E1VpUQC-0000qT-G4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: usb2 and usb3 controller
	support for upstream qemu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bba6747189fb9c4cb51f3c99977d224615106c59
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Thu Dec 5 14:40:47 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:55:13 2013 +0000

    libxl: usb2 and usb3 controller support for upstream qemu
    
    Usage: usbversion=1|2|3 (default=0, no usb controller defined)
    Specifies the type of an emulated USB bus in the guest. 1 for usb1,
    2 for usb2 and 3 for usb3, it is available only with upstream qemu.
    The old usb and usbdevice parameters cannot be used with this.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5       |    8 ++++++++
 tools/libxl/libxl.h         |   14 ++++++++++++++
 tools/libxl/libxl_create.c  |    9 +++++++++
 tools/libxl/libxl_dm.c      |   24 ++++++++++++++++++++++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 6 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 7f107cb..6eb9c16 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1200,6 +1200,14 @@ device.
 
 Enables or disables an emulated USB bus in the guest.
 
+=item B<usbversion=NUMBER>
+
+Specifies the type of an emulated USB bus in the guest. 1 for usb1,
+2 for usb2 and 3 for usb3, it is available only with upstream qemu.
+Due to implementation limitations this is not compatible with the usb
+and usbdevice parameters.
+Default is 0 (no usb controller defined).
+
 =item B<usbdevice=[ "DEVICE", "DEVICE", ...]>
 
 Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index a9663e4..1c0bee7 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -311,6 +311,20 @@
 #define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
 
 /*
+ * LIBXL_HAVE_BUILDINFO_USBVERSION
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbversion, a integer type that contains a USB
+ * controller version to specify on the qemu upstream command-line.
+ *
+ * If it is set, callers may use hvm.usbversion to specify if the usb
+ * controller is usb1, usb2 or usb3.
+ *
+ * If this is not defined, the hvm.usbversion field does not exist.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBVERSION 1
+
+/*
  * LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
  *
  * If this is defined, libxl_device_* structures containing a backend_domid
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index fe7ba0d..409a312 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -284,6 +284,15 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
+        if (b_info->u.hvm.usbversion &&
+            ( libxl_defbool_val(b_info->u.hvm.usb)
+            || b_info->u.hvm.usbdevice_list
+            || b_info->u.hvm.usbdevice) ){
+            LOG(ERROR,"usbversion cannot be enabled with usb or"
+            "usbdevice parameters.");
+            return ERROR_INVAL;
+        }
+
         if (!b_info->u.hvm.boot) {
             b_info->u.hvm.boot = strdup("cda");
             if (!b_info->u.hvm.boot) return ERROR_NOMEM;
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index ea773b3..9f29d33 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -544,6 +544,30 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                                       *p, NULL);
                 }
             }
+        } else if (b_info->u.hvm.usbversion) {
+            switch (b_info->u.hvm.usbversion) {
+            case 1:
+                flexarray_vappend(dm_args,
+                    "-device", "piix3-usb-uhci,id=usb", NULL);
+                break;
+            case 2:
+                flexarray_append_pair(dm_args, "-device",
+                    "ich9-usb-ehci1,id=usb,addr=0x1d.0x7,multifunction=on");
+                for (i = 1; i < 4; i++)
+                    flexarray_append_pair(dm_args, "-device",
+                        GCSPRINTF("ich9-usb-uhci%d,masterbus=usb.0,"
+                        "firstport=%d,addr=0x1d.%#x,multifunction=on",
+                        i, 2*(i-1), i-1));
+                break;
+            case 3:
+                flexarray_vappend(dm_args,
+                    "-device", "nec-usb-xhci,id=usb", NULL);
+                break;
+            default:
+                LOG(ERROR, "%s: usbversion parameter is invalid, "
+                    "must be between 1 and 3", __func__);
+                return NULL;
+            }
         }
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index cba8eff..0d04c16 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -362,6 +362,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("serial",           string),
                                        ("boot",             string),
                                        ("usb",              libxl_defbool),
+                                       ("usbversion",       integer),
                                        # usbdevice:
                                        # - "tablet" for absolute mouse,
                                        # - "mouse" for PS/2 protocol relative mouse
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c5677cd..5ab62a9 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1592,6 +1592,8 @@ skip_vfb:
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
         xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
+        if (!xlu_cfg_get_long (config, "usbversion", &l, 0))
+            b_info->u.hvm.usbversion = l;
         switch (xlu_cfg_get_list_as_string_list(config, "usbdevice",
                                                 &b_info->u.hvm.usbdevice_list,
                                                 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 Sun Dec 08 02:48:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUQG-0003at-PE; Sun, 08 Dec 2013 02:48: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 1VpUQF-0003ac-DG
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:43 +0000
Received: from [85.158.139.211:26645] by server-14.bemta-5.messagelabs.com id
	65/2F-24200-A0ED3A25; Sun, 08 Dec 2013 02:48:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386470920!3000425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15745 invoked from network); 8 Dec 2013 02:48:41 -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;
	8 Dec 2013 02:48: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 1VpUQC-0004YT-IF
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQC-0000qT-G4
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:40 +0000
Date: Sun, 08 Dec 2013 02:48:40 +0000
Message-Id: <E1VpUQC-0000qT-G4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: usb2 and usb3 controller
	support for upstream qemu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bba6747189fb9c4cb51f3c99977d224615106c59
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Thu Dec 5 14:40:47 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 11:55:13 2013 +0000

    libxl: usb2 and usb3 controller support for upstream qemu
    
    Usage: usbversion=1|2|3 (default=0, no usb controller defined)
    Specifies the type of an emulated USB bus in the guest. 1 for usb1,
    2 for usb2 and 3 for usb3, it is available only with upstream qemu.
    The old usb and usbdevice parameters cannot be used with this.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5       |    8 ++++++++
 tools/libxl/libxl.h         |   14 ++++++++++++++
 tools/libxl/libxl_create.c  |    9 +++++++++
 tools/libxl/libxl_dm.c      |   24 ++++++++++++++++++++++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 6 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 7f107cb..6eb9c16 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1200,6 +1200,14 @@ device.
 
 Enables or disables an emulated USB bus in the guest.
 
+=item B<usbversion=NUMBER>
+
+Specifies the type of an emulated USB bus in the guest. 1 for usb1,
+2 for usb2 and 3 for usb3, it is available only with upstream qemu.
+Due to implementation limitations this is not compatible with the usb
+and usbdevice parameters.
+Default is 0 (no usb controller defined).
+
 =item B<usbdevice=[ "DEVICE", "DEVICE", ...]>
 
 Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index a9663e4..1c0bee7 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -311,6 +311,20 @@
 #define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
 
 /*
+ * LIBXL_HAVE_BUILDINFO_USBVERSION
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbversion, a integer type that contains a USB
+ * controller version to specify on the qemu upstream command-line.
+ *
+ * If it is set, callers may use hvm.usbversion to specify if the usb
+ * controller is usb1, usb2 or usb3.
+ *
+ * If this is not defined, the hvm.usbversion field does not exist.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBVERSION 1
+
+/*
  * LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
  *
  * If this is defined, libxl_device_* structures containing a backend_domid
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index fe7ba0d..409a312 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -284,6 +284,15 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
+        if (b_info->u.hvm.usbversion &&
+            ( libxl_defbool_val(b_info->u.hvm.usb)
+            || b_info->u.hvm.usbdevice_list
+            || b_info->u.hvm.usbdevice) ){
+            LOG(ERROR,"usbversion cannot be enabled with usb or"
+            "usbdevice parameters.");
+            return ERROR_INVAL;
+        }
+
         if (!b_info->u.hvm.boot) {
             b_info->u.hvm.boot = strdup("cda");
             if (!b_info->u.hvm.boot) return ERROR_NOMEM;
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index ea773b3..9f29d33 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -544,6 +544,30 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                                       *p, NULL);
                 }
             }
+        } else if (b_info->u.hvm.usbversion) {
+            switch (b_info->u.hvm.usbversion) {
+            case 1:
+                flexarray_vappend(dm_args,
+                    "-device", "piix3-usb-uhci,id=usb", NULL);
+                break;
+            case 2:
+                flexarray_append_pair(dm_args, "-device",
+                    "ich9-usb-ehci1,id=usb,addr=0x1d.0x7,multifunction=on");
+                for (i = 1; i < 4; i++)
+                    flexarray_append_pair(dm_args, "-device",
+                        GCSPRINTF("ich9-usb-uhci%d,masterbus=usb.0,"
+                        "firstport=%d,addr=0x1d.%#x,multifunction=on",
+                        i, 2*(i-1), i-1));
+                break;
+            case 3:
+                flexarray_vappend(dm_args,
+                    "-device", "nec-usb-xhci,id=usb", NULL);
+                break;
+            default:
+                LOG(ERROR, "%s: usbversion parameter is invalid, "
+                    "must be between 1 and 3", __func__);
+                return NULL;
+            }
         }
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index cba8eff..0d04c16 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -362,6 +362,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("serial",           string),
                                        ("boot",             string),
                                        ("usb",              libxl_defbool),
+                                       ("usbversion",       integer),
                                        # usbdevice:
                                        # - "tablet" for absolute mouse,
                                        # - "mouse" for PS/2 protocol relative mouse
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c5677cd..5ab62a9 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1592,6 +1592,8 @@ skip_vfb:
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
         xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
+        if (!xlu_cfg_get_long (config, "usbversion", &l, 0))
+            b_info->u.hvm.usbversion = l;
         switch (xlu_cfg_get_list_as_string_list(config, "usbdevice",
                                                 &b_info->u.hvm.usbdevice_list,
                                                 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 Sun Dec 08 02:48:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUQQ-0003cW-S9; Sun, 08 Dec 2013 02:48:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQP-0003cJ-MN
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:54 +0000
Received: from [85.158.137.68:5779] by server-5.bemta-3.messagelabs.com id
	A4/4C-25188-41ED3A25; Sun, 08 Dec 2013 02:48:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1386470930!2421236!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31004 invoked from network); 8 Dec 2013 02:48:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:48: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 1VpUQM-0004YZ-Nq
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQM-0000rE-Lk
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:50 +0000
Date: Sun, 08 Dec 2013 02:48:50 +0000
Message-Id: <E1VpUQM-0000rE-Lk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: spice usbredirection support
	for upstream qemu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f5414ee57a17500e650ea11766474b11da940da2
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Tue Nov 19 16:20:20 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 12:46:37 2013 +0000

    libxl: spice usbredirection support for upstream qemu
    
    Usage: spiceusbredirection=NUMBER (default=0)
    
    Enables spice usbredirection. Creates NUMBER usbredirection channels
    for redirection of up to 4 usb devices from spice client to domU's qemu.
    It requires an usb controller and if not defined will automatically adds
    an usb2 controller.
    
    Changes from v3:
    - fixed condition that enable usbversion if it isn't defined in presence
      of usbredirection enabled
    
    Changes from v2:
    - updated for usbversion patch v7
    - now usbredirection cannot be used with usb and usbdevice parameters
    - if usbversion is undefined it will creates an usb2 controller
    
    Changes from v1:
    - Now can be setted the number of redirection channels.
    - Various code improvements.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
---
 docs/man/xl.cfg.pod.5       |    7 +++++++
 tools/libxl/libxl.h         |   11 +++++++++++
 tools/libxl/libxl_create.c  |   10 +++++++---
 tools/libxl/libxl_dm.c      |   12 ++++++++++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 6 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 6eb9c16..a979a13 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1176,6 +1176,13 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
 Enables Spice clipboard sharing (copy/paste). It requires spicevdagent
 enabled. The default is false (0).
 
+=item B<spiceusbredirection=NUMBER>
+
+Enables spice usbredirection. Creates NUMBER usbredirection channels
+for redirection of up to 4 usb devices from spice client to domU's qemu.
+It requires an usb controller and if not defined it will automatically adds
+an usb2 controller. The default is disabled (0).
+
 =back
 
 =head3 Miscellaneous Emulated Hardware
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 1c0bee7..094ddd0 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -376,6 +376,17 @@
 #define LIBXL_HAVE_SPICE_VDAGENT 1
 
 /*
+ * LIBXL_HAVE_SPICE_USBREDIRECTION
+ *
+ * If defined, then the libxl_spice_info structure will contain an integer type
+ * field: usbredirection. This value defines if Spice usbredirection is enabled
+ * and with how much channels.
+ *
+ * If this is not defined, the Spice usbredirection support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_USBREDIREDIRECTION 1
+
+/*
  * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
  *
  * If this is defined, libxl_domain_create_restore()'s API has changed to
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 409a312..e03bb55 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -284,12 +284,16 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
-        if (b_info->u.hvm.usbversion &&
+        if (!b_info->u.hvm.usbversion &&
+            (b_info->u.hvm.spice.usbredirection > 0) )
+            b_info->u.hvm.usbversion = 2;
+
+        if ((b_info->u.hvm.usbversion || b_info->u.hvm.spice.usbredirection) &&
             ( libxl_defbool_val(b_info->u.hvm.usb)
             || b_info->u.hvm.usbdevice_list
             || b_info->u.hvm.usbdevice) ){
-            LOG(ERROR,"usbversion cannot be enabled with usb or"
-            "usbdevice parameters.");
+            LOG(ERROR,"usbversion and/or usbredirection cannot be "
+            "enabled with usb and/or usbdevice parameters.");
             return ERROR_INVAL;
         }
 
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 9f29d33..f6f7bbd 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -568,6 +568,18 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                     "must be between 1 and 3", __func__);
                 return NULL;
             }
+            if (b_info->u.hvm.spice.usbredirection >= 0 &&
+                b_info->u.hvm.spice.usbredirection < 5) {
+                for (i = 1; i <= b_info->u.hvm.spice.usbredirection; i++)
+                    flexarray_vappend(dm_args, "-chardev", libxl__sprintf(gc,
+                        "spicevmc,name=usbredir,id=usbrc%d", i), "-device",
+                        libxl__sprintf(gc, "usb-redir,chardev=usbrc%d,"
+                        "id=usbrc%d", i, i), NULL);
+            } else {
+                LOG(ERROR, "%s: usbredirection parameter is invalid, "
+                    "it must be between 1 and 4", __func__);
+                return NULL;
+            }
         }
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 0d04c16..649ce50 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -200,6 +200,7 @@ libxl_spice_info = Struct("spice_info", [
     ("agent_mouse", libxl_defbool),
     ("vdagent",     libxl_defbool),
     ("clipboard_sharing", libxl_defbool),
+    ("usbredirection", integer),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5ab62a9..4977a53 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1586,6 +1586,8 @@ skip_vfb:
                             &b_info->u.hvm.spice.vdagent, 0);
         xlu_cfg_get_defbool(config, "spice_clipboard_sharing",
                             &b_info->u.hvm.spice.clipboard_sharing, 0);
+        if (!xlu_cfg_get_long (config, "spiceusbredirection", &l, 0))
+            b_info->u.hvm.spice.usbredirection = l;
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
         xlu_cfg_get_defbool(config, "gfx_passthru", 
                             &b_info->u.hvm.gfx_passthru, 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 Sun Dec 08 02:48:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:48: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 1VpUQQ-0003cW-S9; Sun, 08 Dec 2013 02:48:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQP-0003cJ-MN
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:54 +0000
Received: from [85.158.137.68:5779] by server-5.bemta-3.messagelabs.com id
	A4/4C-25188-41ED3A25; Sun, 08 Dec 2013 02:48:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1386470930!2421236!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31004 invoked from network); 8 Dec 2013 02:48:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:48: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 1VpUQM-0004YZ-Nq
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQM-0000rE-Lk
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:48:50 +0000
Date: Sun, 08 Dec 2013 02:48:50 +0000
Message-Id: <E1VpUQM-0000rE-Lk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: spice usbredirection support
	for upstream qemu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f5414ee57a17500e650ea11766474b11da940da2
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Tue Nov 19 16:20:20 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 6 12:46:37 2013 +0000

    libxl: spice usbredirection support for upstream qemu
    
    Usage: spiceusbredirection=NUMBER (default=0)
    
    Enables spice usbredirection. Creates NUMBER usbredirection channels
    for redirection of up to 4 usb devices from spice client to domU's qemu.
    It requires an usb controller and if not defined will automatically adds
    an usb2 controller.
    
    Changes from v3:
    - fixed condition that enable usbversion if it isn't defined in presence
      of usbredirection enabled
    
    Changes from v2:
    - updated for usbversion patch v7
    - now usbredirection cannot be used with usb and usbdevice parameters
    - if usbversion is undefined it will creates an usb2 controller
    
    Changes from v1:
    - Now can be setted the number of redirection channels.
    - Various code improvements.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
---
 docs/man/xl.cfg.pod.5       |    7 +++++++
 tools/libxl/libxl.h         |   11 +++++++++++
 tools/libxl/libxl_create.c  |   10 +++++++---
 tools/libxl/libxl_dm.c      |   12 ++++++++++++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 6 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 6eb9c16..a979a13 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1176,6 +1176,13 @@ requires vdagent service installed on domU o.s. to work. The default is 0.
 Enables Spice clipboard sharing (copy/paste). It requires spicevdagent
 enabled. The default is false (0).
 
+=item B<spiceusbredirection=NUMBER>
+
+Enables spice usbredirection. Creates NUMBER usbredirection channels
+for redirection of up to 4 usb devices from spice client to domU's qemu.
+It requires an usb controller and if not defined it will automatically adds
+an usb2 controller. The default is disabled (0).
+
 =back
 
 =head3 Miscellaneous Emulated Hardware
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 1c0bee7..094ddd0 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -376,6 +376,17 @@
 #define LIBXL_HAVE_SPICE_VDAGENT 1
 
 /*
+ * LIBXL_HAVE_SPICE_USBREDIRECTION
+ *
+ * If defined, then the libxl_spice_info structure will contain an integer type
+ * field: usbredirection. This value defines if Spice usbredirection is enabled
+ * and with how much channels.
+ *
+ * If this is not defined, the Spice usbredirection support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_USBREDIREDIRECTION 1
+
+/*
  * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
  *
  * If this is defined, libxl_domain_create_restore()'s API has changed to
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 409a312..e03bb55 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -284,12 +284,16 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
-        if (b_info->u.hvm.usbversion &&
+        if (!b_info->u.hvm.usbversion &&
+            (b_info->u.hvm.spice.usbredirection > 0) )
+            b_info->u.hvm.usbversion = 2;
+
+        if ((b_info->u.hvm.usbversion || b_info->u.hvm.spice.usbredirection) &&
             ( libxl_defbool_val(b_info->u.hvm.usb)
             || b_info->u.hvm.usbdevice_list
             || b_info->u.hvm.usbdevice) ){
-            LOG(ERROR,"usbversion cannot be enabled with usb or"
-            "usbdevice parameters.");
+            LOG(ERROR,"usbversion and/or usbredirection cannot be "
+            "enabled with usb and/or usbdevice parameters.");
             return ERROR_INVAL;
         }
 
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 9f29d33..f6f7bbd 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -568,6 +568,18 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
                     "must be between 1 and 3", __func__);
                 return NULL;
             }
+            if (b_info->u.hvm.spice.usbredirection >= 0 &&
+                b_info->u.hvm.spice.usbredirection < 5) {
+                for (i = 1; i <= b_info->u.hvm.spice.usbredirection; i++)
+                    flexarray_vappend(dm_args, "-chardev", libxl__sprintf(gc,
+                        "spicevmc,name=usbredir,id=usbrc%d", i), "-device",
+                        libxl__sprintf(gc, "usb-redir,chardev=usbrc%d,"
+                        "id=usbrc%d", i, i), NULL);
+            } else {
+                LOG(ERROR, "%s: usbredirection parameter is invalid, "
+                    "it must be between 1 and 4", __func__);
+                return NULL;
+            }
         }
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 0d04c16..649ce50 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -200,6 +200,7 @@ libxl_spice_info = Struct("spice_info", [
     ("agent_mouse", libxl_defbool),
     ("vdagent",     libxl_defbool),
     ("clipboard_sharing", libxl_defbool),
+    ("usbredirection", integer),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5ab62a9..4977a53 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1586,6 +1586,8 @@ skip_vfb:
                             &b_info->u.hvm.spice.vdagent, 0);
         xlu_cfg_get_defbool(config, "spice_clipboard_sharing",
                             &b_info->u.hvm.spice.clipboard_sharing, 0);
+        if (!xlu_cfg_get_long (config, "spiceusbredirection", &l, 0))
+            b_info->u.hvm.spice.usbredirection = l;
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
         xlu_cfg_get_defbool(config, "gfx_passthru", 
                             &b_info->u.hvm.gfx_passthru, 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 Sun Dec 08 02:49:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:49: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 1VpUQb-0003eF-V8; Sun, 08 Dec 2013 02:49:05 +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 1VpUQa-0003e3-QH
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:04 +0000
Received: from [85.158.143.35:11635] by server-2.bemta-4.messagelabs.com id
	59/F3-11386-02ED3A25; Sun, 08 Dec 2013 02:49:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1386470942!4108058!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25695 invoked from network); 8 Dec 2013 02:49:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:49:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQY-0004ZB-8G
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQW-0000s7-QQ
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:02 +0000
Date: Sun, 08 Dec 2013 02:49:00 +0000
Message-Id: <E1VpUQW-0000s7-QQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tmem: fix public header 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 cc9a0f989f04f01c59c5d90748092811a760bd84
Author:     Bob Liu <bob.liu@oracle.com>
AuthorDate: Fri Dec 6 15:58:00 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 6 15:58:00 2013 +0100

    tmem: fix public header file
    
    Commit 006a687ba4de74d7933c09b43872abc19f126c63 dropped typedef tmem_cli_mfn_t
    from public tmem.h which may cause some problem.
    This patch added tmem_cli_mfn_t back with #ifdef __XEN_INTERFACE_VERSION__
    around.
    
    Signed-off-by: Bob Liu <bob.liu@oracle.com>
    Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/include/public/tmem.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/tmem.h b/xen/include/public/tmem.h
index dd685ee..5eb2fb4 100644
--- a/xen/include/public/tmem.h
+++ b/xen/include/public/tmem.h
@@ -95,6 +95,9 @@
 
 
 #ifndef __ASSEMBLY__
+#if __XEN_INTERFACE_VERSION__ < 0x00040400
+typedef xen_pfn_t tmem_cli_mfn_t;
+#endif
 typedef XEN_GUEST_HANDLE(char) tmem_cli_va_t;
 struct tmem_op {
     uint32_t cmd;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:49:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:49: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 1VpUQb-0003eF-V8; Sun, 08 Dec 2013 02:49:05 +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 1VpUQa-0003e3-QH
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:04 +0000
Received: from [85.158.143.35:11635] by server-2.bemta-4.messagelabs.com id
	59/F3-11386-02ED3A25; Sun, 08 Dec 2013 02:49:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1386470942!4108058!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25695 invoked from network); 8 Dec 2013 02:49:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Dec 2013 02:49:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQY-0004ZB-8G
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQW-0000s7-QQ
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:02 +0000
Date: Sun, 08 Dec 2013 02:49:00 +0000
Message-Id: <E1VpUQW-0000s7-QQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tmem: fix public header 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 cc9a0f989f04f01c59c5d90748092811a760bd84
Author:     Bob Liu <bob.liu@oracle.com>
AuthorDate: Fri Dec 6 15:58:00 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 6 15:58:00 2013 +0100

    tmem: fix public header file
    
    Commit 006a687ba4de74d7933c09b43872abc19f126c63 dropped typedef tmem_cli_mfn_t
    from public tmem.h which may cause some problem.
    This patch added tmem_cli_mfn_t back with #ifdef __XEN_INTERFACE_VERSION__
    around.
    
    Signed-off-by: Bob Liu <bob.liu@oracle.com>
    Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/include/public/tmem.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/tmem.h b/xen/include/public/tmem.h
index dd685ee..5eb2fb4 100644
--- a/xen/include/public/tmem.h
+++ b/xen/include/public/tmem.h
@@ -95,6 +95,9 @@
 
 
 #ifndef __ASSEMBLY__
+#if __XEN_INTERFACE_VERSION__ < 0x00040400
+typedef xen_pfn_t tmem_cli_mfn_t;
+#endif
 typedef XEN_GUEST_HANDLE(char) tmem_cli_va_t;
 struct tmem_op {
     uint32_t cmd;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:49:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:49: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 1VpUQm-0003gL-5s; Sun, 08 Dec 2013 02:49: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 1VpUQl-0003g9-2p
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:15 +0000
Received: from [85.158.139.211:12452] by server-10.bemta-5.messagelabs.com id
	87/58-01405-A2ED3A25; Sun, 08 Dec 2013 02:49:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1386470952!2931513!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28914 invoked from network); 8 Dec 2013 02:49:13 -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 Dec 2013 02:49:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQi-0004ZH-E6
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQi-0000se-Cr
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:12 +0000
Date: Sun, 08 Dec 2013 02:49:12 +0000
Message-Id: <E1VpUQi-0000se-Cr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tmem: Fix uses of unmatched
	__map_domain_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2f718161bc292bfbdf1aeefd3932b73c0965373d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 6 16:09:38 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 6 16:09:38 2013 +0100

    tmem: Fix uses of unmatched __map_domain_page()
    
    __map_domain_page() *must* be matched with an unmap_domain_page().  These five
    static inline functions each map a page (or two), then throw away the context
    needed to unmap it.
    
    Each of the changes are limited to their respective functions.  In two cases,
    this involved replacing a large amount of pointer arithmetic with memcpy()
    (all callers were relying on memcpy() semantics of positive/negative returns
    rather than specifically -1/+1). A third case had its pointer arithmetic
    entirely replaced with memcpy().
    
    In addition, remove redundant casts of void pointers and assertions.
    
    This fixes Coverity IDs 1135373 1135374 1135375 1135376 1135377 1135378
    11353739 which were retroactively identified following modelling improvements.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Tested-by: Bob Liu <bob.liu@oracle.com>
---
 xen/include/xen/tmem_xen.h |   78 ++++++++++++++++++++++---------------------
 1 files changed, 40 insertions(+), 38 deletions(-)

diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index b26c6fa..cccc98e 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -228,26 +228,24 @@ static inline bool_t tmem_current_is_privileged(void)
 
 static inline uint8_t tmem_get_first_byte(struct page_info *pfp)
 {
-    void *p = __map_domain_page(pfp);
+    const uint8_t *p = __map_domain_page(pfp);
+    uint8_t byte = p[0];
 
-    return (uint8_t)(*(char *)p);
+    unmap_domain_page(p);
+
+    return byte;
 }
 
 static inline int tmem_page_cmp(struct page_info *pfp1, struct page_info *pfp2)
 {
-    const uint64_t *p1 = (uint64_t *)__map_domain_page(pfp1);
-    const uint64_t *p2 = (uint64_t *)__map_domain_page(pfp2);
-    int i;
-
-    // FIXME: code in assembly?
-ASSERT(p1 != NULL);
-ASSERT(p2 != NULL);
-    for ( i = PAGE_SIZE/sizeof(uint64_t); i && *p1 == *p2; i--, p1++, p2++ );
-    if ( !i )
-        return 0;
-    if ( *p1 < *p2 )
-        return -1;
-    return 1;
+    const uint64_t *p1 = __map_domain_page(pfp1);
+    const uint64_t *p2 = __map_domain_page(pfp2);
+    int rc = memcmp(p1, p2, PAGE_SIZE);
+
+    unmap_domain_page(p2);
+    unmap_domain_page(p1);
+
+    return rc;
 }
 
 static inline int tmem_pcd_cmp(void *va1, pagesize_t len1, void *va2, pagesize_t len2)
@@ -271,54 +269,58 @@ static inline int tmem_pcd_cmp(void *va1, pagesize_t len1, void *va2, pagesize_t
     return 1;
 }
 
-static inline int tmem_tze_pfp_cmp(struct page_info *pfp1, pagesize_t pfp_len, void *tva, pagesize_t tze_len)
+static inline int tmem_tze_pfp_cmp(struct page_info *pfp1, pagesize_t pfp_len,
+                                   void *tva, const pagesize_t tze_len)
 {
-    const uint64_t *p1 = (uint64_t *)__map_domain_page(pfp1);
-    const uint64_t *p2;
-    pagesize_t i;
+    const uint64_t *p1 = __map_domain_page(pfp1);
+    const uint64_t *p2 = tze_len == PAGE_SIZE ?
+        __map_domain_page((struct page_info *)tva) : tva;
+    int rc;
 
-    if ( tze_len == PAGE_SIZE )
-       p2 = (uint64_t *)__map_domain_page((struct page_info *)tva);
-    else
-       p2 = (uint64_t *)tva;
     ASSERT(pfp_len <= PAGE_SIZE);
     ASSERT(!(pfp_len & (sizeof(uint64_t)-1)));
     ASSERT(tze_len <= PAGE_SIZE);
     ASSERT(!(tze_len & (sizeof(uint64_t)-1)));
     if ( pfp_len < tze_len )
-        return -1;
-    if ( pfp_len > tze_len )
-        return 1;
-    ASSERT(pfp_len == tze_len);
-    for ( i = tze_len/sizeof(uint64_t); i && *p1 == *p2; i--, p1++, p2++ );
-    if ( !i )
-        return 0;
-    if ( *p1 < *p2 )
-        return -1;
-    return 1;
+        rc = -1;
+    else if ( pfp_len > tze_len )
+        rc = 1;
+    else
+        rc = memcmp(p1, p2, tze_len);
+
+    if ( tze_len == PAGE_SIZE )
+        unmap_domain_page(p2);
+    unmap_domain_page(p1);
+
+    return rc;
 }
 
 /* return the size of the data in the pfp, ignoring trailing zeroes and
  * rounded up to the nearest multiple of 8 */
 static inline pagesize_t tmem_tze_pfp_scan(struct page_info *pfp)
 {
-    const uint64_t *p = (uint64_t *)__map_domain_page(pfp);
+    const uint64_t *const page = __map_domain_page(pfp);
+    const uint64_t *p = page;
     pagesize_t bytecount = PAGE_SIZE;
     pagesize_t len = PAGE_SIZE/sizeof(uint64_t);
+
     p += len;
     while ( len-- && !*--p )
         bytecount -= sizeof(uint64_t);
+
+    unmap_domain_page(page);
+
     return bytecount;
 }
 
 static inline void tmem_tze_copy_from_pfp(void *tva, struct page_info *pfp, pagesize_t len)
 {
-    uint64_t *p1 = (uint64_t *)tva;
-    const uint64_t *p2 = (uint64_t *)__map_domain_page(pfp);
+    const uint64_t *p = __map_domain_page(pfp);
 
-    pagesize_t i;
     ASSERT(!(len & (sizeof(uint64_t)-1)));
-    for ( i = len/sizeof(uint64_t); i--; *p1++ = *p2++);
+    memcpy(tva, p, len);
+
+    unmap_domain_page(p);
 }
 
 /* these typedefs are in the public/tmem.h interface
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Dec 08 02:49:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Dec 2013 02:49: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 1VpUQm-0003gL-5s; Sun, 08 Dec 2013 02:49: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 1VpUQl-0003g9-2p
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:15 +0000
Received: from [85.158.139.211:12452] by server-10.bemta-5.messagelabs.com id
	87/58-01405-A2ED3A25; Sun, 08 Dec 2013 02:49:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1386470952!2931513!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28914 invoked from network); 8 Dec 2013 02:49:13 -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 Dec 2013 02:49:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQi-0004ZH-E6
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VpUQi-0000se-Cr
	for xen-changelog@lists.xensource.com; Sun, 08 Dec 2013 02:49:12 +0000
Date: Sun, 08 Dec 2013 02:49:12 +0000
Message-Id: <E1VpUQi-0000se-Cr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tmem: Fix uses of unmatched
	__map_domain_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2f718161bc292bfbdf1aeefd3932b73c0965373d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Dec 6 16:09:38 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 6 16:09:38 2013 +0100

    tmem: Fix uses of unmatched __map_domain_page()
    
    __map_domain_page() *must* be matched with an unmap_domain_page().  These five
    static inline functions each map a page (or two), then throw away the context
    needed to unmap it.
    
    Each of the changes are limited to their respective functions.  In two cases,
    this involved replacing a large amount of pointer arithmetic with memcpy()
    (all callers were relying on memcpy() semantics of positive/negative returns
    rather than specifically -1/+1). A third case had its pointer arithmetic
    entirely replaced with memcpy().
    
    In addition, remove redundant casts of void pointers and assertions.
    
    This fixes Coverity IDs 1135373 1135374 1135375 1135376 1135377 1135378
    11353739 which were retroactively identified following modelling improvements.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Tested-by: Bob Liu <bob.liu@oracle.com>
---
 xen/include/xen/tmem_xen.h |   78 ++++++++++++++++++++++---------------------
 1 files changed, 40 insertions(+), 38 deletions(-)

diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index b26c6fa..cccc98e 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -228,26 +228,24 @@ static inline bool_t tmem_current_is_privileged(void)
 
 static inline uint8_t tmem_get_first_byte(struct page_info *pfp)
 {
-    void *p = __map_domain_page(pfp);
+    const uint8_t *p = __map_domain_page(pfp);
+    uint8_t byte = p[0];
 
-    return (uint8_t)(*(char *)p);
+    unmap_domain_page(p);
+
+    return byte;
 }
 
 static inline int tmem_page_cmp(struct page_info *pfp1, struct page_info *pfp2)
 {
-    const uint64_t *p1 = (uint64_t *)__map_domain_page(pfp1);
-    const uint64_t *p2 = (uint64_t *)__map_domain_page(pfp2);
-    int i;
-
-    // FIXME: code in assembly?
-ASSERT(p1 != NULL);
-ASSERT(p2 != NULL);
-    for ( i = PAGE_SIZE/sizeof(uint64_t); i && *p1 == *p2; i--, p1++, p2++ );
-    if ( !i )
-        return 0;
-    if ( *p1 < *p2 )
-        return -1;
-    return 1;
+    const uint64_t *p1 = __map_domain_page(pfp1);
+    const uint64_t *p2 = __map_domain_page(pfp2);
+    int rc = memcmp(p1, p2, PAGE_SIZE);
+
+    unmap_domain_page(p2);
+    unmap_domain_page(p1);
+
+    return rc;
 }
 
 static inline int tmem_pcd_cmp(void *va1, pagesize_t len1, void *va2, pagesize_t len2)
@@ -271,54 +269,58 @@ static inline int tmem_pcd_cmp(void *va1, pagesize_t len1, void *va2, pagesize_t
     return 1;
 }
 
-static inline int tmem_tze_pfp_cmp(struct page_info *pfp1, pagesize_t pfp_len, void *tva, pagesize_t tze_len)
+static inline int tmem_tze_pfp_cmp(struct page_info *pfp1, pagesize_t pfp_len,
+                                   void *tva, const pagesize_t tze_len)
 {
-    const uint64_t *p1 = (uint64_t *)__map_domain_page(pfp1);
-    const uint64_t *p2;
-    pagesize_t i;
+    const uint64_t *p1 = __map_domain_page(pfp1);
+    const uint64_t *p2 = tze_len == PAGE_SIZE ?
+        __map_domain_page((struct page_info *)tva) : tva;
+    int rc;
 
-    if ( tze_len == PAGE_SIZE )
-       p2 = (uint64_t *)__map_domain_page((struct page_info *)tva);
-    else
-       p2 = (uint64_t *)tva;
     ASSERT(pfp_len <= PAGE_SIZE);
     ASSERT(!(pfp_len & (sizeof(uint64_t)-1)));
     ASSERT(tze_len <= PAGE_SIZE);
     ASSERT(!(tze_len & (sizeof(uint64_t)-1)));
     if ( pfp_len < tze_len )
-        return -1;
-    if ( pfp_len > tze_len )
-        return 1;
-    ASSERT(pfp_len == tze_len);
-    for ( i = tze_len/sizeof(uint64_t); i && *p1 == *p2; i--, p1++, p2++ );
-    if ( !i )
-        return 0;
-    if ( *p1 < *p2 )
-        return -1;
-    return 1;
+        rc = -1;
+    else if ( pfp_len > tze_len )
+        rc = 1;
+    else
+        rc = memcmp(p1, p2, tze_len);
+
+    if ( tze_len == PAGE_SIZE )
+        unmap_domain_page(p2);
+    unmap_domain_page(p1);
+
+    return rc;
 }
 
 /* return the size of the data in the pfp, ignoring trailing zeroes and
  * rounded up to the nearest multiple of 8 */
 static inline pagesize_t tmem_tze_pfp_scan(struct page_info *pfp)
 {
-    const uint64_t *p = (uint64_t *)__map_domain_page(pfp);
+    const uint64_t *const page = __map_domain_page(pfp);
+    const uint64_t *p = page;
     pagesize_t bytecount = PAGE_SIZE;
     pagesize_t len = PAGE_SIZE/sizeof(uint64_t);
+
     p += len;
     while ( len-- && !*--p )
         bytecount -= sizeof(uint64_t);
+
+    unmap_domain_page(page);
+
     return bytecount;
 }
 
 static inline void tmem_tze_copy_from_pfp(void *tva, struct page_info *pfp, pagesize_t len)
 {
-    uint64_t *p1 = (uint64_t *)tva;
-    const uint64_t *p2 = (uint64_t *)__map_domain_page(pfp);
+    const uint64_t *p = __map_domain_page(pfp);
 
-    pagesize_t i;
     ASSERT(!(len & (sizeof(uint64_t)-1)));
-    for ( i = len/sizeof(uint64_t); i--; *p1++ = *p2++);
+    memcpy(tva, p, len);
+
+    unmap_domain_page(p);
 }
 
 /* these typedefs are in the public/tmem.h interface
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Dec 09 21:44:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Dec 2013 21:44: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 1Vq8cY-0004pD-Mp; Mon, 09 Dec 2013 21:44: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 1Vq8cX-0004p5-5r
	for xen-changelog@lists.xensource.com; Mon, 09 Dec 2013 21:44:05 +0000
Received: from [85.158.143.35:43334] by server-3.bemta-4.messagelabs.com id
	DD/60-32360-4A936A25; Mon, 09 Dec 2013 21:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1386625443!4485300!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25755 invoked from network); 9 Dec 2013 21:44:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Dec 2013 21:44:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vq8cU-0007sp-Rt
	for xen-changelog@lists.xensource.com; Mon, 09 Dec 2013 21:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vq8cU-0006GY-IE
	for xen-changelog@lists.xensource.com; Mon, 09 Dec 2013 21:44:02 +0000
Date: Mon, 09 Dec 2013 21:44:02 +0000
Message-Id: <E1Vq8cU-0006GY-IE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: arch_domain_create: don't
	return 0 when alloc_xenheap_pages 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 2e213747ac49a382eeed2d493e767496482da2c8
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Dec 8 02:32:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 09:58:55 2013 +0000

    xen/arm: arch_domain_create: don't return 0 when alloc_xenheap_pages has failed
    
    The previous call before alloc_xenheap_pages reset rc to 0 if it success.
    If the latter fails, arch_domain_create will return 0 and Xen will consider
    the domain as valid. Move rc initialization later.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 52d2403..67c65c3 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -501,10 +501,10 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
     if ( is_idle_domain(d) )
         return 0;
 
-    rc = -ENOMEM;
     if ( (rc = p2m_init(d)) != 0 )
         goto fail;
 
+    rc = -ENOMEM;
     if ( (d->shared_info = alloc_xenheap_pages(0, 0)) == NULL )
         goto fail;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Dec 09 21:44:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 09 Dec 2013 21:44: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 1Vq8cY-0004pD-Mp; Mon, 09 Dec 2013 21:44: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 1Vq8cX-0004p5-5r
	for xen-changelog@lists.xensource.com; Mon, 09 Dec 2013 21:44:05 +0000
Received: from [85.158.143.35:43334] by server-3.bemta-4.messagelabs.com id
	DD/60-32360-4A936A25; Mon, 09 Dec 2013 21:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1386625443!4485300!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25755 invoked from network); 9 Dec 2013 21:44:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Dec 2013 21:44:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vq8cU-0007sp-Rt
	for xen-changelog@lists.xensource.com; Mon, 09 Dec 2013 21:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vq8cU-0006GY-IE
	for xen-changelog@lists.xensource.com; Mon, 09 Dec 2013 21:44:02 +0000
Date: Mon, 09 Dec 2013 21:44:02 +0000
Message-Id: <E1Vq8cU-0006GY-IE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: arch_domain_create: don't
	return 0 when alloc_xenheap_pages 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 2e213747ac49a382eeed2d493e767496482da2c8
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Sun Dec 8 02:32:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 09:58:55 2013 +0000

    xen/arm: arch_domain_create: don't return 0 when alloc_xenheap_pages has failed
    
    The previous call before alloc_xenheap_pages reset rc to 0 if it success.
    If the latter fails, arch_domain_create will return 0 and Xen will consider
    the domain as valid. Move rc initialization later.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 52d2403..67c65c3 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -501,10 +501,10 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
     if ( is_idle_domain(d) )
         return 0;
 
-    rc = -ENOMEM;
     if ( (rc = p2m_init(d)) != 0 )
         goto fail;
 
+    rc = -ENOMEM;
     if ( (d->shared_info = alloc_xenheap_pages(0, 0)) == NULL )
         goto fail;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 00:55:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00: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 1VqBbW-0003nt-4F; Tue, 10 Dec 2013 00:55:14 +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 1VqBbV-0003nk-F6
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:13 +0000
Received: from [85.158.143.35:19947] by server-3.bemta-4.messagelabs.com id
	8B/59-32360-07666A25; Tue, 10 Dec 2013 00:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1386636909!4508610!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6585 invoked from network); 10 Dec 2013 00:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00: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 1VqBbM-0001r0-6b
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbL-0003QM-M4
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:03 +0000
Date: Tue, 10 Dec 2013 00:55:03 +0000
Message-Id: <E1VqBbL-0003QM-M4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/hvm: fix segment validation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 77c7b3c602744e7589522925b6d6f7dd11bede76
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Dec 9 14:36:58 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:36:58 2013 +0100

    x86/hvm: fix segment validation
    
    Also Coverity CID 1055180.
    
    Reported-by: David Binderman <dcb314@hotmail.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    
    Use _SEGMENT_* instead of plain numbers and adjust a comment.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6ed4bfbabd487b41021caa7ed03cee1f00ecbabf
    master date: 2013-11-26 09:54:21 +0100
---
 xen/arch/x86/hvm/hvm.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3cfce05..2144d4a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2121,7 +2121,7 @@ static int hvm_load_segment_selector(
             if ( !(desc.b & (1u<<11)) )
                 goto unmap_and_fail;
             /* Non-conforming segment: check DPL against RPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && (dpl != rpl) )
+            if ( !(desc.b & _SEGMENT_EC) && (dpl != rpl) )
                 goto unmap_and_fail;
             break;
         case x86_seg_ss:
@@ -2140,8 +2140,13 @@ static int hvm_load_segment_selector(
             /* Readable code or data segment? */
             if ( (desc.b & (5u<<9)) == (4u<<9) )
                 goto unmap_and_fail;
-            /* Non-conforming segment: check DPL against RPL and CPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && ((dpl < cpl) || (dpl < rpl)) )
+            /*
+             * Data or non-conforming code segment:
+             * check DPL against RPL and CPL.
+             */
+            if ( ((desc.b & (_SEGMENT_EC|_SEGMENT_CODE)) !=
+                  (_SEGMENT_EC|_SEGMENT_CODE))
+                 && ((dpl < cpl) || (dpl < rpl)) )
                 goto unmap_and_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 Tue Dec 10 00:55:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00: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 1VqBbW-0003nt-4F; Tue, 10 Dec 2013 00:55:14 +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 1VqBbV-0003nk-F6
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:13 +0000
Received: from [85.158.143.35:19947] by server-3.bemta-4.messagelabs.com id
	8B/59-32360-07666A25; Tue, 10 Dec 2013 00:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1386636909!4508610!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6585 invoked from network); 10 Dec 2013 00:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00: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 1VqBbM-0001r0-6b
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbL-0003QM-M4
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:03 +0000
Date: Tue, 10 Dec 2013 00:55:03 +0000
Message-Id: <E1VqBbL-0003QM-M4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/hvm: fix segment validation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 77c7b3c602744e7589522925b6d6f7dd11bede76
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Dec 9 14:36:58 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:36:58 2013 +0100

    x86/hvm: fix segment validation
    
    Also Coverity CID 1055180.
    
    Reported-by: David Binderman <dcb314@hotmail.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    
    Use _SEGMENT_* instead of plain numbers and adjust a comment.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6ed4bfbabd487b41021caa7ed03cee1f00ecbabf
    master date: 2013-11-26 09:54:21 +0100
---
 xen/arch/x86/hvm/hvm.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3cfce05..2144d4a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2121,7 +2121,7 @@ static int hvm_load_segment_selector(
             if ( !(desc.b & (1u<<11)) )
                 goto unmap_and_fail;
             /* Non-conforming segment: check DPL against RPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && (dpl != rpl) )
+            if ( !(desc.b & _SEGMENT_EC) && (dpl != rpl) )
                 goto unmap_and_fail;
             break;
         case x86_seg_ss:
@@ -2140,8 +2140,13 @@ static int hvm_load_segment_selector(
             /* Readable code or data segment? */
             if ( (desc.b & (5u<<9)) == (4u<<9) )
                 goto unmap_and_fail;
-            /* Non-conforming segment: check DPL against RPL and CPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && ((dpl < cpl) || (dpl < rpl)) )
+            /*
+             * Data or non-conforming code segment:
+             * check DPL against RPL and CPL.
+             */
+            if ( ((desc.b & (_SEGMENT_EC|_SEGMENT_CODE)) !=
+                  (_SEGMENT_EC|_SEGMENT_CODE))
+                 && ((dpl < cpl) || (dpl < rpl)) )
                 goto unmap_and_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 Tue Dec 10 00:55:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VqBba-0003on-7H; Tue, 10 Dec 2013 00:55:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbZ-0003oX-FE
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:17 +0000
Received: from [193.109.254.147:56519] by server-11.bemta-14.messagelabs.com
	id EB/5B-20576-47666A25; Tue, 10 Dec 2013 00:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386636914!3990976!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20184 invoked from network); 10 Dec 2013 00:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00: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 1VqBbW-0001r3-DA
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbW-0003Qk-BC
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:14 +0000
Date: Tue, 10 Dec 2013 00:55:14 +0000
Message-Id: <E1VqBbW-0003Qk-BC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VMX: disable EPT when
	!cpu_has_vmx_pat
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f1e0df14412ccc6933a68eda66ac5b7d89186b62
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:40:51 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:40:51 2013 +0100

    VMX: disable EPT when !cpu_has_vmx_pat
    
    Recently Oracle developers found a Xen security issue as DOS affecting,
    named as XSA-60. Please refer http://xenbits.xen.org/xsa/advisory-60.html
    Basically it involves how to handle guest cr0.cd setting, which under
    some environment it consumes much time resulting in DOS-like behavior.
    
    This is a preparing patch for fixing XSA-60. Later patch will fix XSA-60
    via PAT under Intel EPT case, which depends on cpu_has_vmx_pat.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: c13b0d65ddedd74508edef5cd66defffe30468fc
    master date: 2013-11-06 10:11:18 +0100
---
 xen/arch/x86/hvm/vmx/vmcs.c |    4 ++--
 xen/arch/x86/hvm/vmx/vmx.c  |   10 +++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 11c19f1..049267e 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -779,7 +779,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
-        if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+        if ( paging_mode_hap(d) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT);
     }
 
@@ -905,7 +905,7 @@ static int construct_vmcs(struct vcpu *v)
 #endif
     }
 
-    if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+    if ( paging_mode_hap(d) )
     {
         u64 host_pat, guest_pat;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 1e30557..f40c276 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -972,7 +972,7 @@ static unsigned long vmx_get_shadow_gs_base(struct vcpu *v)
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -986,7 +986,7 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -1593,7 +1593,11 @@ struct hvm_function_table * __init start_vmx(void)
         return NULL;
     }
 
-    if ( cpu_has_vmx_ept )
+    /*
+     * Do not enable EPT when (!cpu_has_vmx_pat), to prevent security hole
+     * (refer to http://xenbits.xen.org/xsa/advisory-60.html).
+     */
+    if ( cpu_has_vmx_ept && cpu_has_vmx_pat )
     {
         vmx_function_table.hap_supported = 1;
 
--
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 Tue Dec 10 00:55:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VqBba-0003on-7H; Tue, 10 Dec 2013 00:55:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbZ-0003oX-FE
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:17 +0000
Received: from [193.109.254.147:56519] by server-11.bemta-14.messagelabs.com
	id EB/5B-20576-47666A25; Tue, 10 Dec 2013 00:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386636914!3990976!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20184 invoked from network); 10 Dec 2013 00:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00: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 1VqBbW-0001r3-DA
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbW-0003Qk-BC
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:14 +0000
Date: Tue, 10 Dec 2013 00:55:14 +0000
Message-Id: <E1VqBbW-0003Qk-BC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VMX: disable EPT when
	!cpu_has_vmx_pat
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f1e0df14412ccc6933a68eda66ac5b7d89186b62
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:40:51 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:40:51 2013 +0100

    VMX: disable EPT when !cpu_has_vmx_pat
    
    Recently Oracle developers found a Xen security issue as DOS affecting,
    named as XSA-60. Please refer http://xenbits.xen.org/xsa/advisory-60.html
    Basically it involves how to handle guest cr0.cd setting, which under
    some environment it consumes much time resulting in DOS-like behavior.
    
    This is a preparing patch for fixing XSA-60. Later patch will fix XSA-60
    via PAT under Intel EPT case, which depends on cpu_has_vmx_pat.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: c13b0d65ddedd74508edef5cd66defffe30468fc
    master date: 2013-11-06 10:11:18 +0100
---
 xen/arch/x86/hvm/vmx/vmcs.c |    4 ++--
 xen/arch/x86/hvm/vmx/vmx.c  |   10 +++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 11c19f1..049267e 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -779,7 +779,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
-        if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+        if ( paging_mode_hap(d) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT);
     }
 
@@ -905,7 +905,7 @@ static int construct_vmcs(struct vcpu *v)
 #endif
     }
 
-    if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+    if ( paging_mode_hap(d) )
     {
         u64 host_pat, guest_pat;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 1e30557..f40c276 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -972,7 +972,7 @@ static unsigned long vmx_get_shadow_gs_base(struct vcpu *v)
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -986,7 +986,7 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -1593,7 +1593,11 @@ struct hvm_function_table * __init start_vmx(void)
         return NULL;
     }
 
-    if ( cpu_has_vmx_ept )
+    /*
+     * Do not enable EPT when (!cpu_has_vmx_pat), to prevent security hole
+     * (refer to http://xenbits.xen.org/xsa/advisory-60.html).
+     */
+    if ( cpu_has_vmx_ept && cpu_has_vmx_pat )
     {
         vmx_function_table.hap_supported = 1;
 
--
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 Tue Dec 10 00:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00: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 1VqBbl-0003qS-EH; Tue, 10 Dec 2013 00:55:29 +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 1VqBbj-0003q7-JW
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:27 +0000
Received: from [193.109.254.147:45239] by server-1.bemta-14.messagelabs.com id
	AE/2C-15600-E7666A25; Tue, 10 Dec 2013 00:55:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1386636924!558302!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29218 invoked from network); 10 Dec 2013 00:55:25 -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;
	10 Dec 2013 00:55: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 1VqBbg-0001rC-KZ
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbg-0003R6-H7
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:24 +0000
Date: Tue, 10 Dec 2013 00:55:24 +0000
Message-Id: <E1VqBbg-0003R6-H7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VMX: remove the problematic
	set_uc_mode logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 644e6c5c7106d276fb750daf6e07de0034b2e76a
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:41:44 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:41:44 2013 +0100

    VMX: remove the problematic set_uc_mode logic
    
    XSA-60 security hole comes from the problematic vmx_set_uc_mode.
    This patch remove vmx_set_uc_mode logic, which will be replaced by
    PAT approach at later patch.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: 1c84d046735102e02d2df454ab07f14ac51f235d
    master date: 2013-11-06 10:12:00 +0100
---
 xen/arch/x86/hvm/hvm.c        |    2 -
 xen/arch/x86/hvm/mtrr.c       |    3 -
 xen/arch/x86/hvm/vmx/vmx.c    |    9 ---
 xen/arch/x86/mm/p2m-ept.c     |  110 -----------------------------------------
 xen/include/asm-x86/hvm/hvm.h |    1 -
 5 files changed, 0 insertions(+), 125 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2144d4a..863efdf 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1575,8 +1575,6 @@ static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
 {
     v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
     shadow_blow_tables_per_domain(v->domain);
-    if ( hvm_funcs.set_uc_mode )
-        return hvm_funcs.set_uc_mode(v);
 }
 
 int hvm_mov_to_cr(unsigned int cr, unsigned int gpr)
diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index 7807e03..4842d63 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -696,9 +696,6 @@ uint8_t epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn,
     if ( !v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT] )
         return MTRR_TYPE_WRBACK;
 
-    if ( (v == current) && v->domain->arch.hvm_domain.is_in_uc_mode )
-        return MTRR_TYPE_UNCACHABLE;
-
     if ( !mfn_valid(mfn_x(mfn)) )
         return MTRR_TYPE_UNCACHABLE;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index f40c276..5bfe9ac 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1495,14 +1495,6 @@ static int vmx_do_pmu_interrupt(struct cpu_user_regs *regs)
     return vpmu_do_interrupt(regs);
 }
 
-static void vmx_set_uc_mode(struct vcpu *v)
-{
-    if ( paging_mode_hap(v->domain) )
-        ept_change_entry_emt_with_range(
-            v->domain, 0, p2m_get_hostp2m(v->domain)->max_mapped_pfn);
-    hvm_asid_flush_vcpu(v);
-}
-
 static void vmx_set_info_guest(struct vcpu *v)
 {
     unsigned long intr_shadow;
@@ -1565,7 +1557,6 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
-    .set_uc_mode          = vmx_set_uc_mode,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting,
     .nhvm_vcpu_initialise = nvmx_vcpu_initialise,
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index c964f54..4576377 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -582,43 +582,6 @@ out:
     return mfn;
 }
 
-/* WARNING: Only caller doesn't care about PoD pages.  So this function will
- * always return 0 for PoD pages, not populate them.  If that becomes necessary,
- * pass a p2m_query_t type along to distinguish. */
-static ept_entry_t ept_get_entry_content(struct p2m_domain *p2m,
-    unsigned long gfn, int *level)
-{
-    ept_entry_t *table = map_domain_page(ept_get_asr(p2m->domain));
-    unsigned long gfn_remainder = gfn;
-    ept_entry_t *ept_entry;
-    ept_entry_t content = { .epte = 0 };
-    u32 index;
-    int i;
-    int ret=0;
-
-    /* This pfn is higher than the highest the p2m map currently holds */
-    if ( gfn > p2m->max_mapped_pfn )
-        goto out;
-
-    for ( i = ept_get_wl(p2m->domain); i > 0; i-- )
-    {
-        ret = ept_next_level(p2m, 1, &table, &gfn_remainder, i);
-        if ( !ret || ret == GUEST_TABLE_POD_PAGE )
-            goto out;
-        else if ( ret == GUEST_TABLE_SUPER_PAGE )
-            break;
-    }
-
-    index = gfn_remainder >> (i * EPT_TABLE_ORDER);
-    ept_entry = table + index;
-    content = *ept_entry;
-    *level = i;
-
- out:
-    unmap_domain_page(table);
-    return content;
-}
-
 void ept_walk_table(struct domain *d, unsigned long gfn)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
@@ -670,79 +633,6 @@ out:
 }
 
 /*
- * To test if the new emt type is the same with old,
- * return 1 to not to reset ept entry.
- */
-static int need_modify_ept_entry(struct p2m_domain *p2m, unsigned long gfn,
-                                 mfn_t mfn, uint8_t o_ipat, uint8_t o_emt,
-                                 p2m_type_t p2mt)
-{
-    uint8_t ipat;
-    uint8_t emt;
-    bool_t direct_mmio = (p2mt == p2m_mmio_direct);
-
-    emt = epte_get_entry_emt(p2m->domain, gfn, mfn, &ipat, direct_mmio);
-
-    if ( (emt == o_emt) && (ipat == o_ipat) )
-        return 0;
-
-    return 1;
-}
-
-void ept_change_entry_emt_with_range(struct domain *d,
-                                     unsigned long start_gfn,
-                                     unsigned long end_gfn)
-{
-    unsigned long gfn;
-    ept_entry_t e;
-    mfn_t mfn;
-    int order = 0;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    p2m_lock(p2m);
-    for ( gfn = start_gfn; gfn <= end_gfn; gfn++ )
-    {
-        int level = 0;
-        uint64_t trunk = 0;
-
-        e = ept_get_entry_content(p2m, gfn, &level);
-        if ( !is_epte_present(&e) || !p2m_has_emt(e.sa_p2mt) )
-            continue;
-
-        order = 0;
-        mfn = _mfn(e.mfn);
-
-        if ( is_epte_superpage(&e) )
-        {
-            while ( level )
-            {
-                trunk = (1UL << (level * EPT_TABLE_ORDER)) - 1;
-                if ( !(gfn & trunk) && (gfn + trunk <= end_gfn) )
-                {
-                    /* gfn assigned with 2M or 1G, and the end covers more than
-                     * the super page areas.
-                     * Set emt for super page.
-                     */
-                    order = level * EPT_TABLE_ORDER;
-                    if ( need_modify_ept_entry(p2m, gfn, mfn, 
-                          e.ipat, e.emt, e.sa_p2mt) )
-                        ept_set_entry(p2m, gfn, mfn, order, e.sa_p2mt, e.access);
-                    gfn += trunk;
-                    break;
-                }
-                level--;
-             }
-        }
-        else /* gfn assigned with 4k */
-        {
-            if ( need_modify_ept_entry(p2m, gfn, mfn, e.ipat, e.emt, e.sa_p2mt) )
-                ept_set_entry(p2m, gfn, mfn, order, e.sa_p2mt, e.access);
-        }
-    }
-    p2m_unlock(p2m);
-}
-
-/*
  * Walk the whole p2m table, changing any entries of the old type
  * to the new type.  This is used in hardware-assisted paging to
  * quickly enable or diable log-dirty tracking
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index a440fb4..ccc5208 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -157,7 +157,6 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
-    void (*set_uc_mode)(struct vcpu *v);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 
--
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 Tue Dec 10 00:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00: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 1VqBbl-0003qS-EH; Tue, 10 Dec 2013 00:55:29 +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 1VqBbj-0003q7-JW
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:27 +0000
Received: from [193.109.254.147:45239] by server-1.bemta-14.messagelabs.com id
	AE/2C-15600-E7666A25; Tue, 10 Dec 2013 00:55:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1386636924!558302!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29218 invoked from network); 10 Dec 2013 00:55:25 -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;
	10 Dec 2013 00:55: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 1VqBbg-0001rC-KZ
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbg-0003R6-H7
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:24 +0000
Date: Tue, 10 Dec 2013 00:55:24 +0000
Message-Id: <E1VqBbg-0003R6-H7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VMX: remove the problematic
	set_uc_mode logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 644e6c5c7106d276fb750daf6e07de0034b2e76a
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:41:44 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:41:44 2013 +0100

    VMX: remove the problematic set_uc_mode logic
    
    XSA-60 security hole comes from the problematic vmx_set_uc_mode.
    This patch remove vmx_set_uc_mode logic, which will be replaced by
    PAT approach at later patch.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: 1c84d046735102e02d2df454ab07f14ac51f235d
    master date: 2013-11-06 10:12:00 +0100
---
 xen/arch/x86/hvm/hvm.c        |    2 -
 xen/arch/x86/hvm/mtrr.c       |    3 -
 xen/arch/x86/hvm/vmx/vmx.c    |    9 ---
 xen/arch/x86/mm/p2m-ept.c     |  110 -----------------------------------------
 xen/include/asm-x86/hvm/hvm.h |    1 -
 5 files changed, 0 insertions(+), 125 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2144d4a..863efdf 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1575,8 +1575,6 @@ static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
 {
     v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
     shadow_blow_tables_per_domain(v->domain);
-    if ( hvm_funcs.set_uc_mode )
-        return hvm_funcs.set_uc_mode(v);
 }
 
 int hvm_mov_to_cr(unsigned int cr, unsigned int gpr)
diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index 7807e03..4842d63 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -696,9 +696,6 @@ uint8_t epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn,
     if ( !v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT] )
         return MTRR_TYPE_WRBACK;
 
-    if ( (v == current) && v->domain->arch.hvm_domain.is_in_uc_mode )
-        return MTRR_TYPE_UNCACHABLE;
-
     if ( !mfn_valid(mfn_x(mfn)) )
         return MTRR_TYPE_UNCACHABLE;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index f40c276..5bfe9ac 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1495,14 +1495,6 @@ static int vmx_do_pmu_interrupt(struct cpu_user_regs *regs)
     return vpmu_do_interrupt(regs);
 }
 
-static void vmx_set_uc_mode(struct vcpu *v)
-{
-    if ( paging_mode_hap(v->domain) )
-        ept_change_entry_emt_with_range(
-            v->domain, 0, p2m_get_hostp2m(v->domain)->max_mapped_pfn);
-    hvm_asid_flush_vcpu(v);
-}
-
 static void vmx_set_info_guest(struct vcpu *v)
 {
     unsigned long intr_shadow;
@@ -1565,7 +1557,6 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
-    .set_uc_mode          = vmx_set_uc_mode,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting,
     .nhvm_vcpu_initialise = nvmx_vcpu_initialise,
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index c964f54..4576377 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -582,43 +582,6 @@ out:
     return mfn;
 }
 
-/* WARNING: Only caller doesn't care about PoD pages.  So this function will
- * always return 0 for PoD pages, not populate them.  If that becomes necessary,
- * pass a p2m_query_t type along to distinguish. */
-static ept_entry_t ept_get_entry_content(struct p2m_domain *p2m,
-    unsigned long gfn, int *level)
-{
-    ept_entry_t *table = map_domain_page(ept_get_asr(p2m->domain));
-    unsigned long gfn_remainder = gfn;
-    ept_entry_t *ept_entry;
-    ept_entry_t content = { .epte = 0 };
-    u32 index;
-    int i;
-    int ret=0;
-
-    /* This pfn is higher than the highest the p2m map currently holds */
-    if ( gfn > p2m->max_mapped_pfn )
-        goto out;
-
-    for ( i = ept_get_wl(p2m->domain); i > 0; i-- )
-    {
-        ret = ept_next_level(p2m, 1, &table, &gfn_remainder, i);
-        if ( !ret || ret == GUEST_TABLE_POD_PAGE )
-            goto out;
-        else if ( ret == GUEST_TABLE_SUPER_PAGE )
-            break;
-    }
-
-    index = gfn_remainder >> (i * EPT_TABLE_ORDER);
-    ept_entry = table + index;
-    content = *ept_entry;
-    *level = i;
-
- out:
-    unmap_domain_page(table);
-    return content;
-}
-
 void ept_walk_table(struct domain *d, unsigned long gfn)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
@@ -670,79 +633,6 @@ out:
 }
 
 /*
- * To test if the new emt type is the same with old,
- * return 1 to not to reset ept entry.
- */
-static int need_modify_ept_entry(struct p2m_domain *p2m, unsigned long gfn,
-                                 mfn_t mfn, uint8_t o_ipat, uint8_t o_emt,
-                                 p2m_type_t p2mt)
-{
-    uint8_t ipat;
-    uint8_t emt;
-    bool_t direct_mmio = (p2mt == p2m_mmio_direct);
-
-    emt = epte_get_entry_emt(p2m->domain, gfn, mfn, &ipat, direct_mmio);
-
-    if ( (emt == o_emt) && (ipat == o_ipat) )
-        return 0;
-
-    return 1;
-}
-
-void ept_change_entry_emt_with_range(struct domain *d,
-                                     unsigned long start_gfn,
-                                     unsigned long end_gfn)
-{
-    unsigned long gfn;
-    ept_entry_t e;
-    mfn_t mfn;
-    int order = 0;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    p2m_lock(p2m);
-    for ( gfn = start_gfn; gfn <= end_gfn; gfn++ )
-    {
-        int level = 0;
-        uint64_t trunk = 0;
-
-        e = ept_get_entry_content(p2m, gfn, &level);
-        if ( !is_epte_present(&e) || !p2m_has_emt(e.sa_p2mt) )
-            continue;
-
-        order = 0;
-        mfn = _mfn(e.mfn);
-
-        if ( is_epte_superpage(&e) )
-        {
-            while ( level )
-            {
-                trunk = (1UL << (level * EPT_TABLE_ORDER)) - 1;
-                if ( !(gfn & trunk) && (gfn + trunk <= end_gfn) )
-                {
-                    /* gfn assigned with 2M or 1G, and the end covers more than
-                     * the super page areas.
-                     * Set emt for super page.
-                     */
-                    order = level * EPT_TABLE_ORDER;
-                    if ( need_modify_ept_entry(p2m, gfn, mfn, 
-                          e.ipat, e.emt, e.sa_p2mt) )
-                        ept_set_entry(p2m, gfn, mfn, order, e.sa_p2mt, e.access);
-                    gfn += trunk;
-                    break;
-                }
-                level--;
-             }
-        }
-        else /* gfn assigned with 4k */
-        {
-            if ( need_modify_ept_entry(p2m, gfn, mfn, e.ipat, e.emt, e.sa_p2mt) )
-                ept_set_entry(p2m, gfn, mfn, order, e.sa_p2mt, e.access);
-        }
-    }
-    p2m_unlock(p2m);
-}
-
-/*
  * Walk the whole p2m table, changing any entries of the old type
  * to the new type.  This is used in hardware-assisted paging to
  * quickly enable or diable log-dirty tracking
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index a440fb4..ccc5208 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -157,7 +157,6 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
-    void (*set_uc_mode)(struct vcpu *v);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 
--
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 Tue Dec 10 00:55:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00:55: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 1VqBbv-0003sG-IK; Tue, 10 Dec 2013 00:55:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbu-0003rz-Ao
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:38 +0000
Received: from [85.158.137.68:60503] by server-14.bemta-3.messagelabs.com id
	C1/33-06105-98666A25; Tue, 10 Dec 2013 00:55:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1386636935!2828630!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17277 invoked from network); 10 Dec 2013 00:55:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00: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 1VqBbq-0001rK-TB
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbq-0003SF-PL
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:34 +0000
Date: Tue, 10 Dec 2013 00:55:34 +0000
Message-Id: <E1VqBbq-0003SF-PL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VMX: fix cr0.cd handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0fffcffeb594741d5027c8c0d05900b951f997b2
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:43:34 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:43:34 2013 +0100

    VMX: fix cr0.cd handling
    
    This patch solves XSA-60 security hole:
    1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need
    do nothing, since hardware snoop mechanism has ensured cache coherency.
    
    2. For guest with VT-d but non-snooped, cache coherency can not be
    guaranteed by h/w snoop, therefore it need emulate UC type to guest:
    2.1). if it works w/ Intel EPT, set guest IA32_PAT fields as UC so that
    guest memory type are all UC.
    2.2). if it works w/ shadow, drop all shadows so that any new ones would
    be created on demand w/ UC.
    
    This patch also fix a bug of shadow cr0.cd setting. Current shadow has a
    small window between cache flush and TLB invalidation, resulting in possilbe
    cache pollution. This patch pause vcpus so that no vcpus context involved
    into the window.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 62652c00efa55fb45374bcc92f7d96fc411aebb2
    master date: 2013-11-06 10:12:36 +0100
---
 xen/arch/x86/hvm/hvm.c            |   75 ++++++++++++++++++++++--------------
 xen/arch/x86/hvm/vmx/vmcs.c       |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c        |   54 +++++++++++++++++++++++++-
 xen/common/domain.c               |   10 +++++
 xen/include/asm-x86/hvm/hvm.h     |    1 +
 xen/include/asm-x86/hvm/support.h |    2 +
 xen/include/xen/sched.h           |    1 +
 7 files changed, 113 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 863efdf..1bcc40d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1657,6 +1657,40 @@ int hvm_mov_from_cr(unsigned int cr, unsigned int gpr)
     return X86EMUL_UNHANDLEABLE;
 }
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( value & X86_CR0_CD )
+    {
+        /* Entering no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+
+        if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
+        {
+            domain_pause_nosync(v->domain);
+
+            /* Flush physical caches. */
+            on_each_cpu(local_flush_cache, NULL, 1);
+            hvm_set_uc_mode(v, 1);
+
+            domain_unpause(v->domain);
+        }
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+    else if ( !(value & X86_CR0_CD) &&
+              (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
+    {
+        /* Exit from no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+
+        if ( domain_exit_uc_mode(v) )
+            hvm_set_uc_mode(v, 0);
+
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+}
+
 int hvm_set_cr0(unsigned long value)
 {
     struct vcpu *v = current;
@@ -1739,35 +1773,18 @@ int hvm_set_cr0(unsigned long value)
         }
     }
 
-    if ( cache_flush_permitted(v->domain) )
-    {
-        if ( (value & X86_CR0_CD) && !(value & X86_CR0_NW) )
-        {
-            /* Entering no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
-
-            if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
-            {
-                /* Flush physical caches. */
-                on_each_cpu(local_flush_cache, NULL, 1);
-                hvm_set_uc_mode(v, 1);
-            }
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-        else if ( !(value & (X86_CR0_CD | X86_CR0_NW)) &&
-                  (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        {
-            /* Exit from no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
-
-            if ( domain_exit_uc_mode(v) )
-                hvm_set_uc_mode(v, 0);
-
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-    }
+    /*
+     * When cr0.cd setting
+     * 1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need not
+     * do anything, since hardware snoop mechanism has ensured cache coherency;
+     * 2. For guest with VT-d but non-snooped, cache coherency cannot be
+     * guaranteed by h/w so need emulate UC memory type to guest.
+     */
+    if ( ((value ^ old_value) & X86_CR0_CD) &&
+           has_arch_pdevs(v->domain) &&
+           iommu_enabled && !iommu_snoop &&
+           hvm_funcs.handle_cd )
+        hvm_funcs.handle_cd(v, value);
 
     v->arch.hvm_vcpu.guest_cr[0] = value;
     hvm_update_guest_cr(v, 0);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 049267e..da30039 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -779,7 +779,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
-        if ( paging_mode_hap(d) )
+        if ( paging_mode_hap(d) && (!iommu_enabled || iommu_snoop) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT);
     }
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 5bfe9ac..f7c1130 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -972,7 +972,8 @@ static unsigned long vmx_get_shadow_gs_base(struct vcpu *v)
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -986,7 +987,8 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -998,6 +1000,53 @@ static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
     return 1;
 }
 
+static void vmx_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( !paging_mode_hap(v->domain) )
+    {
+        /*
+         * For shadow, 'load IA32_PAT' VM-entry control is 0, so it cannot
+         * set guest memory type as UC via IA32_PAT. Xen drop all shadows
+         * so that any new ones would be created on demand.
+         */
+        hvm_shadow_handle_cd(v, value);
+    }
+    else
+    {
+        u64 *pat = &v->arch.hvm_vcpu.pat_cr;
+
+        if ( value & X86_CR0_CD )
+        {
+            /*
+             * For EPT, set guest IA32_PAT fields as UC so that guest
+             * memory type are all UC.
+             */
+            u64 uc_pat =
+                ((uint64_t)PAT_TYPE_UNCACHABLE)       |       /* PAT0 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 8)  |       /* PAT1 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 16) |       /* PAT2 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 24) |       /* PAT3 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 32) |       /* PAT4 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 40) |       /* PAT5 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 48) |       /* PAT6 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 56);        /* PAT7 */
+
+            vmx_get_guest_pat(v, pat);
+            vmx_set_guest_pat(v, uc_pat);
+
+            wbinvd();               /* flush possibly polluted cache */
+            hvm_asid_flush_vcpu(v); /* invalidate memory type cached in TLB */
+            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+        }
+        else
+        {
+            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+            vmx_set_guest_pat(v, *pat);
+            hvm_asid_flush_vcpu(v); /* no need to flush cache */
+        }
+    }
+}
+
 static void vmx_set_tsc_offset(struct vcpu *v, u64 offset)
 {
     vmx_vmcs_enter(v);
@@ -1557,6 +1606,7 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
+    .handle_cd            = vmx_handle_cd,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting,
     .nhvm_vcpu_initialise = nvmx_vcpu_initialise,
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 2ebb494..c05509c 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -758,6 +758,16 @@ void domain_pause(struct domain *d)
         vcpu_sleep_sync(v);
 }
 
+void domain_pause_nosync(struct domain *d)
+{
+    struct vcpu *v;
+
+    atomic_inc(&d->pause_count);
+
+    for_each_vcpu( d, v )
+        vcpu_sleep_nosync(v);
+}
+
 void domain_unpause(struct domain *d)
 {
     struct vcpu *v;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index ccc5208..f9ea093 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -157,6 +157,7 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
+    void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 
diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h
index 7ddc806..52aef1f 100644
--- a/xen/include/asm-x86/hvm/support.h
+++ b/xen/include/asm-x86/hvm/support.h
@@ -130,6 +130,8 @@ void hvm_rdtsc_intercept(struct cpu_user_regs *regs);
 
 int __must_check hvm_handle_xsetbv(u32 index, u64 new_bv);
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value);
+
 /* These functions all return X86EMUL return codes. */
 int hvm_set_efer(uint64_t value);
 int hvm_set_cr0(unsigned long value);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index b0715cb..0ab0fb4 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -659,6 +659,7 @@ void vcpu_unblock(struct vcpu *v);
 void vcpu_pause(struct vcpu *v);
 void vcpu_pause_nosync(struct vcpu *v);
 void domain_pause(struct domain *d);
+void domain_pause_nosync(struct domain *d);
 void vcpu_unpause(struct vcpu *v);
 void domain_unpause(struct domain *d);
 void domain_pause_by_systemcontroller(struct domain *d);
--
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 Tue Dec 10 00:55:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00:55: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 1VqBbv-0003sG-IK; Tue, 10 Dec 2013 00:55:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbu-0003rz-Ao
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:38 +0000
Received: from [85.158.137.68:60503] by server-14.bemta-3.messagelabs.com id
	C1/33-06105-98666A25; Tue, 10 Dec 2013 00:55:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1386636935!2828630!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17277 invoked from network); 10 Dec 2013 00:55:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00: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 1VqBbq-0001rK-TB
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBbq-0003SF-PL
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:34 +0000
Date: Tue, 10 Dec 2013 00:55:34 +0000
Message-Id: <E1VqBbq-0003SF-PL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VMX: fix cr0.cd handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0fffcffeb594741d5027c8c0d05900b951f997b2
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:43:34 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:43:34 2013 +0100

    VMX: fix cr0.cd handling
    
    This patch solves XSA-60 security hole:
    1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need
    do nothing, since hardware snoop mechanism has ensured cache coherency.
    
    2. For guest with VT-d but non-snooped, cache coherency can not be
    guaranteed by h/w snoop, therefore it need emulate UC type to guest:
    2.1). if it works w/ Intel EPT, set guest IA32_PAT fields as UC so that
    guest memory type are all UC.
    2.2). if it works w/ shadow, drop all shadows so that any new ones would
    be created on demand w/ UC.
    
    This patch also fix a bug of shadow cr0.cd setting. Current shadow has a
    small window between cache flush and TLB invalidation, resulting in possilbe
    cache pollution. This patch pause vcpus so that no vcpus context involved
    into the window.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 62652c00efa55fb45374bcc92f7d96fc411aebb2
    master date: 2013-11-06 10:12:36 +0100
---
 xen/arch/x86/hvm/hvm.c            |   75 ++++++++++++++++++++++--------------
 xen/arch/x86/hvm/vmx/vmcs.c       |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c        |   54 +++++++++++++++++++++++++-
 xen/common/domain.c               |   10 +++++
 xen/include/asm-x86/hvm/hvm.h     |    1 +
 xen/include/asm-x86/hvm/support.h |    2 +
 xen/include/xen/sched.h           |    1 +
 7 files changed, 113 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 863efdf..1bcc40d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1657,6 +1657,40 @@ int hvm_mov_from_cr(unsigned int cr, unsigned int gpr)
     return X86EMUL_UNHANDLEABLE;
 }
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( value & X86_CR0_CD )
+    {
+        /* Entering no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+
+        if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
+        {
+            domain_pause_nosync(v->domain);
+
+            /* Flush physical caches. */
+            on_each_cpu(local_flush_cache, NULL, 1);
+            hvm_set_uc_mode(v, 1);
+
+            domain_unpause(v->domain);
+        }
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+    else if ( !(value & X86_CR0_CD) &&
+              (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
+    {
+        /* Exit from no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+
+        if ( domain_exit_uc_mode(v) )
+            hvm_set_uc_mode(v, 0);
+
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+}
+
 int hvm_set_cr0(unsigned long value)
 {
     struct vcpu *v = current;
@@ -1739,35 +1773,18 @@ int hvm_set_cr0(unsigned long value)
         }
     }
 
-    if ( cache_flush_permitted(v->domain) )
-    {
-        if ( (value & X86_CR0_CD) && !(value & X86_CR0_NW) )
-        {
-            /* Entering no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
-
-            if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
-            {
-                /* Flush physical caches. */
-                on_each_cpu(local_flush_cache, NULL, 1);
-                hvm_set_uc_mode(v, 1);
-            }
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-        else if ( !(value & (X86_CR0_CD | X86_CR0_NW)) &&
-                  (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        {
-            /* Exit from no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
-
-            if ( domain_exit_uc_mode(v) )
-                hvm_set_uc_mode(v, 0);
-
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-    }
+    /*
+     * When cr0.cd setting
+     * 1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need not
+     * do anything, since hardware snoop mechanism has ensured cache coherency;
+     * 2. For guest with VT-d but non-snooped, cache coherency cannot be
+     * guaranteed by h/w so need emulate UC memory type to guest.
+     */
+    if ( ((value ^ old_value) & X86_CR0_CD) &&
+           has_arch_pdevs(v->domain) &&
+           iommu_enabled && !iommu_snoop &&
+           hvm_funcs.handle_cd )
+        hvm_funcs.handle_cd(v, value);
 
     v->arch.hvm_vcpu.guest_cr[0] = value;
     hvm_update_guest_cr(v, 0);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 049267e..da30039 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -779,7 +779,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
-        if ( paging_mode_hap(d) )
+        if ( paging_mode_hap(d) && (!iommu_enabled || iommu_snoop) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT);
     }
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 5bfe9ac..f7c1130 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -972,7 +972,8 @@ static unsigned long vmx_get_shadow_gs_base(struct vcpu *v)
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -986,7 +987,8 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -998,6 +1000,53 @@ static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
     return 1;
 }
 
+static void vmx_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( !paging_mode_hap(v->domain) )
+    {
+        /*
+         * For shadow, 'load IA32_PAT' VM-entry control is 0, so it cannot
+         * set guest memory type as UC via IA32_PAT. Xen drop all shadows
+         * so that any new ones would be created on demand.
+         */
+        hvm_shadow_handle_cd(v, value);
+    }
+    else
+    {
+        u64 *pat = &v->arch.hvm_vcpu.pat_cr;
+
+        if ( value & X86_CR0_CD )
+        {
+            /*
+             * For EPT, set guest IA32_PAT fields as UC so that guest
+             * memory type are all UC.
+             */
+            u64 uc_pat =
+                ((uint64_t)PAT_TYPE_UNCACHABLE)       |       /* PAT0 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 8)  |       /* PAT1 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 16) |       /* PAT2 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 24) |       /* PAT3 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 32) |       /* PAT4 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 40) |       /* PAT5 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 48) |       /* PAT6 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 56);        /* PAT7 */
+
+            vmx_get_guest_pat(v, pat);
+            vmx_set_guest_pat(v, uc_pat);
+
+            wbinvd();               /* flush possibly polluted cache */
+            hvm_asid_flush_vcpu(v); /* invalidate memory type cached in TLB */
+            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+        }
+        else
+        {
+            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+            vmx_set_guest_pat(v, *pat);
+            hvm_asid_flush_vcpu(v); /* no need to flush cache */
+        }
+    }
+}
+
 static void vmx_set_tsc_offset(struct vcpu *v, u64 offset)
 {
     vmx_vmcs_enter(v);
@@ -1557,6 +1606,7 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
+    .handle_cd            = vmx_handle_cd,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting,
     .nhvm_vcpu_initialise = nvmx_vcpu_initialise,
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 2ebb494..c05509c 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -758,6 +758,16 @@ void domain_pause(struct domain *d)
         vcpu_sleep_sync(v);
 }
 
+void domain_pause_nosync(struct domain *d)
+{
+    struct vcpu *v;
+
+    atomic_inc(&d->pause_count);
+
+    for_each_vcpu( d, v )
+        vcpu_sleep_nosync(v);
+}
+
 void domain_unpause(struct domain *d)
 {
     struct vcpu *v;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index ccc5208..f9ea093 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -157,6 +157,7 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
+    void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 
diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h
index 7ddc806..52aef1f 100644
--- a/xen/include/asm-x86/hvm/support.h
+++ b/xen/include/asm-x86/hvm/support.h
@@ -130,6 +130,8 @@ void hvm_rdtsc_intercept(struct cpu_user_regs *regs);
 
 int __must_check hvm_handle_xsetbv(u32 index, u64 new_bv);
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value);
+
 /* These functions all return X86EMUL return codes. */
 int hvm_set_efer(uint64_t value);
 int hvm_set_cr0(unsigned long value);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index b0715cb..0ab0fb4 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -659,6 +659,7 @@ void vcpu_unblock(struct vcpu *v);
 void vcpu_pause(struct vcpu *v);
 void vcpu_pause_nosync(struct vcpu *v);
 void domain_pause(struct domain *d);
+void domain_pause_nosync(struct domain *d);
 void vcpu_unpause(struct vcpu *v);
 void domain_unpause(struct domain *d);
 void domain_pause_by_systemcontroller(struct domain *d);
--
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 Tue Dec 10 00:55:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00:55: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 1VqBc5-0003ut-My; Tue, 10 Dec 2013 00:55:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBc3-0003uO-So
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:48 +0000
Received: from [85.158.137.68:23914] by server-8.bemta-3.messagelabs.com id
	AA/79-31081-39666A25; Tue, 10 Dec 2013 00:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1386636945!2816878!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17735 invoked from network); 10 Dec 2013 00:55:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00:55: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 1VqBc1-0001rQ-66
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBc1-0003Sb-0f
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:45 +0000
Date: Tue, 10 Dec 2013 00:55:45 +0000
Message-Id: <E1VqBc1-0003Sb-0f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: properly handle MSI-X unmask
	operation from 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 ac58c24866024b33379c5a15a27b0e9115efd230
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Mon Dec 9 14:45:00 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:45:00 2013 +0100

    x86: properly handle MSI-X unmask operation from guests
    
    For a pass-through device with MSI-x capability, when guest tries
    to unmask the MSI-x interrupt for the passed through device, xen
    doesn't clear the mask bit for MSI-x in hardware in the following
    scenario, which will cause network disconnection:
    
    1. Guest masks the MSI-x interrupt
    2. Guest updates the address and data for it
    3. Guest unmasks the MSI-x interrupt (This is the problematic step)
    
    In the step #3 above, Xen doesn't handle it well. When guest tries
    to unmask MSI-X interrupt, it traps to Xen, Xen just returns to Qemu
    if it notices that address or data has been modified by guest before,
    then Qemu will update Xen with the latest value of address/data by
    hypercall. However, in this whole process, the MSI-X interrupt unmask
    operation is missing, which means Xen doesn't clear the mask bit in
    hardware for the MSI-X interrupt, so it remains disabled, that is why
    it loses the network connection.
    
    This patch fixes this issue.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    
    Only latch the address if the guest really is unmasking the entry.
    
    Clean up the entire change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 74fd0036deb585a139b63b26db025805ecedc37a
    master date: 2013-11-27 15:15:43 +0100
---
 xen/arch/x86/hvm/io.c          |    3 +++
 xen/arch/x86/hvm/vmsi.c        |   16 ++++++++++++++++
 xen/include/asm-x86/hvm/io.h   |    1 +
 xen/include/asm-x86/hvm/vcpu.h |    2 ++
 4 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index b04083b..a75a8d1 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -302,7 +302,10 @@ void hvm_io_assist(void)
     }
 
     if ( p->state == STATE_IOREQ_NONE )
+    {
+        msix_write_completion(curr);
         vcpu_end_shutdown_deferral(curr);
+    }
 }
 
 static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index 8741646..0772714 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -294,7 +294,11 @@ static int msixtbl_write(struct vcpu *v, unsigned long address,
 
     /* exit to device model if address/data has been modified */
     if ( test_and_clear_bit(nr_entry, &entry->table_flags) )
+    {
+        if ( !(val & PCI_MSIX_VECTOR_BITMASK) )
+            v->arch.hvm_vcpu.hvm_io.msix_unmask_address = address;
         goto out;
+    }
 
     virt = msixtbl_addr_to_virt(entry, address);
     if ( !virt )
@@ -529,3 +533,15 @@ void msixtbl_pt_cleanup(struct domain *d)
     spin_unlock(&d->arch.hvm_domain.msixtbl_list_lock);
     local_irq_restore(flags);
 }
+
+void msix_write_completion(struct vcpu *v)
+{
+    unsigned long ctrl_address = v->arch.hvm_vcpu.hvm_io.msix_unmask_address;
+
+    if ( !ctrl_address )
+        return;
+
+    v->arch.hvm_vcpu.hvm_io.msix_unmask_address = 0;
+    if ( msixtbl_write(v, ctrl_address, 4, 0) != X86EMUL_OKAY )
+        gdprintk(XENLOG_WARNING, "MSI-X write completion failure\n");
+}
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index b0718b8..62aa2f6 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -124,6 +124,7 @@ void hvm_interrupt_post(struct vcpu *v, int vector, int type);
 void hvm_io_assist(void);
 void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
                   union vioapic_redir_entry *ent);
+void msix_write_completion(struct vcpu *);
 
 struct hvm_hw_stdvga {
     uint8_t sr_index;
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index 9d68ed2..aa9e00f 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -66,6 +66,8 @@ struct hvm_vcpu_io {
     /* We may write up to m256 as a number of device-model transactions. */
     unsigned int mmio_large_write_bytes;
     paddr_t mmio_large_write_pa;
+
+    unsigned long msix_unmask_address;
 };
 
 #define VMCX_EADDR    (~0ULL)
--
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 Tue Dec 10 00:55:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00:55: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 1VqBc5-0003ut-My; Tue, 10 Dec 2013 00:55:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBc3-0003uO-So
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:48 +0000
Received: from [85.158.137.68:23914] by server-8.bemta-3.messagelabs.com id
	AA/79-31081-39666A25; Tue, 10 Dec 2013 00:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1386636945!2816878!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17735 invoked from network); 10 Dec 2013 00:55:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00:55: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 1VqBc1-0001rQ-66
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBc1-0003Sb-0f
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:45 +0000
Date: Tue, 10 Dec 2013 00:55:45 +0000
Message-Id: <E1VqBc1-0003Sb-0f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: properly handle MSI-X unmask
	operation from 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 ac58c24866024b33379c5a15a27b0e9115efd230
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Mon Dec 9 14:45:00 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:45:00 2013 +0100

    x86: properly handle MSI-X unmask operation from guests
    
    For a pass-through device with MSI-x capability, when guest tries
    to unmask the MSI-x interrupt for the passed through device, xen
    doesn't clear the mask bit for MSI-x in hardware in the following
    scenario, which will cause network disconnection:
    
    1. Guest masks the MSI-x interrupt
    2. Guest updates the address and data for it
    3. Guest unmasks the MSI-x interrupt (This is the problematic step)
    
    In the step #3 above, Xen doesn't handle it well. When guest tries
    to unmask MSI-X interrupt, it traps to Xen, Xen just returns to Qemu
    if it notices that address or data has been modified by guest before,
    then Qemu will update Xen with the latest value of address/data by
    hypercall. However, in this whole process, the MSI-X interrupt unmask
    operation is missing, which means Xen doesn't clear the mask bit in
    hardware for the MSI-X interrupt, so it remains disabled, that is why
    it loses the network connection.
    
    This patch fixes this issue.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    
    Only latch the address if the guest really is unmasking the entry.
    
    Clean up the entire change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 74fd0036deb585a139b63b26db025805ecedc37a
    master date: 2013-11-27 15:15:43 +0100
---
 xen/arch/x86/hvm/io.c          |    3 +++
 xen/arch/x86/hvm/vmsi.c        |   16 ++++++++++++++++
 xen/include/asm-x86/hvm/io.h   |    1 +
 xen/include/asm-x86/hvm/vcpu.h |    2 ++
 4 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index b04083b..a75a8d1 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -302,7 +302,10 @@ void hvm_io_assist(void)
     }
 
     if ( p->state == STATE_IOREQ_NONE )
+    {
+        msix_write_completion(curr);
         vcpu_end_shutdown_deferral(curr);
+    }
 }
 
 static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index 8741646..0772714 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -294,7 +294,11 @@ static int msixtbl_write(struct vcpu *v, unsigned long address,
 
     /* exit to device model if address/data has been modified */
     if ( test_and_clear_bit(nr_entry, &entry->table_flags) )
+    {
+        if ( !(val & PCI_MSIX_VECTOR_BITMASK) )
+            v->arch.hvm_vcpu.hvm_io.msix_unmask_address = address;
         goto out;
+    }
 
     virt = msixtbl_addr_to_virt(entry, address);
     if ( !virt )
@@ -529,3 +533,15 @@ void msixtbl_pt_cleanup(struct domain *d)
     spin_unlock(&d->arch.hvm_domain.msixtbl_list_lock);
     local_irq_restore(flags);
 }
+
+void msix_write_completion(struct vcpu *v)
+{
+    unsigned long ctrl_address = v->arch.hvm_vcpu.hvm_io.msix_unmask_address;
+
+    if ( !ctrl_address )
+        return;
+
+    v->arch.hvm_vcpu.hvm_io.msix_unmask_address = 0;
+    if ( msixtbl_write(v, ctrl_address, 4, 0) != X86EMUL_OKAY )
+        gdprintk(XENLOG_WARNING, "MSI-X write completion failure\n");
+}
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index b0718b8..62aa2f6 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -124,6 +124,7 @@ void hvm_interrupt_post(struct vcpu *v, int vector, int type);
 void hvm_io_assist(void);
 void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
                   union vioapic_redir_entry *ent);
+void msix_write_completion(struct vcpu *);
 
 struct hvm_hw_stdvga {
     uint8_t sr_index;
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index 9d68ed2..aa9e00f 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -66,6 +66,8 @@ struct hvm_vcpu_io {
     /* We may write up to m256 as a number of device-model transactions. */
     unsigned int mmio_large_write_bytes;
     paddr_t mmio_large_write_pa;
+
+    unsigned long msix_unmask_address;
 };
 
 #define VMCX_EADDR    (~0ULL)
--
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 Tue Dec 10 00:55:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00: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 1VqBcF-0003ww-Po; Tue, 10 Dec 2013 00:55: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 1VqBcD-0003wf-Un
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:58 +0000
Received: from [85.158.143.35:21803] by server-2.bemta-4.messagelabs.com id
	CD/E4-11386-D9666A25; Tue, 10 Dec 2013 00:55:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1386636955!4500163!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17675 invoked from network); 10 Dec 2013 00:55:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00:55: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 1VqBcB-0001rZ-CA
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBcB-0003Sx-9V
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:55 +0000
Date: Tue, 10 Dec 2013 00:55:55 +0000
Message-Id: <E1VqBcB-0003Sx-9V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] Fix ptr calculation when
	converting from a VA
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 74c2f042c89d33eec558538827b1df91ff269d97
Author:     Jean-Yves Migeon <jym@NetBSD.org>
AuthorDate: Mon Dec 9 14:45:59 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:45:59 2013 +0100

    Fix ptr calculation when converting from a VA
    
    The ptr calculation shall take the offset into the page into account
    when ptr is valid.
    
    Reported regression on NetBSD's port-xen with last known working libxen
    being rev 2.9. This corrupts the kernel symbol table when the table is
    not loaded on a page boundary.
    
    Issue was tracked down by FastIce and Jeff Rizzo. See also
    http://mail-index.netbsd.org/port-xen/2013/10/16/msg008088.html
    
    Signed-off-by: Jean-Yves Migeon <jym@NetBSD.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: cb08944a482a5e80a3ff1113f0735761cc4c6cb8
    master date: 2013-11-29 11:07:01 +0000
---
 tools/libxc/xc_dom.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index d801f66..cbe0096 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -319,7 +319,7 @@ static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
     if ( ptr == NULL )
         return ptr;
     *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
-    return ptr;
+    return ptr + offset;
 }
 
 static inline int xc_dom_feature_translated(struct xc_dom_image *dom)
--
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 Tue Dec 10 00:55:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00: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 1VqBcF-0003ww-Po; Tue, 10 Dec 2013 00:55: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 1VqBcD-0003wf-Un
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:58 +0000
Received: from [85.158.143.35:21803] by server-2.bemta-4.messagelabs.com id
	CD/E4-11386-D9666A25; Tue, 10 Dec 2013 00:55:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1386636955!4500163!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17675 invoked from network); 10 Dec 2013 00:55:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00:55: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 1VqBcB-0001rZ-CA
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBcB-0003Sx-9V
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:55:55 +0000
Date: Tue, 10 Dec 2013 00:55:55 +0000
Message-Id: <E1VqBcB-0003Sx-9V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] Fix ptr calculation when
	converting from a VA
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 74c2f042c89d33eec558538827b1df91ff269d97
Author:     Jean-Yves Migeon <jym@NetBSD.org>
AuthorDate: Mon Dec 9 14:45:59 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:45:59 2013 +0100

    Fix ptr calculation when converting from a VA
    
    The ptr calculation shall take the offset into the page into account
    when ptr is valid.
    
    Reported regression on NetBSD's port-xen with last known working libxen
    being rev 2.9. This corrupts the kernel symbol table when the table is
    not loaded on a page boundary.
    
    Issue was tracked down by FastIce and Jeff Rizzo. See also
    http://mail-index.netbsd.org/port-xen/2013/10/16/msg008088.html
    
    Signed-off-by: Jean-Yves Migeon <jym@NetBSD.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: cb08944a482a5e80a3ff1113f0735761cc4c6cb8
    master date: 2013-11-29 11:07:01 +0000
---
 tools/libxc/xc_dom.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index d801f66..cbe0096 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -319,7 +319,7 @@ static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
     if ( ptr == NULL )
         return ptr;
     *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
-    return ptr;
+    return ptr + offset;
 }
 
 static inline int xc_dom_feature_translated(struct xc_dom_image *dom)
--
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 Tue Dec 10 00:56:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00:56: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 1VqBcP-0003zL-Sl; Tue, 10 Dec 2013 00: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 1VqBcO-0003yq-8g
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:08 +0000
Received: from [85.158.137.68:50869] by server-7.bemta-3.messagelabs.com id
	E6/5B-27599-7A666A25; Tue, 10 Dec 2013 00:56:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1386636965!2828699!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19938 invoked from network); 10 Dec 2013 00:56:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00:56: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 1VqBcL-0001s8-Io
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBcL-0003TU-G0
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:05 +0000
Date: Tue, 10 Dec 2013 00:56:05 +0000
Message-Id: <E1VqBcL-0003TU-G0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] fix locking in offline_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3ce0c9a3b44b8a83479486406d1ce111aeee54e4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Dec 9 14:46:26 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:46:26 2013 +0100

    fix locking in offline_page()
    
    Coverity ID 1055655
    
    Apart from the Coverity-detected lock order reversal (a domain's
    page_alloc_lock taken with the heap lock already held), calling
    put_page() with heap_lock is a bad idea too (as a possible descendant
    from put_page() is free_heap_pages(), which wants to take this very
    lock).
    
    From all I can tell the region over which heap_lock was held was far
    too large: All we need to protect are the call to mark_page_offline()
    and reserve_heap_page() (and I'd even put under question the need for
    the former). Hence by slightly re-arranging the if/else-if chain we
    can drop the lock much earlier, at once no longer covering the two
    put_page() invocations.
    
    Once at it, do a little bit of other cleanup: Put the "pod_replace"
    code path inline rather than at its own label, and drop the effectively
    unused variable "ret".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: d4837a56da4a59259dd0cf9f3bdc073159d81d7a
    master date: 2013-12-03 12:40:57 +0100
---
 xen/common/page_alloc.c |   39 ++++++++++++++++++---------------------
 1 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index fbdff5c..2f563e2 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -819,7 +819,6 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
 {
     unsigned long old_info = 0;
     struct domain *owner;
-    int ret = 0;
     struct page_info *pg;
 
     if ( !mfn_valid(mfn) )
@@ -869,16 +868,28 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( page_state_is(pg, offlined) )
     {
         reserve_heap_page(pg);
-        *status = PG_OFFLINE_OFFLINED;
+
+        spin_unlock(&heap_lock);
+
+        *status = broken ? PG_OFFLINE_OFFLINED | PG_OFFLINE_BROKEN
+                         : PG_OFFLINE_OFFLINED;
+        return 0;
     }
-    else if ( (owner = page_get_owner_and_reference(pg)) )
+
+    spin_unlock(&heap_lock);
+
+    if ( (owner = page_get_owner_and_reference(pg)) )
     {
         if ( p2m_pod_offline_or_broken_hit(pg) )
-            goto pod_replace;
+        {
+            put_page(pg);
+            p2m_pod_offline_or_broken_replace(pg);
+            *status = PG_OFFLINE_OFFLINED;
+        }
         else
         {
             *status = PG_OFFLINE_OWNED | PG_OFFLINE_PENDING |
-              (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
+                      (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
             /* Release the reference since it will not be allocated anymore */
             put_page(pg);
         }
@@ -886,7 +897,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     else if ( old_info & PGC_xen_heap )
     {
         *status = PG_OFFLINE_XENPAGE | PG_OFFLINE_PENDING |
-          (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
+                  (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
     }
     else
     {
@@ -905,21 +916,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( broken )
         *status |= PG_OFFLINE_BROKEN;
 
-    spin_unlock(&heap_lock);
-
-    return ret;
-
-pod_replace:
-    put_page(pg);
-    spin_unlock(&heap_lock);
-
-    p2m_pod_offline_or_broken_replace(pg);
-    *status = PG_OFFLINE_OFFLINED;
-
-    if ( broken )
-        *status |= PG_OFFLINE_BROKEN;
-
-    return ret;
+    return 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 Tue Dec 10 00:56:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00:56: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 1VqBcP-0003zL-Sl; Tue, 10 Dec 2013 00: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 1VqBcO-0003yq-8g
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:08 +0000
Received: from [85.158.137.68:50869] by server-7.bemta-3.messagelabs.com id
	E6/5B-27599-7A666A25; Tue, 10 Dec 2013 00:56:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1386636965!2828699!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19938 invoked from network); 10 Dec 2013 00:56:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00:56: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 1VqBcL-0001s8-Io
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBcL-0003TU-G0
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:05 +0000
Date: Tue, 10 Dec 2013 00:56:05 +0000
Message-Id: <E1VqBcL-0003TU-G0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] fix locking in offline_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3ce0c9a3b44b8a83479486406d1ce111aeee54e4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Dec 9 14:46:26 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:46:26 2013 +0100

    fix locking in offline_page()
    
    Coverity ID 1055655
    
    Apart from the Coverity-detected lock order reversal (a domain's
    page_alloc_lock taken with the heap lock already held), calling
    put_page() with heap_lock is a bad idea too (as a possible descendant
    from put_page() is free_heap_pages(), which wants to take this very
    lock).
    
    From all I can tell the region over which heap_lock was held was far
    too large: All we need to protect are the call to mark_page_offline()
    and reserve_heap_page() (and I'd even put under question the need for
    the former). Hence by slightly re-arranging the if/else-if chain we
    can drop the lock much earlier, at once no longer covering the two
    put_page() invocations.
    
    Once at it, do a little bit of other cleanup: Put the "pod_replace"
    code path inline rather than at its own label, and drop the effectively
    unused variable "ret".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: d4837a56da4a59259dd0cf9f3bdc073159d81d7a
    master date: 2013-12-03 12:40:57 +0100
---
 xen/common/page_alloc.c |   39 ++++++++++++++++++---------------------
 1 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index fbdff5c..2f563e2 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -819,7 +819,6 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
 {
     unsigned long old_info = 0;
     struct domain *owner;
-    int ret = 0;
     struct page_info *pg;
 
     if ( !mfn_valid(mfn) )
@@ -869,16 +868,28 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( page_state_is(pg, offlined) )
     {
         reserve_heap_page(pg);
-        *status = PG_OFFLINE_OFFLINED;
+
+        spin_unlock(&heap_lock);
+
+        *status = broken ? PG_OFFLINE_OFFLINED | PG_OFFLINE_BROKEN
+                         : PG_OFFLINE_OFFLINED;
+        return 0;
     }
-    else if ( (owner = page_get_owner_and_reference(pg)) )
+
+    spin_unlock(&heap_lock);
+
+    if ( (owner = page_get_owner_and_reference(pg)) )
     {
         if ( p2m_pod_offline_or_broken_hit(pg) )
-            goto pod_replace;
+        {
+            put_page(pg);
+            p2m_pod_offline_or_broken_replace(pg);
+            *status = PG_OFFLINE_OFFLINED;
+        }
         else
         {
             *status = PG_OFFLINE_OWNED | PG_OFFLINE_PENDING |
-              (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
+                      (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
             /* Release the reference since it will not be allocated anymore */
             put_page(pg);
         }
@@ -886,7 +897,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     else if ( old_info & PGC_xen_heap )
     {
         *status = PG_OFFLINE_XENPAGE | PG_OFFLINE_PENDING |
-          (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
+                  (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
     }
     else
     {
@@ -905,21 +916,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( broken )
         *status |= PG_OFFLINE_BROKEN;
 
-    spin_unlock(&heap_lock);
-
-    return ret;
-
-pod_replace:
-    put_page(pg);
-    spin_unlock(&heap_lock);
-
-    p2m_pod_offline_or_broken_replace(pg);
-    *status = PG_OFFLINE_OFFLINED;
-
-    if ( broken )
-        *status |= PG_OFFLINE_BROKEN;
-
-    return ret;
+    return 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 Tue Dec 10 00:56:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00:56: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 1VqBcZ-000418-WE; Tue, 10 Dec 2013 00:56: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 1VqBcY-00040n-6P
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:18 +0000
Received: from [85.158.137.68:4123] by server-7.bemta-3.messagelabs.com id
	28/6B-27599-1B666A25; Tue, 10 Dec 2013 00:56:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1386636975!2821032!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13086 invoked from network); 10 Dec 2013 00:56:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00:56: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 1VqBcV-0001sE-Nx
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBcV-0003U5-MC
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:15 +0000
Date: Tue, 10 Dec 2013 00:56:15 +0000
Message-Id: <E1VqBcV-0003U5-MC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: fix early boot command line
	parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a9de2b4eea55d44359da7e8db2307e299bac9f04
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Mon Dec 9 14:47:07 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:47:07 2013 +0100

    x86: fix early boot command line parsing
    
    There is no reliable way to encode NUL character as a character so encode
    it as a number. Read: http://sourceware.org/binutils/docs/as/Characters.html.
    Octal and hex encoding do not work on at least one system (GNU assembler
    version 2.22 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.22).
    Without this fix e.g. no-real-mode option at the end of xen.gz command line
    is not detected.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: dc37e0bfffc673f4bdce1d69ad86098bfb0ab531
    master date: 2013-12-04 13:26:37 +0100
---
 xen/arch/x86/boot/cmdline.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/cmdline.S b/xen/arch/x86/boot/cmdline.S
index 05ffb94..e1f4595 100644
--- a/xen/arch/x86/boot/cmdline.S
+++ b/xen/arch/x86/boot/cmdline.S
@@ -138,7 +138,8 @@
         call    .Lstrlen
         add     $4,%esp
         xadd    %eax,%ebx
-        cmpb    $'\0',(%ebx)
+        /* NUL check (as $'\0' == 0x30 in GAS) */
+        cmpb    $0,(%ebx)
         je      3f
         cmpb    $' ',(%ebx)
         je      3f
--
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 Tue Dec 10 00:56:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00:56: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 1VqBcZ-000418-WE; Tue, 10 Dec 2013 00:56: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 1VqBcY-00040n-6P
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:18 +0000
Received: from [85.158.137.68:4123] by server-7.bemta-3.messagelabs.com id
	28/6B-27599-1B666A25; Tue, 10 Dec 2013 00:56:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1386636975!2821032!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13086 invoked from network); 10 Dec 2013 00:56:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00:56: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 1VqBcV-0001sE-Nx
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBcV-0003U5-MC
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:15 +0000
Date: Tue, 10 Dec 2013 00:56:15 +0000
Message-Id: <E1VqBcV-0003U5-MC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: fix early boot command line
	parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a9de2b4eea55d44359da7e8db2307e299bac9f04
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Mon Dec 9 14:47:07 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:47:07 2013 +0100

    x86: fix early boot command line parsing
    
    There is no reliable way to encode NUL character as a character so encode
    it as a number. Read: http://sourceware.org/binutils/docs/as/Characters.html.
    Octal and hex encoding do not work on at least one system (GNU assembler
    version 2.22 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.22).
    Without this fix e.g. no-real-mode option at the end of xen.gz command line
    is not detected.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: dc37e0bfffc673f4bdce1d69ad86098bfb0ab531
    master date: 2013-12-04 13:26:37 +0100
---
 xen/arch/x86/boot/cmdline.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/cmdline.S b/xen/arch/x86/boot/cmdline.S
index 05ffb94..e1f4595 100644
--- a/xen/arch/x86/boot/cmdline.S
+++ b/xen/arch/x86/boot/cmdline.S
@@ -138,7 +138,8 @@
         call    .Lstrlen
         add     $4,%esp
         xadd    %eax,%ebx
-        cmpb    $'\0',(%ebx)
+        /* NUL check (as $'\0' == 0x30 in GAS) */
+        cmpb    $0,(%ebx)
         je      3f
         cmpb    $' ',(%ebx)
         je      3f
--
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 Tue Dec 10 00:56:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00: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 1VqBck-000439-2t; Tue, 10 Dec 2013 00:56: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 1VqBci-00042s-Ft
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:28 +0000
Received: from [85.158.143.35:10792] by server-1.bemta-4.messagelabs.com id
	04/FB-02132-BB666A25; Tue, 10 Dec 2013 00:56:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386636986!4520658!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4624 invoked from network); 10 Dec 2013 00:56:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00: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 1VqBcf-0001sK-Vm
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBcf-0003Ua-Rn
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:25 +0000
Date: Tue, 10 Dec 2013 00:56:25 +0000
Message-Id: <E1VqBcf-0003Ua-Rn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/boot: fix BIOS memory
	corruption on certain IBM 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 6bbf2a656a44cafe0294049aa4fd2559bd49c18d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 9 14:47:43 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:47:43 2013 +0100

    x86/boot: fix BIOS memory corruption on certain IBM systems
    
    IBM System x3530 M4 BIOSes (including the latest available at the time of this
    patch) will corrupt a byte at physical address 0x105ff1 to the value of 0x86
    if %esp has the value 0x00080000 when issuing an `int $0x15 (ax=0xec00)` to
    inform the system about our intended operating mode.
    
    Xen gets unhappy when the bootloader has placed it's .text section in over
    this specific region of RAM.
    
    After dropping into 16bit mode, clear all 32 bits of %esp, and for the BIOS
    call already documented to be affected by BIOS bugs clear all GPRs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ed76797439e384de18fcd6810bd4743d4f38b1e
    master date: 2013-12-06 11:28:00 +0100
---
 xen/arch/x86/boot/trampoline.S |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 4421fc2..9927b7a 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -165,7 +165,7 @@ trampoline_boot_cpu_entry:
         mov     %ax,%ss
 
         /* Initialise stack pointer and IDT, and enable irqs. */
-        xor     %sp,%sp
+        xor     %esp,%esp
         lidt    bootsym(rm_idt)
         sti
 
@@ -174,6 +174,11 @@ trampoline_boot_cpu_entry:
          * Declare that our target operating mode is long mode.
          * Initialise 32-bit registers since some buggy BIOSes depend on it.
          */
+        xor     %ecx,%ecx
+        xor     %edx,%edx
+        xor     %esi,%esi
+        xor     %edi,%edi
+        xor     %ebp,%ebp
         movl    $0xec00,%eax      # declare target operating mode
         movl    $0x0002,%ebx      # long mode
         int     $0x15
--
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 Tue Dec 10 00:56:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 00: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 1VqBck-000439-2t; Tue, 10 Dec 2013 00:56: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 1VqBci-00042s-Ft
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:28 +0000
Received: from [85.158.143.35:10792] by server-1.bemta-4.messagelabs.com id
	04/FB-02132-BB666A25; Tue, 10 Dec 2013 00:56:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386636986!4520658!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4624 invoked from network); 10 Dec 2013 00:56:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 00: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 1VqBcf-0001sK-Vm
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqBcf-0003Ua-Rn
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 00:56:25 +0000
Date: Tue, 10 Dec 2013 00:56:25 +0000
Message-Id: <E1VqBcf-0003Ua-Rn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/boot: fix BIOS memory
	corruption on certain IBM 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 6bbf2a656a44cafe0294049aa4fd2559bd49c18d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 9 14:47:43 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:47:43 2013 +0100

    x86/boot: fix BIOS memory corruption on certain IBM systems
    
    IBM System x3530 M4 BIOSes (including the latest available at the time of this
    patch) will corrupt a byte at physical address 0x105ff1 to the value of 0x86
    if %esp has the value 0x00080000 when issuing an `int $0x15 (ax=0xec00)` to
    inform the system about our intended operating mode.
    
    Xen gets unhappy when the bootloader has placed it's .text section in over
    this specific region of RAM.
    
    After dropping into 16bit mode, clear all 32 bits of %esp, and for the BIOS
    call already documented to be affected by BIOS bugs clear all GPRs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ed76797439e384de18fcd6810bd4743d4f38b1e
    master date: 2013-12-06 11:28:00 +0100
---
 xen/arch/x86/boot/trampoline.S |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 4421fc2..9927b7a 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -165,7 +165,7 @@ trampoline_boot_cpu_entry:
         mov     %ax,%ss
 
         /* Initialise stack pointer and IDT, and enable irqs. */
-        xor     %sp,%sp
+        xor     %esp,%esp
         lidt    bootsym(rm_idt)
         sti
 
@@ -174,6 +174,11 @@ trampoline_boot_cpu_entry:
          * Declare that our target operating mode is long mode.
          * Initialise 32-bit registers since some buggy BIOSes depend on it.
          */
+        xor     %ecx,%ecx
+        xor     %edx,%edx
+        xor     %esi,%esi
+        xor     %edi,%edi
+        xor     %ebp,%ebp
         movl    $0xec00,%eax      # declare target operating mode
         movl    $0x0002,%ebx      # long mode
         int     $0x15
--
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 Tue Dec 10 08:44:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:44: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 1VqIvH-0005CU-9m; Tue, 10 Dec 2013 08:44: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 1VqIvG-0005CI-1J
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:06 +0000
Received: from [85.158.137.68:20859] by server-14.bemta-3.messagelabs.com id
	45/90-06105-554D6A25; Tue, 10 Dec 2013 08:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1386665043!1729122!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8420 invoked from network); 10 Dec 2013 08:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 08: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 1VqIvD-0005m0-82
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIvD-0008Hk-6A
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:03 +0000
Date: Tue, 10 Dec 2013 08:44:03 +0000
Message-Id: <E1VqIvD-0008Hk-6A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VMX: disable EPT when
	!cpu_has_vmx_pat
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 72380ecbcd9f870db1c60e698c9df71bdea6d819
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:24:20 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:24:20 2013 +0100

    VMX: disable EPT when !cpu_has_vmx_pat
    
    Recently Oracle developers found a Xen security issue as DOS affecting,
    named as XSA-60. Please refer http://xenbits.xen.org/xsa/advisory-60.html
    Basically it involves how to handle guest cr0.cd setting, which under
    some environment it consumes much time resulting in DOS-like behavior.
    
    This is a preparing patch for fixing XSA-60. Later patch will fix XSA-60
    via PAT under Intel EPT case, which depends on cpu_has_vmx_pat.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: c13b0d65ddedd74508edef5cd66defffe30468fc
    master date: 2013-11-06 10:11:18 +0100
---
 xen/arch/x86/hvm/vmx/vmcs.c |    4 ++--
 xen/arch/x86/hvm/vmx/vmx.c  |   10 +++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 76b55b4..c824494 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -920,7 +920,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS, MSR_TYPE_R | MSR_TYPE_W);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP, MSR_TYPE_R | MSR_TYPE_W);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP, MSR_TYPE_R | MSR_TYPE_W);
-        if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+        if ( paging_mode_hap(d) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT, MSR_TYPE_R | MSR_TYPE_W);
     }
 
@@ -1065,7 +1065,7 @@ static int construct_vmcs(struct vcpu *v)
         __vmwrite(EPT_POINTER, ept_get_eptp(ept));
     }
 
-    if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+    if ( paging_mode_hap(d) )
     {
         u64 host_pat, guest_pat;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index cb1d118..a0060b6 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -923,7 +923,7 @@ static unsigned long vmx_get_shadow_gs_base(struct vcpu *v)
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -934,7 +934,7 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -1593,7 +1593,11 @@ const struct hvm_function_table * __init start_vmx(void)
         return NULL;
     }
 
-    if ( cpu_has_vmx_ept )
+    /*
+     * Do not enable EPT when (!cpu_has_vmx_pat), to prevent security hole
+     * (refer to http://xenbits.xen.org/xsa/advisory-60.html).
+     */
+    if ( cpu_has_vmx_ept && cpu_has_vmx_pat )
     {
         vmx_function_table.hap_supported = 1;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:44:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:44: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 1VqIvH-0005CU-9m; Tue, 10 Dec 2013 08:44: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 1VqIvG-0005CI-1J
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:06 +0000
Received: from [85.158.137.68:20859] by server-14.bemta-3.messagelabs.com id
	45/90-06105-554D6A25; Tue, 10 Dec 2013 08:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1386665043!1729122!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8420 invoked from network); 10 Dec 2013 08:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 08: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 1VqIvD-0005m0-82
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIvD-0008Hk-6A
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:03 +0000
Date: Tue, 10 Dec 2013 08:44:03 +0000
Message-Id: <E1VqIvD-0008Hk-6A@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VMX: disable EPT when
	!cpu_has_vmx_pat
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 72380ecbcd9f870db1c60e698c9df71bdea6d819
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:24:20 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:24:20 2013 +0100

    VMX: disable EPT when !cpu_has_vmx_pat
    
    Recently Oracle developers found a Xen security issue as DOS affecting,
    named as XSA-60. Please refer http://xenbits.xen.org/xsa/advisory-60.html
    Basically it involves how to handle guest cr0.cd setting, which under
    some environment it consumes much time resulting in DOS-like behavior.
    
    This is a preparing patch for fixing XSA-60. Later patch will fix XSA-60
    via PAT under Intel EPT case, which depends on cpu_has_vmx_pat.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: c13b0d65ddedd74508edef5cd66defffe30468fc
    master date: 2013-11-06 10:11:18 +0100
---
 xen/arch/x86/hvm/vmx/vmcs.c |    4 ++--
 xen/arch/x86/hvm/vmx/vmx.c  |   10 +++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 76b55b4..c824494 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -920,7 +920,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS, MSR_TYPE_R | MSR_TYPE_W);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP, MSR_TYPE_R | MSR_TYPE_W);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP, MSR_TYPE_R | MSR_TYPE_W);
-        if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+        if ( paging_mode_hap(d) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT, MSR_TYPE_R | MSR_TYPE_W);
     }
 
@@ -1065,7 +1065,7 @@ static int construct_vmcs(struct vcpu *v)
         __vmwrite(EPT_POINTER, ept_get_eptp(ept));
     }
 
-    if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+    if ( paging_mode_hap(d) )
     {
         u64 host_pat, guest_pat;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index cb1d118..a0060b6 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -923,7 +923,7 @@ static unsigned long vmx_get_shadow_gs_base(struct vcpu *v)
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -934,7 +934,7 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -1593,7 +1593,11 @@ const struct hvm_function_table * __init start_vmx(void)
         return NULL;
     }
 
-    if ( cpu_has_vmx_ept )
+    /*
+     * Do not enable EPT when (!cpu_has_vmx_pat), to prevent security hole
+     * (refer to http://xenbits.xen.org/xsa/advisory-60.html).
+     */
+    if ( cpu_has_vmx_ept && cpu_has_vmx_pat )
     {
         vmx_function_table.hap_supported = 1;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:44:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08: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 1VqIvR-0005E5-Co; Tue, 10 Dec 2013 08:44:17 +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 1VqIvQ-0005Dk-HD
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:16 +0000
Received: from [193.109.254.147:42349] by server-7.bemta-14.messagelabs.com id
	ED/8D-15500-F54D6A25; Tue, 10 Dec 2013 08:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1386665053!4097997!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25051 invoked from network); 10 Dec 2013 08:44:14 -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;
	10 Dec 2013 08:44: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 1VqIvN-0005m6-NT
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIvN-0008Is-C7
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:13 +0000
Date: Tue, 10 Dec 2013 08:44:13 +0000
Message-Id: <E1VqIvN-0008Is-C7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VMX: remove the problematic
	set_uc_mode logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e81d0ac25464825b3828cff5dc9e8285612992c4
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:26:03 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:26:03 2013 +0100

    VMX: remove the problematic set_uc_mode logic
    
    XSA-60 security hole comes from the problematic vmx_set_uc_mode.
    This patch remove vmx_set_uc_mode logic, which will be replaced by
    PAT approach at later patch.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: 1c84d046735102e02d2df454ab07f14ac51f235d
    master date: 2013-11-06 10:12:00 +0100
---
 xen/arch/x86/hvm/hvm.c        |    2 -
 xen/arch/x86/hvm/mtrr.c       |    3 -
 xen/arch/x86/hvm/vmx/vmx.c    |    9 ---
 xen/arch/x86/mm/p2m-ept.c     |  120 -----------------------------------------
 xen/include/asm-x86/hvm/hvm.h |    1 -
 5 files changed, 0 insertions(+), 135 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a24c6e0..ce2a9d8 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1629,8 +1629,6 @@ static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
 {
     v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
     shadow_blow_tables_per_domain(v->domain);
-    if ( hvm_funcs.set_uc_mode )
-        return hvm_funcs.set_uc_mode(v);
 }
 
 int hvm_mov_to_cr(unsigned int cr, unsigned int gpr)
diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index ef51a8d..4ff1e55 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -696,9 +696,6 @@ uint8_t epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn,
     if ( !v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT] )
         return MTRR_TYPE_WRBACK;
 
-    if ( (v == current) && v->domain->arch.hvm_domain.is_in_uc_mode )
-        return MTRR_TYPE_UNCACHABLE;
-
     if ( !mfn_valid(mfn_x(mfn)) )
         return MTRR_TYPE_UNCACHABLE;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index a0060b6..9f98252 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1399,14 +1399,6 @@ static int vmx_event_pending(struct vcpu *v)
     return (__vmread(VM_ENTRY_INTR_INFO) & INTR_INFO_VALID_MASK);
 }
 
-static void vmx_set_uc_mode(struct vcpu *v)
-{
-    if ( paging_mode_hap(v->domain) )
-        ept_change_entry_emt_with_range(
-            v->domain, 0, p2m_get_hostp2m(v->domain)->max_mapped_pfn);
-    hvm_asid_flush_vcpu(v);
-}
-
 static void vmx_set_info_guest(struct vcpu *v)
 {
     unsigned long intr_shadow;
@@ -1561,7 +1553,6 @@ static struct hvm_function_table __initdata vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
-    .set_uc_mode          = vmx_set_uc_mode,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting,
     .nhvm_vcpu_initialise = nvmx_vcpu_initialise,
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 595c6e7..92d9e2d 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -587,44 +587,6 @@ out:
     return mfn;
 }
 
-/* WARNING: Only caller doesn't care about PoD pages.  So this function will
- * always return 0 for PoD pages, not populate them.  If that becomes necessary,
- * pass a p2m_query_t type along to distinguish. */
-static ept_entry_t ept_get_entry_content(struct p2m_domain *p2m,
-    unsigned long gfn, int *level)
-{
-    ept_entry_t *table = map_domain_page(pagetable_get_pfn(p2m_get_pagetable(p2m)));
-    unsigned long gfn_remainder = gfn;
-    ept_entry_t *ept_entry;
-    ept_entry_t content = { .epte = 0 };
-    u32 index;
-    int i;
-    int ret=0;
-    struct ept_data *ept = &p2m->ept;
-
-    /* This pfn is higher than the highest the p2m map currently holds */
-    if ( gfn > p2m->max_mapped_pfn )
-        goto out;
-
-    for ( i = ept_get_wl(ept); i > 0; i-- )
-    {
-        ret = ept_next_level(p2m, 1, &table, &gfn_remainder, i);
-        if ( !ret || ret == GUEST_TABLE_POD_PAGE )
-            goto out;
-        else if ( ret == GUEST_TABLE_SUPER_PAGE )
-            break;
-    }
-
-    index = gfn_remainder >> (i * EPT_TABLE_ORDER);
-    ept_entry = table + index;
-    content = *ept_entry;
-    *level = i;
-
- out:
-    unmap_domain_page(table);
-    return content;
-}
-
 void ept_walk_table(struct domain *d, unsigned long gfn)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
@@ -677,88 +639,6 @@ out:
 }
 
 /*
- * To test if the new emt type is the same with old,
- * return 1 to not to reset ept entry.
- */
-static int need_modify_ept_entry(struct p2m_domain *p2m, unsigned long gfn,
-                                 mfn_t mfn, uint8_t o_ipat, uint8_t o_emt,
-                                 p2m_type_t p2mt)
-{
-    uint8_t ipat;
-    uint8_t emt;
-    bool_t direct_mmio = (p2mt == p2m_mmio_direct);
-
-    emt = epte_get_entry_emt(p2m->domain, gfn, mfn, &ipat, direct_mmio);
-
-    if ( (emt == o_emt) && (ipat == o_ipat) )
-        return 0;
-
-    return 1;
-}
-
-void ept_change_entry_emt_with_range(struct domain *d,
-                                     unsigned long start_gfn,
-                                     unsigned long end_gfn)
-{
-    unsigned long gfn;
-    ept_entry_t e;
-    mfn_t mfn;
-    int order = 0;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    int rc;
-
-    p2m_lock(p2m);
-    for ( gfn = start_gfn; gfn <= end_gfn; gfn++ )
-    {
-        int level = 0;
-        uint64_t trunk = 0;
-
-        e = ept_get_entry_content(p2m, gfn, &level);
-        if ( !is_epte_present(&e) || !p2m_has_emt(e.sa_p2mt) )
-            continue;
-
-        order = 0;
-        mfn = _mfn(e.mfn);
-
-        if ( is_epte_superpage(&e) )
-        {
-            while ( level )
-            {
-                trunk = (1UL << (level * EPT_TABLE_ORDER)) - 1;
-                if ( !(gfn & trunk) && (gfn + trunk <= end_gfn) )
-                {
-                    /* gfn assigned with 2M or 1G, and the end covers more than
-                     * the super page areas.
-                     * Set emt for super page.
-                     */
-                    order = level * EPT_TABLE_ORDER;
-                    if ( need_modify_ept_entry(p2m, gfn, mfn, 
-                          e.ipat, e.emt, e.sa_p2mt) )
-                    {
-                        rc = ept_set_entry(p2m, gfn, mfn, order,
-                                           e.sa_p2mt, e.access);
-                        ASSERT(rc);
-                    }
-                    gfn += trunk;
-                    break;
-                }
-                level--;
-             }
-        }
-        else /* gfn assigned with 4k */
-        {
-            if ( need_modify_ept_entry(p2m, gfn, mfn,
-                                       e.ipat, e.emt, e.sa_p2mt) )
-            {
-                rc = ept_set_entry(p2m, gfn, mfn, order, e.sa_p2mt, e.access);
-                ASSERT(rc);
-            }
-        }
-    }
-    p2m_unlock(p2m);
-}
-
-/*
  * Walk the whole p2m table, changing any entries of the old type
  * to the new type.  This is used in hardware-assisted paging to
  * quickly enable or diable log-dirty tracking
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 4d303e6..be52ef2 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -156,7 +156,6 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
-    void (*set_uc_mode)(struct vcpu *v);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:44:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08: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 1VqIvR-0005E5-Co; Tue, 10 Dec 2013 08:44:17 +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 1VqIvQ-0005Dk-HD
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:16 +0000
Received: from [193.109.254.147:42349] by server-7.bemta-14.messagelabs.com id
	ED/8D-15500-F54D6A25; Tue, 10 Dec 2013 08:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1386665053!4097997!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25051 invoked from network); 10 Dec 2013 08:44:14 -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;
	10 Dec 2013 08:44: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 1VqIvN-0005m6-NT
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIvN-0008Is-C7
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:13 +0000
Date: Tue, 10 Dec 2013 08:44:13 +0000
Message-Id: <E1VqIvN-0008Is-C7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VMX: remove the problematic
	set_uc_mode logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e81d0ac25464825b3828cff5dc9e8285612992c4
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:26:03 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:26:03 2013 +0100

    VMX: remove the problematic set_uc_mode logic
    
    XSA-60 security hole comes from the problematic vmx_set_uc_mode.
    This patch remove vmx_set_uc_mode logic, which will be replaced by
    PAT approach at later patch.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: 1c84d046735102e02d2df454ab07f14ac51f235d
    master date: 2013-11-06 10:12:00 +0100
---
 xen/arch/x86/hvm/hvm.c        |    2 -
 xen/arch/x86/hvm/mtrr.c       |    3 -
 xen/arch/x86/hvm/vmx/vmx.c    |    9 ---
 xen/arch/x86/mm/p2m-ept.c     |  120 -----------------------------------------
 xen/include/asm-x86/hvm/hvm.h |    1 -
 5 files changed, 0 insertions(+), 135 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a24c6e0..ce2a9d8 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1629,8 +1629,6 @@ static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
 {
     v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
     shadow_blow_tables_per_domain(v->domain);
-    if ( hvm_funcs.set_uc_mode )
-        return hvm_funcs.set_uc_mode(v);
 }
 
 int hvm_mov_to_cr(unsigned int cr, unsigned int gpr)
diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index ef51a8d..4ff1e55 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -696,9 +696,6 @@ uint8_t epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn,
     if ( !v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT] )
         return MTRR_TYPE_WRBACK;
 
-    if ( (v == current) && v->domain->arch.hvm_domain.is_in_uc_mode )
-        return MTRR_TYPE_UNCACHABLE;
-
     if ( !mfn_valid(mfn_x(mfn)) )
         return MTRR_TYPE_UNCACHABLE;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index a0060b6..9f98252 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1399,14 +1399,6 @@ static int vmx_event_pending(struct vcpu *v)
     return (__vmread(VM_ENTRY_INTR_INFO) & INTR_INFO_VALID_MASK);
 }
 
-static void vmx_set_uc_mode(struct vcpu *v)
-{
-    if ( paging_mode_hap(v->domain) )
-        ept_change_entry_emt_with_range(
-            v->domain, 0, p2m_get_hostp2m(v->domain)->max_mapped_pfn);
-    hvm_asid_flush_vcpu(v);
-}
-
 static void vmx_set_info_guest(struct vcpu *v)
 {
     unsigned long intr_shadow;
@@ -1561,7 +1553,6 @@ static struct hvm_function_table __initdata vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
-    .set_uc_mode          = vmx_set_uc_mode,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting,
     .nhvm_vcpu_initialise = nvmx_vcpu_initialise,
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 595c6e7..92d9e2d 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -587,44 +587,6 @@ out:
     return mfn;
 }
 
-/* WARNING: Only caller doesn't care about PoD pages.  So this function will
- * always return 0 for PoD pages, not populate them.  If that becomes necessary,
- * pass a p2m_query_t type along to distinguish. */
-static ept_entry_t ept_get_entry_content(struct p2m_domain *p2m,
-    unsigned long gfn, int *level)
-{
-    ept_entry_t *table = map_domain_page(pagetable_get_pfn(p2m_get_pagetable(p2m)));
-    unsigned long gfn_remainder = gfn;
-    ept_entry_t *ept_entry;
-    ept_entry_t content = { .epte = 0 };
-    u32 index;
-    int i;
-    int ret=0;
-    struct ept_data *ept = &p2m->ept;
-
-    /* This pfn is higher than the highest the p2m map currently holds */
-    if ( gfn > p2m->max_mapped_pfn )
-        goto out;
-
-    for ( i = ept_get_wl(ept); i > 0; i-- )
-    {
-        ret = ept_next_level(p2m, 1, &table, &gfn_remainder, i);
-        if ( !ret || ret == GUEST_TABLE_POD_PAGE )
-            goto out;
-        else if ( ret == GUEST_TABLE_SUPER_PAGE )
-            break;
-    }
-
-    index = gfn_remainder >> (i * EPT_TABLE_ORDER);
-    ept_entry = table + index;
-    content = *ept_entry;
-    *level = i;
-
- out:
-    unmap_domain_page(table);
-    return content;
-}
-
 void ept_walk_table(struct domain *d, unsigned long gfn)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
@@ -677,88 +639,6 @@ out:
 }
 
 /*
- * To test if the new emt type is the same with old,
- * return 1 to not to reset ept entry.
- */
-static int need_modify_ept_entry(struct p2m_domain *p2m, unsigned long gfn,
-                                 mfn_t mfn, uint8_t o_ipat, uint8_t o_emt,
-                                 p2m_type_t p2mt)
-{
-    uint8_t ipat;
-    uint8_t emt;
-    bool_t direct_mmio = (p2mt == p2m_mmio_direct);
-
-    emt = epte_get_entry_emt(p2m->domain, gfn, mfn, &ipat, direct_mmio);
-
-    if ( (emt == o_emt) && (ipat == o_ipat) )
-        return 0;
-
-    return 1;
-}
-
-void ept_change_entry_emt_with_range(struct domain *d,
-                                     unsigned long start_gfn,
-                                     unsigned long end_gfn)
-{
-    unsigned long gfn;
-    ept_entry_t e;
-    mfn_t mfn;
-    int order = 0;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    int rc;
-
-    p2m_lock(p2m);
-    for ( gfn = start_gfn; gfn <= end_gfn; gfn++ )
-    {
-        int level = 0;
-        uint64_t trunk = 0;
-
-        e = ept_get_entry_content(p2m, gfn, &level);
-        if ( !is_epte_present(&e) || !p2m_has_emt(e.sa_p2mt) )
-            continue;
-
-        order = 0;
-        mfn = _mfn(e.mfn);
-
-        if ( is_epte_superpage(&e) )
-        {
-            while ( level )
-            {
-                trunk = (1UL << (level * EPT_TABLE_ORDER)) - 1;
-                if ( !(gfn & trunk) && (gfn + trunk <= end_gfn) )
-                {
-                    /* gfn assigned with 2M or 1G, and the end covers more than
-                     * the super page areas.
-                     * Set emt for super page.
-                     */
-                    order = level * EPT_TABLE_ORDER;
-                    if ( need_modify_ept_entry(p2m, gfn, mfn, 
-                          e.ipat, e.emt, e.sa_p2mt) )
-                    {
-                        rc = ept_set_entry(p2m, gfn, mfn, order,
-                                           e.sa_p2mt, e.access);
-                        ASSERT(rc);
-                    }
-                    gfn += trunk;
-                    break;
-                }
-                level--;
-             }
-        }
-        else /* gfn assigned with 4k */
-        {
-            if ( need_modify_ept_entry(p2m, gfn, mfn,
-                                       e.ipat, e.emt, e.sa_p2mt) )
-            {
-                rc = ept_set_entry(p2m, gfn, mfn, order, e.sa_p2mt, e.access);
-                ASSERT(rc);
-            }
-        }
-    }
-    p2m_unlock(p2m);
-}
-
-/*
  * Walk the whole p2m table, changing any entries of the old type
  * to the new type.  This is used in hardware-assisted paging to
  * quickly enable or diable log-dirty tracking
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 4d303e6..be52ef2 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -156,7 +156,6 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
-    void (*set_uc_mode)(struct vcpu *v);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:44:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:44: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 1VqIvc-0005G0-I4; Tue, 10 Dec 2013 08:44: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 1VqIva-0005Fj-VG
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:27 +0000
Received: from [193.109.254.147:65374] by server-8.bemta-14.messagelabs.com id
	E1/2B-30921-A64D6A25; Tue, 10 Dec 2013 08:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1386665064!4101069!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17992 invoked from network); 10 Dec 2013 08:44:25 -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;
	10 Dec 2013 08:44: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 1VqIvX-0005mC-V8
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIvX-0008JF-RH
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:23 +0000
Date: Tue, 10 Dec 2013 08:44:23 +0000
Message-Id: <E1VqIvX-0008JF-RH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VMX: fix cr0.cd handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 064275dcfb6002dc4327ba94b6bd758806735538
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:27:04 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:27:04 2013 +0100

    VMX: fix cr0.cd handling
    
    This patch solves XSA-60 security hole:
    1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need
    do nothing, since hardware snoop mechanism has ensured cache coherency.
    
    2. For guest with VT-d but non-snooped, cache coherency can not be
    guaranteed by h/w snoop, therefore it need emulate UC type to guest:
    2.1). if it works w/ Intel EPT, set guest IA32_PAT fields as UC so that
    guest memory type are all UC.
    2.2). if it works w/ shadow, drop all shadows so that any new ones would
    be created on demand w/ UC.
    
    This patch also fix a bug of shadow cr0.cd setting. Current shadow has a
    small window between cache flush and TLB invalidation, resulting in possilbe
    cache pollution. This patch pause vcpus so that no vcpus context involved
    into the window.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 62652c00efa55fb45374bcc92f7d96fc411aebb2
    master date: 2013-11-06 10:12:36 +0100
---
 xen/arch/x86/hvm/hvm.c            |   75 ++++++++++++++++++++++--------------
 xen/arch/x86/hvm/vmx/vmcs.c       |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c        |   54 +++++++++++++++++++++++++-
 xen/common/domain.c               |   10 +++++
 xen/include/asm-x86/hvm/hvm.h     |    1 +
 xen/include/asm-x86/hvm/support.h |    2 +
 xen/include/xen/sched.h           |    1 +
 7 files changed, 113 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index ce2a9d8..e9cd4a7 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1711,6 +1711,40 @@ int hvm_mov_from_cr(unsigned int cr, unsigned int gpr)
     return X86EMUL_UNHANDLEABLE;
 }
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( value & X86_CR0_CD )
+    {
+        /* Entering no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+
+        if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
+        {
+            domain_pause_nosync(v->domain);
+
+            /* Flush physical caches. */
+            on_each_cpu(local_flush_cache, NULL, 1);
+            hvm_set_uc_mode(v, 1);
+
+            domain_unpause(v->domain);
+        }
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+    else if ( !(value & X86_CR0_CD) &&
+              (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
+    {
+        /* Exit from no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+
+        if ( domain_exit_uc_mode(v) )
+            hvm_set_uc_mode(v, 0);
+
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+}
+
 int hvm_set_cr0(unsigned long value)
 {
     struct vcpu *v = current;
@@ -1793,35 +1827,18 @@ int hvm_set_cr0(unsigned long value)
         }
     }
 
-    if ( cache_flush_permitted(v->domain) )
-    {
-        if ( (value & X86_CR0_CD) && !(value & X86_CR0_NW) )
-        {
-            /* Entering no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
-
-            if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
-            {
-                /* Flush physical caches. */
-                on_each_cpu(local_flush_cache, NULL, 1);
-                hvm_set_uc_mode(v, 1);
-            }
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-        else if ( !(value & (X86_CR0_CD | X86_CR0_NW)) &&
-                  (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        {
-            /* Exit from no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
-
-            if ( domain_exit_uc_mode(v) )
-                hvm_set_uc_mode(v, 0);
-
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-    }
+    /*
+     * When cr0.cd setting
+     * 1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need not
+     * do anything, since hardware snoop mechanism has ensured cache coherency;
+     * 2. For guest with VT-d but non-snooped, cache coherency cannot be
+     * guaranteed by h/w so need emulate UC memory type to guest.
+     */
+    if ( ((value ^ old_value) & X86_CR0_CD) &&
+           has_arch_pdevs(v->domain) &&
+           iommu_enabled && !iommu_snoop &&
+           hvm_funcs.handle_cd )
+        hvm_funcs.handle_cd(v, value);
 
     v->arch.hvm_vcpu.guest_cr[0] = value;
     hvm_update_guest_cr(v, 0);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index c824494..7e74fba 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -920,7 +920,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS, MSR_TYPE_R | MSR_TYPE_W);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP, MSR_TYPE_R | MSR_TYPE_W);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP, MSR_TYPE_R | MSR_TYPE_W);
-        if ( paging_mode_hap(d) )
+        if ( paging_mode_hap(d) && (!iommu_enabled || iommu_snoop) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT, MSR_TYPE_R | MSR_TYPE_W);
     }
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 9f98252..32751d2 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -923,7 +923,8 @@ static unsigned long vmx_get_shadow_gs_base(struct vcpu *v)
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -934,7 +935,8 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -943,6 +945,53 @@ static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
     return 1;
 }
 
+static void vmx_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( !paging_mode_hap(v->domain) )
+    {
+        /*
+         * For shadow, 'load IA32_PAT' VM-entry control is 0, so it cannot
+         * set guest memory type as UC via IA32_PAT. Xen drop all shadows
+         * so that any new ones would be created on demand.
+         */
+        hvm_shadow_handle_cd(v, value);
+    }
+    else
+    {
+        u64 *pat = &v->arch.hvm_vcpu.pat_cr;
+
+        if ( value & X86_CR0_CD )
+        {
+            /*
+             * For EPT, set guest IA32_PAT fields as UC so that guest
+             * memory type are all UC.
+             */
+            u64 uc_pat =
+                ((uint64_t)PAT_TYPE_UNCACHABLE)       |       /* PAT0 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 8)  |       /* PAT1 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 16) |       /* PAT2 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 24) |       /* PAT3 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 32) |       /* PAT4 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 40) |       /* PAT5 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 48) |       /* PAT6 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 56);        /* PAT7 */
+
+            vmx_get_guest_pat(v, pat);
+            vmx_set_guest_pat(v, uc_pat);
+
+            wbinvd();               /* flush possibly polluted cache */
+            hvm_asid_flush_vcpu(v); /* invalidate memory type cached in TLB */
+            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+        }
+        else
+        {
+            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+            vmx_set_guest_pat(v, *pat);
+            hvm_asid_flush_vcpu(v); /* no need to flush cache */
+        }
+    }
+}
+
 static void vmx_set_tsc_offset(struct vcpu *v, u64 offset)
 {
     vmx_vmcs_enter(v);
@@ -1553,6 +1602,7 @@ static struct hvm_function_table __initdata vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
+    .handle_cd            = vmx_handle_cd,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting,
     .nhvm_vcpu_initialise = nvmx_vcpu_initialise,
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 2612949..df17ece 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -808,6 +808,16 @@ void domain_pause(struct domain *d)
         vcpu_sleep_sync(v);
 }
 
+void domain_pause_nosync(struct domain *d)
+{
+    struct vcpu *v;
+
+    atomic_inc(&d->pause_count);
+
+    for_each_vcpu( d, v )
+        vcpu_sleep_nosync(v);
+}
+
 void domain_unpause(struct domain *d)
 {
     struct vcpu *v;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index be52ef2..144ba6a 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -156,6 +156,7 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
+    void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 
diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h
index 7ddc806..52aef1f 100644
--- a/xen/include/asm-x86/hvm/support.h
+++ b/xen/include/asm-x86/hvm/support.h
@@ -130,6 +130,8 @@ void hvm_rdtsc_intercept(struct cpu_user_regs *regs);
 
 int __must_check hvm_handle_xsetbv(u32 index, u64 new_bv);
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value);
+
 /* These functions all return X86EMUL return codes. */
 int hvm_set_efer(uint64_t value);
 int hvm_set_cr0(unsigned long value);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index ae6a3b8..0ba9178 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -687,6 +687,7 @@ void vcpu_unblock(struct vcpu *v);
 void vcpu_pause(struct vcpu *v);
 void vcpu_pause_nosync(struct vcpu *v);
 void domain_pause(struct domain *d);
+void domain_pause_nosync(struct domain *d);
 void vcpu_unpause(struct vcpu *v);
 void domain_unpause(struct domain *d);
 void domain_pause_by_systemcontroller(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:44:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:44: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 1VqIvc-0005G0-I4; Tue, 10 Dec 2013 08:44: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 1VqIva-0005Fj-VG
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:27 +0000
Received: from [193.109.254.147:65374] by server-8.bemta-14.messagelabs.com id
	E1/2B-30921-A64D6A25; Tue, 10 Dec 2013 08:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1386665064!4101069!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17992 invoked from network); 10 Dec 2013 08:44:25 -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;
	10 Dec 2013 08:44: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 1VqIvX-0005mC-V8
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIvX-0008JF-RH
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:23 +0000
Date: Tue, 10 Dec 2013 08:44:23 +0000
Message-Id: <E1VqIvX-0008JF-RH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VMX: fix cr0.cd handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 064275dcfb6002dc4327ba94b6bd758806735538
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:27:04 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:27:04 2013 +0100

    VMX: fix cr0.cd handling
    
    This patch solves XSA-60 security hole:
    1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need
    do nothing, since hardware snoop mechanism has ensured cache coherency.
    
    2. For guest with VT-d but non-snooped, cache coherency can not be
    guaranteed by h/w snoop, therefore it need emulate UC type to guest:
    2.1). if it works w/ Intel EPT, set guest IA32_PAT fields as UC so that
    guest memory type are all UC.
    2.2). if it works w/ shadow, drop all shadows so that any new ones would
    be created on demand w/ UC.
    
    This patch also fix a bug of shadow cr0.cd setting. Current shadow has a
    small window between cache flush and TLB invalidation, resulting in possilbe
    cache pollution. This patch pause vcpus so that no vcpus context involved
    into the window.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 62652c00efa55fb45374bcc92f7d96fc411aebb2
    master date: 2013-11-06 10:12:36 +0100
---
 xen/arch/x86/hvm/hvm.c            |   75 ++++++++++++++++++++++--------------
 xen/arch/x86/hvm/vmx/vmcs.c       |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c        |   54 +++++++++++++++++++++++++-
 xen/common/domain.c               |   10 +++++
 xen/include/asm-x86/hvm/hvm.h     |    1 +
 xen/include/asm-x86/hvm/support.h |    2 +
 xen/include/xen/sched.h           |    1 +
 7 files changed, 113 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index ce2a9d8..e9cd4a7 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1711,6 +1711,40 @@ int hvm_mov_from_cr(unsigned int cr, unsigned int gpr)
     return X86EMUL_UNHANDLEABLE;
 }
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( value & X86_CR0_CD )
+    {
+        /* Entering no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+
+        if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
+        {
+            domain_pause_nosync(v->domain);
+
+            /* Flush physical caches. */
+            on_each_cpu(local_flush_cache, NULL, 1);
+            hvm_set_uc_mode(v, 1);
+
+            domain_unpause(v->domain);
+        }
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+    else if ( !(value & X86_CR0_CD) &&
+              (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
+    {
+        /* Exit from no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+
+        if ( domain_exit_uc_mode(v) )
+            hvm_set_uc_mode(v, 0);
+
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+}
+
 int hvm_set_cr0(unsigned long value)
 {
     struct vcpu *v = current;
@@ -1793,35 +1827,18 @@ int hvm_set_cr0(unsigned long value)
         }
     }
 
-    if ( cache_flush_permitted(v->domain) )
-    {
-        if ( (value & X86_CR0_CD) && !(value & X86_CR0_NW) )
-        {
-            /* Entering no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
-
-            if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
-            {
-                /* Flush physical caches. */
-                on_each_cpu(local_flush_cache, NULL, 1);
-                hvm_set_uc_mode(v, 1);
-            }
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-        else if ( !(value & (X86_CR0_CD | X86_CR0_NW)) &&
-                  (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        {
-            /* Exit from no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
-
-            if ( domain_exit_uc_mode(v) )
-                hvm_set_uc_mode(v, 0);
-
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-    }
+    /*
+     * When cr0.cd setting
+     * 1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need not
+     * do anything, since hardware snoop mechanism has ensured cache coherency;
+     * 2. For guest with VT-d but non-snooped, cache coherency cannot be
+     * guaranteed by h/w so need emulate UC memory type to guest.
+     */
+    if ( ((value ^ old_value) & X86_CR0_CD) &&
+           has_arch_pdevs(v->domain) &&
+           iommu_enabled && !iommu_snoop &&
+           hvm_funcs.handle_cd )
+        hvm_funcs.handle_cd(v, value);
 
     v->arch.hvm_vcpu.guest_cr[0] = value;
     hvm_update_guest_cr(v, 0);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index c824494..7e74fba 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -920,7 +920,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS, MSR_TYPE_R | MSR_TYPE_W);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP, MSR_TYPE_R | MSR_TYPE_W);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP, MSR_TYPE_R | MSR_TYPE_W);
-        if ( paging_mode_hap(d) )
+        if ( paging_mode_hap(d) && (!iommu_enabled || iommu_snoop) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT, MSR_TYPE_R | MSR_TYPE_W);
     }
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 9f98252..32751d2 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -923,7 +923,8 @@ static unsigned long vmx_get_shadow_gs_base(struct vcpu *v)
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -934,7 +935,8 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -943,6 +945,53 @@ static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
     return 1;
 }
 
+static void vmx_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( !paging_mode_hap(v->domain) )
+    {
+        /*
+         * For shadow, 'load IA32_PAT' VM-entry control is 0, so it cannot
+         * set guest memory type as UC via IA32_PAT. Xen drop all shadows
+         * so that any new ones would be created on demand.
+         */
+        hvm_shadow_handle_cd(v, value);
+    }
+    else
+    {
+        u64 *pat = &v->arch.hvm_vcpu.pat_cr;
+
+        if ( value & X86_CR0_CD )
+        {
+            /*
+             * For EPT, set guest IA32_PAT fields as UC so that guest
+             * memory type are all UC.
+             */
+            u64 uc_pat =
+                ((uint64_t)PAT_TYPE_UNCACHABLE)       |       /* PAT0 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 8)  |       /* PAT1 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 16) |       /* PAT2 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 24) |       /* PAT3 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 32) |       /* PAT4 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 40) |       /* PAT5 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 48) |       /* PAT6 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 56);        /* PAT7 */
+
+            vmx_get_guest_pat(v, pat);
+            vmx_set_guest_pat(v, uc_pat);
+
+            wbinvd();               /* flush possibly polluted cache */
+            hvm_asid_flush_vcpu(v); /* invalidate memory type cached in TLB */
+            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+        }
+        else
+        {
+            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+            vmx_set_guest_pat(v, *pat);
+            hvm_asid_flush_vcpu(v); /* no need to flush cache */
+        }
+    }
+}
+
 static void vmx_set_tsc_offset(struct vcpu *v, u64 offset)
 {
     vmx_vmcs_enter(v);
@@ -1553,6 +1602,7 @@ static struct hvm_function_table __initdata vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
+    .handle_cd            = vmx_handle_cd,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting,
     .nhvm_vcpu_initialise = nvmx_vcpu_initialise,
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 2612949..df17ece 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -808,6 +808,16 @@ void domain_pause(struct domain *d)
         vcpu_sleep_sync(v);
 }
 
+void domain_pause_nosync(struct domain *d)
+{
+    struct vcpu *v;
+
+    atomic_inc(&d->pause_count);
+
+    for_each_vcpu( d, v )
+        vcpu_sleep_nosync(v);
+}
+
 void domain_unpause(struct domain *d)
 {
     struct vcpu *v;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index be52ef2..144ba6a 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -156,6 +156,7 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
+    void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 
diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h
index 7ddc806..52aef1f 100644
--- a/xen/include/asm-x86/hvm/support.h
+++ b/xen/include/asm-x86/hvm/support.h
@@ -130,6 +130,8 @@ void hvm_rdtsc_intercept(struct cpu_user_regs *regs);
 
 int __must_check hvm_handle_xsetbv(u32 index, u64 new_bv);
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value);
+
 /* These functions all return X86EMUL return codes. */
 int hvm_set_efer(uint64_t value);
 int hvm_set_cr0(unsigned long value);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index ae6a3b8..0ba9178 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -687,6 +687,7 @@ void vcpu_unblock(struct vcpu *v);
 void vcpu_pause(struct vcpu *v);
 void vcpu_pause_nosync(struct vcpu *v);
 void domain_pause(struct domain *d);
+void domain_pause_nosync(struct domain *d);
 void vcpu_unpause(struct vcpu *v);
 void domain_unpause(struct domain *d);
 void domain_pause_by_systemcontroller(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:44:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:44: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 1VqIvm-0005HQ-Kv; Tue, 10 Dec 2013 08:44:38 +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 1VqIvl-0005HA-0y
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:37 +0000
Received: from [85.158.137.68:65346] by server-6.bemta-3.messagelabs.com id
	86/63-04868-474D6A25; Tue, 10 Dec 2013 08:44:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1386665074!2884234!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16816 invoked from network); 10 Dec 2013 08:44:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 08:44: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 1VqIvi-0005mK-3A
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIvi-0008Jf-1p
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:34 +0000
Date: Tue, 10 Dec 2013 08:44:34 +0000
Message-Id: <E1VqIvi-0008Jf-1p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/hvm: fix segment validation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32abacd714b04e6167450b76341966d48187e4ad
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Dec 9 14:28:06 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:28:06 2013 +0100

    x86/hvm: fix segment validation
    
    Also Coverity CID 1055180.
    
    Reported-by: David Binderman <dcb314@hotmail.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    
    Use _SEGMENT_* instead of plain numbers and adjust a comment.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6ed4bfbabd487b41021caa7ed03cee1f00ecbabf
    master date: 2013-11-26 09:54:21 +0100
---
 xen/arch/x86/hvm/hvm.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e9cd4a7..a4d7af0 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2205,7 +2205,7 @@ static int hvm_load_segment_selector(
             if ( !(desc.b & (1u<<11)) )
                 goto unmap_and_fail;
             /* Non-conforming segment: check DPL against RPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && (dpl != rpl) )
+            if ( !(desc.b & _SEGMENT_EC) && (dpl != rpl) )
                 goto unmap_and_fail;
             break;
         case x86_seg_ss:
@@ -2224,8 +2224,13 @@ static int hvm_load_segment_selector(
             /* Readable code or data segment? */
             if ( (desc.b & (5u<<9)) == (4u<<9) )
                 goto unmap_and_fail;
-            /* Non-conforming segment: check DPL against RPL and CPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && ((dpl < cpl) || (dpl < rpl)) )
+            /*
+             * Data or non-conforming code segment:
+             * check DPL against RPL and CPL.
+             */
+            if ( ((desc.b & (_SEGMENT_EC|_SEGMENT_CODE)) !=
+                  (_SEGMENT_EC|_SEGMENT_CODE))
+                 && ((dpl < cpl) || (dpl < rpl)) )
                 goto unmap_and_fail;
             break;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:44:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:44: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 1VqIvm-0005HQ-Kv; Tue, 10 Dec 2013 08:44:38 +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 1VqIvl-0005HA-0y
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:37 +0000
Received: from [85.158.137.68:65346] by server-6.bemta-3.messagelabs.com id
	86/63-04868-474D6A25; Tue, 10 Dec 2013 08:44:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1386665074!2884234!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16816 invoked from network); 10 Dec 2013 08:44:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 08:44: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 1VqIvi-0005mK-3A
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIvi-0008Jf-1p
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:34 +0000
Date: Tue, 10 Dec 2013 08:44:34 +0000
Message-Id: <E1VqIvi-0008Jf-1p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/hvm: fix segment validation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32abacd714b04e6167450b76341966d48187e4ad
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Mon Dec 9 14:28:06 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:28:06 2013 +0100

    x86/hvm: fix segment validation
    
    Also Coverity CID 1055180.
    
    Reported-by: David Binderman <dcb314@hotmail.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    
    Use _SEGMENT_* instead of plain numbers and adjust a comment.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6ed4bfbabd487b41021caa7ed03cee1f00ecbabf
    master date: 2013-11-26 09:54:21 +0100
---
 xen/arch/x86/hvm/hvm.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e9cd4a7..a4d7af0 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2205,7 +2205,7 @@ static int hvm_load_segment_selector(
             if ( !(desc.b & (1u<<11)) )
                 goto unmap_and_fail;
             /* Non-conforming segment: check DPL against RPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && (dpl != rpl) )
+            if ( !(desc.b & _SEGMENT_EC) && (dpl != rpl) )
                 goto unmap_and_fail;
             break;
         case x86_seg_ss:
@@ -2224,8 +2224,13 @@ static int hvm_load_segment_selector(
             /* Readable code or data segment? */
             if ( (desc.b & (5u<<9)) == (4u<<9) )
                 goto unmap_and_fail;
-            /* Non-conforming segment: check DPL against RPL and CPL. */
-            if ( ((desc.b & (6u<<9)) != 6) && ((dpl < cpl) || (dpl < rpl)) )
+            /*
+             * Data or non-conforming code segment:
+             * check DPL against RPL and CPL.
+             */
+            if ( ((desc.b & (_SEGMENT_EC|_SEGMENT_CODE)) !=
+                  (_SEGMENT_EC|_SEGMENT_CODE))
+                 && ((dpl < cpl) || (dpl < rpl)) )
                 goto unmap_and_fail;
             break;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:44:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:44: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 1VqIvw-0005J3-Nj; Tue, 10 Dec 2013 08:44:48 +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 1VqIvu-0005Iq-U5
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:47 +0000
Received: from [193.109.254.147:50973] by server-7.bemta-14.messagelabs.com id
	96/2E-15500-E74D6A25; Tue, 10 Dec 2013 08:44:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1386665084!4104033!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25681 invoked from network); 10 Dec 2013 08:44:45 -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;
	10 Dec 2013 08:44: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 1VqIvs-0005mQ-7p
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIvs-0008K1-5w
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:44 +0000
Date: Tue, 10 Dec 2013 08:44:44 +0000
Message-Id: <E1VqIvs-0008K1-5w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: properly handle MSI-X unmask
	operation from 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 3014b79dcd8d6c9e75bf4918fb916bf89954c779
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Mon Dec 9 14:29:39 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:29:39 2013 +0100

    x86: properly handle MSI-X unmask operation from guests
    
    For a pass-through device with MSI-x capability, when guest tries
    to unmask the MSI-x interrupt for the passed through device, xen
    doesn't clear the mask bit for MSI-x in hardware in the following
    scenario, which will cause network disconnection:
    
    1. Guest masks the MSI-x interrupt
    2. Guest updates the address and data for it
    3. Guest unmasks the MSI-x interrupt (This is the problematic step)
    
    In the step #3 above, Xen doesn't handle it well. When guest tries
    to unmask MSI-X interrupt, it traps to Xen, Xen just returns to Qemu
    if it notices that address or data has been modified by guest before,
    then Qemu will update Xen with the latest value of address/data by
    hypercall. However, in this whole process, the MSI-X interrupt unmask
    operation is missing, which means Xen doesn't clear the mask bit in
    hardware for the MSI-X interrupt, so it remains disabled, that is why
    it loses the network connection.
    
    This patch fixes this issue.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    
    Only latch the address if the guest really is unmasking the entry.
    
    Clean up the entire change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 74fd0036deb585a139b63b26db025805ecedc37a
    master date: 2013-11-27 15:15:43 +0100
---
 xen/arch/x86/hvm/io.c          |    3 +++
 xen/arch/x86/hvm/vmsi.c        |   16 ++++++++++++++++
 xen/include/asm-x86/hvm/io.h   |    1 +
 xen/include/asm-x86/hvm/vcpu.h |    2 ++
 4 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 53acd01..95458ea 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -298,7 +298,10 @@ void hvm_io_assist(void)
     }
 
     if ( p->state == STATE_IOREQ_NONE )
+    {
+        msix_write_completion(curr);
         vcpu_end_shutdown_deferral(curr);
+    }
 }
 
 static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index e8aa61c..2bda25c 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -293,7 +293,11 @@ static int msixtbl_write(struct vcpu *v, unsigned long address,
 
     /* exit to device model if address/data has been modified */
     if ( test_and_clear_bit(nr_entry, &entry->table_flags) )
+    {
+        if ( !(val & PCI_MSIX_VECTOR_BITMASK) )
+            v->arch.hvm_vcpu.hvm_io.msix_unmask_address = address;
         goto out;
+    }
 
     virt = msixtbl_addr_to_virt(entry, address);
     if ( !virt )
@@ -528,3 +532,15 @@ void msixtbl_pt_cleanup(struct domain *d)
     spin_unlock(&d->arch.hvm_domain.msixtbl_list_lock);
     local_irq_restore(flags);
 }
+
+void msix_write_completion(struct vcpu *v)
+{
+    unsigned long ctrl_address = v->arch.hvm_vcpu.hvm_io.msix_unmask_address;
+
+    if ( !ctrl_address )
+        return;
+
+    v->arch.hvm_vcpu.hvm_io.msix_unmask_address = 0;
+    if ( msixtbl_write(v, ctrl_address, 4, 0) != X86EMUL_OKAY )
+        gdprintk(XENLOG_WARNING, "MSI-X write completion failure\n");
+}
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index b0718b8..62aa2f6 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -124,6 +124,7 @@ void hvm_interrupt_post(struct vcpu *v, int vector, int type);
 void hvm_io_assist(void);
 void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
                   union vioapic_redir_entry *ent);
+void msix_write_completion(struct vcpu *);
 
 struct hvm_hw_stdvga {
     uint8_t sr_index;
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index e8b8cd7..caf5f9a 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -66,6 +66,8 @@ struct hvm_vcpu_io {
     /* We may write up to m256 as a number of device-model transactions. */
     unsigned int mmio_large_write_bytes;
     paddr_t mmio_large_write_pa;
+
+    unsigned long msix_unmask_address;
 };
 
 #define VMCX_EADDR    (~0ULL)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:44:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:44: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 1VqIvw-0005J3-Nj; Tue, 10 Dec 2013 08:44:48 +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 1VqIvu-0005Iq-U5
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:47 +0000
Received: from [193.109.254.147:50973] by server-7.bemta-14.messagelabs.com id
	96/2E-15500-E74D6A25; Tue, 10 Dec 2013 08:44:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1386665084!4104033!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25681 invoked from network); 10 Dec 2013 08:44:45 -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;
	10 Dec 2013 08:44: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 1VqIvs-0005mQ-7p
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIvs-0008K1-5w
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:44 +0000
Date: Tue, 10 Dec 2013 08:44:44 +0000
Message-Id: <E1VqIvs-0008K1-5w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: properly handle MSI-X unmask
	operation from 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 3014b79dcd8d6c9e75bf4918fb916bf89954c779
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Mon Dec 9 14:29:39 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:29:39 2013 +0100

    x86: properly handle MSI-X unmask operation from guests
    
    For a pass-through device with MSI-x capability, when guest tries
    to unmask the MSI-x interrupt for the passed through device, xen
    doesn't clear the mask bit for MSI-x in hardware in the following
    scenario, which will cause network disconnection:
    
    1. Guest masks the MSI-x interrupt
    2. Guest updates the address and data for it
    3. Guest unmasks the MSI-x interrupt (This is the problematic step)
    
    In the step #3 above, Xen doesn't handle it well. When guest tries
    to unmask MSI-X interrupt, it traps to Xen, Xen just returns to Qemu
    if it notices that address or data has been modified by guest before,
    then Qemu will update Xen with the latest value of address/data by
    hypercall. However, in this whole process, the MSI-X interrupt unmask
    operation is missing, which means Xen doesn't clear the mask bit in
    hardware for the MSI-X interrupt, so it remains disabled, that is why
    it loses the network connection.
    
    This patch fixes this issue.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    
    Only latch the address if the guest really is unmasking the entry.
    
    Clean up the entire change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 74fd0036deb585a139b63b26db025805ecedc37a
    master date: 2013-11-27 15:15:43 +0100
---
 xen/arch/x86/hvm/io.c          |    3 +++
 xen/arch/x86/hvm/vmsi.c        |   16 ++++++++++++++++
 xen/include/asm-x86/hvm/io.h   |    1 +
 xen/include/asm-x86/hvm/vcpu.h |    2 ++
 4 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 53acd01..95458ea 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -298,7 +298,10 @@ void hvm_io_assist(void)
     }
 
     if ( p->state == STATE_IOREQ_NONE )
+    {
+        msix_write_completion(curr);
         vcpu_end_shutdown_deferral(curr);
+    }
 }
 
 static int dpci_ioport_read(uint32_t mport, ioreq_t *p)
diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index e8aa61c..2bda25c 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -293,7 +293,11 @@ static int msixtbl_write(struct vcpu *v, unsigned long address,
 
     /* exit to device model if address/data has been modified */
     if ( test_and_clear_bit(nr_entry, &entry->table_flags) )
+    {
+        if ( !(val & PCI_MSIX_VECTOR_BITMASK) )
+            v->arch.hvm_vcpu.hvm_io.msix_unmask_address = address;
         goto out;
+    }
 
     virt = msixtbl_addr_to_virt(entry, address);
     if ( !virt )
@@ -528,3 +532,15 @@ void msixtbl_pt_cleanup(struct domain *d)
     spin_unlock(&d->arch.hvm_domain.msixtbl_list_lock);
     local_irq_restore(flags);
 }
+
+void msix_write_completion(struct vcpu *v)
+{
+    unsigned long ctrl_address = v->arch.hvm_vcpu.hvm_io.msix_unmask_address;
+
+    if ( !ctrl_address )
+        return;
+
+    v->arch.hvm_vcpu.hvm_io.msix_unmask_address = 0;
+    if ( msixtbl_write(v, ctrl_address, 4, 0) != X86EMUL_OKAY )
+        gdprintk(XENLOG_WARNING, "MSI-X write completion failure\n");
+}
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index b0718b8..62aa2f6 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -124,6 +124,7 @@ void hvm_interrupt_post(struct vcpu *v, int vector, int type);
 void hvm_io_assist(void);
 void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
                   union vioapic_redir_entry *ent);
+void msix_write_completion(struct vcpu *);
 
 struct hvm_hw_stdvga {
     uint8_t sr_index;
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index e8b8cd7..caf5f9a 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -66,6 +66,8 @@ struct hvm_vcpu_io {
     /* We may write up to m256 as a number of device-model transactions. */
     unsigned int mmio_large_write_bytes;
     paddr_t mmio_large_write_pa;
+
+    unsigned long msix_unmask_address;
 };
 
 #define VMCX_EADDR    (~0ULL)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:45: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 1VqIw8-0005L5-Qv; Tue, 10 Dec 2013 08:45:00 +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 1VqIw7-0005Kq-7X
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:59 +0000
Received: from [85.158.143.35:59899] by server-1.bemta-4.messagelabs.com id
	15/C1-02132-A84D6A25; Tue, 10 Dec 2013 08:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1386665095!4587170!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17449 invoked from network); 10 Dec 2013 08:44:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 08:44: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 1VqIw3-0005mZ-C9
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIw2-0008KS-B6
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:55 +0000
Date: Tue, 10 Dec 2013 08:44:54 +0000
Message-Id: <E1VqIw2-0008KS-B6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Fix ptr calculation when
	converting from a VA
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b3a75d8a744a01200c4dff2e46b69595d80bb496
Author:     Jean-Yves Migeon <jym@NetBSD.org>
AuthorDate: Mon Dec 9 14:30:29 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:30:29 2013 +0100

    Fix ptr calculation when converting from a VA
    
    The ptr calculation shall take the offset into the page into account
    when ptr is valid.
    
    Reported regression on NetBSD's port-xen with last known working libxen
    being rev 2.9. This corrupts the kernel symbol table when the table is
    not loaded on a page boundary.
    
    Issue was tracked down by FastIce and Jeff Rizzo. See also
    http://mail-index.netbsd.org/port-xen/2013/10/16/msg008088.html
    
    Signed-off-by: Jean-Yves Migeon <jym@NetBSD.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: cb08944a482a5e80a3ff1113f0735761cc4c6cb8
    master date: 2013-11-29 11:07:01 +0000
---
 tools/libxc/xc_dom.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index 86e23ee..91fbc1f 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -335,7 +335,7 @@ static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
     if ( ptr == NULL )
         return ptr;
     *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
-    return ptr;
+    return ptr + offset;
 }
 
 static inline xen_pfn_t xc_dom_p2m_host(struct xc_dom_image *dom, xen_pfn_t pfn)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:45: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 1VqIw8-0005L5-Qv; Tue, 10 Dec 2013 08:45:00 +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 1VqIw7-0005Kq-7X
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:59 +0000
Received: from [85.158.143.35:59899] by server-1.bemta-4.messagelabs.com id
	15/C1-02132-A84D6A25; Tue, 10 Dec 2013 08:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1386665095!4587170!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17449 invoked from network); 10 Dec 2013 08:44:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 08:44: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 1VqIw3-0005mZ-C9
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIw2-0008KS-B6
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:44:55 +0000
Date: Tue, 10 Dec 2013 08:44:54 +0000
Message-Id: <E1VqIw2-0008KS-B6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Fix ptr calculation when
	converting from a VA
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b3a75d8a744a01200c4dff2e46b69595d80bb496
Author:     Jean-Yves Migeon <jym@NetBSD.org>
AuthorDate: Mon Dec 9 14:30:29 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:30:29 2013 +0100

    Fix ptr calculation when converting from a VA
    
    The ptr calculation shall take the offset into the page into account
    when ptr is valid.
    
    Reported regression on NetBSD's port-xen with last known working libxen
    being rev 2.9. This corrupts the kernel symbol table when the table is
    not loaded on a page boundary.
    
    Issue was tracked down by FastIce and Jeff Rizzo. See also
    http://mail-index.netbsd.org/port-xen/2013/10/16/msg008088.html
    
    Signed-off-by: Jean-Yves Migeon <jym@NetBSD.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: cb08944a482a5e80a3ff1113f0735761cc4c6cb8
    master date: 2013-11-29 11:07:01 +0000
---
 tools/libxc/xc_dom.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index 86e23ee..91fbc1f 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -335,7 +335,7 @@ static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
     if ( ptr == NULL )
         return ptr;
     *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
-    return ptr;
+    return ptr + offset;
 }
 
 static inline xen_pfn_t xc_dom_p2m_host(struct xc_dom_image *dom, xen_pfn_t pfn)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:45: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 1VqIwI-0005N9-1b; Tue, 10 Dec 2013 08:45: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 1VqIwG-0005Ms-Q8
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:09 +0000
Received: from [85.158.139.211:25993] by server-14.bemta-5.messagelabs.com id
	83/39-24200-494D6A25; Tue, 10 Dec 2013 08:45:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1386665106!3428506!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16777 invoked from network); 10 Dec 2013 08:45:07 -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;
	10 Dec 2013 08:45: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 1VqIwD-0005nY-PX
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIwD-0008L1-KK
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:05 +0000
Date: Tue, 10 Dec 2013 08:45:05 +0000
Message-Id: <E1VqIwD-0008L1-KK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] nested vmx: fix I/O port bitmap
	indexing arithmetic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e45bf29ad84a6cb4a0a8f47f5efaaff61a288211
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Mon Dec 9 14:31:02 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:31:02 2013 +0100

    nested vmx: fix I/O port bitmap indexing arithmetic
    
    The I/O port bitmap holds 8 ports per element, and hence the port number
    used when indexing into it should be shifted right by 3 bits, not 4.
    
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Yang Zhang <yang.z.zhang@intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
    master commit: b80e4583501904297d2ff5b0f905e68f81f8f2c9
    master date: 2013-12-03 09:51:54 +0100
---
 xen/arch/x86/hvm/vmx/vvmx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 5c92ac6..9ce02cf 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -2213,7 +2213,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         {
             port = __vmread(EXIT_QUALIFICATION) >> 16;
             bitmap = nvmx->iobitmap[port >> 15];
-            if ( bitmap[(port & 0x7fff) >> 4] & (1 << (port & 0x7)) )
+            if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 0x7)) )
                 nvcpu->nv_vmexit_pending = 1;
             if ( !nvcpu->nv_vmexit_pending )
                gdprintk(XENLOG_WARNING, "L0 PIO %x.\n", port);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:45: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 1VqIwI-0005N9-1b; Tue, 10 Dec 2013 08:45: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 1VqIwG-0005Ms-Q8
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:09 +0000
Received: from [85.158.139.211:25993] by server-14.bemta-5.messagelabs.com id
	83/39-24200-494D6A25; Tue, 10 Dec 2013 08:45:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1386665106!3428506!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16777 invoked from network); 10 Dec 2013 08:45:07 -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;
	10 Dec 2013 08:45: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 1VqIwD-0005nY-PX
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIwD-0008L1-KK
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:05 +0000
Date: Tue, 10 Dec 2013 08:45:05 +0000
Message-Id: <E1VqIwD-0008L1-KK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] nested vmx: fix I/O port bitmap
	indexing arithmetic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e45bf29ad84a6cb4a0a8f47f5efaaff61a288211
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Mon Dec 9 14:31:02 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:31:02 2013 +0100

    nested vmx: fix I/O port bitmap indexing arithmetic
    
    The I/O port bitmap holds 8 ports per element, and hence the port number
    used when indexing into it should be shifted right by 3 bits, not 4.
    
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Yang Zhang <yang.z.zhang@intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
    master commit: b80e4583501904297d2ff5b0f905e68f81f8f2c9
    master date: 2013-12-03 09:51:54 +0100
---
 xen/arch/x86/hvm/vmx/vvmx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 5c92ac6..9ce02cf 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -2213,7 +2213,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         {
             port = __vmread(EXIT_QUALIFICATION) >> 16;
             bitmap = nvmx->iobitmap[port >> 15];
-            if ( bitmap[(port & 0x7fff) >> 4] & (1 << (port & 0x7)) )
+            if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 0x7)) )
                 nvcpu->nv_vmexit_pending = 1;
             if ( !nvcpu->nv_vmexit_pending )
                gdprintk(XENLOG_WARNING, "L0 PIO %x.\n", port);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08: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 1VqIwT-0005PL-7H; Tue, 10 Dec 2013 08:45: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 1VqIwR-0005P2-8O
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:19 +0000
Received: from [193.109.254.147:24775] by server-8.bemta-14.messagelabs.com id
	23/5C-30921-E94D6A25; Tue, 10 Dec 2013 08:45:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1386665116!4105667!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29100 invoked from network); 10 Dec 2013 08:45: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;
	10 Dec 2013 08:45: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 1VqIwO-0005ng-BA
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIwN-0008Lv-SI
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:16 +0000
Date: Tue, 10 Dec 2013 08:45:15 +0000
Message-Id: <E1VqIwN-0008Lv-SI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] fix locking in offline_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 82008c842e6fb015606541e92bff7b0db5537591
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Dec 9 14:31:40 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:31:40 2013 +0100

    fix locking in offline_page()
    
    Coverity ID 1055655
    
    Apart from the Coverity-detected lock order reversal (a domain's
    page_alloc_lock taken with the heap lock already held), calling
    put_page() with heap_lock is a bad idea too (as a possible descendant
    from put_page() is free_heap_pages(), which wants to take this very
    lock).
    
    From all I can tell the region over which heap_lock was held was far
    too large: All we need to protect are the call to mark_page_offline()
    and reserve_heap_page() (and I'd even put under question the need for
    the former). Hence by slightly re-arranging the if/else-if chain we
    can drop the lock much earlier, at once no longer covering the two
    put_page() invocations.
    
    Once at it, do a little bit of other cleanup: Put the "pod_replace"
    code path inline rather than at its own label, and drop the effectively
    unused variable "ret".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: d4837a56da4a59259dd0cf9f3bdc073159d81d7a
    master date: 2013-12-03 12:40:57 +0100
---
 xen/common/page_alloc.c |   39 ++++++++++++++++++---------------------
 1 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2162ef1..8176ad6 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -957,7 +957,6 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
 {
     unsigned long old_info = 0;
     struct domain *owner;
-    int ret = 0;
     struct page_info *pg;
 
     if ( !mfn_valid(mfn) )
@@ -1007,16 +1006,28 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( page_state_is(pg, offlined) )
     {
         reserve_heap_page(pg);
-        *status = PG_OFFLINE_OFFLINED;
+
+        spin_unlock(&heap_lock);
+
+        *status = broken ? PG_OFFLINE_OFFLINED | PG_OFFLINE_BROKEN
+                         : PG_OFFLINE_OFFLINED;
+        return 0;
     }
-    else if ( (owner = page_get_owner_and_reference(pg)) )
+
+    spin_unlock(&heap_lock);
+
+    if ( (owner = page_get_owner_and_reference(pg)) )
     {
         if ( p2m_pod_offline_or_broken_hit(pg) )
-            goto pod_replace;
+        {
+            put_page(pg);
+            p2m_pod_offline_or_broken_replace(pg);
+            *status = PG_OFFLINE_OFFLINED;
+        }
         else
         {
             *status = PG_OFFLINE_OWNED | PG_OFFLINE_PENDING |
-              (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
+                      (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
             /* Release the reference since it will not be allocated anymore */
             put_page(pg);
         }
@@ -1024,7 +1035,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     else if ( old_info & PGC_xen_heap )
     {
         *status = PG_OFFLINE_XENPAGE | PG_OFFLINE_PENDING |
-          (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
+                  (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
     }
     else
     {
@@ -1043,21 +1054,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( broken )
         *status |= PG_OFFLINE_BROKEN;
 
-    spin_unlock(&heap_lock);
-
-    return ret;
-
-pod_replace:
-    put_page(pg);
-    spin_unlock(&heap_lock);
-
-    p2m_pod_offline_or_broken_replace(pg);
-    *status = PG_OFFLINE_OFFLINED;
-
-    if ( broken )
-        *status |= PG_OFFLINE_BROKEN;
-
-    return ret;
+    return 0;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08: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 1VqIwT-0005PL-7H; Tue, 10 Dec 2013 08:45: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 1VqIwR-0005P2-8O
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:19 +0000
Received: from [193.109.254.147:24775] by server-8.bemta-14.messagelabs.com id
	23/5C-30921-E94D6A25; Tue, 10 Dec 2013 08:45:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1386665116!4105667!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29100 invoked from network); 10 Dec 2013 08:45: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;
	10 Dec 2013 08:45: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 1VqIwO-0005ng-BA
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIwN-0008Lv-SI
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:16 +0000
Date: Tue, 10 Dec 2013 08:45:15 +0000
Message-Id: <E1VqIwN-0008Lv-SI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] fix locking in offline_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 82008c842e6fb015606541e92bff7b0db5537591
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Dec 9 14:31:40 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:31:40 2013 +0100

    fix locking in offline_page()
    
    Coverity ID 1055655
    
    Apart from the Coverity-detected lock order reversal (a domain's
    page_alloc_lock taken with the heap lock already held), calling
    put_page() with heap_lock is a bad idea too (as a possible descendant
    from put_page() is free_heap_pages(), which wants to take this very
    lock).
    
    From all I can tell the region over which heap_lock was held was far
    too large: All we need to protect are the call to mark_page_offline()
    and reserve_heap_page() (and I'd even put under question the need for
    the former). Hence by slightly re-arranging the if/else-if chain we
    can drop the lock much earlier, at once no longer covering the two
    put_page() invocations.
    
    Once at it, do a little bit of other cleanup: Put the "pod_replace"
    code path inline rather than at its own label, and drop the effectively
    unused variable "ret".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: d4837a56da4a59259dd0cf9f3bdc073159d81d7a
    master date: 2013-12-03 12:40:57 +0100
---
 xen/common/page_alloc.c |   39 ++++++++++++++++++---------------------
 1 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2162ef1..8176ad6 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -957,7 +957,6 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
 {
     unsigned long old_info = 0;
     struct domain *owner;
-    int ret = 0;
     struct page_info *pg;
 
     if ( !mfn_valid(mfn) )
@@ -1007,16 +1006,28 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( page_state_is(pg, offlined) )
     {
         reserve_heap_page(pg);
-        *status = PG_OFFLINE_OFFLINED;
+
+        spin_unlock(&heap_lock);
+
+        *status = broken ? PG_OFFLINE_OFFLINED | PG_OFFLINE_BROKEN
+                         : PG_OFFLINE_OFFLINED;
+        return 0;
     }
-    else if ( (owner = page_get_owner_and_reference(pg)) )
+
+    spin_unlock(&heap_lock);
+
+    if ( (owner = page_get_owner_and_reference(pg)) )
     {
         if ( p2m_pod_offline_or_broken_hit(pg) )
-            goto pod_replace;
+        {
+            put_page(pg);
+            p2m_pod_offline_or_broken_replace(pg);
+            *status = PG_OFFLINE_OFFLINED;
+        }
         else
         {
             *status = PG_OFFLINE_OWNED | PG_OFFLINE_PENDING |
-              (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
+                      (owner->domain_id << PG_OFFLINE_OWNER_SHIFT);
             /* Release the reference since it will not be allocated anymore */
             put_page(pg);
         }
@@ -1024,7 +1035,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     else if ( old_info & PGC_xen_heap )
     {
         *status = PG_OFFLINE_XENPAGE | PG_OFFLINE_PENDING |
-          (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
+                  (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
     }
     else
     {
@@ -1043,21 +1054,7 @@ int offline_page(unsigned long mfn, int broken, uint32_t *status)
     if ( broken )
         *status |= PG_OFFLINE_BROKEN;
 
-    spin_unlock(&heap_lock);
-
-    return ret;
-
-pod_replace:
-    put_page(pg);
-    spin_unlock(&heap_lock);
-
-    p2m_pod_offline_or_broken_replace(pg);
-    *status = PG_OFFLINE_OFFLINED;
-
-    if ( broken )
-        *status |= PG_OFFLINE_BROKEN;
-
-    return ret;
+    return 0;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08: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 1VqIwd-0005Qx-Al; Tue, 10 Dec 2013 08:45: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 1VqIwb-0005Qk-G2
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:29 +0000
Received: from [85.158.137.68:24707] by server-14.bemta-3.messagelabs.com id
	72/C2-06105-8A4D6A25; Tue, 10 Dec 2013 08:45:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1386665126!2862698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19759 invoked from network); 10 Dec 2013 08:45:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 08:45: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 1VqIwY-0005nm-Gp
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIwY-0008MH-Em
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:26 +0000
Date: Tue, 10 Dec 2013 08:45:26 +0000
Message-Id: <E1VqIwY-0008MH-Em@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] nested VMX: fix I/O port exit
	emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5fff433162d9b48c3bb94f2b453f45176a39eb5f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Dec 9 14:32:16 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:32:16 2013 +0100

    nested VMX: fix I/O port exit emulation
    
    For multi-byte operations all affected ports' bits in the bitmap need
    to be checked, not just the first port's one.
    
    Reported-by: Matthew Daley <mattd@bugfuzz.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
    master commit: e1978480c76e36bc22ec12657121ac91d08aca6b
    master date: 2013-12-04 13:23:27 +0100
---
 xen/arch/x86/hvm/vmx/vvmx.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 9ce02cf..5f07fbb 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -2127,8 +2127,6 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     u32 ctrl;
-    u16 port;
-    u8 *bitmap;
 
     nvcpu->nv_vmexit_pending = 0;
     nvmx->intr.intr_info = 0;
@@ -2211,12 +2209,22 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         ctrl = __n2_exec_control(v);
         if ( ctrl & CPU_BASED_ACTIVATE_IO_BITMAP )
         {
-            port = __vmread(EXIT_QUALIFICATION) >> 16;
-            bitmap = nvmx->iobitmap[port >> 15];
-            if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 0x7)) )
-                nvcpu->nv_vmexit_pending = 1;
+            unsigned long qual = __vmread(EXIT_QUALIFICATION);
+            u16 port = qual >> 16;
+            u16 size = (qual & 7) + 1;
+
+            do {
+                const u8 *bitmap = nvmx->iobitmap[port >> 15];
+
+                if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 7)) )
+                    nvcpu->nv_vmexit_pending = 1;
+                if ( !--size )
+                    break;
+                if ( !++port )
+                    nvcpu->nv_vmexit_pending = 1;
+            } while ( !nvcpu->nv_vmexit_pending );
             if ( !nvcpu->nv_vmexit_pending )
-               gdprintk(XENLOG_WARNING, "L0 PIO %x.\n", port);
+                printk(XENLOG_G_WARNING "L0 PIO %04x\n", port);
         }
         else if ( ctrl & CPU_BASED_UNCOND_IO_EXITING )
             nvcpu->nv_vmexit_pending = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08: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 1VqIwd-0005Qx-Al; Tue, 10 Dec 2013 08:45: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 1VqIwb-0005Qk-G2
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:29 +0000
Received: from [85.158.137.68:24707] by server-14.bemta-3.messagelabs.com id
	72/C2-06105-8A4D6A25; Tue, 10 Dec 2013 08:45:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1386665126!2862698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19759 invoked from network); 10 Dec 2013 08:45:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 08:45: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 1VqIwY-0005nm-Gp
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIwY-0008MH-Em
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:26 +0000
Date: Tue, 10 Dec 2013 08:45:26 +0000
Message-Id: <E1VqIwY-0008MH-Em@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] nested VMX: fix I/O port exit
	emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5fff433162d9b48c3bb94f2b453f45176a39eb5f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Dec 9 14:32:16 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:32:16 2013 +0100

    nested VMX: fix I/O port exit emulation
    
    For multi-byte operations all affected ports' bits in the bitmap need
    to be checked, not just the first port's one.
    
    Reported-by: Matthew Daley <mattd@bugfuzz.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
    master commit: e1978480c76e36bc22ec12657121ac91d08aca6b
    master date: 2013-12-04 13:23:27 +0100
---
 xen/arch/x86/hvm/vmx/vvmx.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 9ce02cf..5f07fbb 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -2127,8 +2127,6 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     u32 ctrl;
-    u16 port;
-    u8 *bitmap;
 
     nvcpu->nv_vmexit_pending = 0;
     nvmx->intr.intr_info = 0;
@@ -2211,12 +2209,22 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         ctrl = __n2_exec_control(v);
         if ( ctrl & CPU_BASED_ACTIVATE_IO_BITMAP )
         {
-            port = __vmread(EXIT_QUALIFICATION) >> 16;
-            bitmap = nvmx->iobitmap[port >> 15];
-            if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 0x7)) )
-                nvcpu->nv_vmexit_pending = 1;
+            unsigned long qual = __vmread(EXIT_QUALIFICATION);
+            u16 port = qual >> 16;
+            u16 size = (qual & 7) + 1;
+
+            do {
+                const u8 *bitmap = nvmx->iobitmap[port >> 15];
+
+                if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 7)) )
+                    nvcpu->nv_vmexit_pending = 1;
+                if ( !--size )
+                    break;
+                if ( !++port )
+                    nvcpu->nv_vmexit_pending = 1;
+            } while ( !nvcpu->nv_vmexit_pending );
             if ( !nvcpu->nv_vmexit_pending )
-               gdprintk(XENLOG_WARNING, "L0 PIO %x.\n", port);
+                printk(XENLOG_G_WARNING "L0 PIO %04x\n", port);
         }
         else if ( ctrl & CPU_BASED_UNCOND_IO_EXITING )
             nvcpu->nv_vmexit_pending = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:45: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 1VqIwm-0005Sh-DV; Tue, 10 Dec 2013 08:45: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 1VqIwl-0005SV-8d
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:39 +0000
Received: from [85.158.139.211:49095] by server-9.bemta-5.messagelabs.com id
	EC/2E-15098-2B4D6A25; Tue, 10 Dec 2013 08:45:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1386665136!3428673!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20513 invoked from network); 10 Dec 2013 08:45:37 -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;
	10 Dec 2013 08:45: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 1VqIwi-0005nx-MA
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIwi-0008Mk-KC
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:36 +0000
Date: Tue, 10 Dec 2013 08:45:36 +0000
Message-Id: <E1VqIwi-0008Mk-KC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: fix early boot command line
	parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd279948564daedb4e19673f50e71729e01f39c2
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Mon Dec 9 14:32:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:32:54 2013 +0100

    x86: fix early boot command line parsing
    
    There is no reliable way to encode NUL character as a character so encode
    it as a number. Read: http://sourceware.org/binutils/docs/as/Characters.html.
    Octal and hex encoding do not work on at least one system (GNU assembler
    version 2.22 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.22).
    Without this fix e.g. no-real-mode option at the end of xen.gz command line
    is not detected.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: dc37e0bfffc673f4bdce1d69ad86098bfb0ab531
    master date: 2013-12-04 13:26:37 +0100
---
 xen/arch/x86/boot/cmdline.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/cmdline.S b/xen/arch/x86/boot/cmdline.S
index 05ffb94..e1f4595 100644
--- a/xen/arch/x86/boot/cmdline.S
+++ b/xen/arch/x86/boot/cmdline.S
@@ -138,7 +138,8 @@
         call    .Lstrlen
         add     $4,%esp
         xadd    %eax,%ebx
-        cmpb    $'\0',(%ebx)
+        /* NUL check (as $'\0' == 0x30 in GAS) */
+        cmpb    $0,(%ebx)
         je      3f
         cmpb    $' ',(%ebx)
         je      3f
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:45: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 1VqIwm-0005Sh-DV; Tue, 10 Dec 2013 08:45: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 1VqIwl-0005SV-8d
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:39 +0000
Received: from [85.158.139.211:49095] by server-9.bemta-5.messagelabs.com id
	EC/2E-15098-2B4D6A25; Tue, 10 Dec 2013 08:45:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1386665136!3428673!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20513 invoked from network); 10 Dec 2013 08:45:37 -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;
	10 Dec 2013 08:45: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 1VqIwi-0005nx-MA
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIwi-0008Mk-KC
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:36 +0000
Date: Tue, 10 Dec 2013 08:45:36 +0000
Message-Id: <E1VqIwi-0008Mk-KC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: fix early boot command line
	parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd279948564daedb4e19673f50e71729e01f39c2
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Mon Dec 9 14:32:54 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:32:54 2013 +0100

    x86: fix early boot command line parsing
    
    There is no reliable way to encode NUL character as a character so encode
    it as a number. Read: http://sourceware.org/binutils/docs/as/Characters.html.
    Octal and hex encoding do not work on at least one system (GNU assembler
    version 2.22 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.22).
    Without this fix e.g. no-real-mode option at the end of xen.gz command line
    is not detected.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: dc37e0bfffc673f4bdce1d69ad86098bfb0ab531
    master date: 2013-12-04 13:26:37 +0100
---
 xen/arch/x86/boot/cmdline.S |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/cmdline.S b/xen/arch/x86/boot/cmdline.S
index 05ffb94..e1f4595 100644
--- a/xen/arch/x86/boot/cmdline.S
+++ b/xen/arch/x86/boot/cmdline.S
@@ -138,7 +138,8 @@
         call    .Lstrlen
         add     $4,%esp
         xadd    %eax,%ebx
-        cmpb    $'\0',(%ebx)
+        /* NUL check (as $'\0' == 0x30 in GAS) */
+        cmpb    $0,(%ebx)
         je      3f
         cmpb    $' ',(%ebx)
         je      3f
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:45: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 1VqIww-0005UM-GR; Tue, 10 Dec 2013 08:45:50 +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 1VqIwv-0005UE-Ku
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:49 +0000
Received: from [85.158.143.35:7761] by server-2.bemta-4.messagelabs.com id
	3D/4C-11386-CB4D6A25; Tue, 10 Dec 2013 08:45:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1386665147!4571326!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27811 invoked from network); 10 Dec 2013 08:45:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 08:45: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 1VqIws-0005o3-RT
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIws-0008N6-Pl
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:46 +0000
Date: Tue, 10 Dec 2013 08:45:46 +0000
Message-Id: <E1VqIws-0008N6-Pl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Nested VMX: CR emulation fix up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6a64987e1176e69eadfa91b9be23479991e6aeb5
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Mon Dec 9 14:33:33 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:33:33 2013 +0100

    Nested VMX: CR emulation fix up
    
    This patch fixs two issues:
    1. The CR_READ_SHADOW should only cover the value that L2 wirtes to
    CR when L2 is running. But currently, L0 wirtes wrong value to
    it during virtual vmentry and L2's CR access emualtion.
    
    2. L2 changed cr[0/4] in a way that did not change any of L1's shadowed
    bits, but did change L0 shadowed bits. In this case, the effective cr[0/4]
    value that L1 would like to write into the hardware is consist of
    the L2-owned bits from the new value combined with the L1-owned bits
    from L1's guest cr[0/4].
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
    master commit: ef17e127c4111d8e01fe208495d83d15e8834cce
    master date: 2013-12-06 11:08:20 +0100
---
 xen/arch/x86/hvm/hvm.c              |   13 +++++++---
 xen/arch/x86/hvm/vmx/vmx.c          |   13 ++++++++-
 xen/arch/x86/hvm/vmx/vvmx.c         |   44 +++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/hvm/nestedhvm.h |    8 ++++++
 xen/include/asm-x86/hvm/vcpu.h      |    3 ++
 xen/include/asm-x86/hvm/vmx/vvmx.h  |    1 +
 6 files changed, 76 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a4d7af0..7efa274 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1745,6 +1745,13 @@ void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value)
     }
 }
 
+static void hvm_update_cr(struct vcpu *v, unsigned int cr, unsigned long value)
+{
+    v->arch.hvm_vcpu.guest_cr[cr] = value;
+    nestedhvm_set_cr(v, cr, value);
+    hvm_update_guest_cr(v, cr);
+}
+
 int hvm_set_cr0(unsigned long value)
 {
     struct vcpu *v = current;
@@ -1840,8 +1847,7 @@ int hvm_set_cr0(unsigned long value)
            hvm_funcs.handle_cd )
         hvm_funcs.handle_cd(v, value);
 
-    v->arch.hvm_vcpu.guest_cr[0] = value;
-    hvm_update_guest_cr(v, 0);
+    hvm_update_cr(v, 0, value);
 
     if ( (value ^ old_value) & X86_CR0_PG ) {
         if ( !nestedhvm_vmswitch_in_progress(v) && nestedhvm_vcpu_in_guestmode(v) )
@@ -1922,8 +1928,7 @@ int hvm_set_cr4(unsigned long value)
         goto gpf;
     }
 
-    v->arch.hvm_vcpu.guest_cr[4] = value;
-    hvm_update_guest_cr(v, 4);
+    hvm_update_cr(v, 4, value);
     hvm_memory_event_cr4(value, old_cr);
 
     /*
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 32751d2..9346a54 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1156,6 +1156,11 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             vmx_update_cpu_exec_control(v);
         }
 
+        if ( !nestedhvm_vcpu_in_guestmode(v) )
+            __vmwrite(CR0_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[0]);
+        else
+            nvmx_set_cr_read_shadow(v, 0);
+
         if ( !(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_TS) )
         {
             if ( v != current )
@@ -1204,7 +1209,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         v->arch.hvm_vcpu.hw_cr[0] =
             v->arch.hvm_vcpu.guest_cr[0] | hw_cr0_mask;
         __vmwrite(GUEST_CR0, v->arch.hvm_vcpu.hw_cr[0]);
-        __vmwrite(CR0_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[0]);
 
         /* Changing CR0 can change some bits in real CR4. */
         vmx_update_guest_cr(v, 4);
@@ -1229,6 +1233,12 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         v->arch.hvm_vcpu.hw_cr[4] = HVM_CR4_HOST_MASK;
         if ( paging_mode_hap(v->domain) )
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+
+        if ( !nestedhvm_vcpu_in_guestmode(v) )
+            __vmwrite(CR4_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[4]);
+        else
+            nvmx_set_cr_read_shadow(v, 4);
+
         v->arch.hvm_vcpu.hw_cr[4] |= v->arch.hvm_vcpu.guest_cr[4];
         if ( v->arch.hvm_vmx.vmx_realmode ) 
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_VME;
@@ -1248,7 +1258,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
         __vmwrite(GUEST_CR4, v->arch.hvm_vcpu.hw_cr[4]);
-        __vmwrite(CR4_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[4]);
         break;
     default:
         BUG();
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 5f07fbb..fd841ae 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1047,6 +1047,8 @@ static void load_shadow_guest_state(struct vcpu *v)
     vvmcs_to_shadow_bulk(v, ARRAY_SIZE(vmcs_gstate_field),
                          vmcs_gstate_field);
 
+    nvcpu->guest_cr[0] = __get_vvmcs(vvmcs, CR0_READ_SHADOW);
+    nvcpu->guest_cr[4] = __get_vvmcs(vvmcs, CR4_READ_SHADOW);
     hvm_set_cr0(__get_vvmcs(vvmcs, GUEST_CR0));
     hvm_set_cr4(__get_vvmcs(vvmcs, GUEST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, GUEST_CR3));
@@ -2447,3 +2449,45 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     return ( nvcpu->nv_vmexit_pending == 1 );
 }
 
+void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int cr)
+{
+    unsigned long cr_field, read_shadow_field, mask_field;
+
+    switch ( cr )
+    {
+    case 0:
+        cr_field = GUEST_CR0;
+        read_shadow_field = CR0_READ_SHADOW;
+        mask_field = CR0_GUEST_HOST_MASK;
+        break;
+    case 4:
+        cr_field = GUEST_CR4;
+        read_shadow_field = CR4_READ_SHADOW;
+        mask_field = CR4_GUEST_HOST_MASK;
+        break;
+    default:
+        gdprintk(XENLOG_WARNING, "Set read shadow for CR%d.\n", cr);
+        return;
+    }
+
+    if ( !nestedhvm_vmswitch_in_progress(v) )
+    {
+        unsigned long virtual_cr_mask =
+            __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, mask_field);
+
+        /*
+         * We get here when L2 changed cr in a way that did not change
+         * any of L1's shadowed bits (see nvmx_n2_vmexit_handler),
+         * but did change L0 shadowed bits. So we first calculate the
+         * effective cr value that L1 would like to write into the
+         * hardware. It consists of the L2-owned bits from the new
+         * value combined with the L1-owned bits from L1's guest cr.
+         */
+        v->arch.hvm_vcpu.guest_cr[cr] &= ~virtual_cr_mask;
+        v->arch.hvm_vcpu.guest_cr[cr] |= virtual_cr_mask &
+            __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, cr_field);
+    }
+
+    /* nvcpu.guest_cr is what L2 write to cr actually. */
+    __vmwrite(read_shadow_field, v->arch.hvm_vcpu.nvcpu.guest_cr[cr]);
+}
diff --git a/xen/include/asm-x86/hvm/nestedhvm.h b/xen/include/asm-x86/hvm/nestedhvm.h
index 649c511..d8124cf 100644
--- a/xen/include/asm-x86/hvm/nestedhvm.h
+++ b/xen/include/asm-x86/hvm/nestedhvm.h
@@ -68,4 +68,12 @@ void nestedhvm_vmcx_flushtlb(struct p2m_domain *p2m);
 
 bool_t nestedhvm_is_n2(struct vcpu *v);
 
+static inline void nestedhvm_set_cr(struct vcpu *v, unsigned int cr,
+                                    unsigned long value)
+{
+    if ( !nestedhvm_vmswitch_in_progress(v) &&
+         nestedhvm_vcpu_in_guestmode(v) )
+        v->arch.hvm_vcpu.nvcpu.guest_cr[cr] = value;
+}
+
 #endif /* _HVM_NESTEDHVM_H */
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index caf5f9a..2a5e134 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -102,6 +102,9 @@ struct nestedvcpu {
      */
     bool_t nv_ioport80;
     bool_t nv_ioportED;
+
+    /* L2's control-resgister, just as the L2 sees them. */
+    unsigned long       guest_cr[5];
 };
 
 #define vcpu_nestedhvm(v) ((v)->arch.hvm_vcpu.nvcpu)
diff --git a/xen/include/asm-x86/hvm/vmx/vvmx.h b/xen/include/asm-x86/hvm/vmx/vvmx.h
index 848be75..c17a440 100644
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h
@@ -223,6 +223,7 @@ void nvmx_idtv_handling(void);
 u64 nvmx_get_tsc_offset(struct vcpu *v);
 int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                           unsigned int exit_reason);
+void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int cr);
 
 uint64_t nept_get_ept_vpid_cap(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:45:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:45: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 1VqIww-0005UM-GR; Tue, 10 Dec 2013 08:45:50 +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 1VqIwv-0005UE-Ku
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:49 +0000
Received: from [85.158.143.35:7761] by server-2.bemta-4.messagelabs.com id
	3D/4C-11386-CB4D6A25; Tue, 10 Dec 2013 08:45:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1386665147!4571326!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27811 invoked from network); 10 Dec 2013 08:45:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 08:45: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 1VqIws-0005o3-RT
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIws-0008N6-Pl
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:46 +0000
Date: Tue, 10 Dec 2013 08:45:46 +0000
Message-Id: <E1VqIws-0008N6-Pl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Nested VMX: CR emulation fix up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6a64987e1176e69eadfa91b9be23479991e6aeb5
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Mon Dec 9 14:33:33 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:33:33 2013 +0100

    Nested VMX: CR emulation fix up
    
    This patch fixs two issues:
    1. The CR_READ_SHADOW should only cover the value that L2 wirtes to
    CR when L2 is running. But currently, L0 wirtes wrong value to
    it during virtual vmentry and L2's CR access emualtion.
    
    2. L2 changed cr[0/4] in a way that did not change any of L1's shadowed
    bits, but did change L0 shadowed bits. In this case, the effective cr[0/4]
    value that L1 would like to write into the hardware is consist of
    the L2-owned bits from the new value combined with the L1-owned bits
    from L1's guest cr[0/4].
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
    master commit: ef17e127c4111d8e01fe208495d83d15e8834cce
    master date: 2013-12-06 11:08:20 +0100
---
 xen/arch/x86/hvm/hvm.c              |   13 +++++++---
 xen/arch/x86/hvm/vmx/vmx.c          |   13 ++++++++-
 xen/arch/x86/hvm/vmx/vvmx.c         |   44 +++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/hvm/nestedhvm.h |    8 ++++++
 xen/include/asm-x86/hvm/vcpu.h      |    3 ++
 xen/include/asm-x86/hvm/vmx/vvmx.h  |    1 +
 6 files changed, 76 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a4d7af0..7efa274 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1745,6 +1745,13 @@ void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value)
     }
 }
 
+static void hvm_update_cr(struct vcpu *v, unsigned int cr, unsigned long value)
+{
+    v->arch.hvm_vcpu.guest_cr[cr] = value;
+    nestedhvm_set_cr(v, cr, value);
+    hvm_update_guest_cr(v, cr);
+}
+
 int hvm_set_cr0(unsigned long value)
 {
     struct vcpu *v = current;
@@ -1840,8 +1847,7 @@ int hvm_set_cr0(unsigned long value)
            hvm_funcs.handle_cd )
         hvm_funcs.handle_cd(v, value);
 
-    v->arch.hvm_vcpu.guest_cr[0] = value;
-    hvm_update_guest_cr(v, 0);
+    hvm_update_cr(v, 0, value);
 
     if ( (value ^ old_value) & X86_CR0_PG ) {
         if ( !nestedhvm_vmswitch_in_progress(v) && nestedhvm_vcpu_in_guestmode(v) )
@@ -1922,8 +1928,7 @@ int hvm_set_cr4(unsigned long value)
         goto gpf;
     }
 
-    v->arch.hvm_vcpu.guest_cr[4] = value;
-    hvm_update_guest_cr(v, 4);
+    hvm_update_cr(v, 4, value);
     hvm_memory_event_cr4(value, old_cr);
 
     /*
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 32751d2..9346a54 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1156,6 +1156,11 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             vmx_update_cpu_exec_control(v);
         }
 
+        if ( !nestedhvm_vcpu_in_guestmode(v) )
+            __vmwrite(CR0_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[0]);
+        else
+            nvmx_set_cr_read_shadow(v, 0);
+
         if ( !(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_TS) )
         {
             if ( v != current )
@@ -1204,7 +1209,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         v->arch.hvm_vcpu.hw_cr[0] =
             v->arch.hvm_vcpu.guest_cr[0] | hw_cr0_mask;
         __vmwrite(GUEST_CR0, v->arch.hvm_vcpu.hw_cr[0]);
-        __vmwrite(CR0_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[0]);
 
         /* Changing CR0 can change some bits in real CR4. */
         vmx_update_guest_cr(v, 4);
@@ -1229,6 +1233,12 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         v->arch.hvm_vcpu.hw_cr[4] = HVM_CR4_HOST_MASK;
         if ( paging_mode_hap(v->domain) )
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+
+        if ( !nestedhvm_vcpu_in_guestmode(v) )
+            __vmwrite(CR4_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[4]);
+        else
+            nvmx_set_cr_read_shadow(v, 4);
+
         v->arch.hvm_vcpu.hw_cr[4] |= v->arch.hvm_vcpu.guest_cr[4];
         if ( v->arch.hvm_vmx.vmx_realmode ) 
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_VME;
@@ -1248,7 +1258,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
         __vmwrite(GUEST_CR4, v->arch.hvm_vcpu.hw_cr[4]);
-        __vmwrite(CR4_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[4]);
         break;
     default:
         BUG();
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 5f07fbb..fd841ae 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1047,6 +1047,8 @@ static void load_shadow_guest_state(struct vcpu *v)
     vvmcs_to_shadow_bulk(v, ARRAY_SIZE(vmcs_gstate_field),
                          vmcs_gstate_field);
 
+    nvcpu->guest_cr[0] = __get_vvmcs(vvmcs, CR0_READ_SHADOW);
+    nvcpu->guest_cr[4] = __get_vvmcs(vvmcs, CR4_READ_SHADOW);
     hvm_set_cr0(__get_vvmcs(vvmcs, GUEST_CR0));
     hvm_set_cr4(__get_vvmcs(vvmcs, GUEST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, GUEST_CR3));
@@ -2447,3 +2449,45 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
     return ( nvcpu->nv_vmexit_pending == 1 );
 }
 
+void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int cr)
+{
+    unsigned long cr_field, read_shadow_field, mask_field;
+
+    switch ( cr )
+    {
+    case 0:
+        cr_field = GUEST_CR0;
+        read_shadow_field = CR0_READ_SHADOW;
+        mask_field = CR0_GUEST_HOST_MASK;
+        break;
+    case 4:
+        cr_field = GUEST_CR4;
+        read_shadow_field = CR4_READ_SHADOW;
+        mask_field = CR4_GUEST_HOST_MASK;
+        break;
+    default:
+        gdprintk(XENLOG_WARNING, "Set read shadow for CR%d.\n", cr);
+        return;
+    }
+
+    if ( !nestedhvm_vmswitch_in_progress(v) )
+    {
+        unsigned long virtual_cr_mask =
+            __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, mask_field);
+
+        /*
+         * We get here when L2 changed cr in a way that did not change
+         * any of L1's shadowed bits (see nvmx_n2_vmexit_handler),
+         * but did change L0 shadowed bits. So we first calculate the
+         * effective cr value that L1 would like to write into the
+         * hardware. It consists of the L2-owned bits from the new
+         * value combined with the L1-owned bits from L1's guest cr.
+         */
+        v->arch.hvm_vcpu.guest_cr[cr] &= ~virtual_cr_mask;
+        v->arch.hvm_vcpu.guest_cr[cr] |= virtual_cr_mask &
+            __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, cr_field);
+    }
+
+    /* nvcpu.guest_cr is what L2 write to cr actually. */
+    __vmwrite(read_shadow_field, v->arch.hvm_vcpu.nvcpu.guest_cr[cr]);
+}
diff --git a/xen/include/asm-x86/hvm/nestedhvm.h b/xen/include/asm-x86/hvm/nestedhvm.h
index 649c511..d8124cf 100644
--- a/xen/include/asm-x86/hvm/nestedhvm.h
+++ b/xen/include/asm-x86/hvm/nestedhvm.h
@@ -68,4 +68,12 @@ void nestedhvm_vmcx_flushtlb(struct p2m_domain *p2m);
 
 bool_t nestedhvm_is_n2(struct vcpu *v);
 
+static inline void nestedhvm_set_cr(struct vcpu *v, unsigned int cr,
+                                    unsigned long value)
+{
+    if ( !nestedhvm_vmswitch_in_progress(v) &&
+         nestedhvm_vcpu_in_guestmode(v) )
+        v->arch.hvm_vcpu.nvcpu.guest_cr[cr] = value;
+}
+
 #endif /* _HVM_NESTEDHVM_H */
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index caf5f9a..2a5e134 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -102,6 +102,9 @@ struct nestedvcpu {
      */
     bool_t nv_ioport80;
     bool_t nv_ioportED;
+
+    /* L2's control-resgister, just as the L2 sees them. */
+    unsigned long       guest_cr[5];
 };
 
 #define vcpu_nestedhvm(v) ((v)->arch.hvm_vcpu.nvcpu)
diff --git a/xen/include/asm-x86/hvm/vmx/vvmx.h b/xen/include/asm-x86/hvm/vmx/vvmx.h
index 848be75..c17a440 100644
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h
@@ -223,6 +223,7 @@ void nvmx_idtv_handling(void);
 u64 nvmx_get_tsc_offset(struct vcpu *v);
 int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                           unsigned int exit_reason);
+void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int cr);
 
 uint64_t nept_get_ept_vpid_cap(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:46:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:46: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 1VqIx6-0005WA-JF; Tue, 10 Dec 2013 08:46: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 1VqIx5-0005Vw-Nc
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:59 +0000
Received: from [85.158.139.211:54946] by server-12.bemta-5.messagelabs.com id
	FE/91-30017-7C4D6A25; Tue, 10 Dec 2013 08:45:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1386665157!3413296!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14763 invoked from network); 10 Dec 2013 08:45:58 -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;
	10 Dec 2013 08:45: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 1VqIx2-0005oF-WF
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIx2-0008NS-UJ
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:56 +0000
Date: Tue, 10 Dec 2013 08:45:56 +0000
Message-Id: <E1VqIx2-0008NS-UJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/boot: fix BIOS memory
	corruption on certain IBM 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 68903c912ebf25843bae8ce372f4c875681be824
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 9 14:34:24 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:34:24 2013 +0100

    x86/boot: fix BIOS memory corruption on certain IBM systems
    
    IBM System x3530 M4 BIOSes (including the latest available at the time of this
    patch) will corrupt a byte at physical address 0x105ff1 to the value of 0x86
    if %esp has the value 0x00080000 when issuing an `int $0x15 (ax=0xec00)` to
    inform the system about our intended operating mode.
    
    Xen gets unhappy when the bootloader has placed it's .text section in over
    this specific region of RAM.
    
    After dropping into 16bit mode, clear all 32 bits of %esp, and for the BIOS
    call already documented to be affected by BIOS bugs clear all GPRs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ed76797439e384de18fcd6810bd4743d4f38b1e
    master date: 2013-12-06 11:28:00 +0100
---
 xen/arch/x86/boot/trampoline.S |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index f84ce2a..1f00449 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -147,7 +147,7 @@ trampoline_boot_cpu_entry:
         mov     %ax,%ss
 
         /* Initialise stack pointer and IDT, and enable irqs. */
-        xor     %sp,%sp
+        xor     %esp,%esp
         lidt    bootsym(rm_idt)
         sti
 
@@ -155,6 +155,11 @@ trampoline_boot_cpu_entry:
          * Declare that our target operating mode is long mode.
          * Initialise 32-bit registers since some buggy BIOSes depend on it.
          */
+        xor     %ecx,%ecx
+        xor     %edx,%edx
+        xor     %esi,%esi
+        xor     %edi,%edi
+        xor     %ebp,%ebp
         movl    $0xec00,%eax      # declare target operating mode
         movl    $0x0002,%ebx      # long mode
         int     $0x15
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 08:46:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 08:46: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 1VqIx6-0005WA-JF; Tue, 10 Dec 2013 08:46: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 1VqIx5-0005Vw-Nc
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:59 +0000
Received: from [85.158.139.211:54946] by server-12.bemta-5.messagelabs.com id
	FE/91-30017-7C4D6A25; Tue, 10 Dec 2013 08:45:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1386665157!3413296!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14763 invoked from network); 10 Dec 2013 08:45:58 -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;
	10 Dec 2013 08:45: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 1VqIx2-0005oF-WF
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqIx2-0008NS-UJ
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 08:45:56 +0000
Date: Tue, 10 Dec 2013 08:45:56 +0000
Message-Id: <E1VqIx2-0008NS-UJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/boot: fix BIOS memory
	corruption on certain IBM 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 68903c912ebf25843bae8ce372f4c875681be824
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 9 14:34:24 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:34:24 2013 +0100

    x86/boot: fix BIOS memory corruption on certain IBM systems
    
    IBM System x3530 M4 BIOSes (including the latest available at the time of this
    patch) will corrupt a byte at physical address 0x105ff1 to the value of 0x86
    if %esp has the value 0x00080000 when issuing an `int $0x15 (ax=0xec00)` to
    inform the system about our intended operating mode.
    
    Xen gets unhappy when the bootloader has placed it's .text section in over
    this specific region of RAM.
    
    After dropping into 16bit mode, clear all 32 bits of %esp, and for the BIOS
    call already documented to be affected by BIOS bugs clear all GPRs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ed76797439e384de18fcd6810bd4743d4f38b1e
    master date: 2013-12-06 11:28:00 +0100
---
 xen/arch/x86/boot/trampoline.S |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index f84ce2a..1f00449 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -147,7 +147,7 @@ trampoline_boot_cpu_entry:
         mov     %ax,%ss
 
         /* Initialise stack pointer and IDT, and enable irqs. */
-        xor     %sp,%sp
+        xor     %esp,%esp
         lidt    bootsym(rm_idt)
         sti
 
@@ -155,6 +155,11 @@ trampoline_boot_cpu_entry:
          * Declare that our target operating mode is long mode.
          * Initialise 32-bit registers since some buggy BIOSes depend on it.
          */
+        xor     %ecx,%ecx
+        xor     %edx,%edx
+        xor     %esi,%esi
+        xor     %edi,%edi
+        xor     %ebp,%ebp
         movl    $0xec00,%eax      # declare target operating mode
         movl    $0x0002,%ebx      # long mode
         int     $0x15
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Tue Dec 10 13:11:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11: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 1VqN5f-0001qG-LB; Tue, 10 Dec 2013 13:11:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN5d-0001pp-WE
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:06 +0000
Received: from [85.158.143.35:54356] by server-3.bemta-4.messagelabs.com id
	8E/8B-32360-9E217A25; Tue, 10 Dec 2013 13:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1386681063!4663739!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13606 invoked from network); 10 Dec 2013 13:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:11: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 1VqN5b-0000It-JP
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN5b-0007oG-Go
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:03 +0000
Date: Tue, 10 Dec 2013 13:11:03 +0000
Message-Id: <E1VqN5b-0007oG-Go@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] defer the domain mapping in
	scrub_one_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7dd4f9da063cb2cd43426c785535534c9d958ce5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 9 14:13:23 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:13:23 2013 +0100

    defer the domain mapping in scrub_one_page()
    
    This avoids a resource leak and needless playing with the pagetables in the
    case that the page is broken.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <JBeulich@suse.com>
    Reviewed-by: Keir Fraser <keir@xen.org>
---
 xen/common/page_alloc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 8002bd2..5f484a2 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1652,11 +1652,13 @@ __initcall(pagealloc_keyhandler_init);
 
 void scrub_one_page(struct page_info *pg)
 {
-    void *p = __map_domain_page(pg);
+    void *p;
 
     if ( unlikely(pg->count_info & PGC_broken) )
         return;
 
+    p = __map_domain_page(pg);
+
 #ifndef NDEBUG
     /* Avoid callers relying on allocations returning zeroed pages. */
     memset(p, 0xc2, PAGE_SIZE);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:11:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11: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 1VqN5f-0001qG-LB; Tue, 10 Dec 2013 13:11:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN5d-0001pp-WE
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:06 +0000
Received: from [85.158.143.35:54356] by server-3.bemta-4.messagelabs.com id
	8E/8B-32360-9E217A25; Tue, 10 Dec 2013 13:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1386681063!4663739!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13606 invoked from network); 10 Dec 2013 13:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:11: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 1VqN5b-0000It-JP
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN5b-0007oG-Go
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:03 +0000
Date: Tue, 10 Dec 2013 13:11:03 +0000
Message-Id: <E1VqN5b-0007oG-Go@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] defer the domain mapping in
	scrub_one_page()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7dd4f9da063cb2cd43426c785535534c9d958ce5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Dec 9 14:13:23 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:13:23 2013 +0100

    defer the domain mapping in scrub_one_page()
    
    This avoids a resource leak and needless playing with the pagetables in the
    case that the page is broken.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <JBeulich@suse.com>
    Reviewed-by: Keir Fraser <keir@xen.org>
---
 xen/common/page_alloc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 8002bd2..5f484a2 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1652,11 +1652,13 @@ __initcall(pagealloc_keyhandler_init);
 
 void scrub_one_page(struct page_info *pg)
 {
-    void *p = __map_domain_page(pg);
+    void *p;
 
     if ( unlikely(pg->count_info & PGC_broken) )
         return;
 
+    p = __map_domain_page(pg);
+
 #ifndef NDEBUG
     /* Avoid callers relying on allocations returning zeroed pages. */
     memset(p, 0xc2, PAGE_SIZE);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:11:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VqN5p-0001rg-O0; Tue, 10 Dec 2013 13:11:17 +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 1VqN5o-0001rP-Di
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:16 +0000
Received: from [193.109.254.147:31736] by server-14.bemta-14.messagelabs.com
	id 20/4E-12628-3F217A25; Tue, 10 Dec 2013 13:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386681074!4140638!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27414 invoked from network); 10 Dec 2013 13:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:11: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 1VqN5m-0000Iz-0f
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN5l-0007oe-Ne
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:13 +0000
Date: Tue, 10 Dec 2013 13:11:13 +0000
Message-Id: <E1VqN5l-0007oe-Ne@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: match output of vcpu-list with
	pinning syntax
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 700810c7c845a6bb0c15351e5d1c3c60fc74f6fc
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:04:32 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:19:51 2013 +0000

    xl: match output of vcpu-list with pinning syntax
    
    in fact, pinning to all the pcpus happens by specifying "all"
    (either on the command line or in the config file), while `xl
    vcpu-list' report it as "any cpu".
    
    Change this into something more consistent, by using "all"
    everywhere.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   27 +++++++--------------------
 1 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 4977a53..5bdb869 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3121,8 +3121,7 @@ out:
     }
 }
 
-/* If map is not full, prints it and returns 0. Returns 1 otherwise. */
-static int print_bitmap(uint8_t *map, int maplen, FILE *stream)
+static void print_bitmap(uint8_t *map, int maplen, FILE *stream)
 {
     int i;
     uint8_t pmap = 0, bitmask = 0;
@@ -3160,28 +3159,16 @@ static int print_bitmap(uint8_t *map, int maplen, FILE *stream)
         case 2:
             break;
         case 1:
-            if (firstset == 0)
-                return 1;
+            if (firstset == 0) {
+                fprintf(stream, "all");
+                break;
+            }
         case 3:
             fprintf(stream, "%s%d", state > 1 ? "," : "", firstset);
             if (i - 1 > firstset)
                 fprintf(stream, "-%d", i - 1);
             break;
     }
-
-    return 0;
-}
-
-static void print_cpumap(uint8_t *map, int maplen, FILE *stream)
-{
-    if (print_bitmap(map, maplen, stream))
-        fprintf(stream, "any cpu");
-}
-
-static void print_nodemap(uint8_t *map, int maplen, FILE *stream)
-{
-    if (print_bitmap(map, maplen, stream))
-        fprintf(stream, "any node");
 }
 
 static void list_domains(int verbose, int context, int claim, int numa,
@@ -3254,7 +3241,7 @@ static void list_domains(int verbose, int context, int claim, int numa,
             libxl_domain_get_nodeaffinity(ctx, info[i].domid, &nodemap);
 
             putchar(' ');
-            print_nodemap(nodemap.map, physinfo.nr_nodes, stdout);
+            print_bitmap(nodemap.map, physinfo.nr_nodes, stdout);
         }
         putchar('\n');
     }
@@ -4466,7 +4453,7 @@ static void print_vcpuinfo(uint32_t tdomid,
     /*      TIM */
     printf("%9.1f  ", ((float)vcpuinfo->vcpu_time / 1e9));
     /* CPU AFFINITY */
-    print_cpumap(vcpuinfo->cpumap.map, nr_cpus, stdout);
+    print_bitmap(vcpuinfo->cpumap.map, nr_cpus, stdout);
     printf("\n");
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:11:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VqN5p-0001rg-O0; Tue, 10 Dec 2013 13:11:17 +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 1VqN5o-0001rP-Di
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:16 +0000
Received: from [193.109.254.147:31736] by server-14.bemta-14.messagelabs.com
	id 20/4E-12628-3F217A25; Tue, 10 Dec 2013 13:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1386681074!4140638!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27414 invoked from network); 10 Dec 2013 13:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:11: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 1VqN5m-0000Iz-0f
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN5l-0007oe-Ne
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:13 +0000
Date: Tue, 10 Dec 2013 13:11:13 +0000
Message-Id: <E1VqN5l-0007oe-Ne@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: match output of vcpu-list with
	pinning syntax
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 700810c7c845a6bb0c15351e5d1c3c60fc74f6fc
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:04:32 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:19:51 2013 +0000

    xl: match output of vcpu-list with pinning syntax
    
    in fact, pinning to all the pcpus happens by specifying "all"
    (either on the command line or in the config file), while `xl
    vcpu-list' report it as "any cpu".
    
    Change this into something more consistent, by using "all"
    everywhere.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   27 +++++++--------------------
 1 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 4977a53..5bdb869 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3121,8 +3121,7 @@ out:
     }
 }
 
-/* If map is not full, prints it and returns 0. Returns 1 otherwise. */
-static int print_bitmap(uint8_t *map, int maplen, FILE *stream)
+static void print_bitmap(uint8_t *map, int maplen, FILE *stream)
 {
     int i;
     uint8_t pmap = 0, bitmask = 0;
@@ -3160,28 +3159,16 @@ static int print_bitmap(uint8_t *map, int maplen, FILE *stream)
         case 2:
             break;
         case 1:
-            if (firstset == 0)
-                return 1;
+            if (firstset == 0) {
+                fprintf(stream, "all");
+                break;
+            }
         case 3:
             fprintf(stream, "%s%d", state > 1 ? "," : "", firstset);
             if (i - 1 > firstset)
                 fprintf(stream, "-%d", i - 1);
             break;
     }
-
-    return 0;
-}
-
-static void print_cpumap(uint8_t *map, int maplen, FILE *stream)
-{
-    if (print_bitmap(map, maplen, stream))
-        fprintf(stream, "any cpu");
-}
-
-static void print_nodemap(uint8_t *map, int maplen, FILE *stream)
-{
-    if (print_bitmap(map, maplen, stream))
-        fprintf(stream, "any node");
 }
 
 static void list_domains(int verbose, int context, int claim, int numa,
@@ -3254,7 +3241,7 @@ static void list_domains(int verbose, int context, int claim, int numa,
             libxl_domain_get_nodeaffinity(ctx, info[i].domid, &nodemap);
 
             putchar(' ');
-            print_nodemap(nodemap.map, physinfo.nr_nodes, stdout);
+            print_bitmap(nodemap.map, physinfo.nr_nodes, stdout);
         }
         putchar('\n');
     }
@@ -4466,7 +4453,7 @@ static void print_vcpuinfo(uint32_t tdomid,
     /*      TIM */
     printf("%9.1f  ", ((float)vcpuinfo->vcpu_time / 1e9));
     /* CPU AFFINITY */
-    print_cpumap(vcpuinfo->cpumap.map, nr_cpus, stdout);
+    print_bitmap(vcpuinfo->cpumap.map, nr_cpus, stdout);
     printf("\n");
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:11:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11: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 1VqN60-0001tX-Qv; Tue, 10 Dec 2013 13:11: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 1VqN5y-0001tI-Rs
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:27 +0000
Received: from [193.109.254.147:24431] by server-14.bemta-14.messagelabs.com
	id 47/8E-12628-EF217A25; Tue, 10 Dec 2013 13:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1386681084!4187261!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13150 invoked from network); 10 Dec 2013 13:11:25 -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;
	10 Dec 2013 13:11: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 1VqN5w-0000J5-6D
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN5w-0007p0-41
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:24 +0000
Date: Tue, 10 Dec 2013 13:11:24 +0000
Message-Id: <E1VqN5w-0007p0-41@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: better name for parameters in
	libxl_list_vcpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c42fa088ec5deb9de3263ef6b7e3115f75e919e9
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:04:40 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:19:51 2013 +0000

    libxl: better name for parameters in libxl_list_vcpu
    
    so that the parameter that returns the number of pCPUs is
    called nr_cpus_out, while the one that returns the number of
    vCPUs is called nr_vcpus_out.
    
    The patch is all about renaming, so no functional change.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |   15 +++++++++------
 tools/libxl/libxl.h |    2 +-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 771b45b..108da30 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4525,7 +4525,7 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
 }
 
 libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
-                                       int *nb_vcpu, int *nr_vcpus_out)
+                                       int *nr_vcpus_out, int *nr_cpus_out)
 {
     libxl_vcpuinfo *ptr, *ret;
     xc_domaininfo_t domaininfo;
@@ -4535,26 +4535,29 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting infolist");
         return NULL;
     }
-    *nr_vcpus_out = libxl_get_max_cpus(ctx);
+    *nr_cpus_out = libxl_get_max_cpus(ctx);
     ret = ptr = calloc(domaininfo.max_vcpu_id + 1, sizeof (libxl_vcpuinfo));
     if (!ptr) {
         return NULL;
     }
 
-    for (*nb_vcpu = 0; *nb_vcpu <= domaininfo.max_vcpu_id; ++*nb_vcpu, ++ptr) {
+    for (*nr_vcpus_out = 0;
+         *nr_vcpus_out <= domaininfo.max_vcpu_id;
+         ++*nr_vcpus_out, ++ptr) {
         if (libxl_cpu_bitmap_alloc(ctx, &ptr->cpumap, 0)) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpumap");
             goto err;
         }
-        if (xc_vcpu_getinfo(ctx->xch, domid, *nb_vcpu, &vcpuinfo) == -1) {
+        if (xc_vcpu_getinfo(ctx->xch, domid, *nr_vcpus_out, &vcpuinfo) == -1) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu info");
             goto err;
         }
-        if (xc_vcpu_getaffinity(ctx->xch, domid, *nb_vcpu, ptr->cpumap.map) == -1) {
+        if (xc_vcpu_getaffinity(ctx->xch, domid, *nr_vcpus_out,
+                                ptr->cpumap.map) == -1) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu affinity");
             goto err;
         }
-        ptr->vcpuid = *nb_vcpu;
+        ptr->vcpuid = *nr_vcpus_out;
         ptr->cpu = vcpuinfo.cpu;
         ptr->online = !!vcpuinfo.online;
         ptr->blocked = !!vcpuinfo.blocked;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 094ddd0..75b64ea 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -769,7 +769,7 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr);
 void libxl_numainfo_list_free(libxl_numainfo *, int nr);
 
 libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
-                                int *nb_vcpu, int *nr_vcpus_out);
+                                int *nb_vcpu, int *nr_cpus_out);
 void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
 
 void libxl_device_vtpm_list_free(libxl_device_vtpm*, int nr_vtpms);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:11:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11: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 1VqN60-0001tX-Qv; Tue, 10 Dec 2013 13:11: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 1VqN5y-0001tI-Rs
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:27 +0000
Received: from [193.109.254.147:24431] by server-14.bemta-14.messagelabs.com
	id 47/8E-12628-EF217A25; Tue, 10 Dec 2013 13:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1386681084!4187261!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13150 invoked from network); 10 Dec 2013 13:11:25 -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;
	10 Dec 2013 13:11: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 1VqN5w-0000J5-6D
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN5w-0007p0-41
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:24 +0000
Date: Tue, 10 Dec 2013 13:11:24 +0000
Message-Id: <E1VqN5w-0007p0-41@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: better name for parameters in
	libxl_list_vcpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c42fa088ec5deb9de3263ef6b7e3115f75e919e9
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:04:40 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:19:51 2013 +0000

    libxl: better name for parameters in libxl_list_vcpu
    
    so that the parameter that returns the number of pCPUs is
    called nr_cpus_out, while the one that returns the number of
    vCPUs is called nr_vcpus_out.
    
    The patch is all about renaming, so no functional change.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |   15 +++++++++------
 tools/libxl/libxl.h |    2 +-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 771b45b..108da30 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4525,7 +4525,7 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
 }
 
 libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
-                                       int *nb_vcpu, int *nr_vcpus_out)
+                                       int *nr_vcpus_out, int *nr_cpus_out)
 {
     libxl_vcpuinfo *ptr, *ret;
     xc_domaininfo_t domaininfo;
@@ -4535,26 +4535,29 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting infolist");
         return NULL;
     }
-    *nr_vcpus_out = libxl_get_max_cpus(ctx);
+    *nr_cpus_out = libxl_get_max_cpus(ctx);
     ret = ptr = calloc(domaininfo.max_vcpu_id + 1, sizeof (libxl_vcpuinfo));
     if (!ptr) {
         return NULL;
     }
 
-    for (*nb_vcpu = 0; *nb_vcpu <= domaininfo.max_vcpu_id; ++*nb_vcpu, ++ptr) {
+    for (*nr_vcpus_out = 0;
+         *nr_vcpus_out <= domaininfo.max_vcpu_id;
+         ++*nr_vcpus_out, ++ptr) {
         if (libxl_cpu_bitmap_alloc(ctx, &ptr->cpumap, 0)) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpumap");
             goto err;
         }
-        if (xc_vcpu_getinfo(ctx->xch, domid, *nb_vcpu, &vcpuinfo) == -1) {
+        if (xc_vcpu_getinfo(ctx->xch, domid, *nr_vcpus_out, &vcpuinfo) == -1) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu info");
             goto err;
         }
-        if (xc_vcpu_getaffinity(ctx->xch, domid, *nb_vcpu, ptr->cpumap.map) == -1) {
+        if (xc_vcpu_getaffinity(ctx->xch, domid, *nr_vcpus_out,
+                                ptr->cpumap.map) == -1) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu affinity");
             goto err;
         }
-        ptr->vcpuid = *nb_vcpu;
+        ptr->vcpuid = *nr_vcpus_out;
         ptr->cpu = vcpuinfo.cpu;
         ptr->online = !!vcpuinfo.online;
         ptr->blocked = !!vcpuinfo.blocked;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 094ddd0..75b64ea 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -769,7 +769,7 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr);
 void libxl_numainfo_list_free(libxl_numainfo *, int nr);
 
 libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
-                                int *nb_vcpu, int *nr_vcpus_out);
+                                int *nb_vcpu, int *nr_cpus_out);
 void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
 
 void libxl_device_vtpm_list_free(libxl_device_vtpm*, int nr_vtpms);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:11:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VqN69-0001vQ-Tj; Tue, 10 Dec 2013 13:11:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN68-0001v4-Mq
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:36 +0000
Received: from [85.158.143.35:59844] by server-3.bemta-4.messagelabs.com id
	A3/8C-32360-80317A25; Tue, 10 Dec 2013 13:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1386681094!4611121!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30623 invoked from network); 10 Dec 2013 13:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:11: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 1VqN66-0000JD-Ae
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN66-0007pw-9T
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:34 +0000
Date: Tue, 10 Dec 2013 13:11:34 +0000
Message-Id: <E1VqN66-0007pw-9T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix memory leak in
	libxl_list_vcpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2217a4318ff156ad86c377fc0f13f0fc6406123e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:04:48 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:19:51 2013 +0000

    libxl: fix memory leak in libxl_list_vcpu
    
    more specifically, of the cpumap inside libxl_vcpuinfo, in case
    of failure after it has been allocated.
    
    While at it, use the correct libxl memory allocation wrapper for
    calloc() in there and turn the function into using the new LOGE()
    logging style.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 108da30..2925e1e 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4527,34 +4527,35 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
 libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
                                        int *nr_vcpus_out, int *nr_cpus_out)
 {
+    GC_INIT(ctx);
     libxl_vcpuinfo *ptr, *ret;
     xc_domaininfo_t domaininfo;
     xc_vcpuinfo_t vcpuinfo;
 
     if (xc_domain_getinfolist(ctx->xch, domid, 1, &domaininfo) != 1) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting infolist");
+        LOGE(ERROR, "getting infolist");
+        GC_FREE;
         return NULL;
     }
     *nr_cpus_out = libxl_get_max_cpus(ctx);
-    ret = ptr = calloc(domaininfo.max_vcpu_id + 1, sizeof (libxl_vcpuinfo));
-    if (!ptr) {
-        return NULL;
-    }
+    ret = ptr = libxl__calloc(NOGC, domaininfo.max_vcpu_id + 1,
+                              sizeof(libxl_vcpuinfo));
 
     for (*nr_vcpus_out = 0;
          *nr_vcpus_out <= domaininfo.max_vcpu_id;
          ++*nr_vcpus_out, ++ptr) {
+        libxl_bitmap_init(&ptr->cpumap);
         if (libxl_cpu_bitmap_alloc(ctx, &ptr->cpumap, 0)) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpumap");
+            LOGE(ERROR, "allocating cpumap");
             goto err;
         }
         if (xc_vcpu_getinfo(ctx->xch, domid, *nr_vcpus_out, &vcpuinfo) == -1) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu info");
+            LOGE(ERROR, "getting vcpu info");
             goto err;
         }
         if (xc_vcpu_getaffinity(ctx->xch, domid, *nr_vcpus_out,
                                 ptr->cpumap.map) == -1) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu affinity");
+            LOGE(ERROR, "getting vcpu affinity");
             goto err;
         }
         ptr->vcpuid = *nr_vcpus_out;
@@ -4564,10 +4565,13 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
         ptr->running = !!vcpuinfo.running;
         ptr->vcpu_time = vcpuinfo.cpu_time;
     }
+    GC_FREE;
     return ret;
 
 err:
+    libxl_bitmap_dispose(&ptr->cpumap);
     free(ret);
+    GC_FREE;
     return 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 Tue Dec 10 13:11:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VqN69-0001vQ-Tj; Tue, 10 Dec 2013 13:11:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN68-0001v4-Mq
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:36 +0000
Received: from [85.158.143.35:59844] by server-3.bemta-4.messagelabs.com id
	A3/8C-32360-80317A25; Tue, 10 Dec 2013 13:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1386681094!4611121!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30623 invoked from network); 10 Dec 2013 13:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:11: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 1VqN66-0000JD-Ae
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN66-0007pw-9T
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:34 +0000
Date: Tue, 10 Dec 2013 13:11:34 +0000
Message-Id: <E1VqN66-0007pw-9T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix memory leak in
	libxl_list_vcpu
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2217a4318ff156ad86c377fc0f13f0fc6406123e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:04:48 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:19:51 2013 +0000

    libxl: fix memory leak in libxl_list_vcpu
    
    more specifically, of the cpumap inside libxl_vcpuinfo, in case
    of failure after it has been allocated.
    
    While at it, use the correct libxl memory allocation wrapper for
    calloc() in there and turn the function into using the new LOGE()
    logging style.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 108da30..2925e1e 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4527,34 +4527,35 @@ const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
 libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
                                        int *nr_vcpus_out, int *nr_cpus_out)
 {
+    GC_INIT(ctx);
     libxl_vcpuinfo *ptr, *ret;
     xc_domaininfo_t domaininfo;
     xc_vcpuinfo_t vcpuinfo;
 
     if (xc_domain_getinfolist(ctx->xch, domid, 1, &domaininfo) != 1) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting infolist");
+        LOGE(ERROR, "getting infolist");
+        GC_FREE;
         return NULL;
     }
     *nr_cpus_out = libxl_get_max_cpus(ctx);
-    ret = ptr = calloc(domaininfo.max_vcpu_id + 1, sizeof (libxl_vcpuinfo));
-    if (!ptr) {
-        return NULL;
-    }
+    ret = ptr = libxl__calloc(NOGC, domaininfo.max_vcpu_id + 1,
+                              sizeof(libxl_vcpuinfo));
 
     for (*nr_vcpus_out = 0;
          *nr_vcpus_out <= domaininfo.max_vcpu_id;
          ++*nr_vcpus_out, ++ptr) {
+        libxl_bitmap_init(&ptr->cpumap);
         if (libxl_cpu_bitmap_alloc(ctx, &ptr->cpumap, 0)) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpumap");
+            LOGE(ERROR, "allocating cpumap");
             goto err;
         }
         if (xc_vcpu_getinfo(ctx->xch, domid, *nr_vcpus_out, &vcpuinfo) == -1) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu info");
+            LOGE(ERROR, "getting vcpu info");
             goto err;
         }
         if (xc_vcpu_getaffinity(ctx->xch, domid, *nr_vcpus_out,
                                 ptr->cpumap.map) == -1) {
-            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting vcpu affinity");
+            LOGE(ERROR, "getting vcpu affinity");
             goto err;
         }
         ptr->vcpuid = *nr_vcpus_out;
@@ -4564,10 +4565,13 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
         ptr->running = !!vcpuinfo.running;
         ptr->vcpu_time = vcpuinfo.cpu_time;
     }
+    GC_FREE;
     return ret;
 
 err:
+    libxl_bitmap_dispose(&ptr->cpumap);
     free(ret);
+    GC_FREE;
     return 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 Tue Dec 10 13:11:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11: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 1VqN6L-0001xe-0S; Tue, 10 Dec 2013 13:11:49 +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 1VqN6J-0001xI-5O
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:47 +0000
Received: from [193.109.254.147:45104] by server-11.bemta-14.messagelabs.com
	id AE/E4-20576-21317A25; Tue, 10 Dec 2013 13:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1386681104!1891632!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20534 invoked from network); 10 Dec 2013 13:11:45 -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;
	10 Dec 2013 13:11: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 1VqN6G-0000JJ-FE
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6G-0007qI-DQ
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:44 +0000
Date: Tue, 10 Dec 2013 13:11:44 +0000
Message-Id: <E1VqN6G-0007qI-DQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: move libxl_{cpu,
	node}_bitmap_alloc()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ad07f45dae9d74be8d300aa5fda31cd11c10061
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:04:55 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:02 2013 +0000

    libxl: move libxl_{cpu, node}_bitmap_alloc()
    
    in libxl_utils.c (from .h), as they will be reworked in
    the next commit ("libxc/libxl: sanitize error handling in
    *_get_max_{cpus,nodes}") and we want to keep code motion
    separate from functional changes.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_utils.c |   25 +++++++++++++++++++++++++
 tools/libxl/libxl_utils.h |   29 +++--------------------------
 2 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 9f5f589..93f7a87 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -651,6 +651,31 @@ char *libxl_bitmap_to_hex_string(libxl_ctx *ctx, const libxl_bitmap *bitmap)
     return q;
 }
 
+int libxl_cpu_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *cpumap, int max_cpus)
+{
+    if (max_cpus < 0)
+        return ERROR_INVAL;
+    if (max_cpus == 0)
+        max_cpus = libxl_get_max_cpus(ctx);
+    if (max_cpus == 0)
+        return ERROR_FAIL;
+
+    return libxl_bitmap_alloc(ctx, cpumap, max_cpus);
+}
+
+int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
+                            int max_nodes)
+{
+    if (max_nodes < 0)
+        return ERROR_INVAL;
+    if (max_nodes == 0)
+        max_nodes = libxl_get_max_nodes(ctx);
+    if (max_nodes == 0)
+        return ERROR_FAIL;
+
+    return libxl_bitmap_alloc(ctx, nodemap, max_nodes);
+}
+
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
                             const libxl_bitmap *nodemap,
                             libxl_bitmap *cpumap)
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 7b84e6a..e37fb89 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -98,32 +98,9 @@ static inline int libxl_bitmap_cpu_valid(libxl_bitmap *bitmap, int bit)
 #define libxl_for_each_set_bit(v, m) for (v = 0; v < (m).size * 8; v++) \
                                              if (libxl_bitmap_test(&(m), v))
 
-static inline int libxl_cpu_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *cpumap,
-                                         int max_cpus)
-{
-    if (max_cpus < 0)
-        return ERROR_INVAL;
-    if (max_cpus == 0)
-        max_cpus = libxl_get_max_cpus(ctx);
-    if (max_cpus == 0)
-        return ERROR_FAIL;
-
-    return libxl_bitmap_alloc(ctx, cpumap, max_cpus);
-}
-
-static inline int libxl_node_bitmap_alloc(libxl_ctx *ctx,
-                                          libxl_bitmap *nodemap,
-                                          int max_nodes)
-{
-    if (max_nodes < 0)
-        return ERROR_INVAL;
-    if (max_nodes == 0)
-        max_nodes = libxl_get_max_nodes(ctx);
-    if (max_nodes == 0)
-        return ERROR_FAIL;
-
-    return libxl_bitmap_alloc(ctx, nodemap, max_nodes);
-}
+int libxl_cpu_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *cpumap, int max_cpus);
+int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
+                            int max_nodes);
 
 /* Populate cpumap with the cpus spanned by the nodes in nodemap */
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:11:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11: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 1VqN6L-0001xe-0S; Tue, 10 Dec 2013 13:11:49 +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 1VqN6J-0001xI-5O
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:47 +0000
Received: from [193.109.254.147:45104] by server-11.bemta-14.messagelabs.com
	id AE/E4-20576-21317A25; Tue, 10 Dec 2013 13:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1386681104!1891632!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20534 invoked from network); 10 Dec 2013 13:11:45 -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;
	10 Dec 2013 13:11: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 1VqN6G-0000JJ-FE
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6G-0007qI-DQ
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:44 +0000
Date: Tue, 10 Dec 2013 13:11:44 +0000
Message-Id: <E1VqN6G-0007qI-DQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: move libxl_{cpu,
	node}_bitmap_alloc()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ad07f45dae9d74be8d300aa5fda31cd11c10061
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:04:55 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:02 2013 +0000

    libxl: move libxl_{cpu, node}_bitmap_alloc()
    
    in libxl_utils.c (from .h), as they will be reworked in
    the next commit ("libxc/libxl: sanitize error handling in
    *_get_max_{cpus,nodes}") and we want to keep code motion
    separate from functional changes.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_utils.c |   25 +++++++++++++++++++++++++
 tools/libxl/libxl_utils.h |   29 +++--------------------------
 2 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 9f5f589..93f7a87 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -651,6 +651,31 @@ char *libxl_bitmap_to_hex_string(libxl_ctx *ctx, const libxl_bitmap *bitmap)
     return q;
 }
 
+int libxl_cpu_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *cpumap, int max_cpus)
+{
+    if (max_cpus < 0)
+        return ERROR_INVAL;
+    if (max_cpus == 0)
+        max_cpus = libxl_get_max_cpus(ctx);
+    if (max_cpus == 0)
+        return ERROR_FAIL;
+
+    return libxl_bitmap_alloc(ctx, cpumap, max_cpus);
+}
+
+int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
+                            int max_nodes)
+{
+    if (max_nodes < 0)
+        return ERROR_INVAL;
+    if (max_nodes == 0)
+        max_nodes = libxl_get_max_nodes(ctx);
+    if (max_nodes == 0)
+        return ERROR_FAIL;
+
+    return libxl_bitmap_alloc(ctx, nodemap, max_nodes);
+}
+
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
                             const libxl_bitmap *nodemap,
                             libxl_bitmap *cpumap)
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 7b84e6a..e37fb89 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -98,32 +98,9 @@ static inline int libxl_bitmap_cpu_valid(libxl_bitmap *bitmap, int bit)
 #define libxl_for_each_set_bit(v, m) for (v = 0; v < (m).size * 8; v++) \
                                              if (libxl_bitmap_test(&(m), v))
 
-static inline int libxl_cpu_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *cpumap,
-                                         int max_cpus)
-{
-    if (max_cpus < 0)
-        return ERROR_INVAL;
-    if (max_cpus == 0)
-        max_cpus = libxl_get_max_cpus(ctx);
-    if (max_cpus == 0)
-        return ERROR_FAIL;
-
-    return libxl_bitmap_alloc(ctx, cpumap, max_cpus);
-}
-
-static inline int libxl_node_bitmap_alloc(libxl_ctx *ctx,
-                                          libxl_bitmap *nodemap,
-                                          int max_nodes)
-{
-    if (max_nodes < 0)
-        return ERROR_INVAL;
-    if (max_nodes == 0)
-        max_nodes = libxl_get_max_nodes(ctx);
-    if (max_nodes == 0)
-        return ERROR_FAIL;
-
-    return libxl_bitmap_alloc(ctx, nodemap, max_nodes);
-}
+int libxl_cpu_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *cpumap, int max_cpus);
+int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
+                            int max_nodes);
 
 /* Populate cpumap with the cpus spanned by the nodes in nodemap */
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:11:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11: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 1VqN6V-0001zU-3o; Tue, 10 Dec 2013 13:11: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 1VqN6T-0001z8-I2
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:57 +0000
Received: from [85.158.143.35:64177] by server-3.bemta-4.messagelabs.com id
	29/2D-32360-C1317A25; Tue, 10 Dec 2013 13:11:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1386681114!4687585!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32533 invoked from network); 10 Dec 2013 13:11:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:11: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 1VqN6Q-0000JV-KO
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6Q-0007qh-In
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:54 +0000
Date: Tue, 10 Dec 2013 13:11:54 +0000
Message-Id: <E1VqN6Q-0007qh-In@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc/libxl: sanitize error handling
	in *_get_max_{cpus, nodes}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2e82c18cd850592ae9a1f682eb93965a868b5f2f
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:05:03 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:12 2013 +0000

    libxc/libxl: sanitize error handling in *_get_max_{cpus, nodes}
    
    In libxc, make xc_get_max_{cpus,node}() always return either a
    positive number or -1, and change all the callers to deal with
    that.
    
    In libxl, make libxl_get_max_{cpus,nodes}() always return either a
    positive number or a libxl error code. Thanks to that, it is also
    possible to fix loggig for libxl_{cpu,node}_bitmap_alloc(), which
    now happens inside the functions themselves, more accurately
    reporting what happened.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_misc.c             |   22 ++++++++++++---
 tools/libxl/libxl.c               |   16 ++++-------
 tools/libxl/libxl_utils.c         |   55 +++++++++++++++++++++++++++++--------
 tools/python/xen/lowlevel/xc/xc.c |    6 ++--
 4 files changed, 70 insertions(+), 29 deletions(-)

diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 56efe6a..c771469 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -30,9 +30,12 @@ int xc_get_max_cpus(xc_interface *xch)
         return max_cpus;
 
     if ( !xc_physinfo(xch, &physinfo) )
+    {
         max_cpus = physinfo.max_cpu_id + 1;
+        return max_cpus;
+    }
 
-    return max_cpus;
+    return -1;
 }
 
 int xc_get_max_nodes(xc_interface *xch)
@@ -44,19 +47,30 @@ int xc_get_max_nodes(xc_interface *xch)
         return max_nodes;
 
     if ( !xc_physinfo(xch, &physinfo) )
+    {
         max_nodes = physinfo.max_node_id + 1;
+        return max_nodes;
+    }
 
-    return max_nodes;
+    return -1;
 }
 
 int xc_get_cpumap_size(xc_interface *xch)
 {
-    return (xc_get_max_cpus(xch) + 7) / 8;
+    int max_cpus = xc_get_max_cpus(xch);
+
+    if ( max_cpus < 0 )
+        return -1;
+    return (max_cpus + 7) / 8;
 }
 
 int xc_get_nodemap_size(xc_interface *xch)
 {
-    return (xc_get_max_nodes(xch) + 7) / 8;
+    int max_nodes = xc_get_max_nodes(xch);
+
+    if ( max_nodes < 0 )
+        return -1;
+    return (max_nodes + 7) / 8;
 }
 
 xc_cpumap_t xc_cpumap_alloc(xc_interface *xch)
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2925e1e..fd8b988 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -615,10 +615,8 @@ static int cpupool_info(libxl__gc *gc,
     info->n_dom = xcinfo->n_dom;
     rc = libxl_cpu_bitmap_alloc(CTX, &info->cpumap, 0);
     if (rc)
-    {
-        LOG(ERROR, "unable to allocate cpumap %d\n", rc);
         goto out;
-    }
+
     memcpy(info->cpumap.map, xcinfo->cpumap, info->cpumap.size);
 
     rc = 0;
@@ -4355,7 +4353,7 @@ libxl_cputopology *libxl_get_cpu_topology(libxl_ctx *ctx, int *nb_cpu_out)
     int max_cpus;
 
     max_cpus = libxl_get_max_cpus(ctx);
-    if (max_cpus == 0)
+    if (max_cpus < 0)
     {
         LIBXL__LOG(ctx, XTL_ERROR, "Unable to determine number of CPUS");
         ret = NULL;
@@ -4420,7 +4418,7 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr)
     int i, j, max_nodes;
 
     max_nodes = libxl_get_max_nodes(ctx);
-    if (max_nodes == 0)
+    if (max_nodes < 0)
     {
         LIBXL__LOG(ctx, XTL_ERROR, "Unable to determine number of NODES");
         ret = NULL;
@@ -4545,10 +4543,8 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
          *nr_vcpus_out <= domaininfo.max_vcpu_id;
          ++*nr_vcpus_out, ++ptr) {
         libxl_bitmap_init(&ptr->cpumap);
-        if (libxl_cpu_bitmap_alloc(ctx, &ptr->cpumap, 0)) {
-            LOGE(ERROR, "allocating cpumap");
+        if (libxl_cpu_bitmap_alloc(ctx, &ptr->cpumap, 0))
             goto err;
-        }
         if (xc_vcpu_getinfo(ctx->xch, domid, *nr_vcpus_out, &vcpuinfo) == -1) {
             LOGE(ERROR, "getting vcpu info");
             goto err;
@@ -5308,8 +5304,8 @@ int libxl_get_freecpus(libxl_ctx *ctx, libxl_bitmap *cpumap)
     int ncpus;
 
     ncpus = libxl_get_max_cpus(ctx);
-    if (ncpus == 0)
-        return ERROR_FAIL;
+    if (ncpus < 0)
+        return ncpus;
 
     cpumap->map = xc_cpupool_freeinfo(ctx->xch);
     if (cpumap->map == NULL)
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 93f7a87..0833de2 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -653,27 +653,54 @@ char *libxl_bitmap_to_hex_string(libxl_ctx *ctx, const libxl_bitmap *bitmap)
 
 int libxl_cpu_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *cpumap, int max_cpus)
 {
-    if (max_cpus < 0)
-        return ERROR_INVAL;
+    GC_INIT(ctx);
+    int rc = 0;
+
+    if (max_cpus < 0) {
+        rc = ERROR_INVAL;
+        LOG(ERROR, "invalid number of cpus provided");
+        goto out;
+    }
     if (max_cpus == 0)
         max_cpus = libxl_get_max_cpus(ctx);
-    if (max_cpus == 0)
-        return ERROR_FAIL;
+    if (max_cpus < 0) {
+        LOG(ERROR, "failed to retrieve the maximum number of cpus");
+        rc = max_cpus;
+        goto out;
+    }
+    /* This can't fail: no need to check and log */
+    libxl_bitmap_alloc(ctx, cpumap, max_cpus);
 
-    return libxl_bitmap_alloc(ctx, cpumap, max_cpus);
+ out:
+    GC_FREE;
+    return rc;
 }
 
 int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
                             int max_nodes)
 {
-    if (max_nodes < 0)
-        return ERROR_INVAL;
+    GC_INIT(ctx);
+    int rc = 0;
+
+    if (max_nodes < 0) {
+        rc = ERROR_INVAL;
+        LOG(ERROR, "invalid number of nodes provided");
+        goto out;
+    }
+
     if (max_nodes == 0)
         max_nodes = libxl_get_max_nodes(ctx);
-    if (max_nodes == 0)
-        return ERROR_FAIL;
+    if (max_nodes < 0) {
+        LOG(ERROR, "failed to retrieve the maximum number of nodes");
+        rc = max_nodes;
+        goto out;
+    }
+    /* This can't fail: no need to check and log */
+    libxl_bitmap_alloc(ctx, nodemap, max_nodes);
 
-    return libxl_bitmap_alloc(ctx, nodemap, max_nodes);
+ out:
+    GC_FREE;
+    return rc;
 }
 
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
@@ -744,12 +771,16 @@ int libxl_cpumap_to_nodemap(libxl_ctx *ctx,
 
 int libxl_get_max_cpus(libxl_ctx *ctx)
 {
-    return xc_get_max_cpus(ctx->xch);
+    int max_cpus = xc_get_max_cpus(ctx->xch);
+
+    return max_cpus < 0 ? ERROR_FAIL : max_cpus;
 }
 
 int libxl_get_max_nodes(libxl_ctx *ctx)
 {
-    return xc_get_max_nodes(ctx->xch);
+    int max_nodes = xc_get_max_nodes(ctx->xch);
+
+    return max_nodes < 0 ? ERROR_FAIL : max_nodes;
 }
 
 int libxl__enum_from_string(const libxl_enum_string_table *t,
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 2625fc4..737bdac 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -233,7 +233,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
         return NULL;
 
     nr_cpus = xc_get_max_cpus(self->xc_handle);
-    if ( nr_cpus == 0 )
+    if ( nr_cpus < 0 )
         return pyxc_error_to_exception(self->xc_handle);
 
     cpumap = xc_cpumap_alloc(self->xc_handle);
@@ -392,7 +392,7 @@ static PyObject *pyxc_vcpu_getinfo(XcObject *self,
         return NULL;
 
     nr_cpus = xc_get_max_cpus(self->xc_handle);
-    if ( nr_cpus == 0 )
+    if ( nr_cpus < 0 )
         return pyxc_error_to_exception(self->xc_handle);
 
     rc = xc_vcpu_getinfo(self->xc_handle, dom, vcpu, &info);
@@ -1923,7 +1923,7 @@ static PyObject *cpumap_to_cpulist(XcObject *self, xc_cpumap_t cpumap)
     int nr_cpus;
 
     nr_cpus = xc_get_max_cpus(self->xc_handle);
-    if ( nr_cpus == 0 )
+    if ( nr_cpus < 0 )
         return pyxc_error_to_exception(self->xc_handle);
 
     cpulist = PyList_New(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 Dec 10 13:11:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:11: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 1VqN6V-0001zU-3o; Tue, 10 Dec 2013 13:11: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 1VqN6T-0001z8-I2
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:57 +0000
Received: from [85.158.143.35:64177] by server-3.bemta-4.messagelabs.com id
	29/2D-32360-C1317A25; Tue, 10 Dec 2013 13:11:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1386681114!4687585!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32533 invoked from network); 10 Dec 2013 13:11:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:11: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 1VqN6Q-0000JV-KO
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6Q-0007qh-In
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:11:54 +0000
Date: Tue, 10 Dec 2013 13:11:54 +0000
Message-Id: <E1VqN6Q-0007qh-In@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc/libxl: sanitize error handling
	in *_get_max_{cpus, nodes}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2e82c18cd850592ae9a1f682eb93965a868b5f2f
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:05:03 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:12 2013 +0000

    libxc/libxl: sanitize error handling in *_get_max_{cpus, nodes}
    
    In libxc, make xc_get_max_{cpus,node}() always return either a
    positive number or -1, and change all the callers to deal with
    that.
    
    In libxl, make libxl_get_max_{cpus,nodes}() always return either a
    positive number or a libxl error code. Thanks to that, it is also
    possible to fix loggig for libxl_{cpu,node}_bitmap_alloc(), which
    now happens inside the functions themselves, more accurately
    reporting what happened.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_misc.c             |   22 ++++++++++++---
 tools/libxl/libxl.c               |   16 ++++-------
 tools/libxl/libxl_utils.c         |   55 +++++++++++++++++++++++++++++--------
 tools/python/xen/lowlevel/xc/xc.c |    6 ++--
 4 files changed, 70 insertions(+), 29 deletions(-)

diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 56efe6a..c771469 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -30,9 +30,12 @@ int xc_get_max_cpus(xc_interface *xch)
         return max_cpus;
 
     if ( !xc_physinfo(xch, &physinfo) )
+    {
         max_cpus = physinfo.max_cpu_id + 1;
+        return max_cpus;
+    }
 
-    return max_cpus;
+    return -1;
 }
 
 int xc_get_max_nodes(xc_interface *xch)
@@ -44,19 +47,30 @@ int xc_get_max_nodes(xc_interface *xch)
         return max_nodes;
 
     if ( !xc_physinfo(xch, &physinfo) )
+    {
         max_nodes = physinfo.max_node_id + 1;
+        return max_nodes;
+    }
 
-    return max_nodes;
+    return -1;
 }
 
 int xc_get_cpumap_size(xc_interface *xch)
 {
-    return (xc_get_max_cpus(xch) + 7) / 8;
+    int max_cpus = xc_get_max_cpus(xch);
+
+    if ( max_cpus < 0 )
+        return -1;
+    return (max_cpus + 7) / 8;
 }
 
 int xc_get_nodemap_size(xc_interface *xch)
 {
-    return (xc_get_max_nodes(xch) + 7) / 8;
+    int max_nodes = xc_get_max_nodes(xch);
+
+    if ( max_nodes < 0 )
+        return -1;
+    return (max_nodes + 7) / 8;
 }
 
 xc_cpumap_t xc_cpumap_alloc(xc_interface *xch)
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2925e1e..fd8b988 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -615,10 +615,8 @@ static int cpupool_info(libxl__gc *gc,
     info->n_dom = xcinfo->n_dom;
     rc = libxl_cpu_bitmap_alloc(CTX, &info->cpumap, 0);
     if (rc)
-    {
-        LOG(ERROR, "unable to allocate cpumap %d\n", rc);
         goto out;
-    }
+
     memcpy(info->cpumap.map, xcinfo->cpumap, info->cpumap.size);
 
     rc = 0;
@@ -4355,7 +4353,7 @@ libxl_cputopology *libxl_get_cpu_topology(libxl_ctx *ctx, int *nb_cpu_out)
     int max_cpus;
 
     max_cpus = libxl_get_max_cpus(ctx);
-    if (max_cpus == 0)
+    if (max_cpus < 0)
     {
         LIBXL__LOG(ctx, XTL_ERROR, "Unable to determine number of CPUS");
         ret = NULL;
@@ -4420,7 +4418,7 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr)
     int i, j, max_nodes;
 
     max_nodes = libxl_get_max_nodes(ctx);
-    if (max_nodes == 0)
+    if (max_nodes < 0)
     {
         LIBXL__LOG(ctx, XTL_ERROR, "Unable to determine number of NODES");
         ret = NULL;
@@ -4545,10 +4543,8 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
          *nr_vcpus_out <= domaininfo.max_vcpu_id;
          ++*nr_vcpus_out, ++ptr) {
         libxl_bitmap_init(&ptr->cpumap);
-        if (libxl_cpu_bitmap_alloc(ctx, &ptr->cpumap, 0)) {
-            LOGE(ERROR, "allocating cpumap");
+        if (libxl_cpu_bitmap_alloc(ctx, &ptr->cpumap, 0))
             goto err;
-        }
         if (xc_vcpu_getinfo(ctx->xch, domid, *nr_vcpus_out, &vcpuinfo) == -1) {
             LOGE(ERROR, "getting vcpu info");
             goto err;
@@ -5308,8 +5304,8 @@ int libxl_get_freecpus(libxl_ctx *ctx, libxl_bitmap *cpumap)
     int ncpus;
 
     ncpus = libxl_get_max_cpus(ctx);
-    if (ncpus == 0)
-        return ERROR_FAIL;
+    if (ncpus < 0)
+        return ncpus;
 
     cpumap->map = xc_cpupool_freeinfo(ctx->xch);
     if (cpumap->map == NULL)
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 93f7a87..0833de2 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -653,27 +653,54 @@ char *libxl_bitmap_to_hex_string(libxl_ctx *ctx, const libxl_bitmap *bitmap)
 
 int libxl_cpu_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *cpumap, int max_cpus)
 {
-    if (max_cpus < 0)
-        return ERROR_INVAL;
+    GC_INIT(ctx);
+    int rc = 0;
+
+    if (max_cpus < 0) {
+        rc = ERROR_INVAL;
+        LOG(ERROR, "invalid number of cpus provided");
+        goto out;
+    }
     if (max_cpus == 0)
         max_cpus = libxl_get_max_cpus(ctx);
-    if (max_cpus == 0)
-        return ERROR_FAIL;
+    if (max_cpus < 0) {
+        LOG(ERROR, "failed to retrieve the maximum number of cpus");
+        rc = max_cpus;
+        goto out;
+    }
+    /* This can't fail: no need to check and log */
+    libxl_bitmap_alloc(ctx, cpumap, max_cpus);
 
-    return libxl_bitmap_alloc(ctx, cpumap, max_cpus);
+ out:
+    GC_FREE;
+    return rc;
 }
 
 int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
                             int max_nodes)
 {
-    if (max_nodes < 0)
-        return ERROR_INVAL;
+    GC_INIT(ctx);
+    int rc = 0;
+
+    if (max_nodes < 0) {
+        rc = ERROR_INVAL;
+        LOG(ERROR, "invalid number of nodes provided");
+        goto out;
+    }
+
     if (max_nodes == 0)
         max_nodes = libxl_get_max_nodes(ctx);
-    if (max_nodes == 0)
-        return ERROR_FAIL;
+    if (max_nodes < 0) {
+        LOG(ERROR, "failed to retrieve the maximum number of nodes");
+        rc = max_nodes;
+        goto out;
+    }
+    /* This can't fail: no need to check and log */
+    libxl_bitmap_alloc(ctx, nodemap, max_nodes);
 
-    return libxl_bitmap_alloc(ctx, nodemap, max_nodes);
+ out:
+    GC_FREE;
+    return rc;
 }
 
 int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
@@ -744,12 +771,16 @@ int libxl_cpumap_to_nodemap(libxl_ctx *ctx,
 
 int libxl_get_max_cpus(libxl_ctx *ctx)
 {
-    return xc_get_max_cpus(ctx->xch);
+    int max_cpus = xc_get_max_cpus(ctx->xch);
+
+    return max_cpus < 0 ? ERROR_FAIL : max_cpus;
 }
 
 int libxl_get_max_nodes(libxl_ctx *ctx)
 {
-    return xc_get_max_nodes(ctx->xch);
+    int max_nodes = xc_get_max_nodes(ctx->xch);
+
+    return max_nodes < 0 ? ERROR_FAIL : max_nodes;
 }
 
 int libxl__enum_from_string(const libxl_enum_string_table *t,
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 2625fc4..737bdac 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -233,7 +233,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
         return NULL;
 
     nr_cpus = xc_get_max_cpus(self->xc_handle);
-    if ( nr_cpus == 0 )
+    if ( nr_cpus < 0 )
         return pyxc_error_to_exception(self->xc_handle);
 
     cpumap = xc_cpumap_alloc(self->xc_handle);
@@ -392,7 +392,7 @@ static PyObject *pyxc_vcpu_getinfo(XcObject *self,
         return NULL;
 
     nr_cpus = xc_get_max_cpus(self->xc_handle);
-    if ( nr_cpus == 0 )
+    if ( nr_cpus < 0 )
         return pyxc_error_to_exception(self->xc_handle);
 
     rc = xc_vcpu_getinfo(self->xc_handle, dom, vcpu, &info);
@@ -1923,7 +1923,7 @@ static PyObject *cpumap_to_cpulist(XcObject *self, xc_cpumap_t cpumap)
     int nr_cpus;
 
     nr_cpus = xc_get_max_cpus(self->xc_handle);
-    if ( nr_cpus == 0 )
+    if ( nr_cpus < 0 )
         return pyxc_error_to_exception(self->xc_handle);
 
     cpulist = PyList_New(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 Dec 10 13:12:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13: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 1VqN6e-00021y-Ih; Tue, 10 Dec 2013 13:12:08 +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 1VqN6d-00021U-7F
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:07 +0000
Received: from [193.109.254.147:39034] by server-15.bemta-14.messagelabs.com
	id E3/43-22186-62317A25; Tue, 10 Dec 2013 13:12:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1386681124!4183601!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11379 invoked from network); 10 Dec 2013 13:12:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:12: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 1VqN6a-0000K9-P3
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6a-0007rD-Nn
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:04 +0000
Date: Tue, 10 Dec 2013 13:12:04 +0000
Message-Id: <E1VqN6a-0007rD-Nn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc/libxl: allow to retrieve the
	number of online 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 62f25a16a47e62b2abbabd3c24c30c2545c5e312
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:05:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:12 2013 +0000

    libxc/libxl: allow to retrieve the number of online pCPUs
    
    by introducing introduce xc_get_online_cpus() and
    libxl_get_online_cpus().
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_misc.c     |   10 ++++++++++
 tools/libxc/xenctrl.h     |    3 +++
 tools/libxl/libxl.h       |    8 ++++++++
 tools/libxl/libxl_utils.c |    7 +++++++
 4 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index c771469..00cd0d8 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -38,6 +38,16 @@ int xc_get_max_cpus(xc_interface *xch)
     return -1;
 }
 
+int xc_get_online_cpus(xc_interface *xch)
+{
+    xc_physinfo_t physinfo;
+
+    if ( !xc_physinfo(xch, &physinfo) )
+        return physinfo.nr_cpus;
+
+    return -1;
+}
+
 int xc_get_max_nodes(xc_interface *xch)
 {
     static int max_nodes = 0;
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index cced208..6e58ebe 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -356,6 +356,9 @@ typedef uint8_t *xc_cpumap_t;
 /* return maximum number of cpus the hypervisor supports */
 int xc_get_max_cpus(xc_interface *xch);
 
+/* return the number of online cpus */
+int xc_get_online_cpus(xc_interface *xch);
+
 /* return array size for cpumap */
 int xc_get_cpumap_size(xc_interface *xch);
 
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 75b64ea..12d6c31 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -677,6 +677,14 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid, libxl_domain_create_in
 /* get max. number of cpus supported by hypervisor */
 int libxl_get_max_cpus(libxl_ctx *ctx);
 
+/* get the actual number of currently online cpus on the host */
+int libxl_get_online_cpus(libxl_ctx *ctx);
+  /* Beware that no locking or serialization is provided by libxl,
+   * so the information can be outdated as far as the function
+   * returns. If there are other entities in the system capable
+   * of onlining/offlining CPUs, it is up to the application
+   * to guarantee consistency, if that is important. */
+
 /* get max. number of NUMA nodes supported by hypervisor */
 int libxl_get_max_nodes(libxl_ctx *ctx);
 
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 0833de2..c9cef66 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -776,6 +776,13 @@ int libxl_get_max_cpus(libxl_ctx *ctx)
     return max_cpus < 0 ? ERROR_FAIL : max_cpus;
 }
 
+int libxl_get_online_cpus(libxl_ctx *ctx)
+{
+    int online_cpus = xc_get_online_cpus(ctx->xch);
+
+    return online_cpus < 0 ? ERROR_FAIL : online_cpus;
+}
+
 int libxl_get_max_nodes(libxl_ctx *ctx)
 {
     int max_nodes = xc_get_max_nodes(ctx->xch);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:12:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13: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 1VqN6e-00021y-Ih; Tue, 10 Dec 2013 13:12:08 +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 1VqN6d-00021U-7F
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:07 +0000
Received: from [193.109.254.147:39034] by server-15.bemta-14.messagelabs.com
	id E3/43-22186-62317A25; Tue, 10 Dec 2013 13:12:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1386681124!4183601!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11379 invoked from network); 10 Dec 2013 13:12:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:12: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 1VqN6a-0000K9-P3
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6a-0007rD-Nn
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:04 +0000
Date: Tue, 10 Dec 2013 13:12:04 +0000
Message-Id: <E1VqN6a-0007rD-Nn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc/libxl: allow to retrieve the
	number of online 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 62f25a16a47e62b2abbabd3c24c30c2545c5e312
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:05:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:12 2013 +0000

    libxc/libxl: allow to retrieve the number of online pCPUs
    
    by introducing introduce xc_get_online_cpus() and
    libxl_get_online_cpus().
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_misc.c     |   10 ++++++++++
 tools/libxc/xenctrl.h     |    3 +++
 tools/libxl/libxl.h       |    8 ++++++++
 tools/libxl/libxl_utils.c |    7 +++++++
 4 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index c771469..00cd0d8 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -38,6 +38,16 @@ int xc_get_max_cpus(xc_interface *xch)
     return -1;
 }
 
+int xc_get_online_cpus(xc_interface *xch)
+{
+    xc_physinfo_t physinfo;
+
+    if ( !xc_physinfo(xch, &physinfo) )
+        return physinfo.nr_cpus;
+
+    return -1;
+}
+
 int xc_get_max_nodes(xc_interface *xch)
 {
     static int max_nodes = 0;
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index cced208..6e58ebe 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -356,6 +356,9 @@ typedef uint8_t *xc_cpumap_t;
 /* return maximum number of cpus the hypervisor supports */
 int xc_get_max_cpus(xc_interface *xch);
 
+/* return the number of online cpus */
+int xc_get_online_cpus(xc_interface *xch);
+
 /* return array size for cpumap */
 int xc_get_cpumap_size(xc_interface *xch);
 
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 75b64ea..12d6c31 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -677,6 +677,14 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid, libxl_domain_create_in
 /* get max. number of cpus supported by hypervisor */
 int libxl_get_max_cpus(libxl_ctx *ctx);
 
+/* get the actual number of currently online cpus on the host */
+int libxl_get_online_cpus(libxl_ctx *ctx);
+  /* Beware that no locking or serialization is provided by libxl,
+   * so the information can be outdated as far as the function
+   * returns. If there are other entities in the system capable
+   * of onlining/offlining CPUs, it is up to the application
+   * to guarantee consistency, if that is important. */
+
 /* get max. number of NUMA nodes supported by hypervisor */
 int libxl_get_max_nodes(libxl_ctx *ctx);
 
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 0833de2..c9cef66 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -776,6 +776,13 @@ int libxl_get_max_cpus(libxl_ctx *ctx)
     return max_cpus < 0 ? ERROR_FAIL : max_cpus;
 }
 
+int libxl_get_online_cpus(libxl_ctx *ctx)
+{
+    int online_cpus = xc_get_online_cpus(ctx->xch);
+
+    return online_cpus < 0 ? ERROR_FAIL : online_cpus;
+}
+
 int libxl_get_max_nodes(libxl_ctx *ctx)
 {
     int max_nodes = xc_get_max_nodes(ctx->xch);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:12:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:12: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 1VqN6p-00023v-Lu; Tue, 10 Dec 2013 13:12: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 1VqN6n-00023a-R9
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:18 +0000
Received: from [85.158.143.35:6918] by server-3.bemta-4.messagelabs.com id
	6E/CD-32360-13317A25; Tue, 10 Dec 2013 13:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1386681135!4687708!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3225 invoked from network); 10 Dec 2013 13:12:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:12: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 1VqN6k-0000KF-TT
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6k-0007rb-SK
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:14 +0000
Date: Tue, 10 Dec 2013 13:12:14 +0000
Message-Id: <E1VqN6k-0007rb-SK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: allow for node-wise specification
	of vcpu pinning
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 23772b35cf1d18c830bc28b28b55eccbcf8e24be
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:05:18 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:12 2013 +0000

    xl: allow for node-wise specification of vcpu pinning
    
    Making it possible to use something like the following:
     * "nodes:0-3": all pCPUs of nodes 0,1,2,3;
     * "nodes:0-3,^node:2": all pCPUS of nodes 0,1,3;
     * "1,nodes:1-2,^6": pCPU 1 plus all pCPUs of nodes 1,2
       but not pCPU 6;
     * ...
    
    In both domain config file and `xl vcpu-pin'.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5    |   20 ++++++-
 tools/libxl/xl_cmdimpl.c |  153 ++++++++++++++++++++++++++++++++-------------
 2 files changed, 128 insertions(+), 45 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index a979a13..72efd88 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -115,7 +115,25 @@ To allow all the vcpus of the guest to run on all the cpus on the host.
 
 =item "0-3,5,^1"
 
-To allow all the vcpus of the guest to run on cpus 0,2,3,5.
+To allow all the vcpus of the guest to run on cpus 0,2,3,5. Combining
+this with "all" is possible, meaning "all,^7" results in all the vcpus
+of the guest running on all the cpus on the host except cpu 7.
+
+=item "nodes:0-3,node:^2"
+
+To allow all the vcpus of the guest to run on the cpus from NUMA nodes
+0,1,3 of the host. So, if cpus 0-3 belongs to node 0, cpus 4-7 belongs
+to node 1 and cpus 8-11 to node 3, the above would mean all the vcpus
+of the guest will run on cpus 0-3,8-11.
+
+Combining this notation with the one above is possible. For instance,
+"1,node:2,^6", means all the vcpus of the guest will run on cpu 1 and
+on all the cpus of NUMA node 2, but not on cpu 6. Following the same
+example as above, that would be cpus 1,4,5,7.
+
+Combining this with "all" is also possible, meaning "all,^nodes:1"
+results in all the vcpus of the guest running on all the cpus on the
+host, except for the cpus belonging to the host NUMA node 1.
 
 =item ["2", "3"] (or [2, 3])
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5bdb869..fa5916e 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -59,6 +59,11 @@
         }                                                               \
     })
 
+#define STR_HAS_PREFIX( a, b )  \
+    ( strncmp(a, b, strlen(b)) == 0 )
+#define STR_SKIP_PREFIX( a, b ) \
+    ( STR_HAS_PREFIX(a, b) ? ((a) += strlen(b), 1) : 0 )
+
 
 int logfile = 2;
 
@@ -562,61 +567,121 @@ static void split_string_into_string_list(const char *str,
     free(s);
 }
 
-static int vcpupin_parse(char *cpu, libxl_bitmap *cpumap)
+static int parse_range(const char *str, unsigned long *a, unsigned long *b)
 {
-    libxl_bitmap exclude_cpumap;
-    uint32_t cpuida, cpuidb;
-    char *endptr, *toka, *tokb, *saveptr = NULL;
-    int i, rc = 0, rmcpu;
+    const char *nstr;
+    char *endptr;
 
-    if (!strcmp(cpu, "all")) {
-        libxl_bitmap_set_any(cpumap);
-        return 0;
+    *a = *b = strtoul(str, &endptr, 10);
+    if (endptr == str || *a == ULONG_MAX)
+        return ERROR_INVAL;
+
+    if (*endptr == '-') {
+        nstr = endptr + 1;
+
+        *b = strtoul(nstr, &endptr, 10);
+        if (endptr == nstr || *b == ULONG_MAX || *b < *a)
+            return ERROR_INVAL;
+    }
+
+    /* Valid value or range so far, but we also don't want junk after that */
+    if (*endptr != '\0')
+        return ERROR_INVAL;
+
+    return 0;
+}
+
+/*
+ * Add or removes a specific set of cpus (specified in str, either as
+ * single cpus or as entire NUMA nodes) to/from cpumap.
+ */
+static int update_cpumap_range(const char *str, libxl_bitmap *cpumap)
+{
+    unsigned long ida, idb;
+    libxl_bitmap node_cpumap;
+    bool is_not = false, is_nodes = false;
+    int rc = 0;
+
+    libxl_bitmap_init(&node_cpumap);
+
+    rc = libxl_node_bitmap_alloc(ctx, &node_cpumap, 0);
+    if (rc) {
+        fprintf(stderr, "libxl_node_bitmap_alloc failed.\n");
+        goto out;
     }
 
-    if (libxl_cpu_bitmap_alloc(ctx, &exclude_cpumap, 0)) {
-        fprintf(stderr, "Error: Failed to allocate cpumap.\n");
-        return ENOMEM;
+    /* Are we adding or removing cpus/nodes? */
+    if (STR_SKIP_PREFIX(str, "^")) {
+        is_not = true;
     }
 
-    for (toka = strtok_r(cpu, ",", &saveptr); toka;
-         toka = strtok_r(NULL, ",", &saveptr)) {
-        rmcpu = 0;
-        if (*toka == '^') {
-            /* This (These) Cpu(s) will be removed from the map */
-            toka++;
-            rmcpu = 1;
-        }
-        /* Extract a valid (range of) cpu(s) */
-        cpuida = cpuidb = strtoul(toka, &endptr, 10);
-        if (endptr == toka) {
-            fprintf(stderr, "Error: Invalid argument.\n");
-            rc = EINVAL;
-            goto vcpp_out;
-        }
-        if (*endptr == '-') {
-            tokb = endptr + 1;
-            cpuidb = strtoul(tokb, &endptr, 10);
-            if (endptr == tokb || cpuida > cpuidb) {
-                fprintf(stderr, "Error: Invalid argument.\n");
-                rc = EINVAL;
-                goto vcpp_out;
+    /* Are we dealing with cpus or full nodes? */
+    if (STR_SKIP_PREFIX(str, "node:") || STR_SKIP_PREFIX(str, "nodes:")) {
+        is_nodes = true;
+    }
+
+    if (strcmp(str, "all") == 0) {
+        /* We do not accept "^all" or "^nodes:all" */
+        if (is_not) {
+            fprintf(stderr, "Can't combine \"^\" and \"all\".\n");
+            rc = ERROR_INVAL;
+        } else
+            libxl_bitmap_set_any(cpumap);
+        goto out;
+    }
+
+    rc = parse_range(str, &ida, &idb);
+    if (rc) {
+        fprintf(stderr, "Invalid pcpu range: %s.\n", str);
+        goto out;
+    }
+
+    /* Add or remove the specified cpus in the range */
+    while (ida <= idb) {
+        if (is_nodes) {
+            /* Add/Remove all the cpus of a NUMA node */
+            int i;
+
+            rc = libxl_node_to_cpumap(ctx, ida, &node_cpumap);
+            if (rc) {
+                fprintf(stderr, "libxl_node_to_cpumap failed.\n");
+                goto out;
             }
+
+            /* Add/Remove all the cpus in the node cpumap */
+            libxl_for_each_set_bit(i, node_cpumap) {
+                is_not ? libxl_bitmap_reset(cpumap, i) :
+                         libxl_bitmap_set(cpumap, i);
+            }
+        } else {
+            /* Add/Remove this cpu */
+            is_not ? libxl_bitmap_reset(cpumap, ida) :
+                     libxl_bitmap_set(cpumap, ida);
         }
-        while (cpuida <= cpuidb) {
-            rmcpu == 0 ? libxl_bitmap_set(cpumap, cpuida) :
-                         libxl_bitmap_set(&exclude_cpumap, cpuida);
-            cpuida++;
-        }
+        ida++;
     }
 
-    /* Clear all the cpus from the removal list */
-    libxl_for_each_set_bit(i, exclude_cpumap) {
-        libxl_bitmap_reset(cpumap, i);
-    }
+ out:
+    libxl_bitmap_dispose(&node_cpumap);
+    return rc;
+}
 
-vcpp_out:
-    libxl_bitmap_dispose(&exclude_cpumap);
+/*
+ * Takes a string representing a set of cpus (specified either as
+ * single cpus or as eintire NUMA nodes) and turns it into the
+ * corresponding libxl_bitmap (in cpumap).
+ */
+static int vcpupin_parse(char *cpu, libxl_bitmap *cpumap)
+{
+    char *ptr, *saveptr = NULL;
+    int rc = 0;
+
+    for (ptr = strtok_r(cpu, ",", &saveptr); ptr;
+         ptr = strtok_r(NULL, ",", &saveptr)) {
+        rc = update_cpumap_range(ptr, cpumap);
+        if (rc)
+            break;
+    }
 
     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 Tue Dec 10 13:12:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:12: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 1VqN6p-00023v-Lu; Tue, 10 Dec 2013 13:12: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 1VqN6n-00023a-R9
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:18 +0000
Received: from [85.158.143.35:6918] by server-3.bemta-4.messagelabs.com id
	6E/CD-32360-13317A25; Tue, 10 Dec 2013 13:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1386681135!4687708!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3225 invoked from network); 10 Dec 2013 13:12:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:12: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 1VqN6k-0000KF-TT
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6k-0007rb-SK
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:14 +0000
Date: Tue, 10 Dec 2013 13:12:14 +0000
Message-Id: <E1VqN6k-0007rb-SK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: allow for node-wise specification
	of vcpu pinning
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 23772b35cf1d18c830bc28b28b55eccbcf8e24be
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:05:18 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:12 2013 +0000

    xl: allow for node-wise specification of vcpu pinning
    
    Making it possible to use something like the following:
     * "nodes:0-3": all pCPUs of nodes 0,1,2,3;
     * "nodes:0-3,^node:2": all pCPUS of nodes 0,1,3;
     * "1,nodes:1-2,^6": pCPU 1 plus all pCPUs of nodes 1,2
       but not pCPU 6;
     * ...
    
    In both domain config file and `xl vcpu-pin'.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5    |   20 ++++++-
 tools/libxl/xl_cmdimpl.c |  153 ++++++++++++++++++++++++++++++++-------------
 2 files changed, 128 insertions(+), 45 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index a979a13..72efd88 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -115,7 +115,25 @@ To allow all the vcpus of the guest to run on all the cpus on the host.
 
 =item "0-3,5,^1"
 
-To allow all the vcpus of the guest to run on cpus 0,2,3,5.
+To allow all the vcpus of the guest to run on cpus 0,2,3,5. Combining
+this with "all" is possible, meaning "all,^7" results in all the vcpus
+of the guest running on all the cpus on the host except cpu 7.
+
+=item "nodes:0-3,node:^2"
+
+To allow all the vcpus of the guest to run on the cpus from NUMA nodes
+0,1,3 of the host. So, if cpus 0-3 belongs to node 0, cpus 4-7 belongs
+to node 1 and cpus 8-11 to node 3, the above would mean all the vcpus
+of the guest will run on cpus 0-3,8-11.
+
+Combining this notation with the one above is possible. For instance,
+"1,node:2,^6", means all the vcpus of the guest will run on cpu 1 and
+on all the cpus of NUMA node 2, but not on cpu 6. Following the same
+example as above, that would be cpus 1,4,5,7.
+
+Combining this with "all" is also possible, meaning "all,^nodes:1"
+results in all the vcpus of the guest running on all the cpus on the
+host, except for the cpus belonging to the host NUMA node 1.
 
 =item ["2", "3"] (or [2, 3])
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5bdb869..fa5916e 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -59,6 +59,11 @@
         }                                                               \
     })
 
+#define STR_HAS_PREFIX( a, b )  \
+    ( strncmp(a, b, strlen(b)) == 0 )
+#define STR_SKIP_PREFIX( a, b ) \
+    ( STR_HAS_PREFIX(a, b) ? ((a) += strlen(b), 1) : 0 )
+
 
 int logfile = 2;
 
@@ -562,61 +567,121 @@ static void split_string_into_string_list(const char *str,
     free(s);
 }
 
-static int vcpupin_parse(char *cpu, libxl_bitmap *cpumap)
+static int parse_range(const char *str, unsigned long *a, unsigned long *b)
 {
-    libxl_bitmap exclude_cpumap;
-    uint32_t cpuida, cpuidb;
-    char *endptr, *toka, *tokb, *saveptr = NULL;
-    int i, rc = 0, rmcpu;
+    const char *nstr;
+    char *endptr;
 
-    if (!strcmp(cpu, "all")) {
-        libxl_bitmap_set_any(cpumap);
-        return 0;
+    *a = *b = strtoul(str, &endptr, 10);
+    if (endptr == str || *a == ULONG_MAX)
+        return ERROR_INVAL;
+
+    if (*endptr == '-') {
+        nstr = endptr + 1;
+
+        *b = strtoul(nstr, &endptr, 10);
+        if (endptr == nstr || *b == ULONG_MAX || *b < *a)
+            return ERROR_INVAL;
+    }
+
+    /* Valid value or range so far, but we also don't want junk after that */
+    if (*endptr != '\0')
+        return ERROR_INVAL;
+
+    return 0;
+}
+
+/*
+ * Add or removes a specific set of cpus (specified in str, either as
+ * single cpus or as entire NUMA nodes) to/from cpumap.
+ */
+static int update_cpumap_range(const char *str, libxl_bitmap *cpumap)
+{
+    unsigned long ida, idb;
+    libxl_bitmap node_cpumap;
+    bool is_not = false, is_nodes = false;
+    int rc = 0;
+
+    libxl_bitmap_init(&node_cpumap);
+
+    rc = libxl_node_bitmap_alloc(ctx, &node_cpumap, 0);
+    if (rc) {
+        fprintf(stderr, "libxl_node_bitmap_alloc failed.\n");
+        goto out;
     }
 
-    if (libxl_cpu_bitmap_alloc(ctx, &exclude_cpumap, 0)) {
-        fprintf(stderr, "Error: Failed to allocate cpumap.\n");
-        return ENOMEM;
+    /* Are we adding or removing cpus/nodes? */
+    if (STR_SKIP_PREFIX(str, "^")) {
+        is_not = true;
     }
 
-    for (toka = strtok_r(cpu, ",", &saveptr); toka;
-         toka = strtok_r(NULL, ",", &saveptr)) {
-        rmcpu = 0;
-        if (*toka == '^') {
-            /* This (These) Cpu(s) will be removed from the map */
-            toka++;
-            rmcpu = 1;
-        }
-        /* Extract a valid (range of) cpu(s) */
-        cpuida = cpuidb = strtoul(toka, &endptr, 10);
-        if (endptr == toka) {
-            fprintf(stderr, "Error: Invalid argument.\n");
-            rc = EINVAL;
-            goto vcpp_out;
-        }
-        if (*endptr == '-') {
-            tokb = endptr + 1;
-            cpuidb = strtoul(tokb, &endptr, 10);
-            if (endptr == tokb || cpuida > cpuidb) {
-                fprintf(stderr, "Error: Invalid argument.\n");
-                rc = EINVAL;
-                goto vcpp_out;
+    /* Are we dealing with cpus or full nodes? */
+    if (STR_SKIP_PREFIX(str, "node:") || STR_SKIP_PREFIX(str, "nodes:")) {
+        is_nodes = true;
+    }
+
+    if (strcmp(str, "all") == 0) {
+        /* We do not accept "^all" or "^nodes:all" */
+        if (is_not) {
+            fprintf(stderr, "Can't combine \"^\" and \"all\".\n");
+            rc = ERROR_INVAL;
+        } else
+            libxl_bitmap_set_any(cpumap);
+        goto out;
+    }
+
+    rc = parse_range(str, &ida, &idb);
+    if (rc) {
+        fprintf(stderr, "Invalid pcpu range: %s.\n", str);
+        goto out;
+    }
+
+    /* Add or remove the specified cpus in the range */
+    while (ida <= idb) {
+        if (is_nodes) {
+            /* Add/Remove all the cpus of a NUMA node */
+            int i;
+
+            rc = libxl_node_to_cpumap(ctx, ida, &node_cpumap);
+            if (rc) {
+                fprintf(stderr, "libxl_node_to_cpumap failed.\n");
+                goto out;
             }
+
+            /* Add/Remove all the cpus in the node cpumap */
+            libxl_for_each_set_bit(i, node_cpumap) {
+                is_not ? libxl_bitmap_reset(cpumap, i) :
+                         libxl_bitmap_set(cpumap, i);
+            }
+        } else {
+            /* Add/Remove this cpu */
+            is_not ? libxl_bitmap_reset(cpumap, ida) :
+                     libxl_bitmap_set(cpumap, ida);
         }
-        while (cpuida <= cpuidb) {
-            rmcpu == 0 ? libxl_bitmap_set(cpumap, cpuida) :
-                         libxl_bitmap_set(&exclude_cpumap, cpuida);
-            cpuida++;
-        }
+        ida++;
     }
 
-    /* Clear all the cpus from the removal list */
-    libxl_for_each_set_bit(i, exclude_cpumap) {
-        libxl_bitmap_reset(cpumap, i);
-    }
+ out:
+    libxl_bitmap_dispose(&node_cpumap);
+    return rc;
+}
 
-vcpp_out:
-    libxl_bitmap_dispose(&exclude_cpumap);
+/*
+ * Takes a string representing a set of cpus (specified either as
+ * single cpus or as eintire NUMA nodes) and turns it into the
+ * corresponding libxl_bitmap (in cpumap).
+ */
+static int vcpupin_parse(char *cpu, libxl_bitmap *cpumap)
+{
+    char *ptr, *saveptr = NULL;
+    int rc = 0;
+
+    for (ptr = strtok_r(cpu, ",", &saveptr); ptr;
+         ptr = strtok_r(NULL, ",", &saveptr)) {
+        rc = update_cpumap_range(ptr, cpumap);
+        if (rc)
+            break;
+    }
 
     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 Tue Dec 10 13:12:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:12: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 1VqN6y-00025y-P9; Tue, 10 Dec 2013 13:12:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6x-00025c-M3
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:27 +0000
Received: from [85.158.143.35:10022] by server-2.bemta-4.messagelabs.com id
	CD/A9-11386-B3317A25; Tue, 10 Dec 2013 13:12:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1386681145!1993109!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 336 invoked from network); 10 Dec 2013 13:12:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:12: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 1VqN6v-0000KL-4o
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6v-0007ry-0M
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:25 +0000
Date: Tue, 10 Dec 2013 13:12:25 +0000
Message-Id: <E1VqN6v-0007ry-0M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: implement and enable dryrun mode
	for `xl vcpu-pin'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 62c562557a8a52612fa4ad960a285f5cd618611e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:05:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:12 2013 +0000

    xl: implement and enable dryrun mode for `xl vcpu-pin'
    
    As it can be useful to see if the outcome of some complex vCPU
    pinning bitmap specification looks as expected.
    
    This also allow for the introduction of some automatic testing
    and verification for the bitmap parsing code, as it happens
    already in check-xl-disk-parse and check-xl-vif-parse.
    
    In particular, to make the above possible, this commit also
    changes the implementation of the vcpu-pin command so that,
    instead of always returning 0, it returns an error if the
    parsing fails.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c  |   48 ++++++++++++++++++++++++++++++++------------
 tools/libxl/xl_cmdtable.c |    2 +-
 2 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index fa5916e..bd26bcc 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4586,40 +4586,62 @@ int main_vcpulist(int argc, char **argv)
     return 0;
 }
 
-static void vcpupin(uint32_t domid, const char *vcpu, char *cpu)
+static int vcpupin(uint32_t domid, const char *vcpu, char *cpu)
 {
     libxl_vcpuinfo *vcpuinfo;
     libxl_bitmap cpumap;
 
     uint32_t vcpuid;
     char *endptr;
-    int i, nb_vcpu;
+    int i, nb_cpu, nb_vcpu, rc = -1;
+
+    libxl_bitmap_init(&cpumap);
 
     vcpuid = strtoul(vcpu, &endptr, 10);
     if (vcpu == endptr) {
         if (strcmp(vcpu, "all")) {
             fprintf(stderr, "Error: Invalid argument.\n");
-            return;
+            goto out;
         }
         vcpuid = -1;
     }
 
-    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
-        goto vcpupin_out;
-    }
+    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0))
+        goto out;
 
     if (vcpupin_parse(cpu, &cpumap))
-        goto vcpupin_out1;
+        goto out;
+
+    if (dryrun_only) {
+        nb_cpu = libxl_get_online_cpus(ctx);
+        if (nb_cpu < 0) {
+            fprintf(stderr, "libxl_get_online_cpus failed.\n");
+            goto out;
+        }
+
+        fprintf(stdout, "cpumap: ");
+        print_bitmap(cpumap.map, nb_cpu, stdout);
+        fprintf(stdout, "\n");
+
+        if (ferror(stdout) || fflush(stdout)) {
+            perror("stdout");
+            exit(-1);
+        }
+
+        rc = 0;
+        goto out;
+    }
 
     if (vcpuid != -1) {
         if (libxl_set_vcpuaffinity(ctx, domid, vcpuid, &cpumap) == -1) {
             fprintf(stderr, "Could not set affinity for vcpu `%u'.\n", vcpuid);
+            goto out;
         }
     }
     else {
         if (!(vcpuinfo = libxl_list_vcpu(ctx, domid, &nb_vcpu, &i))) {
             fprintf(stderr, "libxl_list_vcpu failed.\n");
-            goto vcpupin_out1;
+            goto out;
         }
         for (i = 0; i < nb_vcpu; i++) {
             if (libxl_set_vcpuaffinity(ctx, domid, vcpuinfo[i].vcpuid,
@@ -4630,10 +4652,11 @@ static void vcpupin(uint32_t domid, const char *vcpu, char *cpu)
         }
         libxl_vcpuinfo_list_free(vcpuinfo, nb_vcpu);
     }
-  vcpupin_out1:
+
+    rc = 0;
+ out:
     libxl_bitmap_dispose(&cpumap);
-  vcpupin_out:
-    ;
+    return rc;
 }
 
 int main_vcpupin(int argc, char **argv)
@@ -4644,8 +4667,7 @@ int main_vcpupin(int argc, char **argv)
         /* No options */
     }
 
-    vcpupin(find_domain(argv[optind]), argv[optind+1] , argv[optind+2]);
-    return 0;
+    return vcpupin(find_domain(argv[optind]), argv[optind+1] , argv[optind+2]);
 }
 
 static void vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 7709206..ebe0220 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -211,7 +211,7 @@ struct cmd_spec cmd_table[] = {
       "[Domain, ...]",
     },
     { "vcpu-pin",
-      &main_vcpupin, 0, 1,
+      &main_vcpupin, 1, 1,
       "Set which CPUs a VCPU can use",
       "<Domain> <VCPU|all> <CPUs|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 Tue Dec 10 13:12:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:12: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 1VqN6y-00025y-P9; Tue, 10 Dec 2013 13:12:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6x-00025c-M3
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:27 +0000
Received: from [85.158.143.35:10022] by server-2.bemta-4.messagelabs.com id
	CD/A9-11386-B3317A25; Tue, 10 Dec 2013 13:12:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1386681145!1993109!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 336 invoked from network); 10 Dec 2013 13:12:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:12: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 1VqN6v-0000KL-4o
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN6v-0007ry-0M
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:25 +0000
Date: Tue, 10 Dec 2013 13:12:25 +0000
Message-Id: <E1VqN6v-0007ry-0M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: implement and enable dryrun mode
	for `xl vcpu-pin'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 62c562557a8a52612fa4ad960a285f5cd618611e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:05:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:12 2013 +0000

    xl: implement and enable dryrun mode for `xl vcpu-pin'
    
    As it can be useful to see if the outcome of some complex vCPU
    pinning bitmap specification looks as expected.
    
    This also allow for the introduction of some automatic testing
    and verification for the bitmap parsing code, as it happens
    already in check-xl-disk-parse and check-xl-vif-parse.
    
    In particular, to make the above possible, this commit also
    changes the implementation of the vcpu-pin command so that,
    instead of always returning 0, it returns an error if the
    parsing fails.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c  |   48 ++++++++++++++++++++++++++++++++------------
 tools/libxl/xl_cmdtable.c |    2 +-
 2 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index fa5916e..bd26bcc 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4586,40 +4586,62 @@ int main_vcpulist(int argc, char **argv)
     return 0;
 }
 
-static void vcpupin(uint32_t domid, const char *vcpu, char *cpu)
+static int vcpupin(uint32_t domid, const char *vcpu, char *cpu)
 {
     libxl_vcpuinfo *vcpuinfo;
     libxl_bitmap cpumap;
 
     uint32_t vcpuid;
     char *endptr;
-    int i, nb_vcpu;
+    int i, nb_cpu, nb_vcpu, rc = -1;
+
+    libxl_bitmap_init(&cpumap);
 
     vcpuid = strtoul(vcpu, &endptr, 10);
     if (vcpu == endptr) {
         if (strcmp(vcpu, "all")) {
             fprintf(stderr, "Error: Invalid argument.\n");
-            return;
+            goto out;
         }
         vcpuid = -1;
     }
 
-    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
-        goto vcpupin_out;
-    }
+    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0))
+        goto out;
 
     if (vcpupin_parse(cpu, &cpumap))
-        goto vcpupin_out1;
+        goto out;
+
+    if (dryrun_only) {
+        nb_cpu = libxl_get_online_cpus(ctx);
+        if (nb_cpu < 0) {
+            fprintf(stderr, "libxl_get_online_cpus failed.\n");
+            goto out;
+        }
+
+        fprintf(stdout, "cpumap: ");
+        print_bitmap(cpumap.map, nb_cpu, stdout);
+        fprintf(stdout, "\n");
+
+        if (ferror(stdout) || fflush(stdout)) {
+            perror("stdout");
+            exit(-1);
+        }
+
+        rc = 0;
+        goto out;
+    }
 
     if (vcpuid != -1) {
         if (libxl_set_vcpuaffinity(ctx, domid, vcpuid, &cpumap) == -1) {
             fprintf(stderr, "Could not set affinity for vcpu `%u'.\n", vcpuid);
+            goto out;
         }
     }
     else {
         if (!(vcpuinfo = libxl_list_vcpu(ctx, domid, &nb_vcpu, &i))) {
             fprintf(stderr, "libxl_list_vcpu failed.\n");
-            goto vcpupin_out1;
+            goto out;
         }
         for (i = 0; i < nb_vcpu; i++) {
             if (libxl_set_vcpuaffinity(ctx, domid, vcpuinfo[i].vcpuid,
@@ -4630,10 +4652,11 @@ static void vcpupin(uint32_t domid, const char *vcpu, char *cpu)
         }
         libxl_vcpuinfo_list_free(vcpuinfo, nb_vcpu);
     }
-  vcpupin_out1:
+
+    rc = 0;
+ out:
     libxl_bitmap_dispose(&cpumap);
-  vcpupin_out:
-    ;
+    return rc;
 }
 
 int main_vcpupin(int argc, char **argv)
@@ -4644,8 +4667,7 @@ int main_vcpupin(int argc, char **argv)
         /* No options */
     }
 
-    vcpupin(find_domain(argv[optind]), argv[optind+1] , argv[optind+2]);
-    return 0;
+    return vcpupin(find_domain(argv[optind]), argv[optind+1] , argv[optind+2]);
 }
 
 static void vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 7709206..ebe0220 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -211,7 +211,7 @@ struct cmd_spec cmd_table[] = {
       "[Domain, ...]",
     },
     { "vcpu-pin",
-      &main_vcpupin, 0, 1,
+      &main_vcpupin, 1, 1,
       "Set which CPUs a VCPU can use",
       "<Domain> <VCPU|all> <CPUs|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 Tue Dec 10 13:12:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:12: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 1VqN79-00028M-S7; Tue, 10 Dec 2013 13:12:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN78-000284-7y
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:38 +0000
Received: from [193.109.254.147:5048] by server-3.bemta-14.messagelabs.com id
	72/A4-11000-54317A25; Tue, 10 Dec 2013 13:12:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1386681155!4194269!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29701 invoked from network); 10 Dec 2013 13:12:36 -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;
	10 Dec 2013 13:12: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 1VqN75-0000KW-9K
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN75-0007tF-7f
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:35 +0000
Date: Tue, 10 Dec 2013 13:12:35 +0000
Message-Id: <E1VqN75-0007tF-7f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: test script for the cpumap parser
	(for vCPU pinning)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit caee9a0362b198636410793e091ba901ddca9f2c
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:05:34 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:12 2013 +0000

    xl: test script for the cpumap parser (for vCPU pinning)
    
    This commit introduces "check-xl-vcpupin-parse" for helping
    verifying and debugging the (v)CPU bitmap parsing code in xl.
    
    The script runs "xl -N vcpu-pin 0 all <some strings>"
    repeatedly, with various input strings, and checks that the
    output is as expected.
    
    This is what the script can do:
    
    # ./check-xl-vcpupin-parse -h
     usage: ./check-xl-vcpupin-parse [options]
    
     Tests various vcpu-pinning strings. If run without arguments acts
     as follows:
      - generates some test data and saves them in
        check-xl-vcpupin-parse.data;
      - tests all the generated configurations (reading them back from
        check-xl-vcpupin-parse.data).
    
     An example of a test vector file is provided in
     check-xl-vcpupin-parse.data-example.
    
     Options:
      -h         prints this message
      -r seed    uses seed for initializing the rundom number generator
                 (default: the script PID)
      -s string  tries using string as a vcpu pinning configuration and
                 reports whether that succeeds or not
      -o ofile   save the test data in ofile
                 (default: check-xl-vcpupin-parse.data)
      -i ifile   read test data from ifile
    
    An example test data file (generated on a 2 NUMA nodes, 16 CPUs
    host) is being provided in check-xl-vcpupin-parse.data-example.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/check-xl-vcpupin-parse              |  294 +++++++++++++++++++++++
 tools/libxl/check-xl-vcpupin-parse.data-example |   53 ++++
 2 files changed, 347 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/check-xl-vcpupin-parse b/tools/libxl/check-xl-vcpupin-parse
new file mode 100755
index 0000000..21f8421
--- /dev/null
+++ b/tools/libxl/check-xl-vcpupin-parse
@@ -0,0 +1,294 @@
+#!/bin/bash
+
+set -e
+
+if [ -x ./xl ] ; then
+    export LD_LIBRARY_PATH=.:../libxc:../xenstore:
+    XL=./xl
+else
+    XL=xl
+fi
+
+fprefix=tmp.check-xl-vcpupin-parse
+outfile=check-xl-vcpupin-parse.data
+
+usage () {
+cat <<END
+usage: $0 [options]
+
+Tests various vcpu-pinning strings. If run without arguments acts
+as follows:
+ - generates some test data and saves them in $outfile;
+ - tests all the generated configurations (reading them back from
+   $outfile).
+
+An example of a test vector file is provided in ${outfile}-example.
+
+Options:
+ -h         prints this message
+ -r seed    uses seed for initializing the rundom number generator
+            (default: the script PID)
+ -s string  tries using string as a vcpu pinning configuration and
+            reports whether that succeeds or not
+ -o ofile   save the test data in ofile (default: $outfile)
+ -i ifile   read test data from ifile
+END
+}
+
+expected () {
+    cat >$fprefix.expected
+}
+
+# by default, re-seed with our PID
+seed=$$
+failures=0
+
+# Execute one test and check the result against the provided
+# rc value and output
+one () {
+    expected_rc=$1; shift
+    printf "test case %s...\n" "$*"
+    set +e
+    ${XL} -N vcpu-pin 0 all "$@" </dev/null >$fprefix.actual 2>/dev/null
+    actual_rc=$?
+    if [ $actual_rc != $expected_rc ]; then
+        diff -u $fprefix.expected $fprefix.actual
+        echo >&2 "test case \`$*' failed ($actual_rc $diff_rc)"
+        failures=$(( $failures + 1 ))
+    fi
+    set -e
+}
+
+# Write an entry in the test vector file. Format is as follows:
+#  test-string*expected-rc*expected-output
+write () {
+    printf "$1*$2*$3\n" >> $outfile
+}
+
+complete () {
+    if [ "$failures" = 0 ]; then
+        echo all ok.; exit 0
+    else
+        echo "$failures tests failed."; exit 1
+    fi
+}
+
+# Test a specific pinning string
+string () {
+    expected_rc=$1; shift
+    printf "test case %s...\n" "$*"
+    set +e
+    ${XL} -N vcpu-pin 0 all "$@" &> /dev/null
+    actual_rc=$?
+    set -e
+
+    if [ $actual_rc != $expected_rc ]; then
+        echo >&2 "test case \`$*' failed ($actual_rc)"
+    else
+        echo >&2 "test case \`$*' succeeded"
+    fi
+
+    exit 0
+}
+
+# Read a test vector file (provided as $1) line by line and
+# test all the entries it contains
+run ()
+{
+    while read line
+    do
+        if [ ${line:0:1} != '#' ]; then
+            test_string="`echo $line | cut -f1 -d'*'`"
+            exp_rc="`echo $line | cut -f2 -d'*'`"
+            exp_output="`echo $line | cut -f3 -d'*'`"
+
+            expected <<END
+$exp_output
+END
+            one $exp_rc "$test_string"
+        fi
+    done < $1
+
+    complete
+
+    exit 0
+}
+
+while getopts "hr:s:o:i:" option
+do
+    case $option in
+    h)
+        usage
+        exit 0
+        ;;
+    r)
+        seed=$OPTARG
+        ;;
+    s)
+        string 0 "$OPTARG"
+        ;;
+    o)
+        outfile=$OPTARG
+        ;;
+    i)
+        run $OPTARG
+        ;;
+    esac
+done
+
+#---------- test data ----------
+#
+nr_cpus=`xl info | grep nr_cpus | cut -f2 -d':'`
+nr_nodes=`xl info | grep nr_nodes | cut -f2 -d':'`
+nr_cpus_per_node=`xl info -n | sed '/cpu:/,/numa_info/!d' | head -n -1 | \
+    awk '{print $4}' | uniq -c | tail -1 | awk '{print $1}'`
+cat >$outfile <<END
+# WARNING: some of these tests are topology based tests.
+# Expect failures if the topology is not detected correctly
+# detected topology: $nr_cpus CPUs, $nr_nodes nodes, $nr_cpus_per_node CPUs per node.
+#
+# seed used for random number generation: seed=${seed}.
+#
+# Format is as follows:
+#  test-string*expected-return-code*expected-output
+#
+END
+
+# Re-seed the random number generator
+RANDOM=$seed
+
+echo "# Testing a wrong configuration" >> $outfile
+write foo 255 ""
+
+echo "# Testing the 'all' syntax" >> $outfile
+write "all" 0 "cpumap: all"
+write "nodes:all" 0 "cpumap: all"
+write "all,nodes:all" 0 "cpumap: all"
+write "all,^nodes:0,all" 0 "cpumap: all"
+
+echo "# Testing the empty cpumap case" >> $outfile
+write "^0" 0 "cpumap: none"
+
+echo "# A few attempts of pinning to just one random cpu" >> $outfile
+if [ $nr_cpus -gt 1 ]; then
+    for i in `seq 0 3`; do
+        cpu=$(($RANDOM % nr_cpus))
+        write "$cpu" 0 "cpumap: $cpu"
+    done
+fi
+
+echo "# A few attempts of pinning to all but one random cpu" >> $outfile
+if [ $nr_cpus -gt 2 ]; then
+    for i in `seq 0 3`; do
+        cpu=$(($RANDOM % nr_cpus))
+        if [ $cpu -eq 0 ]; then
+            expected_range="1-$((nr_cpus - 1))"
+        elif [ $cpu -eq 1 ]; then
+            expected_range="0,2-$((nr_cpus - 1))"
+        elif [ $cpu -eq $((nr_cpus - 2)) ]; then
+            expected_range="0-$((cpu - 1)),$((nr_cpus - 1))"
+        elif [ $cpu -eq $((nr_cpus - 1)) ]; then
+            expected_range="0-$((nr_cpus - 2))"
+        else
+            expected_range="0-$((cpu - 1)),$((cpu + 1))-$((nr_cpus - 1))"
+        fi
+        write "all,^$cpu" 0 "cpumap: $expected_range"
+    done
+fi
+
+echo "# A few attempts of pinning to a random range of cpus" >> $outfile
+if [ $nr_cpus -gt 2 ]; then
+    for i in `seq 0 3`; do
+        cpua=$(($RANDOM % nr_cpus))
+        range=$((nr_cpus - cpua))
+        cpub=$(($RANDOM % range))
+        cpubb=$((cpua + cpub))
+        if [ $cpua -eq $cpubb ]; then
+            expected_range="$cpua"
+        else
+            expected_range="$cpua-$cpubb"
+        fi
+        write "$expected_range" 0 "cpumap: $expected_range"
+    done
+fi
+
+echo "# A few attempts of pinning to just one random node" >> $outfile
+if [ $nr_nodes -gt 1 ]; then
+    for i in `seq 0 3`; do
+        node=$(($RANDOM % nr_nodes))
+        # this assumes that the first $nr_cpus_per_node (from cpu
+        # 0 to cpu $nr_cpus_per_node-1) are assigned to the first node
+        # (node 0), the second $nr_cpus_per_node (from $nr_cpus_per_node
+        # to 2*$nr_cpus_per_node-1) are assigned to the second node (node
+        # 1), etc. Expect failures if that is not the case.
+        write "nodes:$node" 0 "cpumap: $((nr_cpus_per_node*node))-$((nr_cpus_per_node*(node+1)-1))"
+    done
+fi
+
+echo "# A few attempts of pinning to all but one random node" >> $outfile
+if [ $nr_nodes -gt 1 ]; then
+    for i in `seq 0 3`; do
+        node=$(($RANDOM % nr_nodes))
+        # this assumes that the first $nr_cpus_per_node (from cpu
+        # 0 to cpu $nr_cpus_per_node-1) are assigned to the first node
+        # (node 0), the second $nr_cpus_per_node (from $nr_cpus_per_node
+        # to 2*$nr_cpus_per_node-1) are assigned to the second node (node
+        # 1), etc. Expect failures if that is not the case.
+        if [ $node -eq 0 ]; then
+            expected_range="$nr_cpus_per_node-$((nr_cpus - 1))"
+        elif [ $node -eq $((nr_nodes - 1)) ]; then
+            expected_range="0-$((nr_cpus - nr_cpus_per_node - 1))"
+        else
+            expected_range="0-$((nr_cpus_per_node*node-1)),$((nr_cpus_per_node*(node+1)))-$nr_cpus"
+        fi
+        write "all,^nodes:$node" 0 "cpumap: $expected_range"
+    done
+fi
+
+echo "# A few attempts of pinning to a random range of nodes" >> $outfile
+if [ $nr_nodes -gt 1 ]; then
+    for i in `seq 0 3`; do
+        nodea=$(($RANDOM % nr_nodes))
+        range=$((nr_nodes - nodea))
+        nodeb=$(($RANDOM % range))
+        nodebb=$((nodea + nodeb))
+        # this assumes that the first $nr_cpus_per_node (from cpu
+        # 0 to cpu $nr_cpus_per_node-1) are assigned to the first node
+        # (node 0), the second $nr_cpus_per_node (from $nr_cpus_per_node
+        # to 2*$nr_cpus_per_node-1) are assigned to the second node (node
+        # 1), etc. Expect failures if that is not the case.
+        if [ $nodea -eq 0 ] && [ $nodebb -eq $((nr_nodes - 1)) ]; then
+            expected_range="all"
+        else
+            expected_range="$((nr_cpus_per_node*nodea))-$((nr_cpus_per_node*(nodebb+1) - 1))"
+        fi
+        write "nodes:$nodea-$nodebb" 0 "cpumap: $expected_range"
+    done
+fi
+
+echo "# A few attempts of pinning to a node but excluding one random cpu" >> $outfile
+if [ $nr_nodes -gt 1 ]; then
+    for i in `seq 0 3`; do
+        node=$(($RANDOM % nr_nodes))
+        # this assumes that the first $nr_cpus_per_node (from cpu
+        # 0 to cpu $nr_cpus_per_node-1) are assigned to the first node
+        # (node 0), the second $nr_cpus_per_node (from $nr_cpus_per_node
+        # to 2*$nr_cpus_per_node-1) are assigned to the second node (node
+        # 1), etc. Expect failures if that is not the case.
+        cpu=$(($RANDOM % nr_cpus_per_node + nr_cpus_per_node*node))
+        if [ $cpu -eq $((nr_cpus_per_node*node)) ]; then
+            expected_range="$((nr_cpus_per_node*node + 1))-$((nr_cpus_per_node*(node+1) - 1))"
+        elif [ $cpu -eq $((nr_cpus_per_node*node + 1)) ]; then
+            expected_range="$((nr_cpus_per_node*node)),$((nr_cpus_per_node*node + 2))-$((nr_cpus_per_node*(node+1) - 1))"
+        elif [ $cpu -eq $((nr_cpus_per_node*(node+1) - 2)) ]; then
+            expected_range="$((nr_cpus_per_node*node))-$((nr_cpus_per_node*(node+1) - 3)),$((nr_cpus_per_node*(node+1) - 1))"
+        elif [ $cpu -eq $((nr_cpus_per_node*(node+1) - 1)) ]; then
+            expected_range="$((nr_cpus_per_node*node))-$((nr_cpus_per_node*(node+1) - 2))"
+        else
+            expected_range="$((nr_cpus_per_node*node))-$((cpu - 1)),$((cpu + 1))-$((nr_cpus_per_node*(node+1) - 1))"
+        fi
+        write "nodes:$node,^$cpu" 0 "cpumap: $expected_range"
+    done
+fi
+
+run $outfile
diff --git a/tools/libxl/check-xl-vcpupin-parse.data-example b/tools/libxl/check-xl-vcpupin-parse.data-example
new file mode 100644
index 0000000..4bbd5de
--- /dev/null
+++ b/tools/libxl/check-xl-vcpupin-parse.data-example
@@ -0,0 +1,53 @@
+# WARNING: some of these tests are topology based tests.
+# Expect failures if the topology is not detected correctly
+# detected topology:  16 CPUs,  2 nodes, 8 CPUs per node.
+#
+# seed used for random number generation: seed=13328.
+#
+# Format is as follows:
+#  test-string*expected-return-code*expected-output
+#
+# Testing a wrong configuration
+foo*255*
+# Testing the 'all' syntax
+all*0*cpumap: all
+nodes:all*0*cpumap: all
+all,nodes:all*0*cpumap: all
+all,^nodes:0,all*0*cpumap: all
+# Testing the empty cpumap case
+^0*0*cpumap: none
+# A few attempts of pinning to just one random cpu
+0*0*cpumap: 0
+9*0*cpumap: 9
+6*0*cpumap: 6
+0*0*cpumap: 0
+# A few attempts of pinning to all but one random cpu
+all,^12*0*cpumap: 0-11,13-15
+all,^6*0*cpumap: 0-5,7-15
+all,^3*0*cpumap: 0-2,4-15
+all,^7*0*cpumap: 0-6,8-15
+# A few attempts of pinning to a random range of cpus
+13-15*0*cpumap: 13-15
+7*0*cpumap: 7
+3-5*0*cpumap: 3-5
+8-11*0*cpumap: 8-11
+# A few attempts of pinning to just one random node
+nodes:1*0*cpumap: 8-15
+nodes:0*0*cpumap: 0-7
+nodes:0*0*cpumap: 0-7
+nodes:0*0*cpumap: 0-7
+# A few attempts of pinning to all but one random node
+all,^nodes:0*0*cpumap: 8-15
+all,^nodes:1*0*cpumap: 0-7
+all,^nodes:1*0*cpumap: 0-7
+all,^nodes:0*0*cpumap: 8-15
+# A few attempts of pinning to a random range of nodes
+nodes:1-1*0*cpumap: 8-15
+nodes:1-1*0*cpumap: 8-15
+nodes:0-1*0*cpumap: all
+nodes:0-0*0*cpumap: 0-7
+# A few attempts of pinning to a node but excluding one random cpu
+nodes:1,^8*0*cpumap: 9-15
+nodes:0,^6*0*cpumap: 0-5,7
+nodes:1,^9*0*cpumap: 8,10-15
+nodes:0,^5*0*cpumap: 0-4,6-7
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:12:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:12: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 1VqN79-00028M-S7; Tue, 10 Dec 2013 13:12:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN78-000284-7y
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:38 +0000
Received: from [193.109.254.147:5048] by server-3.bemta-14.messagelabs.com id
	72/A4-11000-54317A25; Tue, 10 Dec 2013 13:12:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1386681155!4194269!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29701 invoked from network); 10 Dec 2013 13:12:36 -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;
	10 Dec 2013 13:12: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 1VqN75-0000KW-9K
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN75-0007tF-7f
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:35 +0000
Date: Tue, 10 Dec 2013 13:12:35 +0000
Message-Id: <E1VqN75-0007tF-7f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: test script for the cpumap parser
	(for vCPU pinning)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit caee9a0362b198636410793e091ba901ddca9f2c
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Sat Dec 7 01:05:34 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:20:12 2013 +0000

    xl: test script for the cpumap parser (for vCPU pinning)
    
    This commit introduces "check-xl-vcpupin-parse" for helping
    verifying and debugging the (v)CPU bitmap parsing code in xl.
    
    The script runs "xl -N vcpu-pin 0 all <some strings>"
    repeatedly, with various input strings, and checks that the
    output is as expected.
    
    This is what the script can do:
    
    # ./check-xl-vcpupin-parse -h
     usage: ./check-xl-vcpupin-parse [options]
    
     Tests various vcpu-pinning strings. If run without arguments acts
     as follows:
      - generates some test data and saves them in
        check-xl-vcpupin-parse.data;
      - tests all the generated configurations (reading them back from
        check-xl-vcpupin-parse.data).
    
     An example of a test vector file is provided in
     check-xl-vcpupin-parse.data-example.
    
     Options:
      -h         prints this message
      -r seed    uses seed for initializing the rundom number generator
                 (default: the script PID)
      -s string  tries using string as a vcpu pinning configuration and
                 reports whether that succeeds or not
      -o ofile   save the test data in ofile
                 (default: check-xl-vcpupin-parse.data)
      -i ifile   read test data from ifile
    
    An example test data file (generated on a 2 NUMA nodes, 16 CPUs
    host) is being provided in check-xl-vcpupin-parse.data-example.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/check-xl-vcpupin-parse              |  294 +++++++++++++++++++++++
 tools/libxl/check-xl-vcpupin-parse.data-example |   53 ++++
 2 files changed, 347 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/check-xl-vcpupin-parse b/tools/libxl/check-xl-vcpupin-parse
new file mode 100755
index 0000000..21f8421
--- /dev/null
+++ b/tools/libxl/check-xl-vcpupin-parse
@@ -0,0 +1,294 @@
+#!/bin/bash
+
+set -e
+
+if [ -x ./xl ] ; then
+    export LD_LIBRARY_PATH=.:../libxc:../xenstore:
+    XL=./xl
+else
+    XL=xl
+fi
+
+fprefix=tmp.check-xl-vcpupin-parse
+outfile=check-xl-vcpupin-parse.data
+
+usage () {
+cat <<END
+usage: $0 [options]
+
+Tests various vcpu-pinning strings. If run without arguments acts
+as follows:
+ - generates some test data and saves them in $outfile;
+ - tests all the generated configurations (reading them back from
+   $outfile).
+
+An example of a test vector file is provided in ${outfile}-example.
+
+Options:
+ -h         prints this message
+ -r seed    uses seed for initializing the rundom number generator
+            (default: the script PID)
+ -s string  tries using string as a vcpu pinning configuration and
+            reports whether that succeeds or not
+ -o ofile   save the test data in ofile (default: $outfile)
+ -i ifile   read test data from ifile
+END
+}
+
+expected () {
+    cat >$fprefix.expected
+}
+
+# by default, re-seed with our PID
+seed=$$
+failures=0
+
+# Execute one test and check the result against the provided
+# rc value and output
+one () {
+    expected_rc=$1; shift
+    printf "test case %s...\n" "$*"
+    set +e
+    ${XL} -N vcpu-pin 0 all "$@" </dev/null >$fprefix.actual 2>/dev/null
+    actual_rc=$?
+    if [ $actual_rc != $expected_rc ]; then
+        diff -u $fprefix.expected $fprefix.actual
+        echo >&2 "test case \`$*' failed ($actual_rc $diff_rc)"
+        failures=$(( $failures + 1 ))
+    fi
+    set -e
+}
+
+# Write an entry in the test vector file. Format is as follows:
+#  test-string*expected-rc*expected-output
+write () {
+    printf "$1*$2*$3\n" >> $outfile
+}
+
+complete () {
+    if [ "$failures" = 0 ]; then
+        echo all ok.; exit 0
+    else
+        echo "$failures tests failed."; exit 1
+    fi
+}
+
+# Test a specific pinning string
+string () {
+    expected_rc=$1; shift
+    printf "test case %s...\n" "$*"
+    set +e
+    ${XL} -N vcpu-pin 0 all "$@" &> /dev/null
+    actual_rc=$?
+    set -e
+
+    if [ $actual_rc != $expected_rc ]; then
+        echo >&2 "test case \`$*' failed ($actual_rc)"
+    else
+        echo >&2 "test case \`$*' succeeded"
+    fi
+
+    exit 0
+}
+
+# Read a test vector file (provided as $1) line by line and
+# test all the entries it contains
+run ()
+{
+    while read line
+    do
+        if [ ${line:0:1} != '#' ]; then
+            test_string="`echo $line | cut -f1 -d'*'`"
+            exp_rc="`echo $line | cut -f2 -d'*'`"
+            exp_output="`echo $line | cut -f3 -d'*'`"
+
+            expected <<END
+$exp_output
+END
+            one $exp_rc "$test_string"
+        fi
+    done < $1
+
+    complete
+
+    exit 0
+}
+
+while getopts "hr:s:o:i:" option
+do
+    case $option in
+    h)
+        usage
+        exit 0
+        ;;
+    r)
+        seed=$OPTARG
+        ;;
+    s)
+        string 0 "$OPTARG"
+        ;;
+    o)
+        outfile=$OPTARG
+        ;;
+    i)
+        run $OPTARG
+        ;;
+    esac
+done
+
+#---------- test data ----------
+#
+nr_cpus=`xl info | grep nr_cpus | cut -f2 -d':'`
+nr_nodes=`xl info | grep nr_nodes | cut -f2 -d':'`
+nr_cpus_per_node=`xl info -n | sed '/cpu:/,/numa_info/!d' | head -n -1 | \
+    awk '{print $4}' | uniq -c | tail -1 | awk '{print $1}'`
+cat >$outfile <<END
+# WARNING: some of these tests are topology based tests.
+# Expect failures if the topology is not detected correctly
+# detected topology: $nr_cpus CPUs, $nr_nodes nodes, $nr_cpus_per_node CPUs per node.
+#
+# seed used for random number generation: seed=${seed}.
+#
+# Format is as follows:
+#  test-string*expected-return-code*expected-output
+#
+END
+
+# Re-seed the random number generator
+RANDOM=$seed
+
+echo "# Testing a wrong configuration" >> $outfile
+write foo 255 ""
+
+echo "# Testing the 'all' syntax" >> $outfile
+write "all" 0 "cpumap: all"
+write "nodes:all" 0 "cpumap: all"
+write "all,nodes:all" 0 "cpumap: all"
+write "all,^nodes:0,all" 0 "cpumap: all"
+
+echo "# Testing the empty cpumap case" >> $outfile
+write "^0" 0 "cpumap: none"
+
+echo "# A few attempts of pinning to just one random cpu" >> $outfile
+if [ $nr_cpus -gt 1 ]; then
+    for i in `seq 0 3`; do
+        cpu=$(($RANDOM % nr_cpus))
+        write "$cpu" 0 "cpumap: $cpu"
+    done
+fi
+
+echo "# A few attempts of pinning to all but one random cpu" >> $outfile
+if [ $nr_cpus -gt 2 ]; then
+    for i in `seq 0 3`; do
+        cpu=$(($RANDOM % nr_cpus))
+        if [ $cpu -eq 0 ]; then
+            expected_range="1-$((nr_cpus - 1))"
+        elif [ $cpu -eq 1 ]; then
+            expected_range="0,2-$((nr_cpus - 1))"
+        elif [ $cpu -eq $((nr_cpus - 2)) ]; then
+            expected_range="0-$((cpu - 1)),$((nr_cpus - 1))"
+        elif [ $cpu -eq $((nr_cpus - 1)) ]; then
+            expected_range="0-$((nr_cpus - 2))"
+        else
+            expected_range="0-$((cpu - 1)),$((cpu + 1))-$((nr_cpus - 1))"
+        fi
+        write "all,^$cpu" 0 "cpumap: $expected_range"
+    done
+fi
+
+echo "# A few attempts of pinning to a random range of cpus" >> $outfile
+if [ $nr_cpus -gt 2 ]; then
+    for i in `seq 0 3`; do
+        cpua=$(($RANDOM % nr_cpus))
+        range=$((nr_cpus - cpua))
+        cpub=$(($RANDOM % range))
+        cpubb=$((cpua + cpub))
+        if [ $cpua -eq $cpubb ]; then
+            expected_range="$cpua"
+        else
+            expected_range="$cpua-$cpubb"
+        fi
+        write "$expected_range" 0 "cpumap: $expected_range"
+    done
+fi
+
+echo "# A few attempts of pinning to just one random node" >> $outfile
+if [ $nr_nodes -gt 1 ]; then
+    for i in `seq 0 3`; do
+        node=$(($RANDOM % nr_nodes))
+        # this assumes that the first $nr_cpus_per_node (from cpu
+        # 0 to cpu $nr_cpus_per_node-1) are assigned to the first node
+        # (node 0), the second $nr_cpus_per_node (from $nr_cpus_per_node
+        # to 2*$nr_cpus_per_node-1) are assigned to the second node (node
+        # 1), etc. Expect failures if that is not the case.
+        write "nodes:$node" 0 "cpumap: $((nr_cpus_per_node*node))-$((nr_cpus_per_node*(node+1)-1))"
+    done
+fi
+
+echo "# A few attempts of pinning to all but one random node" >> $outfile
+if [ $nr_nodes -gt 1 ]; then
+    for i in `seq 0 3`; do
+        node=$(($RANDOM % nr_nodes))
+        # this assumes that the first $nr_cpus_per_node (from cpu
+        # 0 to cpu $nr_cpus_per_node-1) are assigned to the first node
+        # (node 0), the second $nr_cpus_per_node (from $nr_cpus_per_node
+        # to 2*$nr_cpus_per_node-1) are assigned to the second node (node
+        # 1), etc. Expect failures if that is not the case.
+        if [ $node -eq 0 ]; then
+            expected_range="$nr_cpus_per_node-$((nr_cpus - 1))"
+        elif [ $node -eq $((nr_nodes - 1)) ]; then
+            expected_range="0-$((nr_cpus - nr_cpus_per_node - 1))"
+        else
+            expected_range="0-$((nr_cpus_per_node*node-1)),$((nr_cpus_per_node*(node+1)))-$nr_cpus"
+        fi
+        write "all,^nodes:$node" 0 "cpumap: $expected_range"
+    done
+fi
+
+echo "# A few attempts of pinning to a random range of nodes" >> $outfile
+if [ $nr_nodes -gt 1 ]; then
+    for i in `seq 0 3`; do
+        nodea=$(($RANDOM % nr_nodes))
+        range=$((nr_nodes - nodea))
+        nodeb=$(($RANDOM % range))
+        nodebb=$((nodea + nodeb))
+        # this assumes that the first $nr_cpus_per_node (from cpu
+        # 0 to cpu $nr_cpus_per_node-1) are assigned to the first node
+        # (node 0), the second $nr_cpus_per_node (from $nr_cpus_per_node
+        # to 2*$nr_cpus_per_node-1) are assigned to the second node (node
+        # 1), etc. Expect failures if that is not the case.
+        if [ $nodea -eq 0 ] && [ $nodebb -eq $((nr_nodes - 1)) ]; then
+            expected_range="all"
+        else
+            expected_range="$((nr_cpus_per_node*nodea))-$((nr_cpus_per_node*(nodebb+1) - 1))"
+        fi
+        write "nodes:$nodea-$nodebb" 0 "cpumap: $expected_range"
+    done
+fi
+
+echo "# A few attempts of pinning to a node but excluding one random cpu" >> $outfile
+if [ $nr_nodes -gt 1 ]; then
+    for i in `seq 0 3`; do
+        node=$(($RANDOM % nr_nodes))
+        # this assumes that the first $nr_cpus_per_node (from cpu
+        # 0 to cpu $nr_cpus_per_node-1) are assigned to the first node
+        # (node 0), the second $nr_cpus_per_node (from $nr_cpus_per_node
+        # to 2*$nr_cpus_per_node-1) are assigned to the second node (node
+        # 1), etc. Expect failures if that is not the case.
+        cpu=$(($RANDOM % nr_cpus_per_node + nr_cpus_per_node*node))
+        if [ $cpu -eq $((nr_cpus_per_node*node)) ]; then
+            expected_range="$((nr_cpus_per_node*node + 1))-$((nr_cpus_per_node*(node+1) - 1))"
+        elif [ $cpu -eq $((nr_cpus_per_node*node + 1)) ]; then
+            expected_range="$((nr_cpus_per_node*node)),$((nr_cpus_per_node*node + 2))-$((nr_cpus_per_node*(node+1) - 1))"
+        elif [ $cpu -eq $((nr_cpus_per_node*(node+1) - 2)) ]; then
+            expected_range="$((nr_cpus_per_node*node))-$((nr_cpus_per_node*(node+1) - 3)),$((nr_cpus_per_node*(node+1) - 1))"
+        elif [ $cpu -eq $((nr_cpus_per_node*(node+1) - 1)) ]; then
+            expected_range="$((nr_cpus_per_node*node))-$((nr_cpus_per_node*(node+1) - 2))"
+        else
+            expected_range="$((nr_cpus_per_node*node))-$((cpu - 1)),$((cpu + 1))-$((nr_cpus_per_node*(node+1) - 1))"
+        fi
+        write "nodes:$node,^$cpu" 0 "cpumap: $expected_range"
+    done
+fi
+
+run $outfile
diff --git a/tools/libxl/check-xl-vcpupin-parse.data-example b/tools/libxl/check-xl-vcpupin-parse.data-example
new file mode 100644
index 0000000..4bbd5de
--- /dev/null
+++ b/tools/libxl/check-xl-vcpupin-parse.data-example
@@ -0,0 +1,53 @@
+# WARNING: some of these tests are topology based tests.
+# Expect failures if the topology is not detected correctly
+# detected topology:  16 CPUs,  2 nodes, 8 CPUs per node.
+#
+# seed used for random number generation: seed=13328.
+#
+# Format is as follows:
+#  test-string*expected-return-code*expected-output
+#
+# Testing a wrong configuration
+foo*255*
+# Testing the 'all' syntax
+all*0*cpumap: all
+nodes:all*0*cpumap: all
+all,nodes:all*0*cpumap: all
+all,^nodes:0,all*0*cpumap: all
+# Testing the empty cpumap case
+^0*0*cpumap: none
+# A few attempts of pinning to just one random cpu
+0*0*cpumap: 0
+9*0*cpumap: 9
+6*0*cpumap: 6
+0*0*cpumap: 0
+# A few attempts of pinning to all but one random cpu
+all,^12*0*cpumap: 0-11,13-15
+all,^6*0*cpumap: 0-5,7-15
+all,^3*0*cpumap: 0-2,4-15
+all,^7*0*cpumap: 0-6,8-15
+# A few attempts of pinning to a random range of cpus
+13-15*0*cpumap: 13-15
+7*0*cpumap: 7
+3-5*0*cpumap: 3-5
+8-11*0*cpumap: 8-11
+# A few attempts of pinning to just one random node
+nodes:1*0*cpumap: 8-15
+nodes:0*0*cpumap: 0-7
+nodes:0*0*cpumap: 0-7
+nodes:0*0*cpumap: 0-7
+# A few attempts of pinning to all but one random node
+all,^nodes:0*0*cpumap: 8-15
+all,^nodes:1*0*cpumap: 0-7
+all,^nodes:1*0*cpumap: 0-7
+all,^nodes:0*0*cpumap: 8-15
+# A few attempts of pinning to a random range of nodes
+nodes:1-1*0*cpumap: 8-15
+nodes:1-1*0*cpumap: 8-15
+nodes:0-1*0*cpumap: all
+nodes:0-0*0*cpumap: 0-7
+# A few attempts of pinning to a node but excluding one random cpu
+nodes:1,^8*0*cpumap: 9-15
+nodes:0,^6*0*cpumap: 0-5,7
+nodes:1,^9*0*cpumap: 8,10-15
+nodes:0,^5*0*cpumap: 0-4,6-7
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:12:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:12: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 1VqN7K-0002Ak-26; Tue, 10 Dec 2013 13:12:50 +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 1VqN7I-0002AP-Er
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:48 +0000
Received: from [85.158.143.35:14576] by server-1.bemta-4.messagelabs.com id
	F3/CE-02132-F4317A25; Tue, 10 Dec 2013 13:12:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1386681165!4687884!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6957 invoked from network); 10 Dec 2013 13:12:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:12: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 1VqN7F-0000Kc-E6
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN7F-0007tg-Cr
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:45 +0000
Date: Tue, 10 Dec 2013 13:12:45 +0000
Message-Id: <E1VqN7F-0007tg-Cr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Config.mk: update OVMF 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 cc0baa5cc313522282976cf291c809d644c0e644
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sun Dec 8 20:50:20 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:25:48 2013 +0000

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: George Dunlap <george.dunlap@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 8d32b99..2007b22 100644
--- a/Config.mk
+++ b/Config.mk
@@ -233,7 +233,7 @@ OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
-OVMF_UPSTREAM_REVISION ?= a93b0e3f6895a074b99c8817181dfa6dbc7a4807
+OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
 QEMU_UPSTREAM_REVISION ?= master
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:12:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:12: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 1VqN7K-0002Ak-26; Tue, 10 Dec 2013 13:12:50 +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 1VqN7I-0002AP-Er
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:48 +0000
Received: from [85.158.143.35:14576] by server-1.bemta-4.messagelabs.com id
	F3/CE-02132-F4317A25; Tue, 10 Dec 2013 13:12:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1386681165!4687884!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6957 invoked from network); 10 Dec 2013 13:12:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:12: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 1VqN7F-0000Kc-E6
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN7F-0007tg-Cr
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:45 +0000
Date: Tue, 10 Dec 2013 13:12:45 +0000
Message-Id: <E1VqN7F-0007tg-Cr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Config.mk: update OVMF 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 cc0baa5cc313522282976cf291c809d644c0e644
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sun Dec 8 20:50:20 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:25:48 2013 +0000

    Config.mk: update OVMF changeset
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: George Dunlap <george.dunlap@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 8d32b99..2007b22 100644
--- a/Config.mk
+++ b/Config.mk
@@ -233,7 +233,7 @@ OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
-OVMF_UPSTREAM_REVISION ?= a93b0e3f6895a074b99c8817181dfa6dbc7a4807
+OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
 QEMU_UPSTREAM_REVISION ?= master
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:13:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:13: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 1VqN7U-0002Cx-5U; Tue, 10 Dec 2013 13:13:00 +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 1VqN7S-0002Ca-AR
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:58 +0000
Received: from [85.158.143.35:13775] by server-2.bemta-4.messagelabs.com id
	37/8A-11386-95317A25; Tue, 10 Dec 2013 13:12:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1386681175!3423556!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15166 invoked from network); 10 Dec 2013 13:12:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:12: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 1VqN7P-0000Kl-I3
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN7P-0007uE-Gi
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:55 +0000
Date: Tue, 10 Dec 2013 13:12:55 +0000
Message-Id: <E1VqN7P-0007uE-Gi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: do not BUG on guest paddrs
	which are very high
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9ed46ae6d29e5e87b45127d446e05db119c1b464
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 9 11:09:10 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:25:50 2013 +0000

    xen: arm: do not BUG on guest paddrs which are very high
    
    The BUG_ON in p2m_map_first was over aggressive since the paddr_t can have
    come from the guest, via add_to_physmap. Instead return failure to the caller.
    
    Also the check was simultaneously too lose. The valid offsets are
    0..P2M_FIRST_ENTRIES-1 inclusive.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/p2m.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 1d5c841..083f8bf 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -58,7 +58,8 @@ static lpae_t *p2m_map_first(struct p2m_domain *p2m, paddr_t addr)
 {
     struct page_info *page;
 
-    BUG_ON(first_linear_offset(addr) > P2M_FIRST_ENTRIES);
+    if ( first_linear_offset(addr) >= P2M_FIRST_ENTRIES )
+        return NULL;
 
     page = p2m->first_level + p2m_first_level_index(addr);
 
@@ -80,6 +81,8 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr)
     spin_lock(&p2m->lock);
 
     first = p2m_map_first(p2m, paddr);
+    if ( !first )
+        goto err;
 
     pte = first[first_table_offset(paddr)];
     if ( !pte.p2m.valid || !pte.p2m.table )
@@ -105,6 +108,7 @@ done:
     if (second) unmap_domain_page(second);
     if (first) unmap_domain_page(first);
 
+err:
     spin_unlock(&p2m->lock);
 
     return maddr;
@@ -181,6 +185,11 @@ static int create_p2m_entries(struct domain *d,
         {
             if ( first ) unmap_domain_page(first);
             first = p2m_map_first(p2m, addr);
+            if ( !first )
+            {
+                rc = -EINVAL;
+                goto out;
+            }
             cur_first_page = p2m_first_level_index(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 Tue Dec 10 13:13:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:13: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 1VqN7U-0002Cx-5U; Tue, 10 Dec 2013 13:13:00 +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 1VqN7S-0002Ca-AR
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:58 +0000
Received: from [85.158.143.35:13775] by server-2.bemta-4.messagelabs.com id
	37/8A-11386-95317A25; Tue, 10 Dec 2013 13:12:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1386681175!3423556!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15166 invoked from network); 10 Dec 2013 13:12:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:12: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 1VqN7P-0000Kl-I3
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN7P-0007uE-Gi
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:12:55 +0000
Date: Tue, 10 Dec 2013 13:12:55 +0000
Message-Id: <E1VqN7P-0007uE-Gi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: do not BUG on guest paddrs
	which are very high
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9ed46ae6d29e5e87b45127d446e05db119c1b464
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 9 11:09:10 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:25:50 2013 +0000

    xen: arm: do not BUG on guest paddrs which are very high
    
    The BUG_ON in p2m_map_first was over aggressive since the paddr_t can have
    come from the guest, via add_to_physmap. Instead return failure to the caller.
    
    Also the check was simultaneously too lose. The valid offsets are
    0..P2M_FIRST_ENTRIES-1 inclusive.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/p2m.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 1d5c841..083f8bf 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -58,7 +58,8 @@ static lpae_t *p2m_map_first(struct p2m_domain *p2m, paddr_t addr)
 {
     struct page_info *page;
 
-    BUG_ON(first_linear_offset(addr) > P2M_FIRST_ENTRIES);
+    if ( first_linear_offset(addr) >= P2M_FIRST_ENTRIES )
+        return NULL;
 
     page = p2m->first_level + p2m_first_level_index(addr);
 
@@ -80,6 +81,8 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr)
     spin_lock(&p2m->lock);
 
     first = p2m_map_first(p2m, paddr);
+    if ( !first )
+        goto err;
 
     pte = first[first_table_offset(paddr)];
     if ( !pte.p2m.valid || !pte.p2m.table )
@@ -105,6 +108,7 @@ done:
     if (second) unmap_domain_page(second);
     if (first) unmap_domain_page(first);
 
+err:
     spin_unlock(&p2m->lock);
 
     return maddr;
@@ -181,6 +185,11 @@ static int create_p2m_entries(struct domain *d,
         {
             if ( first ) unmap_domain_page(first);
             first = p2m_map_first(p2m, addr);
+            if ( !first )
+            {
+                rc = -EINVAL;
+                goto out;
+            }
             cur_first_page = p2m_first_level_index(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 Tue Dec 10 13:13:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:13: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 1VqN7h-0002FF-8d; Tue, 10 Dec 2013 13:13: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 1VqN7f-0002Es-LP
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:11 +0000
Received: from [193.109.254.147:53822] by server-2.bemta-14.messagelabs.com id
	2C/E6-00361-76317A25; Tue, 10 Dec 2013 13:13:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1386681185!709639!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24245 invoked from network); 10 Dec 2013 13:13:06 -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;
	10 Dec 2013 13:13: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 1VqN7Z-0000LK-Ly
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN7Z-0007ul-Ke
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:05 +0000
Date: Tue, 10 Dec 2013 13:13:05 +0000
Message-Id: <E1VqN7Z-0007ul-Ke@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: vtimer fixes for arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 90ed3c202f2c8ce286735ca235dd1fdcbd35dd8f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 9 11:13:36 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:27:46 2013 +0000

    xen: arm: vtimer fixes for arm64
    
    The code was writing back the register, even for writes and didn't implement
    CNTPCT at all.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vtimer.c |   51 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index f323453..433ad55 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -165,6 +165,27 @@ static void vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
     }
 }
 
+static int vtimer_cntpct(struct cpu_user_regs *regs, uint64_t *r, int read)
+{
+    struct vcpu *v = current;
+    uint64_t ticks;
+    s_time_t now;
+
+    if ( read )
+    {
+        now = NOW() - v->domain->arch.phys_timer_base.offset;
+        ticks = ns_to_ticks(now);
+        *r = ticks;
+        return 1;
+    }
+    else
+    {
+        gdprintk(XENLOG_DEBUG, "WRITE to R/O CNTPCT\n");
+        return 0;
+    }
+}
+
+
 static int vtimer_emulate_cp32(struct cpu_user_regs *regs, union hsr hsr)
 {
     struct hsr_cp32 cp32 = hsr.cp32;
@@ -187,29 +208,23 @@ static int vtimer_emulate_cp32(struct cpu_user_regs *regs, union hsr hsr)
 
 static int vtimer_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr)
 {
-    struct vcpu *v = current;
     struct hsr_cp64 cp64 = hsr.cp64;
     uint32_t *r1 = (uint32_t *)select_user_reg(regs, cp64.reg1);
     uint32_t *r2 = (uint32_t *)select_user_reg(regs, cp64.reg2);
-    uint64_t ticks;
-    s_time_t now;
+    uint64_t x;
 
     switch ( hsr.bits & HSR_CP64_REGS_MASK )
     {
     case HSR_CPREG64(CNTPCT):
+        if (!vtimer_cntpct(regs, &x, cp64.read))
+            return 0;
+
         if ( cp64.read )
         {
-            now = NOW() - v->domain->arch.phys_timer_base.offset;
-            ticks = ns_to_ticks(now);
-            *r1 = (uint32_t)(ticks & 0xffffffff);
-            *r2 = (uint32_t)(ticks >> 32);
-            return 1;
-        }
-        else
-        {
-            printk("READ from R/O CNTPCT\n");
-            return 0;
+            *r1 = (uint32_t)(x & 0xffffffff);
+            *r2 = (uint32_t)(x >> 32);
         }
+        return 1;
 
     default:
         return 0;
@@ -227,12 +242,18 @@ static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
     {
     case CNTP_CTL_EL0:
         vtimer_cntp_ctl(regs, &r, sysreg.read);
-        *x = r;
+        if ( sysreg.read )
+            *x = r;
         return 1;
     case CNTP_TVAL_EL0:
         vtimer_cntp_tval(regs, &r, sysreg.read);
-        *x = r;
+        if ( sysreg.read )
+            *x = r;
         return 1;
+
+    case HSR_CPREG64(CNTPCT):
+        return vtimer_cntpct(regs, x, sysreg.read);
+
     default:
         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 Tue Dec 10 13:13:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:13: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 1VqN7h-0002FF-8d; Tue, 10 Dec 2013 13:13: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 1VqN7f-0002Es-LP
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:11 +0000
Received: from [193.109.254.147:53822] by server-2.bemta-14.messagelabs.com id
	2C/E6-00361-76317A25; Tue, 10 Dec 2013 13:13:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1386681185!709639!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24245 invoked from network); 10 Dec 2013 13:13:06 -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;
	10 Dec 2013 13:13: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 1VqN7Z-0000LK-Ly
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN7Z-0007ul-Ke
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:05 +0000
Date: Tue, 10 Dec 2013 13:13:05 +0000
Message-Id: <E1VqN7Z-0007ul-Ke@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: vtimer fixes for arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 90ed3c202f2c8ce286735ca235dd1fdcbd35dd8f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 9 11:13:36 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:27:46 2013 +0000

    xen: arm: vtimer fixes for arm64
    
    The code was writing back the register, even for writes and didn't implement
    CNTPCT at all.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vtimer.c |   51 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index f323453..433ad55 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -165,6 +165,27 @@ static void vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
     }
 }
 
+static int vtimer_cntpct(struct cpu_user_regs *regs, uint64_t *r, int read)
+{
+    struct vcpu *v = current;
+    uint64_t ticks;
+    s_time_t now;
+
+    if ( read )
+    {
+        now = NOW() - v->domain->arch.phys_timer_base.offset;
+        ticks = ns_to_ticks(now);
+        *r = ticks;
+        return 1;
+    }
+    else
+    {
+        gdprintk(XENLOG_DEBUG, "WRITE to R/O CNTPCT\n");
+        return 0;
+    }
+}
+
+
 static int vtimer_emulate_cp32(struct cpu_user_regs *regs, union hsr hsr)
 {
     struct hsr_cp32 cp32 = hsr.cp32;
@@ -187,29 +208,23 @@ static int vtimer_emulate_cp32(struct cpu_user_regs *regs, union hsr hsr)
 
 static int vtimer_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr)
 {
-    struct vcpu *v = current;
     struct hsr_cp64 cp64 = hsr.cp64;
     uint32_t *r1 = (uint32_t *)select_user_reg(regs, cp64.reg1);
     uint32_t *r2 = (uint32_t *)select_user_reg(regs, cp64.reg2);
-    uint64_t ticks;
-    s_time_t now;
+    uint64_t x;
 
     switch ( hsr.bits & HSR_CP64_REGS_MASK )
     {
     case HSR_CPREG64(CNTPCT):
+        if (!vtimer_cntpct(regs, &x, cp64.read))
+            return 0;
+
         if ( cp64.read )
         {
-            now = NOW() - v->domain->arch.phys_timer_base.offset;
-            ticks = ns_to_ticks(now);
-            *r1 = (uint32_t)(ticks & 0xffffffff);
-            *r2 = (uint32_t)(ticks >> 32);
-            return 1;
-        }
-        else
-        {
-            printk("READ from R/O CNTPCT\n");
-            return 0;
+            *r1 = (uint32_t)(x & 0xffffffff);
+            *r2 = (uint32_t)(x >> 32);
         }
+        return 1;
 
     default:
         return 0;
@@ -227,12 +242,18 @@ static int vtimer_emulate_sysreg(struct cpu_user_regs *regs, union hsr hsr)
     {
     case CNTP_CTL_EL0:
         vtimer_cntp_ctl(regs, &r, sysreg.read);
-        *x = r;
+        if ( sysreg.read )
+            *x = r;
         return 1;
     case CNTP_TVAL_EL0:
         vtimer_cntp_tval(regs, &r, sysreg.read);
-        *x = r;
+        if ( sysreg.read )
+            *x = r;
         return 1;
+
+    case HSR_CPREG64(CNTPCT):
+        return vtimer_cntpct(regs, x, sysreg.read);
+
     default:
         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 Tue Dec 10 13:13:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:13: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 1VqN7o-0002Gt-BG; Tue, 10 Dec 2013 13:13: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 1VqN7m-0002Gb-Fe
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:18 +0000
Received: from [85.158.143.35:25977] by server-3.bemta-4.messagelabs.com id
	28/AF-32360-D6317A25; Tue, 10 Dec 2013 13:13:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1386681196!4641196!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6588 invoked from network); 10 Dec 2013 13:13:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:13: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 1VqN7j-0000LN-R7
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN7j-0007v9-PM
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:15 +0000
Date: Tue, 10 Dec 2013 13:13:15 +0000
Message-Id: <E1VqN7j-0007v9-PM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: handle initrd addresses
	above the 4G boundary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae5d5fb58dcacaf7e2d5fbfbe7b565f401c62808
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 9 11:43:35 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:28:55 2013 +0000

    xen: arm: handle initrd addresses above the 4G boundary
    
    The Xgene platform has no RAM below 4G.
    
    The /chosen/linux,initrd-* properties do not have "reg" semantics and
    therefore #*-size are not used when interpreting. Instead they are are simply
    numbers which are interpreted according to the properties length.
    
    Fix this both when parsing the entry in the host DTB and when creating the
    dom0 DTB. For dom0 we simply hardcode a 64-bit size, this is acceptable
    even for a 32-bit guest.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c   |   19 +++++++++++++------
 xen/common/device_tree.c      |   37 ++++++++++++++++++++++++++++++++-----
 xen/include/xen/device_tree.h |    8 +++++++-
 3 files changed, 52 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d50658b..fb1ec87 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -222,11 +222,12 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
          */
         if ( early_info.modules.module[MOD_INITRD].size )
         {
-            res = fdt_property_cell(kinfo->fdt, "linux,initrd-start", 0);
+            u64 a = 0;
+            res = fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(a));
             if ( res )
                 return res;
 
-            res = fdt_property_cell(kinfo->fdt, "linux,initrd-end", 0);
+            res = fdt_property(kinfo->fdt, "linux,initrd-end", &a, sizeof(a));
             if ( res )
                 return res;
         }
@@ -926,6 +927,8 @@ static void initrd_load(struct kernel_info *kinfo)
     unsigned long offs;
     int node;
     int res;
+    __be32 val[2];
+    __be32 *cellp;
 
     if ( !len )
         return;
@@ -938,13 +941,17 @@ static void initrd_load(struct kernel_info *kinfo)
     if ( node < 0 )
         panic("Cannot find the /chosen node");
 
-    res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-start",
-                                   load_addr);
+    cellp = (__be32 *)val;
+    dt_set_cell(&cellp, ARRAY_SIZE(val), load_addr);
+    res = fdt_setprop_inplace(kinfo->fdt, node, "linux,initrd-start",
+                              val, sizeof(val));
     if ( res )
         panic("Cannot fix up \"linux,initrd-start\" property");
 
-    res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-end",
-                                   load_addr + len);
+    cellp = (__be32 *)val;
+    dt_set_cell(&cellp, ARRAY_SIZE(val), load_addr + len);
+    res = fdt_setprop_inplace(kinfo->fdt, node, "linux,initrd-end",
+                              val, sizeof(val));
     if ( res )
         panic("Cannot fix up \"linux,initrd-end\" property");
 
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 943b181..84e709d 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -390,18 +390,45 @@ static void __init process_chosen_node(const void *fdt, int node,
                                        const char *name,
                                        u32 address_cells, u32 size_cells)
 {
+    const struct fdt_property *prop;
     struct dt_mb_module *mod = &early_info.modules.module[MOD_INITRD];
-    u32 start, end;
+    paddr_t start, end;
+    int len;
 
     dt_printk("Checking for initrd in /chosen\n");
 
-    start = device_tree_get_u32(fdt, node, "linux,initrd-start", 0);
-    end = device_tree_get_u32(fdt, node, "linux,initrd-end", 0);
+    prop = fdt_get_property(fdt, node, "linux,initrd-start", &len);
+    if ( !prop )
+        /* No initrd present. */
+        return;
+    if ( len != sizeof(u32) && len != sizeof(u64) )
+    {
+        dt_printk("linux,initrd-start property has invalid length %d\n", len);
+        return;
+    }
+    start = dt_read_number((void *)&prop->data, dt_size_to_cells(len));
 
-    if ( !start || !end || (start >= end) )
+    prop = fdt_get_property(fdt, node, "linux,initrd-end", &len);
+    if ( !prop )
+    {
+        dt_printk("linux,initrd-end not present but -start was\n");
         return;
+    }
+    if ( len != sizeof(u32) && len != sizeof(u64) )
+    {
+        dt_printk("linux,initrd-end property has invalid length %d\n", len);
+        return;
+    }
+    end = dt_read_number((void *)&prop->data, dt_size_to_cells(len));
+
+    if ( start >= end )
+    {
+        dt_printk("linux,initrd limits invalid: %"PRIpaddr" >= %"PRIpaddr"\n",
+                  start, end);
+        return;
+    }
 
-    dt_printk("Initrd 0x%x-0x%x\n", start, end);
+    dt_printk("Initrd %"PRIpaddr"-%"PRIpaddr"\n", start, end);
 
     mod->start = start;
     mod->size = end - start;
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index da78c9f..9a8c3de 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -256,12 +256,18 @@ static inline u64 dt_read_number(const __be32 *cell, int size)
     return r;
 }
 
-/* Helper to convert a number of cells in bytes */
+/* Helper to convert a number of cells to bytes */
 static inline int dt_cells_to_size(int size)
 {
     return (size * sizeof (u32));
 }
 
+/* Helper to convert a number of bytes to cells, rounds down */
+static inline int dt_size_to_cells(int bytes)
+{
+    return (bytes / sizeof(u32));
+}
+
 static inline u64 dt_next_cell(int s, const __be32 **cellp)
 {
     const __be32 *p = *cellp;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:13:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:13: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 1VqN7o-0002Gt-BG; Tue, 10 Dec 2013 13:13: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 1VqN7m-0002Gb-Fe
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:18 +0000
Received: from [85.158.143.35:25977] by server-3.bemta-4.messagelabs.com id
	28/AF-32360-D6317A25; Tue, 10 Dec 2013 13:13:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1386681196!4641196!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6588 invoked from network); 10 Dec 2013 13:13:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2013 13:13: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 1VqN7j-0000LN-R7
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN7j-0007v9-PM
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:15 +0000
Date: Tue, 10 Dec 2013 13:13:15 +0000
Message-Id: <E1VqN7j-0007v9-PM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: handle initrd addresses
	above the 4G boundary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae5d5fb58dcacaf7e2d5fbfbe7b565f401c62808
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 9 11:43:35 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:28:55 2013 +0000

    xen: arm: handle initrd addresses above the 4G boundary
    
    The Xgene platform has no RAM below 4G.
    
    The /chosen/linux,initrd-* properties do not have "reg" semantics and
    therefore #*-size are not used when interpreting. Instead they are are simply
    numbers which are interpreted according to the properties length.
    
    Fix this both when parsing the entry in the host DTB and when creating the
    dom0 DTB. For dom0 we simply hardcode a 64-bit size, this is acceptable
    even for a 32-bit guest.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c   |   19 +++++++++++++------
 xen/common/device_tree.c      |   37 ++++++++++++++++++++++++++++++++-----
 xen/include/xen/device_tree.h |    8 +++++++-
 3 files changed, 52 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d50658b..fb1ec87 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -222,11 +222,12 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
          */
         if ( early_info.modules.module[MOD_INITRD].size )
         {
-            res = fdt_property_cell(kinfo->fdt, "linux,initrd-start", 0);
+            u64 a = 0;
+            res = fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(a));
             if ( res )
                 return res;
 
-            res = fdt_property_cell(kinfo->fdt, "linux,initrd-end", 0);
+            res = fdt_property(kinfo->fdt, "linux,initrd-end", &a, sizeof(a));
             if ( res )
                 return res;
         }
@@ -926,6 +927,8 @@ static void initrd_load(struct kernel_info *kinfo)
     unsigned long offs;
     int node;
     int res;
+    __be32 val[2];
+    __be32 *cellp;
 
     if ( !len )
         return;
@@ -938,13 +941,17 @@ static void initrd_load(struct kernel_info *kinfo)
     if ( node < 0 )
         panic("Cannot find the /chosen node");
 
-    res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-start",
-                                   load_addr);
+    cellp = (__be32 *)val;
+    dt_set_cell(&cellp, ARRAY_SIZE(val), load_addr);
+    res = fdt_setprop_inplace(kinfo->fdt, node, "linux,initrd-start",
+                              val, sizeof(val));
     if ( res )
         panic("Cannot fix up \"linux,initrd-start\" property");
 
-    res = fdt_setprop_inplace_cell(kinfo->fdt, node, "linux,initrd-end",
-                                   load_addr + len);
+    cellp = (__be32 *)val;
+    dt_set_cell(&cellp, ARRAY_SIZE(val), load_addr + len);
+    res = fdt_setprop_inplace(kinfo->fdt, node, "linux,initrd-end",
+                              val, sizeof(val));
     if ( res )
         panic("Cannot fix up \"linux,initrd-end\" property");
 
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 943b181..84e709d 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -390,18 +390,45 @@ static void __init process_chosen_node(const void *fdt, int node,
                                        const char *name,
                                        u32 address_cells, u32 size_cells)
 {
+    const struct fdt_property *prop;
     struct dt_mb_module *mod = &early_info.modules.module[MOD_INITRD];
-    u32 start, end;
+    paddr_t start, end;
+    int len;
 
     dt_printk("Checking for initrd in /chosen\n");
 
-    start = device_tree_get_u32(fdt, node, "linux,initrd-start", 0);
-    end = device_tree_get_u32(fdt, node, "linux,initrd-end", 0);
+    prop = fdt_get_property(fdt, node, "linux,initrd-start", &len);
+    if ( !prop )
+        /* No initrd present. */
+        return;
+    if ( len != sizeof(u32) && len != sizeof(u64) )
+    {
+        dt_printk("linux,initrd-start property has invalid length %d\n", len);
+        return;
+    }
+    start = dt_read_number((void *)&prop->data, dt_size_to_cells(len));
 
-    if ( !start || !end || (start >= end) )
+    prop = fdt_get_property(fdt, node, "linux,initrd-end", &len);
+    if ( !prop )
+    {
+        dt_printk("linux,initrd-end not present but -start was\n");
         return;
+    }
+    if ( len != sizeof(u32) && len != sizeof(u64) )
+    {
+        dt_printk("linux,initrd-end property has invalid length %d\n", len);
+        return;
+    }
+    end = dt_read_number((void *)&prop->data, dt_size_to_cells(len));
+
+    if ( start >= end )
+    {
+        dt_printk("linux,initrd limits invalid: %"PRIpaddr" >= %"PRIpaddr"\n",
+                  start, end);
+        return;
+    }
 
-    dt_printk("Initrd 0x%x-0x%x\n", start, end);
+    dt_printk("Initrd %"PRIpaddr"-%"PRIpaddr"\n", start, end);
 
     mod->start = start;
     mod->size = end - start;
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index da78c9f..9a8c3de 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -256,12 +256,18 @@ static inline u64 dt_read_number(const __be32 *cell, int size)
     return r;
 }
 
-/* Helper to convert a number of cells in bytes */
+/* Helper to convert a number of cells to bytes */
 static inline int dt_cells_to_size(int size)
 {
     return (size * sizeof (u32));
 }
 
+/* Helper to convert a number of bytes to cells, rounds down */
+static inline int dt_size_to_cells(int bytes)
+{
+    return (bytes / sizeof(u32));
+}
+
 static inline u64 dt_next_cell(int s, const __be32 **cellp)
 {
     const __be32 *p = *cellp;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:13:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:13: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 1VqN7z-0002Io-EQ; Tue, 10 Dec 2013 13:13: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 1VqN7x-0002IM-Ez
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:29 +0000
Received: from [193.109.254.147:56342] by server-4.bemta-14.messagelabs.com id
	0D/1E-03916-87317A25; Tue, 10 Dec 2013 13:13:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1386681206!4177988!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3141 invoked from network); 10 Dec 2013 13:13: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;
	10 Dec 2013 13:13: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 1VqN7u-0000LW-0q
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN7t-0007vV-Tk
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:25 +0000
Date: Tue, 10 Dec 2013 13:13:25 +0000
Message-Id: <E1VqN7t-0007vV-Tk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: correct definition of DCISW
	(data cache invalidate by set/way)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c7a21dd65d4f4a822f20d9d9e18fba027270aa5
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Dec 6 14:29:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:31:05 2013 +0000

    xen: arm: correct definition of DCISW (data cache invalidate by set/way)
    
    We don't actually use this but I was using it locally for debugging and it
    tripped me up.
    
    Also add DCCIMVAC "data cache clean and invalidate by MVA" which is the only
    cache op missing from cpregs.h.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/include/asm-arm/cpregs.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index 2960492..29cd9d7 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -154,7 +154,7 @@
 #define BPIALL          p15,0,c7,c5,6   /* Invalidate entire branch predictor array */
 #define BPIMVA          p15,0,c7,c5,7   /* Invalidate MVA from branch predictor array */
 #define DCIMVAC         p15,0,c7,c6,1   /* Invalidate data cache line by MVA to PoC */
-#define DCISW           p15,0,c7,c2,1   /* Invalidate data cache line by set/way */
+#define DCISW           p15,0,c7,c6,2   /* Invalidate data cache line by set/way */
 #define ATS1CPR         p15,0,c7,c8,0   /* Address Translation Stage 1. Non-Secure Kernel Read */
 #define ATS1CPW         p15,0,c7,c8,1   /* Address Translation Stage 1. Non-Secure Kernel Write */
 #define ATS1CUR         p15,0,c7,c8,2   /* Address Translation Stage 1. Non-Secure User Read */
@@ -166,6 +166,7 @@
 #define DCCMVAC         p15,0,c7,c10,1  /* Clean data or unified cache line by MVA to PoC */
 #define DCCSW           p15,0,c7,c10,2  /* Clean data cache line by set/way */
 #define DCCMVAU         p15,0,c7,c11,1  /* Clean data cache line by MVA to PoU */
+#define DCCIMVAC        p15,0,c7,c14,1  /* Data cache clean and invalidate by MVA */
 #define DCCISW          p15,0,c7,c14,2  /* Clean and invalidate data cache line by set/way */
 #define ATS1HR          p15,4,c7,c8,0   /* Address Translation Stage 1 Hyp. Read */
 #define ATS1HW          p15,4,c7,c8,1   /* Address Translation Stage 1 Hyp. Write */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:13:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:13: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 1VqN7z-0002Io-EQ; Tue, 10 Dec 2013 13:13: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 1VqN7x-0002IM-Ez
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:29 +0000
Received: from [193.109.254.147:56342] by server-4.bemta-14.messagelabs.com id
	0D/1E-03916-87317A25; Tue, 10 Dec 2013 13:13:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1386681206!4177988!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3141 invoked from network); 10 Dec 2013 13:13: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;
	10 Dec 2013 13:13: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 1VqN7u-0000LW-0q
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN7t-0007vV-Tk
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:25 +0000
Date: Tue, 10 Dec 2013 13:13:25 +0000
Message-Id: <E1VqN7t-0007vV-Tk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: correct definition of DCISW
	(data cache invalidate by set/way)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c7a21dd65d4f4a822f20d9d9e18fba027270aa5
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Dec 6 14:29:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:31:05 2013 +0000

    xen: arm: correct definition of DCISW (data cache invalidate by set/way)
    
    We don't actually use this but I was using it locally for debugging and it
    tripped me up.
    
    Also add DCCIMVAC "data cache clean and invalidate by MVA" which is the only
    cache op missing from cpregs.h.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/include/asm-arm/cpregs.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index 2960492..29cd9d7 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -154,7 +154,7 @@
 #define BPIALL          p15,0,c7,c5,6   /* Invalidate entire branch predictor array */
 #define BPIMVA          p15,0,c7,c5,7   /* Invalidate MVA from branch predictor array */
 #define DCIMVAC         p15,0,c7,c6,1   /* Invalidate data cache line by MVA to PoC */
-#define DCISW           p15,0,c7,c2,1   /* Invalidate data cache line by set/way */
+#define DCISW           p15,0,c7,c6,2   /* Invalidate data cache line by set/way */
 #define ATS1CPR         p15,0,c7,c8,0   /* Address Translation Stage 1. Non-Secure Kernel Read */
 #define ATS1CPW         p15,0,c7,c8,1   /* Address Translation Stage 1. Non-Secure Kernel Write */
 #define ATS1CUR         p15,0,c7,c8,2   /* Address Translation Stage 1. Non-Secure User Read */
@@ -166,6 +166,7 @@
 #define DCCMVAC         p15,0,c7,c10,1  /* Clean data or unified cache line by MVA to PoC */
 #define DCCSW           p15,0,c7,c10,2  /* Clean data cache line by set/way */
 #define DCCMVAU         p15,0,c7,c11,1  /* Clean data cache line by MVA to PoU */
+#define DCCIMVAC        p15,0,c7,c14,1  /* Data cache clean and invalidate by MVA */
 #define DCCISW          p15,0,c7,c14,2  /* Clean and invalidate data cache line by set/way */
 #define ATS1HR          p15,4,c7,c8,0   /* Address Translation Stage 1 Hyp. Read */
 #define ATS1HW          p15,4,c7,c8,1   /* Address Translation Stage 1 Hyp. Write */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:13:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:13: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 1VqN87-0002Kk-H9; Tue, 10 Dec 2013 13:13:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN86-0002KT-Nw
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:39 +0000
Received: from [193.109.254.147:15671] by server-16.bemta-14.messagelabs.com
	id 9E/4E-20600-28317A25; Tue, 10 Dec 2013 13:13:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1386681216!1945054!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8023 invoked from network); 10 Dec 2013 13:13:37 -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;
	10 Dec 2013 13:13: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 1VqN84-0000Le-4u
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN84-0007wR-3f
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:36 +0000
Date: Tue, 10 Dec 2013 13:13:36 +0000
Message-Id: <E1VqN84-0007wR-3f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: correct return value of
	raw_copy_{to/from}_guest_*, raw_clear_guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d96392361cd05a66b385f0153e398128b196e480
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 9 12:13:48 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:31:39 2013 +0000

    xen: arm: correct return value of raw_copy_{to/from}_guest_*, raw_clear_guest
    
    This is a generic interface which is supposed to return the number of bytes
    which were not copied. Make it so.
    
    Update the incorrect callers prepare_dtb, decode_thumb{2} and
    xenmem_add_to_physmap_range.
    
    In the xenmem_add_to_physmap_range case, observe that we are not propagating
    errors from xenmem_add_to_physmap_one and do so.
    
    In the decode_thumb case and an emacs magic block to decode.c
    
    Make the flush_dcache parameter to the helper an int while at it.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/decode.c       |   22 ++++++++++++++--------
 xen/arch/arm/domain_build.c |    8 ++++----
 xen/arch/arm/guestcopy.c    |   20 +++++++-------------
 xen/arch/arm/mm.c           |   23 +++++++++++++++++------
 4 files changed, 42 insertions(+), 31 deletions(-)

diff --git a/xen/arch/arm/decode.c b/xen/arch/arm/decode.c
index abe9f26..8880c39 100644
--- a/xen/arch/arm/decode.c
+++ b/xen/arch/arm/decode.c
@@ -36,12 +36,10 @@ static void update_dabt(struct hsr_dabt *dabt, int reg,
 static int decode_thumb2(register_t pc, struct hsr_dabt *dabt, uint16_t hw1)
 {
     uint16_t hw2;
-    int rc;
     uint16_t rt;
 
-    rc = raw_copy_from_guest(&hw2, (void *__user)(pc + 2), sizeof (hw2));
-    if ( rc )
-        return rc;
+    if ( raw_copy_from_guest(&hw2, (void *__user)(pc + 2), sizeof (hw2)) )
+        return -EFAULT;
 
     rt = (hw2 >> 12) & 0x7;
 
@@ -88,11 +86,9 @@ bad_thumb2:
 static int decode_thumb(register_t pc, struct hsr_dabt *dabt)
 {
     uint16_t instr;
-    int rc;
 
-    rc = raw_copy_from_guest(&instr, (void * __user)pc, sizeof (instr));
-    if ( rc )
-        return rc;
+    if ( raw_copy_from_guest(&instr, (void * __user)pc, sizeof (instr)) )
+        return -EFAULT;
 
     switch ( instr >> 12 )
     {
@@ -163,3 +159,13 @@ int decode_instruction(const struct cpu_user_regs *regs, struct hsr_dabt *dabt)
 
     return 1;
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index fb1ec87..faff88e 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -907,15 +907,15 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
 static void dtb_load(struct kernel_info *kinfo)
 {
     void * __user dtb_virt = (void * __user)(register_t)kinfo->dtb_paddr;
-    unsigned long rc;
+    unsigned long left;
 
     printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
            kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
 
-    rc = raw_copy_to_guest_flush_dcache(dtb_virt, kinfo->fdt,
+    left = raw_copy_to_guest_flush_dcache(dtb_virt, kinfo->fdt,
                                         fdt_totalsize(kinfo->fdt));
-    if ( rc != 0 )
-        panic("Unable to copy the DTB to dom0 memory (rc = %lu)", rc);
+    if ( left != 0 )
+        panic("Unable to copy the DTB to dom0 memory (left = %lu bytes)", left);
     xfree(kinfo->fdt);
 }
 
diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index 08800a4..bd0a355 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -6,21 +6,19 @@
 #include <asm/guest_access.h>
 
 static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
-                                              unsigned len, unsigned flush_dcache)
+                                              unsigned len, int flush_dcache)
 {
     /* XXX needs to handle faults */
     unsigned offset = (vaddr_t)to & ~PAGE_MASK;
 
     while ( len )
     {
-        int rc;
         paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        rc = gvirt_to_maddr((vaddr_t) to, &g);
-        if ( rc )
-            return rc;
+        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+            return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
         p += offset;
@@ -56,14 +54,12 @@ unsigned long raw_clear_guest(void *to, unsigned len)
 
     while ( len )
     {
-        int rc;
         paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        rc = gvirt_to_maddr((vaddr_t) to, &g);
-        if ( rc )
-            return rc;
+        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+            return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
         p += offset;
@@ -84,14 +80,12 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned le
 
     while ( len )
     {
-        int rc;
         paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)(PAGE_SIZE - offset));
 
-        rc = gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g);
-        if ( rc )
-            return rc;
+        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g) )
+            return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
         p += ((vaddr_t)from & (~PAGE_MASK));
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 399e546..26ca588 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1067,22 +1067,33 @@ static int xenmem_add_to_physmap_range(struct domain *d,
         xen_ulong_t idx;
         xen_pfn_t gpfn;
 
-        rc = copy_from_guest_offset(&idx, xatpr->idxs, xatpr->size-1, 1);
-        if ( rc < 0 )
+        if ( unlikely(copy_from_guest_offset(&idx, xatpr->idxs,
+                                             xatpr->size-1, 1)) )
+        {
+            rc = -EFAULT;
             goto out;
+        }
 
-        rc = copy_from_guest_offset(&gpfn, xatpr->gpfns, xatpr->size-1, 1);
-        if ( rc < 0 )
+        if ( unlikely(copy_from_guest_offset(&gpfn, xatpr->gpfns,
+                                             xatpr->size-1, 1)) )
+        {
+            rc = -EFAULT;
             goto out;
+        }
 
         rc = xenmem_add_to_physmap_one(d, xatpr->space,
                                        xatpr->foreign_domid,
                                        idx, gpfn);
-
-        rc = copy_to_guest_offset(xatpr->errs, xatpr->size-1, &rc, 1);
         if ( rc < 0 )
             goto out;
 
+        if ( unlikely(copy_to_guest_offset(xatpr->errs,
+                                           xatpr->size-1, &rc, 1)) );
+        {
+            rc = -EFAULT;
+            goto out;
+        }
+
         xatpr->size--;
 
         /* Check for continuation if it's not the last interation */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 10 13:13:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Dec 2013 13:13: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 1VqN87-0002Kk-H9; Tue, 10 Dec 2013 13:13:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN86-0002KT-Nw
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:39 +0000
Received: from [193.109.254.147:15671] by server-16.bemta-14.messagelabs.com
	id 9E/4E-20600-28317A25; Tue, 10 Dec 2013 13:13:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1386681216!1945054!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8023 invoked from network); 10 Dec 2013 13:13:37 -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;
	10 Dec 2013 13:13: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 1VqN84-0000Le-4u
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqN84-0007wR-3f
	for xen-changelog@lists.xensource.com; Tue, 10 Dec 2013 13:13:36 +0000
Date: Tue, 10 Dec 2013 13:13:36 +0000
Message-Id: <E1VqN84-0007wR-3f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: correct return value of
	raw_copy_{to/from}_guest_*, raw_clear_guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d96392361cd05a66b385f0153e398128b196e480
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 9 12:13:48 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 9 15:31:39 2013 +0000

    xen: arm: correct return value of raw_copy_{to/from}_guest_*, raw_clear_guest
    
    This is a generic interface which is supposed to return the number of bytes
    which were not copied. Make it so.
    
    Update the incorrect callers prepare_dtb, decode_thumb{2} and
    xenmem_add_to_physmap_range.
    
    In the xenmem_add_to_physmap_range case, observe that we are not propagating
    errors from xenmem_add_to_physmap_one and do so.
    
    In the decode_thumb case and an emacs magic block to decode.c
    
    Make the flush_dcache parameter to the helper an int while at it.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/decode.c       |   22 ++++++++++++++--------
 xen/arch/arm/domain_build.c |    8 ++++----
 xen/arch/arm/guestcopy.c    |   20 +++++++-------------
 xen/arch/arm/mm.c           |   23 +++++++++++++++++------
 4 files changed, 42 insertions(+), 31 deletions(-)

diff --git a/xen/arch/arm/decode.c b/xen/arch/arm/decode.c
index abe9f26..8880c39 100644
--- a/xen/arch/arm/decode.c
+++ b/xen/arch/arm/decode.c
@@ -36,12 +36,10 @@ static void update_dabt(struct hsr_dabt *dabt, int reg,
 static int decode_thumb2(register_t pc, struct hsr_dabt *dabt, uint16_t hw1)
 {
     uint16_t hw2;
-    int rc;
     uint16_t rt;
 
-    rc = raw_copy_from_guest(&hw2, (void *__user)(pc + 2), sizeof (hw2));
-    if ( rc )
-        return rc;
+    if ( raw_copy_from_guest(&hw2, (void *__user)(pc + 2), sizeof (hw2)) )
+        return -EFAULT;
 
     rt = (hw2 >> 12) & 0x7;
 
@@ -88,11 +86,9 @@ bad_thumb2:
 static int decode_thumb(register_t pc, struct hsr_dabt *dabt)
 {
     uint16_t instr;
-    int rc;
 
-    rc = raw_copy_from_guest(&instr, (void * __user)pc, sizeof (instr));
-    if ( rc )
-        return rc;
+    if ( raw_copy_from_guest(&instr, (void * __user)pc, sizeof (instr)) )
+        return -EFAULT;
 
     switch ( instr >> 12 )
     {
@@ -163,3 +159,13 @@ int decode_instruction(const struct cpu_user_regs *regs, struct hsr_dabt *dabt)
 
     return 1;
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index fb1ec87..faff88e 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -907,15 +907,15 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
 static void dtb_load(struct kernel_info *kinfo)
 {
     void * __user dtb_virt = (void * __user)(register_t)kinfo->dtb_paddr;
-    unsigned long rc;
+    unsigned long left;
 
     printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
            kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
 
-    rc = raw_copy_to_guest_flush_dcache(dtb_virt, kinfo->fdt,
+    left = raw_copy_to_guest_flush_dcache(dtb_virt, kinfo->fdt,
                                         fdt_totalsize(kinfo->fdt));
-    if ( rc != 0 )
-        panic("Unable to copy the DTB to dom0 memory (rc = %lu)", rc);
+    if ( left != 0 )
+        panic("Unable to copy the DTB to dom0 memory (left = %lu bytes)", left);
     xfree(kinfo->fdt);
 }
 
diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index 08800a4..bd0a355 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -6,21 +6,19 @@
 #include <asm/guest_access.h>
 
 static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
-                                              unsigned len, unsigned flush_dcache)
+                                              unsigned len, int flush_dcache)
 {
     /* XXX needs to handle faults */
     unsigned offset = (vaddr_t)to & ~PAGE_MASK;
 
     while ( len )
     {
-        int rc;
         paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        rc = gvirt_to_maddr((vaddr_t) to, &g);
-        if ( rc )
-            return rc;
+        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+            return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
         p += offset;
@@ -56,14 +54,12 @@ unsigned long raw_clear_guest(void *to, unsigned len)
 
     while ( len )
     {
-        int rc;
         paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        rc = gvirt_to_maddr((vaddr_t) to, &g);
-        if ( rc )
-            return rc;
+        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+            return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
         p += offset;
@@ -84,14 +80,12 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned le
 
     while ( len )
     {
-        int rc;
         paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)(PAGE_SIZE - offset));
 
-        rc = gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g);
-        if ( rc )
-            return rc;
+        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g) )
+            return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
         p += ((vaddr_t)from & (~PAGE_MASK));
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 399e546..26ca588 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1067,22 +1067,33 @@ static int xenmem_add_to_physmap_range(struct domain *d,
         xen_ulong_t idx;
         xen_pfn_t gpfn;
 
-        rc = copy_from_guest_offset(&idx, xatpr->idxs, xatpr->size-1, 1);
-        if ( rc < 0 )
+        if ( unlikely(copy_from_guest_offset(&idx, xatpr->idxs,
+                                             xatpr->size-1, 1)) )
+        {
+            rc = -EFAULT;
             goto out;
+        }
 
-        rc = copy_from_guest_offset(&gpfn, xatpr->gpfns, xatpr->size-1, 1);
-        if ( rc < 0 )
+        if ( unlikely(copy_from_guest_offset(&gpfn, xatpr->gpfns,
+                                             xatpr->size-1, 1)) )
+        {
+            rc = -EFAULT;
             goto out;
+        }
 
         rc = xenmem_add_to_physmap_one(d, xatpr->space,
                                        xatpr->foreign_domid,
                                        idx, gpfn);
-
-        rc = copy_to_guest_offset(xatpr->errs, xatpr->size-1, &rc, 1);
         if ( rc < 0 )
             goto out;
 
+        if ( unlikely(copy_to_guest_offset(xatpr->errs,
+                                           xatpr->size-1, &rc, 1)) );
+        {
+            rc = -EFAULT;
+            goto out;
+        }
+
         xatpr->size--;
 
         /* Check for continuation if it's not the last interation */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 11 02:22:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Dec 2013 02:22: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 1VqZRA-00029l-S3; Wed, 11 Dec 2013 02:22:08 +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 1VqZR8-00029d-UV
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:07 +0000
Received: from [85.158.139.211:13216] by server-9.bemta-5.messagelabs.com id
	BD/84-15098-E4CC7A25; Wed, 11 Dec 2013 02:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1386728523!3469111!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4658 invoked from network); 11 Dec 2013 02:22:04 -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;
	11 Dec 2013 02:22: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 1VqZR5-0008IA-F3
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqZR5-0004nb-49
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:03 +0000
Date: Wed, 11 Dec 2013 02:22:03 +0000
Message-Id: <E1VqZR5-0004nb-49@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xen: list interfaces subject to
	the security process exception in XSA-77
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c9beb1700a3d5bd1e6a63f2372a4fd23f7e49e4c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Dec 10 16:19:53 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:19:53 2013 +0100

    xen: list interfaces subject to the security process exception in XSA-77
    
    List all the sub ops of:
      __HYPERVISOR_domctl
      __HYPERVISOR_sysctl
      __HYPERVISOR_memory_op
      __HYPERVISOR_tmem_op
    which are subject to the policy given in
    http://xenbits.xen.org/xsa/advisory-77.html
    
    It is expected that these lists will be whittled away as each interface is
    audited for safety.
    
    New interfaces should be expected to be safe when introduced (IOW the list
    should never be expanded).
    
    This is XSA-77.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5da5288a0a767c16705dd16ee5e5bb5cf7929397
    master date: 2013-12-10 16:09:24 +0100
---
 docs/misc/xsm-flask.txt |  183 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 183 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index ff81b01..ddd5831 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -17,6 +17,189 @@ Some examples of what FLASK can do:
 Some of these examples require dom0 disaggregation to be useful, since the
 domain build process requires the ability to write to the new domain's memory.
 
+Security Status of dom0 disaggregation
+--------------------------------------
+
+Xen supports disaggregation of various support and management
+functions into their own domains, via the XSM mechanisms described in
+this document.
+
+However the implementations of these support and management interfaces
+were originally written to be used only by the totally-privileged
+dom0, and have not been reviewed for security when exposed to
+supposedly-only-semi-privileged disaggregated management domains.  But
+such management domains are (in such a design) to be seen as
+potentially hostile, e.g. due to privilege escalation following
+exploitation of a bug in the management domain.
+
+Until the interfaces have been properly reviewed for security against
+hostile callers, the Xen.org security team intends (subject of course
+to the permission of anyone disclosing to us) to handle these and
+future vulnerabilities in these interfaces in public, as if they were
+normal non-security-related bugs.
+
+This applies only to bugs which do no more than reduce the security of
+a radically disaggregated system to the security of a
+non-disaggregated one.  Here a "radically disaggregated system" is one
+which uses the XSM mechanism to delegate the affected interfaces to
+other-than-fully-trusted domains.
+
+This policy does not apply to bugs which affect stub device models,
+driver domains, or stub xenstored - even if those bugs do no worse
+than reduce the security of such a system to one whose device models,
+backend drivers, or xenstore, run in dom0.
+
+For more information see http://xenbits.xen.org/xsa/advisory-77.html.
+
+The following interfaces are covered by this statement.  Interfaces
+not listed here are considered safe for disaggregation, security
+issues found in interfaces not listed here will be handled according
+to the normal security problem response policy
+http://www.xenproject.org/security-policy.html.
+
+__HYPERVISOR_domctl (xen/include/public/domctl.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XEN_DOMCTL_createdomain
+ * XEN_DOMCTL_destroydomain
+ * XEN_DOMCTL_pausedomain
+ * XEN_DOMCTL_unpausedomain
+ * XEN_DOMCTL_getdomaininfo
+ * XEN_DOMCTL_getmemlist
+ * XEN_DOMCTL_getpageframeinfo
+ * XEN_DOMCTL_getpageframeinfo2
+ * XEN_DOMCTL_setvcpuaffinity
+ * XEN_DOMCTL_shadow_op
+ * XEN_DOMCTL_max_mem
+ * XEN_DOMCTL_setvcpucontext
+ * XEN_DOMCTL_getvcpucontext
+ * XEN_DOMCTL_getvcpuinfo
+ * XEN_DOMCTL_max_vcpus
+ * XEN_DOMCTL_scheduler_op
+ * XEN_DOMCTL_setdomainhandle
+ * XEN_DOMCTL_setdebugging
+ * XEN_DOMCTL_irq_permission
+ * XEN_DOMCTL_iomem_permission
+ * XEN_DOMCTL_ioport_permission
+ * XEN_DOMCTL_hypercall_init
+ * XEN_DOMCTL_arch_setup
+ * XEN_DOMCTL_settimeoffset
+ * XEN_DOMCTL_getvcpuaffinity
+ * XEN_DOMCTL_real_mode_area
+ * XEN_DOMCTL_resumedomain
+ * XEN_DOMCTL_sendtrigger
+ * XEN_DOMCTL_subscribe
+ * XEN_DOMCTL_gethvmcontext
+ * XEN_DOMCTL_sethvmcontext
+ * XEN_DOMCTL_set_address_size
+ * XEN_DOMCTL_get_address_size
+ * XEN_DOMCTL_assign_device
+ * XEN_DOMCTL_pin_mem_cacheattr
+ * XEN_DOMCTL_set_ext_vcpucontext
+ * XEN_DOMCTL_get_ext_vcpucontext
+ * XEN_DOMCTL_set_opt_feature
+ * XEN_DOMCTL_test_assign_device
+ * XEN_DOMCTL_set_target
+ * XEN_DOMCTL_deassign_device
+ * XEN_DOMCTL_set_cpuid
+ * XEN_DOMCTL_get_device_group
+ * XEN_DOMCTL_set_machine_address_size
+ * XEN_DOMCTL_get_machine_address_size
+ * XEN_DOMCTL_suppress_spurious_page_faults
+ * XEN_DOMCTL_debug_op
+ * XEN_DOMCTL_gethvmcontext_partial
+ * XEN_DOMCTL_mem_event_op
+ * XEN_DOMCTL_mem_sharing_op
+ * XEN_DOMCTL_disable_migrate
+ * XEN_DOMCTL_gettscinfo
+ * XEN_DOMCTL_settscinfo
+ * XEN_DOMCTL_getpageframeinfo3
+ * XEN_DOMCTL_setvcpuextstate
+ * XEN_DOMCTL_getvcpuextstate
+ * XEN_DOMCTL_set_access_required
+ * XEN_DOMCTL_audit_p2m
+ * XEN_DOMCTL_set_virq_handler
+ * XEN_DOMCTL_set_broken_page_p2m
+ * XEN_DOMCTL_setnodeaffinity
+ * XEN_DOMCTL_getnodeaffinity
+ * XEN_DOMCTL_set_max_evtchn
+ * XEN_DOMCTL_gdbsx_guestmemio
+ * XEN_DOMCTL_gdbsx_pausevcpu
+ * XEN_DOMCTL_gdbsx_unpausevcpu
+ * XEN_DOMCTL_gdbsx_domstatus
+
+__HYPERVISOR_sysctl (xen/include/public/sysctl.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XEN_SYSCTL_readconsole
+ * XEN_SYSCTL_tbuf_op
+ * XEN_SYSCTL_physinfo
+ * XEN_SYSCTL_sched_id
+ * XEN_SYSCTL_perfc_op
+ * XEN_SYSCTL_getdomaininfolist
+ * XEN_SYSCTL_debug_keys
+ * XEN_SYSCTL_getcpuinfo
+ * XEN_SYSCTL_availheap
+ * XEN_SYSCTL_get_pmstat
+ * XEN_SYSCTL_cpu_hotplug
+ * XEN_SYSCTL_pm_op
+ * XEN_SYSCTL_page_offline_op
+ * XEN_SYSCTL_lockprof_op
+ * XEN_SYSCTL_topologyinfo
+ * XEN_SYSCTL_numainfo
+ * XEN_SYSCTL_cpupool_op
+ * XEN_SYSCTL_scheduler_op
+ * XEN_SYSCTL_coverage_op
+
+__HYPERVISOR_memory_op (xen/include/public/memory.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XENMEM_set_pod_target
+ * XENMEM_get_pod_target
+ * XENMEM_claim_pages
+
+__HYPERVISOR_tmem_op (xen/include/public/tmem.h)
+
+ The following tmem control ops, that is the sub-subops of
+ TMEM_CONTROL, are covered by this statement. 
+
+ Note that TMEM is also subject to a similar policy arising from
+ XSA-15 http://lists.xen.org/archives/html/xen-announce/2012-09/msg00006.html.
+ Due to this existing policy all TMEM Ops are already subject to
+ reduced security support.
+
+ * TMEMC_THAW
+ * TMEMC_FREEZE
+ * TMEMC_FLUSH
+ * TMEMC_DESTROY
+ * TMEMC_LIST
+ * TMEMC_SET_WEIGHT
+ * TMEMC_SET_CAP
+ * TMEMC_SET_COMPRESS
+ * TMEMC_QUERY_FREEABLE_MB
+ * TMEMC_SAVE_BEGIN
+ * TMEMC_SAVE_GET_VERSION
+ * TMEMC_SAVE_GET_MAXPOOLS
+ * TMEMC_SAVE_GET_CLIENT_WEIGHT
+ * TMEMC_SAVE_GET_CLIENT_CAP
+ * TMEMC_SAVE_GET_CLIENT_FLAGS
+ * TMEMC_SAVE_GET_POOL_FLAGS
+ * TMEMC_SAVE_GET_POOL_NPAGES
+ * TMEMC_SAVE_GET_POOL_UUID
+ * TMEMC_SAVE_GET_NEXT_PAGE
+ * TMEMC_SAVE_GET_NEXT_INV
+ * TMEMC_SAVE_END
+ * TMEMC_RESTORE_BEGIN
+ * TMEMC_RESTORE_PUT_PAGE
+ * TMEMC_RESTORE_FLUSH_PAGE
+
+
 
 Setting up FLASK
 ----------------
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Wed Dec 11 02:22:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Dec 2013 02:22: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 1VqZRA-00029l-S3; Wed, 11 Dec 2013 02:22:08 +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 1VqZR8-00029d-UV
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:07 +0000
Received: from [85.158.139.211:13216] by server-9.bemta-5.messagelabs.com id
	BD/84-15098-E4CC7A25; Wed, 11 Dec 2013 02:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1386728523!3469111!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4658 invoked from network); 11 Dec 2013 02:22:04 -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;
	11 Dec 2013 02:22: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 1VqZR5-0008IA-F3
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqZR5-0004nb-49
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:03 +0000
Date: Wed, 11 Dec 2013 02:22:03 +0000
Message-Id: <E1VqZR5-0004nb-49@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xen: list interfaces subject to
	the security process exception in XSA-77
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c9beb1700a3d5bd1e6a63f2372a4fd23f7e49e4c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Dec 10 16:19:53 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:19:53 2013 +0100

    xen: list interfaces subject to the security process exception in XSA-77
    
    List all the sub ops of:
      __HYPERVISOR_domctl
      __HYPERVISOR_sysctl
      __HYPERVISOR_memory_op
      __HYPERVISOR_tmem_op
    which are subject to the policy given in
    http://xenbits.xen.org/xsa/advisory-77.html
    
    It is expected that these lists will be whittled away as each interface is
    audited for safety.
    
    New interfaces should be expected to be safe when introduced (IOW the list
    should never be expanded).
    
    This is XSA-77.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5da5288a0a767c16705dd16ee5e5bb5cf7929397
    master date: 2013-12-10 16:09:24 +0100
---
 docs/misc/xsm-flask.txt |  183 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 183 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index ff81b01..ddd5831 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -17,6 +17,189 @@ Some examples of what FLASK can do:
 Some of these examples require dom0 disaggregation to be useful, since the
 domain build process requires the ability to write to the new domain's memory.
 
+Security Status of dom0 disaggregation
+--------------------------------------
+
+Xen supports disaggregation of various support and management
+functions into their own domains, via the XSM mechanisms described in
+this document.
+
+However the implementations of these support and management interfaces
+were originally written to be used only by the totally-privileged
+dom0, and have not been reviewed for security when exposed to
+supposedly-only-semi-privileged disaggregated management domains.  But
+such management domains are (in such a design) to be seen as
+potentially hostile, e.g. due to privilege escalation following
+exploitation of a bug in the management domain.
+
+Until the interfaces have been properly reviewed for security against
+hostile callers, the Xen.org security team intends (subject of course
+to the permission of anyone disclosing to us) to handle these and
+future vulnerabilities in these interfaces in public, as if they were
+normal non-security-related bugs.
+
+This applies only to bugs which do no more than reduce the security of
+a radically disaggregated system to the security of a
+non-disaggregated one.  Here a "radically disaggregated system" is one
+which uses the XSM mechanism to delegate the affected interfaces to
+other-than-fully-trusted domains.
+
+This policy does not apply to bugs which affect stub device models,
+driver domains, or stub xenstored - even if those bugs do no worse
+than reduce the security of such a system to one whose device models,
+backend drivers, or xenstore, run in dom0.
+
+For more information see http://xenbits.xen.org/xsa/advisory-77.html.
+
+The following interfaces are covered by this statement.  Interfaces
+not listed here are considered safe for disaggregation, security
+issues found in interfaces not listed here will be handled according
+to the normal security problem response policy
+http://www.xenproject.org/security-policy.html.
+
+__HYPERVISOR_domctl (xen/include/public/domctl.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XEN_DOMCTL_createdomain
+ * XEN_DOMCTL_destroydomain
+ * XEN_DOMCTL_pausedomain
+ * XEN_DOMCTL_unpausedomain
+ * XEN_DOMCTL_getdomaininfo
+ * XEN_DOMCTL_getmemlist
+ * XEN_DOMCTL_getpageframeinfo
+ * XEN_DOMCTL_getpageframeinfo2
+ * XEN_DOMCTL_setvcpuaffinity
+ * XEN_DOMCTL_shadow_op
+ * XEN_DOMCTL_max_mem
+ * XEN_DOMCTL_setvcpucontext
+ * XEN_DOMCTL_getvcpucontext
+ * XEN_DOMCTL_getvcpuinfo
+ * XEN_DOMCTL_max_vcpus
+ * XEN_DOMCTL_scheduler_op
+ * XEN_DOMCTL_setdomainhandle
+ * XEN_DOMCTL_setdebugging
+ * XEN_DOMCTL_irq_permission
+ * XEN_DOMCTL_iomem_permission
+ * XEN_DOMCTL_ioport_permission
+ * XEN_DOMCTL_hypercall_init
+ * XEN_DOMCTL_arch_setup
+ * XEN_DOMCTL_settimeoffset
+ * XEN_DOMCTL_getvcpuaffinity
+ * XEN_DOMCTL_real_mode_area
+ * XEN_DOMCTL_resumedomain
+ * XEN_DOMCTL_sendtrigger
+ * XEN_DOMCTL_subscribe
+ * XEN_DOMCTL_gethvmcontext
+ * XEN_DOMCTL_sethvmcontext
+ * XEN_DOMCTL_set_address_size
+ * XEN_DOMCTL_get_address_size
+ * XEN_DOMCTL_assign_device
+ * XEN_DOMCTL_pin_mem_cacheattr
+ * XEN_DOMCTL_set_ext_vcpucontext
+ * XEN_DOMCTL_get_ext_vcpucontext
+ * XEN_DOMCTL_set_opt_feature
+ * XEN_DOMCTL_test_assign_device
+ * XEN_DOMCTL_set_target
+ * XEN_DOMCTL_deassign_device
+ * XEN_DOMCTL_set_cpuid
+ * XEN_DOMCTL_get_device_group
+ * XEN_DOMCTL_set_machine_address_size
+ * XEN_DOMCTL_get_machine_address_size
+ * XEN_DOMCTL_suppress_spurious_page_faults
+ * XEN_DOMCTL_debug_op
+ * XEN_DOMCTL_gethvmcontext_partial
+ * XEN_DOMCTL_mem_event_op
+ * XEN_DOMCTL_mem_sharing_op
+ * XEN_DOMCTL_disable_migrate
+ * XEN_DOMCTL_gettscinfo
+ * XEN_DOMCTL_settscinfo
+ * XEN_DOMCTL_getpageframeinfo3
+ * XEN_DOMCTL_setvcpuextstate
+ * XEN_DOMCTL_getvcpuextstate
+ * XEN_DOMCTL_set_access_required
+ * XEN_DOMCTL_audit_p2m
+ * XEN_DOMCTL_set_virq_handler
+ * XEN_DOMCTL_set_broken_page_p2m
+ * XEN_DOMCTL_setnodeaffinity
+ * XEN_DOMCTL_getnodeaffinity
+ * XEN_DOMCTL_set_max_evtchn
+ * XEN_DOMCTL_gdbsx_guestmemio
+ * XEN_DOMCTL_gdbsx_pausevcpu
+ * XEN_DOMCTL_gdbsx_unpausevcpu
+ * XEN_DOMCTL_gdbsx_domstatus
+
+__HYPERVISOR_sysctl (xen/include/public/sysctl.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XEN_SYSCTL_readconsole
+ * XEN_SYSCTL_tbuf_op
+ * XEN_SYSCTL_physinfo
+ * XEN_SYSCTL_sched_id
+ * XEN_SYSCTL_perfc_op
+ * XEN_SYSCTL_getdomaininfolist
+ * XEN_SYSCTL_debug_keys
+ * XEN_SYSCTL_getcpuinfo
+ * XEN_SYSCTL_availheap
+ * XEN_SYSCTL_get_pmstat
+ * XEN_SYSCTL_cpu_hotplug
+ * XEN_SYSCTL_pm_op
+ * XEN_SYSCTL_page_offline_op
+ * XEN_SYSCTL_lockprof_op
+ * XEN_SYSCTL_topologyinfo
+ * XEN_SYSCTL_numainfo
+ * XEN_SYSCTL_cpupool_op
+ * XEN_SYSCTL_scheduler_op
+ * XEN_SYSCTL_coverage_op
+
+__HYPERVISOR_memory_op (xen/include/public/memory.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XENMEM_set_pod_target
+ * XENMEM_get_pod_target
+ * XENMEM_claim_pages
+
+__HYPERVISOR_tmem_op (xen/include/public/tmem.h)
+
+ The following tmem control ops, that is the sub-subops of
+ TMEM_CONTROL, are covered by this statement. 
+
+ Note that TMEM is also subject to a similar policy arising from
+ XSA-15 http://lists.xen.org/archives/html/xen-announce/2012-09/msg00006.html.
+ Due to this existing policy all TMEM Ops are already subject to
+ reduced security support.
+
+ * TMEMC_THAW
+ * TMEMC_FREEZE
+ * TMEMC_FLUSH
+ * TMEMC_DESTROY
+ * TMEMC_LIST
+ * TMEMC_SET_WEIGHT
+ * TMEMC_SET_CAP
+ * TMEMC_SET_COMPRESS
+ * TMEMC_QUERY_FREEABLE_MB
+ * TMEMC_SAVE_BEGIN
+ * TMEMC_SAVE_GET_VERSION
+ * TMEMC_SAVE_GET_MAXPOOLS
+ * TMEMC_SAVE_GET_CLIENT_WEIGHT
+ * TMEMC_SAVE_GET_CLIENT_CAP
+ * TMEMC_SAVE_GET_CLIENT_FLAGS
+ * TMEMC_SAVE_GET_POOL_FLAGS
+ * TMEMC_SAVE_GET_POOL_NPAGES
+ * TMEMC_SAVE_GET_POOL_UUID
+ * TMEMC_SAVE_GET_NEXT_PAGE
+ * TMEMC_SAVE_GET_NEXT_INV
+ * TMEMC_SAVE_END
+ * TMEMC_RESTORE_BEGIN
+ * TMEMC_RESTORE_PUT_PAGE
+ * TMEMC_RESTORE_FLUSH_PAGE
+
+
 
 Setting up FLASK
 ----------------
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Wed Dec 11 02:22:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Dec 2013 02: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 1VqZRL-0002AJ-3q; Wed, 11 Dec 2013 02:22: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 1VqZRI-0002A7-W6
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:17 +0000
Received: from [85.158.139.211:25865] by server-17.bemta-5.messagelabs.com id
	C5/6F-19152-85CC7A25; Wed, 11 Dec 2013 02:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386728534!3652991!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27540 invoked from network); 11 Dec 2013 02:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2013 02:22: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 1VqZRF-0008ID-Ut
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqZRF-0004nz-Kr
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:13 +0000
Date: Wed, 11 Dec 2013 02:22:13 +0000
Message-Id: <E1VqZRF-0004nz-Kr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] IOMMU: clear "don't flush"
	override on error paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8940a13d6de1295cfdc4a189e0a5610849a9ef59
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 10 16:20:38 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:20:38 2013 +0100

    IOMMU: clear "don't flush" override on error paths
    
    Both xenmem_add_to_physmap() and iommu_populate_page_table() each have
    an error path that fails to clear that flag, thus suppressing further
    flushes on the respective pCPU.
    
    In iommu_populate_page_table() also slightly re-arrange code to avoid
    the false impression of the flag in question being guarded by a
    domain's page_alloc_lock.
    
    This is CVE-2013-6400 / XSA-80.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 552b7fcb9a70f1d4dd0e0cd5fb4d3d9da410104a
    master date: 2013-12-10 16:10:37 +0100
---
 xen/arch/x86/mm.c               |    2 +-
 xen/drivers/passthrough/iommu.c |   24 +++++++++++++-----------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 91d2c2b..1103cbe 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4651,7 +4651,7 @@ static int xenmem_add_to_physmap(struct domain *d,
         {
             rc = xenmem_add_to_physmap_once(d, xatp);
             if ( rc < 0 )
-                return rc;
+                break;
 
             xatp->idx++;
             xatp->gpfn++;
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 93ad122..bf8b6ba 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -306,11 +306,11 @@ static int iommu_populate_page_table(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
     struct page_info *page;
-    int rc;
+    int rc = 0;
 
+    this_cpu(iommu_dont_flush_iotlb) = 1;
     spin_lock(&d->page_alloc_lock);
 
-    this_cpu(iommu_dont_flush_iotlb) = 1;
     page_list_for_each ( page, &d->page_list )
     {
         if ( is_hvm_domain(d) ||
@@ -320,18 +320,20 @@ static int iommu_populate_page_table(struct domain *d)
             rc = hd->platform_ops->map_page(
                 d, mfn_to_gmfn(d, page_to_mfn(page)), page_to_mfn(page),
                 IOMMUF_readable|IOMMUF_writable);
-            if (rc)
-            {
-                spin_unlock(&d->page_alloc_lock);
-                hd->platform_ops->teardown(d);
-                return rc;
-            }
+            if ( rc )
+                break;
         }
     }
-    this_cpu(iommu_dont_flush_iotlb) = 0;
-    iommu_iotlb_flush_all(d);
+
     spin_unlock(&d->page_alloc_lock);
-    return 0;
+    this_cpu(iommu_dont_flush_iotlb) = 0;
+
+    if ( !rc )
+        iommu_iotlb_flush_all(d);
+    else
+        hd->platform_ops->teardown(d);
+
+    return rc;
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Wed Dec 11 02:22:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Dec 2013 02: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 1VqZRL-0002AJ-3q; Wed, 11 Dec 2013 02:22: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 1VqZRI-0002A7-W6
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:17 +0000
Received: from [85.158.139.211:25865] by server-17.bemta-5.messagelabs.com id
	C5/6F-19152-85CC7A25; Wed, 11 Dec 2013 02:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386728534!3652991!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27540 invoked from network); 11 Dec 2013 02:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2013 02:22: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 1VqZRF-0008ID-Ut
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VqZRF-0004nz-Kr
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 02:22:13 +0000
Date: Wed, 11 Dec 2013 02:22:13 +0000
Message-Id: <E1VqZRF-0004nz-Kr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] IOMMU: clear "don't flush"
	override on error paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8940a13d6de1295cfdc4a189e0a5610849a9ef59
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 10 16:20:38 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:20:38 2013 +0100

    IOMMU: clear "don't flush" override on error paths
    
    Both xenmem_add_to_physmap() and iommu_populate_page_table() each have
    an error path that fails to clear that flag, thus suppressing further
    flushes on the respective pCPU.
    
    In iommu_populate_page_table() also slightly re-arrange code to avoid
    the false impression of the flag in question being guarded by a
    domain's page_alloc_lock.
    
    This is CVE-2013-6400 / XSA-80.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 552b7fcb9a70f1d4dd0e0cd5fb4d3d9da410104a
    master date: 2013-12-10 16:10:37 +0100
---
 xen/arch/x86/mm.c               |    2 +-
 xen/drivers/passthrough/iommu.c |   24 +++++++++++++-----------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 91d2c2b..1103cbe 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4651,7 +4651,7 @@ static int xenmem_add_to_physmap(struct domain *d,
         {
             rc = xenmem_add_to_physmap_once(d, xatp);
             if ( rc < 0 )
-                return rc;
+                break;
 
             xatp->idx++;
             xatp->gpfn++;
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 93ad122..bf8b6ba 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -306,11 +306,11 @@ static int iommu_populate_page_table(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
     struct page_info *page;
-    int rc;
+    int rc = 0;
 
+    this_cpu(iommu_dont_flush_iotlb) = 1;
     spin_lock(&d->page_alloc_lock);
 
-    this_cpu(iommu_dont_flush_iotlb) = 1;
     page_list_for_each ( page, &d->page_list )
     {
         if ( is_hvm_domain(d) ||
@@ -320,18 +320,20 @@ static int iommu_populate_page_table(struct domain *d)
             rc = hd->platform_ops->map_page(
                 d, mfn_to_gmfn(d, page_to_mfn(page)), page_to_mfn(page),
                 IOMMUF_readable|IOMMUF_writable);
-            if (rc)
-            {
-                spin_unlock(&d->page_alloc_lock);
-                hd->platform_ops->teardown(d);
-                return rc;
-            }
+            if ( rc )
+                break;
         }
     }
-    this_cpu(iommu_dont_flush_iotlb) = 0;
-    iommu_iotlb_flush_all(d);
+
     spin_unlock(&d->page_alloc_lock);
-    return 0;
+    this_cpu(iommu_dont_flush_iotlb) = 0;
+
+    if ( !rc )
+        iommu_iotlb_flush_all(d);
+    else
+        hd->platform_ops->teardown(d);
+
+    return rc;
 }
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Wed Dec 11 11:11:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Dec 2013 11:11: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 1Vqhh5-0004V0-5D; Wed, 11 Dec 2013 11:11: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 1Vqhh3-0004Ut-Rx
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 11:11:06 +0000
Received: from [85.158.137.68:30899] by server-11.bemta-3.messagelabs.com id
	DD/D8-19379-84848A25; Wed, 11 Dec 2013 11:11:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1386760262!3168832!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4907 invoked from network); 11 Dec 2013 11:11:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2013 11:11:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vqhh0-0006Cq-I7
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 11:11:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vqhh0-0003s7-Ba
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 11:11:02 +0000
Date: Wed, 11 Dec 2013 11:11:02 +0000
Message-Id: <E1Vqhh0-0003s7-Ba@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] IOMMU: clear "don't flush"
	override on error paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 43359e14ffc64f95343c35c9a1eafbc36adad531
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 10 16:21:57 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:21:57 2013 +0100

    IOMMU: clear "don't flush" override on error paths
    
    Both xenmem_add_to_physmap() and iommu_populate_page_table() each have
    an error path that fails to clear that flag, thus suppressing further
    flushes on the respective pCPU.
    
    In iommu_populate_page_table() also slightly re-arrange code to avoid
    the false impression of the flag in question being guarded by a
    domain's page_alloc_lock.
    
    This is CVE-2013-6400 / XSA-80.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 552b7fcb9a70f1d4dd0e0cd5fb4d3d9da410104a
    master date: 2013-12-10 16:10:37 +0100
---
 xen/arch/x86/mm.c               |    2 +-
 xen/drivers/passthrough/iommu.c |   24 +++++++++++++-----------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index df687af..daba883 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4917,7 +4917,7 @@ static int xenmem_add_to_physmap(struct domain *d,
         {
             rc = xenmem_add_to_physmap_once(d, xatp);
             if ( rc < 0 )
-                return rc;
+                break;
 
             xatp->idx++;
             xatp->gpfn++;
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 159dce9..ddd0a38 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -250,11 +250,11 @@ static int iommu_populate_page_table(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
     struct page_info *page;
-    int rc;
+    int rc = 0;
 
+    this_cpu(iommu_dont_flush_iotlb) = 1;
     spin_lock(&d->page_alloc_lock);
 
-    this_cpu(iommu_dont_flush_iotlb) = 1;
     page_list_for_each ( page, &d->page_list )
     {
         if ( is_hvm_domain(d) ||
@@ -264,18 +264,20 @@ static int iommu_populate_page_table(struct domain *d)
             rc = hd->platform_ops->map_page(
                 d, mfn_to_gmfn(d, page_to_mfn(page)), page_to_mfn(page),
                 IOMMUF_readable|IOMMUF_writable);
-            if (rc)
-            {
-                spin_unlock(&d->page_alloc_lock);
-                hd->platform_ops->teardown(d);
-                return rc;
-            }
+            if ( rc )
+                break;
         }
     }
-    this_cpu(iommu_dont_flush_iotlb) = 0;
-    iommu_iotlb_flush_all(d);
+
     spin_unlock(&d->page_alloc_lock);
-    return 0;
+    this_cpu(iommu_dont_flush_iotlb) = 0;
+
+    if ( !rc )
+        iommu_iotlb_flush_all(d);
+    else
+        hd->platform_ops->teardown(d);
+
+    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 Wed Dec 11 11:11:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Dec 2013 11:11: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 1Vqhh5-0004V0-5D; Wed, 11 Dec 2013 11:11: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 1Vqhh3-0004Ut-Rx
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 11:11:06 +0000
Received: from [85.158.137.68:30899] by server-11.bemta-3.messagelabs.com id
	DD/D8-19379-84848A25; Wed, 11 Dec 2013 11:11:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1386760262!3168832!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4907 invoked from network); 11 Dec 2013 11:11:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2013 11:11:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vqhh0-0006Cq-I7
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 11:11:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vqhh0-0003s7-Ba
	for xen-changelog@lists.xensource.com; Wed, 11 Dec 2013 11:11:02 +0000
Date: Wed, 11 Dec 2013 11:11:02 +0000
Message-Id: <E1Vqhh0-0003s7-Ba@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] IOMMU: clear "don't flush"
	override on error paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 43359e14ffc64f95343c35c9a1eafbc36adad531
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 10 16:21:57 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:21:57 2013 +0100

    IOMMU: clear "don't flush" override on error paths
    
    Both xenmem_add_to_physmap() and iommu_populate_page_table() each have
    an error path that fails to clear that flag, thus suppressing further
    flushes on the respective pCPU.
    
    In iommu_populate_page_table() also slightly re-arrange code to avoid
    the false impression of the flag in question being guarded by a
    domain's page_alloc_lock.
    
    This is CVE-2013-6400 / XSA-80.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 552b7fcb9a70f1d4dd0e0cd5fb4d3d9da410104a
    master date: 2013-12-10 16:10:37 +0100
---
 xen/arch/x86/mm.c               |    2 +-
 xen/drivers/passthrough/iommu.c |   24 +++++++++++++-----------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index df687af..daba883 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4917,7 +4917,7 @@ static int xenmem_add_to_physmap(struct domain *d,
         {
             rc = xenmem_add_to_physmap_once(d, xatp);
             if ( rc < 0 )
-                return rc;
+                break;
 
             xatp->idx++;
             xatp->gpfn++;
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 159dce9..ddd0a38 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -250,11 +250,11 @@ static int iommu_populate_page_table(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
     struct page_info *page;
-    int rc;
+    int rc = 0;
 
+    this_cpu(iommu_dont_flush_iotlb) = 1;
     spin_lock(&d->page_alloc_lock);
 
-    this_cpu(iommu_dont_flush_iotlb) = 1;
     page_list_for_each ( page, &d->page_list )
     {
         if ( is_hvm_domain(d) ||
@@ -264,18 +264,20 @@ static int iommu_populate_page_table(struct domain *d)
             rc = hd->platform_ops->map_page(
                 d, mfn_to_gmfn(d, page_to_mfn(page)), page_to_mfn(page),
                 IOMMUF_readable|IOMMUF_writable);
-            if (rc)
-            {
-                spin_unlock(&d->page_alloc_lock);
-                hd->platform_ops->teardown(d);
-                return rc;
-            }
+            if ( rc )
+                break;
         }
     }
-    this_cpu(iommu_dont_flush_iotlb) = 0;
-    iommu_iotlb_flush_all(d);
+
     spin_unlock(&d->page_alloc_lock);
-    return 0;
+    this_cpu(iommu_dont_flush_iotlb) = 0;
+
+    if ( !rc )
+        iommu_iotlb_flush_all(d);
+    else
+        hd->platform_ops->teardown(d);
+
+    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 Thu Dec 12 01:33:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Dec 2013 01:33: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 1Vqv9I-00069T-3w; Thu, 12 Dec 2013 01:33:08 +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 1Vqv9H-00069K-9T
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:07 +0000
Received: from [85.158.137.68:39531] by server-10.bemta-3.messagelabs.com id
	4E/3D-23989-25219A25; Thu, 12 Dec 2013 01:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1386811984!3349581!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1068 invoked from network); 12 Dec 2013 01:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 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 1Vqv9E-00067E-1v
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 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 1Vqv9D-0003Xn-Aw
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:03 +0000
Date: Thu, 12 Dec 2013 01:33:03 +0000
Message-Id: <E1Vqv9D-0003Xn-Aw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VMX: disable EPT when
	!cpu_has_vmx_pat
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 649e7ae0df99ffb5bccc17b4cb139c46ce2359a2
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:50:55 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:50:55 2013 +0100

    VMX: disable EPT when !cpu_has_vmx_pat
    
    Recently Oracle developers found a Xen security issue as DOS affecting,
    named as XSA-60. Please refer http://xenbits.xen.org/xsa/advisory-60.html
    Basically it involves how to handle guest cr0.cd setting, which under
    some environment it consumes much time resulting in DOS-like behavior.
    
    This is a preparing patch for fixing XSA-60. Later patch will fix XSA-60
    via PAT under Intel EPT case, which depends on cpu_has_vmx_pat.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: c13b0d65ddedd74508edef5cd66defffe30468fc
    master date: 2013-11-06 10:11:18 +0100
---
 xen/arch/x86/hvm/vmx/vmcs.c |    4 ++--
 xen/arch/x86/hvm/vmx/vmx.c  |   10 +++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 6966acc..9eee3d1 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -742,7 +742,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
-        if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+        if ( paging_mode_hap(d) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT);
     }
 
@@ -872,7 +872,7 @@ static int construct_vmcs(struct vcpu *v)
     if ( cpu_has_vmx_vpid )
         __vmwrite(VIRTUAL_PROCESSOR_ID, v->arch.hvm_vcpu.asid);
 
-    if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+    if ( paging_mode_hap(d) )
     {
         u64 host_pat, guest_pat;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 425030b..5dc8bde 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -923,7 +923,7 @@ static void vmx_set_segment_register(struct vcpu *v, enum x86_segment seg,
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -937,7 +937,7 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -1450,7 +1450,11 @@ struct hvm_function_table * __init start_vmx(void)
         return NULL;
     }
 
-    if ( cpu_has_vmx_ept )
+    /*
+     * Do not enable EPT when (!cpu_has_vmx_pat), to prevent security hole
+     * (refer to http://xenbits.xen.org/xsa/advisory-60.html).
+     */
+    if ( cpu_has_vmx_ept && cpu_has_vmx_pat )
     {
         vmx_function_table.hap_supported = 1;
 
--
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 Dec 12 01:33:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Dec 2013 01:33: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 1Vqv9I-00069T-3w; Thu, 12 Dec 2013 01:33:08 +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 1Vqv9H-00069K-9T
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:07 +0000
Received: from [85.158.137.68:39531] by server-10.bemta-3.messagelabs.com id
	4E/3D-23989-25219A25; Thu, 12 Dec 2013 01:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1386811984!3349581!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1068 invoked from network); 12 Dec 2013 01:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 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 1Vqv9E-00067E-1v
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 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 1Vqv9D-0003Xn-Aw
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:03 +0000
Date: Thu, 12 Dec 2013 01:33:03 +0000
Message-Id: <E1Vqv9D-0003Xn-Aw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VMX: disable EPT when
	!cpu_has_vmx_pat
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 649e7ae0df99ffb5bccc17b4cb139c46ce2359a2
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:50:55 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:50:55 2013 +0100

    VMX: disable EPT when !cpu_has_vmx_pat
    
    Recently Oracle developers found a Xen security issue as DOS affecting,
    named as XSA-60. Please refer http://xenbits.xen.org/xsa/advisory-60.html
    Basically it involves how to handle guest cr0.cd setting, which under
    some environment it consumes much time resulting in DOS-like behavior.
    
    This is a preparing patch for fixing XSA-60. Later patch will fix XSA-60
    via PAT under Intel EPT case, which depends on cpu_has_vmx_pat.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: c13b0d65ddedd74508edef5cd66defffe30468fc
    master date: 2013-11-06 10:11:18 +0100
---
 xen/arch/x86/hvm/vmx/vmcs.c |    4 ++--
 xen/arch/x86/hvm/vmx/vmx.c  |   10 +++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 6966acc..9eee3d1 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -742,7 +742,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
-        if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+        if ( paging_mode_hap(d) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT);
     }
 
@@ -872,7 +872,7 @@ static int construct_vmcs(struct vcpu *v)
     if ( cpu_has_vmx_vpid )
         __vmwrite(VIRTUAL_PROCESSOR_ID, v->arch.hvm_vcpu.asid);
 
-    if ( cpu_has_vmx_pat && paging_mode_hap(d) )
+    if ( paging_mode_hap(d) )
     {
         u64 host_pat, guest_pat;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 425030b..5dc8bde 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -923,7 +923,7 @@ static void vmx_set_segment_register(struct vcpu *v, enum x86_segment seg,
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -937,7 +937,7 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !cpu_has_vmx_pat || !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -1450,7 +1450,11 @@ struct hvm_function_table * __init start_vmx(void)
         return NULL;
     }
 
-    if ( cpu_has_vmx_ept )
+    /*
+     * Do not enable EPT when (!cpu_has_vmx_pat), to prevent security hole
+     * (refer to http://xenbits.xen.org/xsa/advisory-60.html).
+     */
+    if ( cpu_has_vmx_ept && cpu_has_vmx_pat )
     {
         vmx_function_table.hap_supported = 1;
 
--
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 Dec 12 01:33:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Dec 2013 01:33: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 1Vqv9T-0006B2-6m; Thu, 12 Dec 2013 01:33: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 1Vqv9S-0006Am-1g
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:18 +0000
Received: from [85.158.137.68:27205] by server-14.bemta-3.messagelabs.com id
	43/51-06105-D5219A25; Thu, 12 Dec 2013 01:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1386811995!2584715!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20521 invoked from network); 12 Dec 2013 01:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2013 01: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 1Vqv9O-00067K-OM
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vqv9O-0003YB-8t
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:14 +0000
Date: Thu, 12 Dec 2013 01:33:14 +0000
Message-Id: <E1Vqv9O-0003YB-8t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VMX: remove the problematic
	set_uc_mode logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8829f8e3a6aff06f800c32841418afe98f0825bb
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:51:46 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:51:46 2013 +0100

    VMX: remove the problematic set_uc_mode logic
    
    XSA-60 security hole comes from the problematic vmx_set_uc_mode.
    This patch remove vmx_set_uc_mode logic, which will be replaced by
    PAT approach at later patch.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: 1c84d046735102e02d2df454ab07f14ac51f235d
    master date: 2013-11-06 10:12:00 +0100
---
 xen/arch/x86/hvm/hvm.c        |    2 -
 xen/arch/x86/hvm/mtrr.c       |    3 -
 xen/arch/x86/hvm/vmx/vmx.c    |    9 ---
 xen/arch/x86/mm/hap/p2m-ept.c |  110 -----------------------------------------
 xen/include/asm-x86/hvm/hvm.h |    1 -
 5 files changed, 0 insertions(+), 125 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9a0a91e..9c34f17 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1327,8 +1327,6 @@ static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
 {
     v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
     shadow_blow_tables_per_domain(v->domain);
-    if ( hvm_funcs.set_uc_mode )
-        return hvm_funcs.set_uc_mode(v);
 }
 
 int hvm_mov_to_cr(unsigned int cr, unsigned int gpr)
diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index dcac00b..dcc2fae 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -700,9 +700,6 @@ uint8_t epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn,
     if ( !v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT] )
         return MTRR_TYPE_WRBACK;
 
-    if ( (v == current) && v->domain->arch.hvm_domain.is_in_uc_mode )
-        return MTRR_TYPE_UNCACHABLE;
-
     if ( !mfn_valid(mfn_x(mfn)) )
         return MTRR_TYPE_UNCACHABLE;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 5dc8bde..3aaed5a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1363,14 +1363,6 @@ static int vmx_do_pmu_interrupt(struct cpu_user_regs *regs)
     return vpmu_do_interrupt(regs);
 }
 
-static void vmx_set_uc_mode(struct vcpu *v)
-{
-    if ( paging_mode_hap(v->domain) )
-        ept_change_entry_emt_with_range(
-            v->domain, 0, p2m_get_hostp2m(v->domain)->max_mapped_pfn);
-    hvm_asid_flush_vcpu(v);
-}
-
 static void vmx_set_info_guest(struct vcpu *v)
 {
     unsigned long intr_shadow;
@@ -1432,7 +1424,6 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
-    .set_uc_mode          = vmx_set_uc_mode,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting
 };
diff --git a/xen/arch/x86/mm/hap/p2m-ept.c b/xen/arch/x86/mm/hap/p2m-ept.c
index b1799b5..77be856 100644
--- a/xen/arch/x86/mm/hap/p2m-ept.c
+++ b/xen/arch/x86/mm/hap/p2m-ept.c
@@ -600,43 +600,6 @@ out:
     return mfn;
 }
 
-/* WARNING: Only caller doesn't care about PoD pages.  So this function will
- * always return 0 for PoD pages, not populate them.  If that becomes necessary,
- * pass a p2m_query_t type along to distinguish. */
-static ept_entry_t ept_get_entry_content(struct p2m_domain *p2m,
-    unsigned long gfn, int *level)
-{
-    ept_entry_t *table = map_domain_page(ept_get_asr(p2m->domain));
-    unsigned long gfn_remainder = gfn;
-    ept_entry_t *ept_entry;
-    ept_entry_t content = { .epte = 0 };
-    u32 index;
-    int i;
-    int ret=0;
-
-    /* This pfn is higher than the highest the p2m map currently holds */
-    if ( gfn > p2m->max_mapped_pfn )
-        goto out;
-
-    for ( i = ept_get_wl(p2m->domain); i > 0; i-- )
-    {
-        ret = ept_next_level(p2m, 1, &table, &gfn_remainder, i);
-        if ( !ret || ret == GUEST_TABLE_POD_PAGE )
-            goto out;
-        else if ( ret == GUEST_TABLE_SUPER_PAGE )
-            break;
-    }
-
-    index = gfn_remainder >> (i * EPT_TABLE_ORDER);
-    ept_entry = table + index;
-    content = *ept_entry;
-    *level = i;
-
- out:
-    unmap_domain_page(table);
-    return content;
-}
-
 void ept_walk_table(struct domain *d, unsigned long gfn)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
@@ -695,79 +658,6 @@ static mfn_t ept_get_entry_current(struct p2m_domain *p2m,
 }
 
 /*
- * To test if the new emt type is the same with old,
- * return 1 to not to reset ept entry.
- */
-static int need_modify_ept_entry(struct p2m_domain *p2m, unsigned long gfn,
-                                 mfn_t mfn, uint8_t o_ipat, uint8_t o_emt,
-                                 p2m_type_t p2mt)
-{
-    uint8_t ipat;
-    uint8_t emt;
-    bool_t direct_mmio = (p2mt == p2m_mmio_direct);
-
-    emt = epte_get_entry_emt(p2m->domain, gfn, mfn, &ipat, direct_mmio);
-
-    if ( (emt == o_emt) && (ipat == o_ipat) )
-        return 0;
-
-    return 1;
-}
-
-void ept_change_entry_emt_with_range(struct domain *d,
-                                     unsigned long start_gfn,
-                                     unsigned long end_gfn)
-{
-    unsigned long gfn;
-    ept_entry_t e;
-    mfn_t mfn;
-    int order = 0;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    p2m_lock(p2m);
-    for ( gfn = start_gfn; gfn <= end_gfn; gfn++ )
-    {
-        int level = 0;
-        uint64_t trunk = 0;
-
-        e = ept_get_entry_content(p2m, gfn, &level);
-        if ( !p2m_has_emt(e.sa_p2mt) )
-            continue;
-
-        order = 0;
-        mfn = _mfn(e.mfn);
-
-        if ( is_epte_superpage(&e) )
-        {
-            while ( level )
-            {
-                trunk = (1UL << (level * EPT_TABLE_ORDER)) - 1;
-                if ( !(gfn & trunk) && (gfn + trunk <= end_gfn) )
-                {
-                    /* gfn assigned with 2M or 1G, and the end covers more than
-                     * the super page areas.
-                     * Set emt for super page.
-                     */
-                    order = level * EPT_TABLE_ORDER;
-                    if ( need_modify_ept_entry(p2m, gfn, mfn, 
-                          e.ipat, e.emt, e.sa_p2mt) )
-                        ept_set_entry(p2m, gfn, mfn, order, e.sa_p2mt, e.access);
-                    gfn += trunk;
-                    break;
-                }
-                level--;
-             }
-        }
-        else /* gfn assigned with 4k */
-        {
-            if ( need_modify_ept_entry(p2m, gfn, mfn, e.ipat, e.emt, e.sa_p2mt) )
-                ept_set_entry(p2m, gfn, mfn, order, e.sa_p2mt, e.access);
-        }
-    }
-    p2m_unlock(p2m);
-}
-
-/*
  * Walk the whole p2m table, changing any entries of the old type
  * to the new type.  This is used in hardware-assisted paging to
  * quickly enable or diable log-dirty tracking
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index e0949de..dfa71d4 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -147,7 +147,6 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
-    void (*set_uc_mode)(struct vcpu *v);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 };
--
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 Dec 12 01:33:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Dec 2013 01:33: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 1Vqv9T-0006B2-6m; Thu, 12 Dec 2013 01:33: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 1Vqv9S-0006Am-1g
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:18 +0000
Received: from [85.158.137.68:27205] by server-14.bemta-3.messagelabs.com id
	43/51-06105-D5219A25; Thu, 12 Dec 2013 01:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1386811995!2584715!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20521 invoked from network); 12 Dec 2013 01:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2013 01: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 1Vqv9O-00067K-OM
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vqv9O-0003YB-8t
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:14 +0000
Date: Thu, 12 Dec 2013 01:33:14 +0000
Message-Id: <E1Vqv9O-0003YB-8t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VMX: remove the problematic
	set_uc_mode logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8829f8e3a6aff06f800c32841418afe98f0825bb
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:51:46 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:51:46 2013 +0100

    VMX: remove the problematic set_uc_mode logic
    
    XSA-60 security hole comes from the problematic vmx_set_uc_mode.
    This patch remove vmx_set_uc_mode logic, which will be replaced by
    PAT approach at later patch.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    master commit: 1c84d046735102e02d2df454ab07f14ac51f235d
    master date: 2013-11-06 10:12:00 +0100
---
 xen/arch/x86/hvm/hvm.c        |    2 -
 xen/arch/x86/hvm/mtrr.c       |    3 -
 xen/arch/x86/hvm/vmx/vmx.c    |    9 ---
 xen/arch/x86/mm/hap/p2m-ept.c |  110 -----------------------------------------
 xen/include/asm-x86/hvm/hvm.h |    1 -
 5 files changed, 0 insertions(+), 125 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9a0a91e..9c34f17 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1327,8 +1327,6 @@ static void hvm_set_uc_mode(struct vcpu *v, bool_t is_in_uc_mode)
 {
     v->domain->arch.hvm_domain.is_in_uc_mode = is_in_uc_mode;
     shadow_blow_tables_per_domain(v->domain);
-    if ( hvm_funcs.set_uc_mode )
-        return hvm_funcs.set_uc_mode(v);
 }
 
 int hvm_mov_to_cr(unsigned int cr, unsigned int gpr)
diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c
index dcac00b..dcc2fae 100644
--- a/xen/arch/x86/hvm/mtrr.c
+++ b/xen/arch/x86/hvm/mtrr.c
@@ -700,9 +700,6 @@ uint8_t epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn,
     if ( !v->domain->arch.hvm_domain.params[HVM_PARAM_IDENT_PT] )
         return MTRR_TYPE_WRBACK;
 
-    if ( (v == current) && v->domain->arch.hvm_domain.is_in_uc_mode )
-        return MTRR_TYPE_UNCACHABLE;
-
     if ( !mfn_valid(mfn_x(mfn)) )
         return MTRR_TYPE_UNCACHABLE;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 5dc8bde..3aaed5a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1363,14 +1363,6 @@ static int vmx_do_pmu_interrupt(struct cpu_user_regs *regs)
     return vpmu_do_interrupt(regs);
 }
 
-static void vmx_set_uc_mode(struct vcpu *v)
-{
-    if ( paging_mode_hap(v->domain) )
-        ept_change_entry_emt_with_range(
-            v->domain, 0, p2m_get_hostp2m(v->domain)->max_mapped_pfn);
-    hvm_asid_flush_vcpu(v);
-}
-
 static void vmx_set_info_guest(struct vcpu *v)
 {
     unsigned long intr_shadow;
@@ -1432,7 +1424,6 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
-    .set_uc_mode          = vmx_set_uc_mode,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting
 };
diff --git a/xen/arch/x86/mm/hap/p2m-ept.c b/xen/arch/x86/mm/hap/p2m-ept.c
index b1799b5..77be856 100644
--- a/xen/arch/x86/mm/hap/p2m-ept.c
+++ b/xen/arch/x86/mm/hap/p2m-ept.c
@@ -600,43 +600,6 @@ out:
     return mfn;
 }
 
-/* WARNING: Only caller doesn't care about PoD pages.  So this function will
- * always return 0 for PoD pages, not populate them.  If that becomes necessary,
- * pass a p2m_query_t type along to distinguish. */
-static ept_entry_t ept_get_entry_content(struct p2m_domain *p2m,
-    unsigned long gfn, int *level)
-{
-    ept_entry_t *table = map_domain_page(ept_get_asr(p2m->domain));
-    unsigned long gfn_remainder = gfn;
-    ept_entry_t *ept_entry;
-    ept_entry_t content = { .epte = 0 };
-    u32 index;
-    int i;
-    int ret=0;
-
-    /* This pfn is higher than the highest the p2m map currently holds */
-    if ( gfn > p2m->max_mapped_pfn )
-        goto out;
-
-    for ( i = ept_get_wl(p2m->domain); i > 0; i-- )
-    {
-        ret = ept_next_level(p2m, 1, &table, &gfn_remainder, i);
-        if ( !ret || ret == GUEST_TABLE_POD_PAGE )
-            goto out;
-        else if ( ret == GUEST_TABLE_SUPER_PAGE )
-            break;
-    }
-
-    index = gfn_remainder >> (i * EPT_TABLE_ORDER);
-    ept_entry = table + index;
-    content = *ept_entry;
-    *level = i;
-
- out:
-    unmap_domain_page(table);
-    return content;
-}
-
 void ept_walk_table(struct domain *d, unsigned long gfn)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
@@ -695,79 +658,6 @@ static mfn_t ept_get_entry_current(struct p2m_domain *p2m,
 }
 
 /*
- * To test if the new emt type is the same with old,
- * return 1 to not to reset ept entry.
- */
-static int need_modify_ept_entry(struct p2m_domain *p2m, unsigned long gfn,
-                                 mfn_t mfn, uint8_t o_ipat, uint8_t o_emt,
-                                 p2m_type_t p2mt)
-{
-    uint8_t ipat;
-    uint8_t emt;
-    bool_t direct_mmio = (p2mt == p2m_mmio_direct);
-
-    emt = epte_get_entry_emt(p2m->domain, gfn, mfn, &ipat, direct_mmio);
-
-    if ( (emt == o_emt) && (ipat == o_ipat) )
-        return 0;
-
-    return 1;
-}
-
-void ept_change_entry_emt_with_range(struct domain *d,
-                                     unsigned long start_gfn,
-                                     unsigned long end_gfn)
-{
-    unsigned long gfn;
-    ept_entry_t e;
-    mfn_t mfn;
-    int order = 0;
-    struct p2m_domain *p2m = p2m_get_hostp2m(d);
-
-    p2m_lock(p2m);
-    for ( gfn = start_gfn; gfn <= end_gfn; gfn++ )
-    {
-        int level = 0;
-        uint64_t trunk = 0;
-
-        e = ept_get_entry_content(p2m, gfn, &level);
-        if ( !p2m_has_emt(e.sa_p2mt) )
-            continue;
-
-        order = 0;
-        mfn = _mfn(e.mfn);
-
-        if ( is_epte_superpage(&e) )
-        {
-            while ( level )
-            {
-                trunk = (1UL << (level * EPT_TABLE_ORDER)) - 1;
-                if ( !(gfn & trunk) && (gfn + trunk <= end_gfn) )
-                {
-                    /* gfn assigned with 2M or 1G, and the end covers more than
-                     * the super page areas.
-                     * Set emt for super page.
-                     */
-                    order = level * EPT_TABLE_ORDER;
-                    if ( need_modify_ept_entry(p2m, gfn, mfn, 
-                          e.ipat, e.emt, e.sa_p2mt) )
-                        ept_set_entry(p2m, gfn, mfn, order, e.sa_p2mt, e.access);
-                    gfn += trunk;
-                    break;
-                }
-                level--;
-             }
-        }
-        else /* gfn assigned with 4k */
-        {
-            if ( need_modify_ept_entry(p2m, gfn, mfn, e.ipat, e.emt, e.sa_p2mt) )
-                ept_set_entry(p2m, gfn, mfn, order, e.sa_p2mt, e.access);
-        }
-    }
-    p2m_unlock(p2m);
-}
-
-/*
  * Walk the whole p2m table, changing any entries of the old type
  * to the new type.  This is used in hardware-assisted paging to
  * quickly enable or diable log-dirty tracking
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index e0949de..dfa71d4 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -147,7 +147,6 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
-    void (*set_uc_mode)(struct vcpu *v);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 };
--
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 Dec 12 01:33:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Dec 2013 01:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vqv9e-0006Ci-9d; Thu, 12 Dec 2013 01:33: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 1Vqv9c-0006CN-I5
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:28 +0000
Received: from [85.158.139.211:12880] by server-15.bemta-5.messagelabs.com id
	97/2D-08490-76219A25; Thu, 12 Dec 2013 01:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386812005!3920027!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8594 invoked from network); 12 Dec 2013 01:33:26 -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;
	12 Dec 2013 01:33: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 1Vqv9Z-00067Q-4T
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vqv9Y-0003ZG-Sa
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:24 +0000
Date: Thu, 12 Dec 2013 01:33:24 +0000
Message-Id: <E1Vqv9Y-0003ZG-Sa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VMX: fix cr0.cd handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 684b40eb41c3d5eba55ad94b36fa3702c7720fe1
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:55:40 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:55:40 2013 +0100

    VMX: fix cr0.cd handling
    
    This patch solves XSA-60 security hole:
    1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need
    do nothing, since hardware snoop mechanism has ensured cache coherency.
    
    2. For guest with VT-d but non-snooped, cache coherency can not be
    guaranteed by h/w snoop, therefore it need emulate UC type to guest:
    2.1). if it works w/ Intel EPT, set guest IA32_PAT fields as UC so that
    guest memory type are all UC.
    2.2). if it works w/ shadow, drop all shadows so that any new ones would
    be created on demand w/ UC.
    
    This patch also fix a bug of shadow cr0.cd setting. Current shadow has a
    small window between cache flush and TLB invalidation, resulting in possilbe
    cache pollution. This patch pause vcpus so that no vcpus context involved
    into the window.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 62652c00efa55fb45374bcc92f7d96fc411aebb2
    master date: 2013-11-06 10:12:36 +0100
---
 xen/arch/x86/hvm/hvm.c            |   75 ++++++++++++++++++++++--------------
 xen/arch/x86/hvm/vmx/vmcs.c       |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c        |   54 +++++++++++++++++++++++++-
 xen/common/domain.c               |   10 +++++
 xen/include/asm-x86/hvm/hvm.h     |    1 +
 xen/include/asm-x86/hvm/support.h |    2 +
 xen/include/xen/sched.h           |    1 +
 7 files changed, 113 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9c34f17..9469499 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1409,6 +1409,40 @@ int hvm_mov_from_cr(unsigned int cr, unsigned int gpr)
     return X86EMUL_UNHANDLEABLE;
 }
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( value & X86_CR0_CD )
+    {
+        /* Entering no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+
+        if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
+        {
+            domain_pause_nosync(v->domain);
+
+            /* Flush physical caches. */
+            on_each_cpu(local_flush_cache, NULL, 1);
+            hvm_set_uc_mode(v, 1);
+
+            domain_unpause(v->domain);
+        }
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+    else if ( !(value & X86_CR0_CD) &&
+              (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
+    {
+        /* Exit from no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+
+        if ( domain_exit_uc_mode(v) )
+            hvm_set_uc_mode(v, 0);
+
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+}
+
 int hvm_set_cr0(unsigned long value)
 {
     struct vcpu *v = current;
@@ -1485,35 +1519,18 @@ int hvm_set_cr0(unsigned long value)
         }
     }
 
-    if ( has_arch_mmios(v->domain) )
-    {
-        if ( (value & X86_CR0_CD) && !(value & X86_CR0_NW) )
-        {
-            /* Entering no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
-
-            if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
-            {
-                /* Flush physical caches. */
-                on_each_cpu(local_flush_cache, NULL, 1);
-                hvm_set_uc_mode(v, 1);
-            }
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-        else if ( !(value & (X86_CR0_CD | X86_CR0_NW)) &&
-                  (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        {
-            /* Exit from no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
-
-            if ( domain_exit_uc_mode(v) )
-                hvm_set_uc_mode(v, 0);
-
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-    }
+    /*
+     * When cr0.cd setting
+     * 1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need not
+     * do anything, since hardware snoop mechanism has ensured cache coherency;
+     * 2. For guest with VT-d but non-snooped, cache coherency cannot be
+     * guaranteed by h/w so need emulate UC memory type to guest.
+     */
+    if ( ((value ^ old_value) & X86_CR0_CD) &&
+           has_arch_pdevs(v->domain) &&
+           iommu_enabled && !iommu_snoop &&
+           hvm_funcs.handle_cd )
+        hvm_funcs.handle_cd(v, value);
 
     v->arch.hvm_vcpu.guest_cr[0] = value;
     hvm_update_guest_cr(v, 0);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 9eee3d1..b884132 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -742,7 +742,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
-        if ( paging_mode_hap(d) )
+        if ( paging_mode_hap(d) && (!iommu_enabled || iommu_snoop) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT);
     }
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 3aaed5a..4c4e6b7 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -923,7 +923,8 @@ static void vmx_set_segment_register(struct vcpu *v, enum x86_segment seg,
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -937,7 +938,8 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -949,6 +951,53 @@ static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
     return 1;
 }
 
+static void vmx_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( !paging_mode_hap(v->domain) )
+    {
+        /*
+         * For shadow, 'load IA32_PAT' VM-entry control is 0, so it cannot
+         * set guest memory type as UC via IA32_PAT. Xen drop all shadows
+         * so that any new ones would be created on demand.
+         */
+        hvm_shadow_handle_cd(v, value);
+    }
+    else
+    {
+        u64 *pat = &v->arch.hvm_vcpu.pat_cr;
+
+        if ( value & X86_CR0_CD )
+        {
+            /*
+             * For EPT, set guest IA32_PAT fields as UC so that guest
+             * memory type are all UC.
+             */
+            u64 uc_pat =
+                ((uint64_t)PAT_TYPE_UNCACHABLE)       |       /* PAT0 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 8)  |       /* PAT1 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 16) |       /* PAT2 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 24) |       /* PAT3 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 32) |       /* PAT4 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 40) |       /* PAT5 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 48) |       /* PAT6 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 56);        /* PAT7 */
+
+            vmx_get_guest_pat(v, pat);
+            vmx_set_guest_pat(v, uc_pat);
+
+            wbinvd();               /* flush possibly polluted cache */
+            hvm_asid_flush_vcpu(v); /* invalidate memory type cached in TLB */
+            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+        }
+        else
+        {
+            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+            vmx_set_guest_pat(v, *pat);
+            hvm_asid_flush_vcpu(v); /* no need to flush cache */
+        }
+    }
+}
+
 static void vmx_set_tsc_offset(struct vcpu *v, u64 offset)
 {
     vmx_vmcs_enter(v);
@@ -1424,6 +1473,7 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
+    .handle_cd            = vmx_handle_cd,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting
 };
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 5fa045b..4637dd1 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -739,6 +739,16 @@ void domain_pause(struct domain *d)
         vcpu_sleep_sync(v);
 }
 
+void domain_pause_nosync(struct domain *d)
+{
+    struct vcpu *v;
+
+    atomic_inc(&d->pause_count);
+
+    for_each_vcpu( d, v )
+        vcpu_sleep_nosync(v);
+}
+
 void domain_unpause(struct domain *d)
 {
     struct vcpu *v;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index dfa71d4..50f53e4 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -147,6 +147,7 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
+    void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 };
diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h
index 1d39c03..41b181c 100644
--- a/xen/include/asm-x86/hvm/support.h
+++ b/xen/include/asm-x86/hvm/support.h
@@ -130,6 +130,8 @@ void hvm_rdtsc_intercept(struct cpu_user_regs *regs);
 
 int hvm_handle_xsetbv(u64 new_bv);
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value);
+
 /* These functions all return X86EMUL return codes. */
 int hvm_set_efer(uint64_t value);
 int hvm_set_cr0(unsigned long value);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 16e50e1..c177a44 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -612,6 +612,7 @@ void vcpu_unblock(struct vcpu *v);
 void vcpu_pause(struct vcpu *v);
 void vcpu_pause_nosync(struct vcpu *v);
 void domain_pause(struct domain *d);
+void domain_pause_nosync(struct domain *d);
 void vcpu_unpause(struct vcpu *v);
 void domain_unpause(struct domain *d);
 void domain_pause_by_systemcontroller(struct domain *d);
--
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 Dec 12 01:33:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Dec 2013 01:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vqv9e-0006Ci-9d; Thu, 12 Dec 2013 01:33: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 1Vqv9c-0006CN-I5
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:28 +0000
Received: from [85.158.139.211:12880] by server-15.bemta-5.messagelabs.com id
	97/2D-08490-76219A25; Thu, 12 Dec 2013 01:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386812005!3920027!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8594 invoked from network); 12 Dec 2013 01:33:26 -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;
	12 Dec 2013 01:33: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 1Vqv9Z-00067Q-4T
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vqv9Y-0003ZG-Sa
	for xen-changelog@lists.xensource.com; Thu, 12 Dec 2013 01:33:24 +0000
Date: Thu, 12 Dec 2013 01:33:24 +0000
Message-Id: <E1Vqv9Y-0003ZG-Sa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VMX: fix cr0.cd handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 684b40eb41c3d5eba55ad94b36fa3702c7720fe1
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Dec 9 14:55:40 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 9 14:55:40 2013 +0100

    VMX: fix cr0.cd handling
    
    This patch solves XSA-60 security hole:
    1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need
    do nothing, since hardware snoop mechanism has ensured cache coherency.
    
    2. For guest with VT-d but non-snooped, cache coherency can not be
    guaranteed by h/w snoop, therefore it need emulate UC type to guest:
    2.1). if it works w/ Intel EPT, set guest IA32_PAT fields as UC so that
    guest memory type are all UC.
    2.2). if it works w/ shadow, drop all shadows so that any new ones would
    be created on demand w/ UC.
    
    This patch also fix a bug of shadow cr0.cd setting. Current shadow has a
    small window between cache flush and TLB invalidation, resulting in possilbe
    cache pollution. This patch pause vcpus so that no vcpus context involved
    into the window.
    
    This is CVE-2013-2212 / XSA-60.
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 62652c00efa55fb45374bcc92f7d96fc411aebb2
    master date: 2013-11-06 10:12:36 +0100
---
 xen/arch/x86/hvm/hvm.c            |   75 ++++++++++++++++++++++--------------
 xen/arch/x86/hvm/vmx/vmcs.c       |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c        |   54 +++++++++++++++++++++++++-
 xen/common/domain.c               |   10 +++++
 xen/include/asm-x86/hvm/hvm.h     |    1 +
 xen/include/asm-x86/hvm/support.h |    2 +
 xen/include/xen/sched.h           |    1 +
 7 files changed, 113 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 9c34f17..9469499 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1409,6 +1409,40 @@ int hvm_mov_from_cr(unsigned int cr, unsigned int gpr)
     return X86EMUL_UNHANDLEABLE;
 }
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( value & X86_CR0_CD )
+    {
+        /* Entering no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+
+        if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
+        {
+            domain_pause_nosync(v->domain);
+
+            /* Flush physical caches. */
+            on_each_cpu(local_flush_cache, NULL, 1);
+            hvm_set_uc_mode(v, 1);
+
+            domain_unpause(v->domain);
+        }
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+    else if ( !(value & X86_CR0_CD) &&
+              (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
+    {
+        /* Exit from no fill cache mode. */
+        spin_lock(&v->domain->arch.hvm_domain.uc_lock);
+        v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+
+        if ( domain_exit_uc_mode(v) )
+            hvm_set_uc_mode(v, 0);
+
+        spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
+    }
+}
+
 int hvm_set_cr0(unsigned long value)
 {
     struct vcpu *v = current;
@@ -1485,35 +1519,18 @@ int hvm_set_cr0(unsigned long value)
         }
     }
 
-    if ( has_arch_mmios(v->domain) )
-    {
-        if ( (value & X86_CR0_CD) && !(value & X86_CR0_NW) )
-        {
-            /* Entering no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
-
-            if ( !v->domain->arch.hvm_domain.is_in_uc_mode )
-            {
-                /* Flush physical caches. */
-                on_each_cpu(local_flush_cache, NULL, 1);
-                hvm_set_uc_mode(v, 1);
-            }
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-        else if ( !(value & (X86_CR0_CD | X86_CR0_NW)) &&
-                  (v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        {
-            /* Exit from no fill cache mode. */
-            spin_lock(&v->domain->arch.hvm_domain.uc_lock);
-            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
-
-            if ( domain_exit_uc_mode(v) )
-                hvm_set_uc_mode(v, 0);
-
-            spin_unlock(&v->domain->arch.hvm_domain.uc_lock);
-        }
-    }
+    /*
+     * When cr0.cd setting
+     * 1. For guest w/o VT-d, and for guest with VT-d but snooped, Xen need not
+     * do anything, since hardware snoop mechanism has ensured cache coherency;
+     * 2. For guest with VT-d but non-snooped, cache coherency cannot be
+     * guaranteed by h/w so need emulate UC memory type to guest.
+     */
+    if ( ((value ^ old_value) & X86_CR0_CD) &&
+           has_arch_pdevs(v->domain) &&
+           iommu_enabled && !iommu_snoop &&
+           hvm_funcs.handle_cd )
+        hvm_funcs.handle_cd(v, value);
 
     v->arch.hvm_vcpu.guest_cr[0] = value;
     hvm_update_guest_cr(v, 0);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 9eee3d1..b884132 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -742,7 +742,7 @@ static int construct_vmcs(struct vcpu *v)
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_CS);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_ESP);
         vmx_disable_intercept_for_msr(v, MSR_IA32_SYSENTER_EIP);
-        if ( paging_mode_hap(d) )
+        if ( paging_mode_hap(d) && (!iommu_enabled || iommu_snoop) )
             vmx_disable_intercept_for_msr(v, MSR_IA32_CR_PAT);
     }
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 3aaed5a..4c4e6b7 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -923,7 +923,8 @@ static void vmx_set_segment_register(struct vcpu *v, enum x86_segment seg,
 
 static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -937,7 +938,8 @@ static int vmx_set_guest_pat(struct vcpu *v, u64 gpat)
 
 static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
 {
-    if ( !paging_mode_hap(v->domain) )
+    if ( !paging_mode_hap(v->domain) ||
+         unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
         return 0;
 
     vmx_vmcs_enter(v);
@@ -949,6 +951,53 @@ static int vmx_get_guest_pat(struct vcpu *v, u64 *gpat)
     return 1;
 }
 
+static void vmx_handle_cd(struct vcpu *v, unsigned long value)
+{
+    if ( !paging_mode_hap(v->domain) )
+    {
+        /*
+         * For shadow, 'load IA32_PAT' VM-entry control is 0, so it cannot
+         * set guest memory type as UC via IA32_PAT. Xen drop all shadows
+         * so that any new ones would be created on demand.
+         */
+        hvm_shadow_handle_cd(v, value);
+    }
+    else
+    {
+        u64 *pat = &v->arch.hvm_vcpu.pat_cr;
+
+        if ( value & X86_CR0_CD )
+        {
+            /*
+             * For EPT, set guest IA32_PAT fields as UC so that guest
+             * memory type are all UC.
+             */
+            u64 uc_pat =
+                ((uint64_t)PAT_TYPE_UNCACHABLE)       |       /* PAT0 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 8)  |       /* PAT1 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 16) |       /* PAT2 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 24) |       /* PAT3 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 32) |       /* PAT4 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 40) |       /* PAT5 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 48) |       /* PAT6 */
+                ((uint64_t)PAT_TYPE_UNCACHABLE << 56);        /* PAT7 */
+
+            vmx_get_guest_pat(v, pat);
+            vmx_set_guest_pat(v, uc_pat);
+
+            wbinvd();               /* flush possibly polluted cache */
+            hvm_asid_flush_vcpu(v); /* invalidate memory type cached in TLB */
+            v->arch.hvm_vcpu.cache_mode = NO_FILL_CACHE_MODE;
+        }
+        else
+        {
+            v->arch.hvm_vcpu.cache_mode = NORMAL_CACHE_MODE;
+            vmx_set_guest_pat(v, *pat);
+            hvm_asid_flush_vcpu(v); /* no need to flush cache */
+        }
+    }
+}
+
 static void vmx_set_tsc_offset(struct vcpu *v, u64 offset)
 {
     vmx_vmcs_enter(v);
@@ -1424,6 +1473,7 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .msr_read_intercept   = vmx_msr_read_intercept,
     .msr_write_intercept  = vmx_msr_write_intercept,
     .invlpg_intercept     = vmx_invlpg_intercept,
+    .handle_cd            = vmx_handle_cd,
     .set_info_guest       = vmx_set_info_guest,
     .set_rdtsc_exiting    = vmx_set_rdtsc_exiting
 };
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 5fa045b..4637dd1 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -739,6 +739,16 @@ void domain_pause(struct domain *d)
         vcpu_sleep_sync(v);
 }
 
+void domain_pause_nosync(struct domain *d)
+{
+    struct vcpu *v;
+
+    atomic_inc(&d->pause_count);
+
+    for_each_vcpu( d, v )
+        vcpu_sleep_nosync(v);
+}
+
 void domain_unpause(struct domain *d)
 {
     struct vcpu *v;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index dfa71d4..50f53e4 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -147,6 +147,7 @@ struct hvm_function_table {
     int (*msr_read_intercept)(unsigned int msr, uint64_t *msr_content);
     int (*msr_write_intercept)(unsigned int msr, uint64_t msr_content);
     void (*invlpg_intercept)(unsigned long vaddr);
+    void (*handle_cd)(struct vcpu *v, unsigned long value);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
 };
diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h
index 1d39c03..41b181c 100644
--- a/xen/include/asm-x86/hvm/support.h
+++ b/xen/include/asm-x86/hvm/support.h
@@ -130,6 +130,8 @@ void hvm_rdtsc_intercept(struct cpu_user_regs *regs);
 
 int hvm_handle_xsetbv(u64 new_bv);
 
+void hvm_shadow_handle_cd(struct vcpu *v, unsigned long value);
+
 /* These functions all return X86EMUL return codes. */
 int hvm_set_efer(uint64_t value);
 int hvm_set_cr0(unsigned long value);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 16e50e1..c177a44 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -612,6 +612,7 @@ void vcpu_unblock(struct vcpu *v);
 void vcpu_pause(struct vcpu *v);
 void vcpu_pause_nosync(struct vcpu *v);
 void domain_pause(struct domain *d);
+void domain_pause_nosync(struct domain *d);
 void vcpu_unpause(struct vcpu *v);
 void domain_unpause(struct domain *d);
 void domain_pause_by_systemcontroller(struct domain *d);
--
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 Dec 13 08:22:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22: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 1VrO0d-0003IR-Uc; Fri, 13 Dec 2013 08:22: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 1VrO0c-0003IE-3z
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:06 +0000
Received: from [85.158.139.211:9735] by server-5.bemta-5.messagelabs.com id
	D3/E1-14928-DA3CAA25; Fri, 13 Dec 2013 08:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386922923!4231531!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29916 invoked from network); 13 Dec 2013 08:22:04 -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;
	13 Dec 2013 08:22: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 1VrO0Z-0001YL-BR
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO0Z-0005pV-54
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:03 +0000
Date: Fri, 13 Dec 2013 08:22:03 +0000
Message-Id: <E1VrO0Z-0005pV-54@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Fix regression after commit
	d963923
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a5767a869cc7c6a1072014fc03a7b7ba3f92bc0
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Dec 9 18:34:10 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Dec 10 09:27:36 2013 +0000

    xen/arm: Fix regression after commit d963923
    
    The commit d963923  "xen: arm: correct return value of
    raw_copy_{to/from}_guest_*, raw_clear_guest" doesn't permit to boot guest
    on Xen ARM.
    
    Remove the stray semicolon from the end of the if statement.
    
    Also we want to get the right rc in the error arrays, so we need to do the
    copy_to_guest_offset before checking the rc returned by
    xenmem_add_to_physmap_one.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- expanded commit log ]
---
 xen/arch/arm/mm.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 26ca588..654281a 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1084,16 +1084,17 @@ static int xenmem_add_to_physmap_range(struct domain *d,
         rc = xenmem_add_to_physmap_one(d, xatpr->space,
                                        xatpr->foreign_domid,
                                        idx, gpfn);
-        if ( rc < 0 )
-            goto out;
 
         if ( unlikely(copy_to_guest_offset(xatpr->errs,
-                                           xatpr->size-1, &rc, 1)) );
+                                           xatpr->size-1, &rc, 1)) )
         {
             rc = -EFAULT;
             goto out;
         }
 
+        if ( rc < 0 )
+            goto out;
+
         xatpr->size--;
 
         /* Check for continuation if it's not the last interation */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:22:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22: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 1VrO0d-0003IR-Uc; Fri, 13 Dec 2013 08:22: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 1VrO0c-0003IE-3z
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:06 +0000
Received: from [85.158.139.211:9735] by server-5.bemta-5.messagelabs.com id
	D3/E1-14928-DA3CAA25; Fri, 13 Dec 2013 08:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386922923!4231531!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29916 invoked from network); 13 Dec 2013 08:22:04 -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;
	13 Dec 2013 08:22: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 1VrO0Z-0001YL-BR
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO0Z-0005pV-54
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:03 +0000
Date: Fri, 13 Dec 2013 08:22:03 +0000
Message-Id: <E1VrO0Z-0005pV-54@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Fix regression after commit
	d963923
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a5767a869cc7c6a1072014fc03a7b7ba3f92bc0
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Dec 9 18:34:10 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Dec 10 09:27:36 2013 +0000

    xen/arm: Fix regression after commit d963923
    
    The commit d963923  "xen: arm: correct return value of
    raw_copy_{to/from}_guest_*, raw_clear_guest" doesn't permit to boot guest
    on Xen ARM.
    
    Remove the stray semicolon from the end of the if statement.
    
    Also we want to get the right rc in the error arrays, so we need to do the
    copy_to_guest_offset before checking the rc returned by
    xenmem_add_to_physmap_one.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- expanded commit log ]
---
 xen/arch/arm/mm.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 26ca588..654281a 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1084,16 +1084,17 @@ static int xenmem_add_to_physmap_range(struct domain *d,
         rc = xenmem_add_to_physmap_one(d, xatpr->space,
                                        xatpr->foreign_domid,
                                        idx, gpfn);
-        if ( rc < 0 )
-            goto out;
 
         if ( unlikely(copy_to_guest_offset(xatpr->errs,
-                                           xatpr->size-1, &rc, 1)) );
+                                           xatpr->size-1, &rc, 1)) )
         {
             rc = -EFAULT;
             goto out;
         }
 
+        if ( rc < 0 )
+            goto out;
+
         xatpr->size--;
 
         /* Check for continuation if it's not the last interation */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:22:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VrO0n-0003JB-2M; Fri, 13 Dec 2013 08:22:17 +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 1VrO0l-0003J2-Vg
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:16 +0000
Received: from [85.158.143.35:6481] by server-1.bemta-4.messagelabs.com id
	8A/46-02132-7B3CAA25; Fri, 13 Dec 2013 08:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386922933!5489598!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19818 invoked from network); 13 Dec 2013 08:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:22: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 1VrO0j-0001YR-Hm
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO0j-0005pt-FR
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:13 +0000
Date: Fri, 13 Dec 2013 08:22:13 +0000
Message-Id: <E1VrO0j-0005pt-FR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: fix memory corruption
	when converting string and key/values lists
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1dfb44be050bc7605b452ab7c745e797b74db79f
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Mon Dec 9 15:17:29 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Dec 10 13:34:53 2013 +0000

    libxl: ocaml: fix memory corruption when converting string and key/values lists
    
    Found by Coverty. CIDs: 1128562 1128563 1128564 1128565.
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xl/xenlight_stubs.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 80a5986..4ea2047 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -151,8 +151,8 @@ static value Val_key_value_list(libxl_key_value_list *c_val)
 
 	list = Val_emptylist;
 	for (i = libxl_string_list_length((libxl_string_list *) c_val) - 1; i >= 0; i -= 2) {
-		val = caml_copy_string((char *) c_val[i]);
-		key = caml_copy_string((char *) c_val[i - 1]);
+		val = caml_copy_string((*c_val)[i]);
+		key = caml_copy_string((*c_val)[i - 1]);
 		kv = caml_alloc_tuple(2);
 		Store_field(kv, 0, key);
 		Store_field(kv, 1, val);
@@ -193,7 +193,7 @@ static value Val_string_list(libxl_string_list *c_val)
 
 	list = Val_emptylist;
 	for (i = libxl_string_list_length(c_val) - 1; i >= 0; i--) {
-		string = caml_copy_string((char *) c_val[i]);
+		string = caml_copy_string((*c_val)[i]);
 		cons = caml_alloc(2, 0);
 		Store_field(cons, 0, string);   // head
 		Store_field(cons, 1, list);     // tail
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:22:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VrO0n-0003JB-2M; Fri, 13 Dec 2013 08:22:17 +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 1VrO0l-0003J2-Vg
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:16 +0000
Received: from [85.158.143.35:6481] by server-1.bemta-4.messagelabs.com id
	8A/46-02132-7B3CAA25; Fri, 13 Dec 2013 08:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386922933!5489598!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19818 invoked from network); 13 Dec 2013 08:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:22: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 1VrO0j-0001YR-Hm
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO0j-0005pt-FR
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:13 +0000
Date: Fri, 13 Dec 2013 08:22:13 +0000
Message-Id: <E1VrO0j-0005pt-FR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: fix memory corruption
	when converting string and key/values lists
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1dfb44be050bc7605b452ab7c745e797b74db79f
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Mon Dec 9 15:17:29 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Dec 10 13:34:53 2013 +0000

    libxl: ocaml: fix memory corruption when converting string and key/values lists
    
    Found by Coverty. CIDs: 1128562 1128563 1128564 1128565.
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xl/xenlight_stubs.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 80a5986..4ea2047 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -151,8 +151,8 @@ static value Val_key_value_list(libxl_key_value_list *c_val)
 
 	list = Val_emptylist;
 	for (i = libxl_string_list_length((libxl_string_list *) c_val) - 1; i >= 0; i -= 2) {
-		val = caml_copy_string((char *) c_val[i]);
-		key = caml_copy_string((char *) c_val[i - 1]);
+		val = caml_copy_string((*c_val)[i]);
+		key = caml_copy_string((*c_val)[i - 1]);
 		kv = caml_alloc_tuple(2);
 		Store_field(kv, 0, key);
 		Store_field(kv, 1, val);
@@ -193,7 +193,7 @@ static value Val_string_list(libxl_string_list *c_val)
 
 	list = Val_emptylist;
 	for (i = libxl_string_list_length(c_val) - 1; i >= 0; i--) {
-		string = caml_copy_string((char *) c_val[i]);
+		string = caml_copy_string((*c_val)[i]);
 		cons = caml_alloc(2, 0);
 		Store_field(cons, 0, string);   // head
 		Store_field(cons, 1, list);     // tail
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:22:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VrO0y-0003KM-5X; Fri, 13 Dec 2013 08:22: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 1VrO0x-0003KB-JT
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:27 +0000
Received: from [193.109.254.147:19895] by server-9.bemta-14.messagelabs.com id
	A8/79-13957-2C3CAA25; Fri, 13 Dec 2013 08:22:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1386922944!4925099!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29875 invoked from network); 13 Dec 2013 08:22:25 -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;
	13 Dec 2013 08:22: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 1VrO0t-0001YX-PI
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO0t-0005qF-Kn
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:23 +0000
Date: Fri, 13 Dec 2013 08:22:23 +0000
Message-Id: <E1VrO0t-0005qF-Kn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: remove dead code in
	xentoollog bindings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f290d0cb3142606faf13dc9bc76766631cc17e92
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Mon Dec 9 15:17:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Dec 10 13:34:53 2013 +0000

    libxl: ocaml: remove dead code in xentoollog bindings
    
    Found by Coverty. CIDs: 1128567 1128568 1128576 1128577.
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xentoollog/xentoollog_stubs.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
index 3b2f91b..122ed0d 100644
--- a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
+++ b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
@@ -87,8 +87,6 @@ static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
 	value *func = caml_named_value(xtl->vmessage_cb) ;
 	char *msg;
 
-	if (args == NULL)
-		caml_raise_out_of_memory();
 	if (func == NULL)
 		caml_raise_sys_error(caml_copy_string("Unable to find callback"));
 	if (vasprintf(&msg, format, al) < 0)
@@ -116,8 +114,6 @@ static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
 	struct caml_xtl *xtl = (struct caml_xtl*)logger;
 	value *func = caml_named_value(xtl->progress_cb) ;
 
-	if (args == NULL)
-		caml_raise_out_of_memory();
 	if (func == NULL)
 		caml_raise_sys_error(caml_copy_string("Unable to find callback"));
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:22:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VrO0y-0003KM-5X; Fri, 13 Dec 2013 08:22: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 1VrO0x-0003KB-JT
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:27 +0000
Received: from [193.109.254.147:19895] by server-9.bemta-14.messagelabs.com id
	A8/79-13957-2C3CAA25; Fri, 13 Dec 2013 08:22:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1386922944!4925099!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29875 invoked from network); 13 Dec 2013 08:22:25 -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;
	13 Dec 2013 08:22: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 1VrO0t-0001YX-PI
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO0t-0005qF-Kn
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:23 +0000
Date: Fri, 13 Dec 2013 08:22:23 +0000
Message-Id: <E1VrO0t-0005qF-Kn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: remove dead code in
	xentoollog bindings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f290d0cb3142606faf13dc9bc76766631cc17e92
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Mon Dec 9 15:17:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Dec 10 13:34:53 2013 +0000

    libxl: ocaml: remove dead code in xentoollog bindings
    
    Found by Coverty. CIDs: 1128567 1128568 1128576 1128577.
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xentoollog/xentoollog_stubs.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
index 3b2f91b..122ed0d 100644
--- a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
+++ b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
@@ -87,8 +87,6 @@ static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
 	value *func = caml_named_value(xtl->vmessage_cb) ;
 	char *msg;
 
-	if (args == NULL)
-		caml_raise_out_of_memory();
 	if (func == NULL)
 		caml_raise_sys_error(caml_copy_string("Unable to find callback"));
 	if (vasprintf(&msg, format, al) < 0)
@@ -116,8 +114,6 @@ static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
 	struct caml_xtl *xtl = (struct caml_xtl*)logger;
 	value *func = caml_named_value(xtl->progress_cb) ;
 
-	if (args == NULL)
-		caml_raise_out_of_memory();
 	if (func == NULL)
 		caml_raise_sys_error(caml_copy_string("Unable to find callback"));
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:22:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22: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 1VrO18-0003Ml-Lo; Fri, 13 Dec 2013 08:22:38 +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 1VrO17-0003MP-C0
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:37 +0000
Received: from [85.158.143.35:10152] by server-1.bemta-4.messagelabs.com id
	12/B6-02132-CC3CAA25; Fri, 13 Dec 2013 08:22:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386922954!5489688!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21528 invoked from network); 13 Dec 2013 08:22:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:22: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 1VrO14-0001Yf-4x
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO13-0005qh-SG
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:34 +0000
Date: Fri, 13 Dec 2013 08:22:33 +0000
Message-Id: <E1VrO13-0005qh-SG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: inject unhandled instruction
	and data aborts to the guest.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91082d7b877cbb40de73199ba3f769d98be94215
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 9 14:58:24 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:03:57 2013 +0000

    xen: arm: inject unhandled instruction and data aborts to the guest.
    
    Currently an unhandled data abort in guest context leads to us killing the
    guest and an unhandled instruction abort in guest context leads to us killing
    the host!
    
    Andre pointed out that an unhandled data abort can be caused by e.g. dmidecode
    looking for things which are not there in the guests physical address space.
    Propagating the fault to the guest allows it to properly SIGSEGV the
    processes.
    
    A guest kernel can trivially jump to an unmapped physical address which would
    cause an instruction abort. Killing the host for that is obviously bad.
    Instead inject the exception so the guest kernel can SIGSEGV or panic() etc as
    it deems appropriate.
    
    Tested on arm64 (Mustang) and arm32 (Midway) with a dom0 kernel late_initcall
    which either dereferences or jumps to address 0, provoking both behaviours and
    resulting correctly in a guest kernel panic. Also tested on fast models with a
    32-bit dom0 on a 64-bit hypervisor, which behaved correctly.
    
    In addition tested on both platforms with a userspace program which either
    calls to or dereferences address 0. The process is correctly killed with SEGV.
    
    Lastly tested on Mustang with a 32-bit version of the userspace test on a
    64-bit dom0 kernel.
    
    I think that covers all the cases.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Cc: Andre Przywara <andre.przywara@calxeda.com>
    [ ijc -- fixed up whitespace in if statements in cpsr_mode_switch ]
---
 xen/arch/arm/traps.c            |  203 +++++++++++++++++++++++++++++++++------
 xen/include/asm-arm/cpregs.h    |    1 +
 xen/include/asm-arm/processor.h |   15 ++-
 xen/include/asm-arm/regs.h      |    2 +
 4 files changed, 186 insertions(+), 35 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 458128e..e01045e 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -264,9 +264,11 @@ static void cpsr_switch_mode(struct cpu_user_regs *regs, int mode)
 
     regs->cpsr |= mode;
     regs->cpsr |= PSR_IRQ_MASK;
-    if (sctlr & SCTLR_TE)
+    if ( mode == PSR_MODE_ABT )
+        regs->cpsr |= PSR_ABT_MASK;
+    if ( sctlr & SCTLR_TE )
         regs->cpsr |= PSR_THUMB;
-    if (sctlr & SCTLR_EE)
+    if ( sctlr & SCTLR_EE )
         regs->cpsr |= PSR_BIG_ENDIAN;
 }
 
@@ -283,7 +285,7 @@ static vaddr_t exception_handler(vaddr_t 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.
+ * ARM ARM.
  */
 static void inject_undef32_exception(struct cpu_user_regs *regs)
 {
@@ -305,6 +307,81 @@ static void inject_undef32_exception(struct cpu_user_regs *regs)
     regs->pc32 = exception_handler(VECTOR32_UND);
 }
 
+/* Injects an Abort exception into the current vcpu, PC is the exact
+ * address of the faulting instruction (without pipeline
+ * adjustments). See TakePrefetchAbortException and
+ * TakeDataAbortException pseudocode in ARM ARM.
+ */
+static void inject_abt32_exception(struct cpu_user_regs *regs,
+                                   int prefetch,
+                                   register_t addr)
+{
+    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 ? 4 : 0;
+    register_t fsr;
+
+    BUG_ON( !is_pv32_domain(current->domain) );
+
+    cpsr_switch_mode(regs, PSR_MODE_ABT);
+
+    /* Update banked registers */
+    regs->spsr_abt = spsr;
+    regs->lr_abt = regs->pc32 + return_offset;
+
+    regs->pc32 = exception_handler(prefetch ? VECTOR32_PABT : VECTOR32_DABT);
+
+    /* Inject a debug fault, best we can do right now */
+    if ( READ_SYSREG(TCR_EL1) & TTBCR_EAE )
+        fsr = FSR_LPAE | FSRL_STATUS_DEBUG;
+    else
+        fsr = FSRS_FS_DEBUG;
+
+    if ( prefetch )
+    {
+        /* Set IFAR and IFSR */
+#ifdef CONFIG_ARM_32
+        WRITE_SYSREG(addr, IFAR);
+        WRITE_SYSREG(fsr, IFSR);
+#else
+        /* FAR_EL1[63:32] is AArch32 register IFAR */
+        register_t far = READ_SYSREG(FAR_EL1) & 0xffffffffUL;
+        far |= addr << 32;
+        WRITE_SYSREG(far, FAR_EL1);
+        WRITE_SYSREG(fsr, IFSR32_EL2);
+
+#endif
+    }
+    else
+    {
+#ifdef CONFIG_ARM_32
+        /* Set DFAR and DFSR */
+        WRITE_SYSREG(addr, DFAR);
+        WRITE_SYSREG(fsr, DFSR);
+#else
+        /* FAR_EL1[31:0] is AArch32 register DFAR */
+        register_t far = READ_SYSREG(FAR_EL1) & ~0xffffffffUL;
+        far |= addr;
+        WRITE_SYSREG(far, FAR_EL1);
+        /* ESR_EL1 is AArch32 register DFSR */
+        WRITE_SYSREG(fsr, ESR_EL1);
+#endif
+    }
+}
+
+static void inject_dabt32_exception(struct cpu_user_regs *regs,
+                                    register_t addr)
+{
+    inject_abt32_exception(regs, 0, addr);
+}
+
+static void inject_pabt32_exception(struct cpu_user_regs *regs,
+                                    register_t addr)
+{
+    inject_abt32_exception(regs, 1, addr);
+}
+
 #ifdef CONFIG_ARM_64
 /* Inject an undefined exception into a 64 bit guest */
 static void inject_undef64_exception(struct cpu_user_regs *regs, int instr_len)
@@ -326,8 +403,85 @@ static void inject_undef64_exception(struct cpu_user_regs *regs, int instr_len)
 
     WRITE_SYSREG32(esr.bits, ESR_EL1);
 }
+
+/* Inject an abort exception into a 64 bit guest */
+static void inject_abt64_exception(struct cpu_user_regs *regs,
+                                   int prefetch,
+                                   register_t addr,
+                                   int instr_len)
+{
+    union hsr esr = {
+        .iss = 0,
+        .len = instr_len,
+    };
+
+    /*
+     * Trap may have been taken from EL0, which might be in AArch32
+     * mode (PSR_MODE_BIT set), or in AArch64 mode (PSR_MODE_EL0t).
+     *
+     * Since we know the kernel must be 64-bit any trap from a 32-bit
+     * mode must have been from EL0.
+     */
+    if ( psr_mode_is_32bit(regs->cpsr) || psr_mode(regs->cpsr,PSR_MODE_EL0t) )
+        esr.ec = prefetch
+            ? HSR_EC_INSTR_ABORT_LOWER_EL : HSR_EC_DATA_ABORT_LOWER_EL;
+    else
+        esr.ec = prefetch
+            ? HSR_EC_INSTR_ABORT_CURR_EL : HSR_EC_DATA_ABORT_CURR_EL;
+
+    BUG_ON( is_pv32_domain(current->domain) );
+
+    regs->spsr_el1 = regs->cpsr;
+    regs->elr_el1 = regs->pc;
+
+    regs->cpsr = PSR_MODE_EL1h | PSR_ABT_MASK | PSR_FIQ_MASK | \
+        PSR_IRQ_MASK | PSR_DBG_MASK;
+    regs->pc = READ_SYSREG(VBAR_EL1) + VECTOR64_CURRENT_SPx_SYNC;
+
+    WRITE_SYSREG(addr, FAR_EL1);
+    WRITE_SYSREG32(esr.bits, ESR_EL1);
+}
+
+static void inject_dabt64_exception(struct cpu_user_regs *regs,
+                                   register_t addr,
+                                   int instr_len)
+{
+    inject_abt64_exception(regs, 0, addr, instr_len);
+}
+
+static void inject_iabt64_exception(struct cpu_user_regs *regs,
+                                   register_t addr,
+                                   int instr_len)
+{
+    inject_abt64_exception(regs, 1, addr, instr_len);
+}
+
 #endif
 
+static void inject_iabt_exception(struct cpu_user_regs *regs,
+                                  register_t addr,
+                                  int instr_len)
+{
+        if ( is_pv32_domain(current->domain) )
+            inject_pabt32_exception(regs, addr);
+#ifdef CONFIG_ARM_64
+        else
+            inject_iabt64_exception(regs, addr, instr_len);
+#endif
+}
+
+static void inject_dabt_exception(struct cpu_user_regs *regs,
+                                  register_t addr,
+                                  int instr_len)
+{
+        if ( is_pv32_domain(current->domain) )
+            inject_dabt32_exception(regs, addr);
+#ifdef CONFIG_ARM_64
+        else
+            inject_dabt64_exception(regs, addr, instr_len);
+#endif
+}
+
 struct reg_ctxt {
     /* Guest-side state */
     uint32_t sctlr_el1;
@@ -1312,12 +1466,19 @@ done:
     if (first) unmap_domain_page(first);
 }
 
+
+static void do_trap_instr_abort_guest(struct cpu_user_regs *regs,
+                                      union hsr hsr)
+{
+    register_t addr = READ_SYSREG(FAR_EL2);
+    inject_iabt_exception(regs, addr, hsr.len);
+}
+
 static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
                                      union hsr hsr)
 {
     struct hsr_dabt dabt = hsr.dabt;
-    const char *msg;
-    int rc, level = -1;
+    int rc;
     mmio_info_t info;
 
     if ( !check_conditional_instr(regs, hsr) )
@@ -1353,7 +1514,7 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
         rc = decode_instruction(regs, &info.dabt);
         if ( rc )
         {
-            gdprintk(XENLOG_ERR, "Unable to decode instruction\n");
+            gdprintk(XENLOG_DEBUG, "Unable to decode instruction\n");
             goto bad_data_abort;
         }
     }
@@ -1365,30 +1526,7 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
     }
 
 bad_data_abort:
-
-    msg = decode_fsc( dabt.dfsc, &level);
-
-    /* XXX inject a suitable fault into the guest */
-    printk("Guest data abort: %s%s%s\n"
-           "    gva=%"PRIvaddr"\n",
-           msg, dabt.s1ptw ? " S2 during S1" : "",
-           fsc_level_str(level),
-           info.gva);
-    if ( !dabt.s1ptw )
-        printk("    gpa=%"PRIpaddr"\n", info.gpa);
-    if ( dabt.valid )
-        printk("    size=%d sign=%d write=%d reg=%d\n",
-               dabt.size, dabt.sign, dabt.write, dabt.reg);
-    else
-        printk("    instruction syndrome invalid\n");
-    printk("    eat=%d cm=%d s1ptw=%d dfsc=%d\n",
-           dabt.eat, dabt.cache, dabt.s1ptw, dabt.dfsc);
-    if ( !dabt.s1ptw )
-        dump_p2m_lookup(current->domain, info.gpa);
-    else
-        dump_guest_s1_walk(current->domain, info.gva);
-    show_execution_state(regs);
-    domain_crash_synchronous();
+    inject_dabt_exception(regs, info.gva, hsr.len);
 }
 
 asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
@@ -1456,7 +1594,10 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
         break;
 #endif
 
-    case HSR_EC_DATA_ABORT_GUEST:
+    case HSR_EC_INSTR_ABORT_LOWER_EL:
+        do_trap_instr_abort_guest(regs, hsr);
+        break;
+    case HSR_EC_DATA_ABORT_LOWER_EL:
         do_trap_data_abort_guest(regs, hsr);
         break;
     default:
diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index 29cd9d7..d5f138a 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -259,6 +259,7 @@
 #define CSSELR_EL1              CSSELR
 #define DACR32_EL2              DACR
 #define ESR_EL2                 HSR
+#define FAR_EL2                 HIFAR
 #define HCR_EL2                 HCR
 #define HPFAR_EL2               HPFAR
 #define ID_AFR0_EL1             ID_AFR0
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index b2746cc..dfe807d 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -103,10 +103,17 @@
 #define HSR_EC_SMC64                0x17
 #define HSR_EC_SYSREG               0x18
 #endif
-#define HSR_EC_INSTR_ABORT_GUEST    0x20
-#define HSR_EC_INSTR_ABORT_HYP      0x21
-#define HSR_EC_DATA_ABORT_GUEST     0x24
-#define HSR_EC_DATA_ABORT_HYP       0x25
+#define HSR_EC_INSTR_ABORT_LOWER_EL 0x20
+#define HSR_EC_INSTR_ABORT_CURR_EL  0x21
+#define HSR_EC_DATA_ABORT_LOWER_EL  0x24
+#define HSR_EC_DATA_ABORT_CURR_EL   0x25
+
+/* FSR format, common */
+#define FSR_LPAE                (_AC(1,UL)<<9)
+/* FSR short format */
+#define FSRS_FS_DEBUG           (_AC(0,UL)<<10|_AC(0x2,UL)<<0)
+/* FSR long format */
+#define FSRL_STATUS_DEBUG       (_AC(0x22,UL)<<0)
 
 #ifndef __ASSEMBLY__
 
diff --git a/xen/include/asm-arm/regs.h b/xen/include/asm-arm/regs.h
index 0130b94..0951857 100644
--- a/xen/include/asm-arm/regs.h
+++ b/xen/include/asm-arm/regs.h
@@ -11,6 +11,8 @@
 
 #define psr_mode(psr,m) (((psr) & PSR_MODE_MASK) == m)
 
+#define psr_mode_is_32bit(psr) !!((psr) & PSR_MODE_BIT)
+
 #define usr_mode(r)     psr_mode((r)->cpsr,PSR_MODE_USR)
 #define fiq_mode(r)     psr_mode((r)->cpsr,PSR_MODE_FIQ)
 #define irq_mode(r)     psr_mode((r)->cpsr,PSR_MODE_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 Fri Dec 13 08:22:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22: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 1VrO18-0003Ml-Lo; Fri, 13 Dec 2013 08:22:38 +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 1VrO17-0003MP-C0
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:37 +0000
Received: from [85.158.143.35:10152] by server-1.bemta-4.messagelabs.com id
	12/B6-02132-CC3CAA25; Fri, 13 Dec 2013 08:22:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386922954!5489688!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21528 invoked from network); 13 Dec 2013 08:22:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:22: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 1VrO14-0001Yf-4x
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO13-0005qh-SG
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:34 +0000
Date: Fri, 13 Dec 2013 08:22:33 +0000
Message-Id: <E1VrO13-0005qh-SG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: inject unhandled instruction
	and data aborts to the guest.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91082d7b877cbb40de73199ba3f769d98be94215
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Dec 9 14:58:24 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:03:57 2013 +0000

    xen: arm: inject unhandled instruction and data aborts to the guest.
    
    Currently an unhandled data abort in guest context leads to us killing the
    guest and an unhandled instruction abort in guest context leads to us killing
    the host!
    
    Andre pointed out that an unhandled data abort can be caused by e.g. dmidecode
    looking for things which are not there in the guests physical address space.
    Propagating the fault to the guest allows it to properly SIGSEGV the
    processes.
    
    A guest kernel can trivially jump to an unmapped physical address which would
    cause an instruction abort. Killing the host for that is obviously bad.
    Instead inject the exception so the guest kernel can SIGSEGV or panic() etc as
    it deems appropriate.
    
    Tested on arm64 (Mustang) and arm32 (Midway) with a dom0 kernel late_initcall
    which either dereferences or jumps to address 0, provoking both behaviours and
    resulting correctly in a guest kernel panic. Also tested on fast models with a
    32-bit dom0 on a 64-bit hypervisor, which behaved correctly.
    
    In addition tested on both platforms with a userspace program which either
    calls to or dereferences address 0. The process is correctly killed with SEGV.
    
    Lastly tested on Mustang with a 32-bit version of the userspace test on a
    64-bit dom0 kernel.
    
    I think that covers all the cases.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Cc: Andre Przywara <andre.przywara@calxeda.com>
    [ ijc -- fixed up whitespace in if statements in cpsr_mode_switch ]
---
 xen/arch/arm/traps.c            |  203 +++++++++++++++++++++++++++++++++------
 xen/include/asm-arm/cpregs.h    |    1 +
 xen/include/asm-arm/processor.h |   15 ++-
 xen/include/asm-arm/regs.h      |    2 +
 4 files changed, 186 insertions(+), 35 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 458128e..e01045e 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -264,9 +264,11 @@ static void cpsr_switch_mode(struct cpu_user_regs *regs, int mode)
 
     regs->cpsr |= mode;
     regs->cpsr |= PSR_IRQ_MASK;
-    if (sctlr & SCTLR_TE)
+    if ( mode == PSR_MODE_ABT )
+        regs->cpsr |= PSR_ABT_MASK;
+    if ( sctlr & SCTLR_TE )
         regs->cpsr |= PSR_THUMB;
-    if (sctlr & SCTLR_EE)
+    if ( sctlr & SCTLR_EE )
         regs->cpsr |= PSR_BIG_ENDIAN;
 }
 
@@ -283,7 +285,7 @@ static vaddr_t exception_handler(vaddr_t 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.
+ * ARM ARM.
  */
 static void inject_undef32_exception(struct cpu_user_regs *regs)
 {
@@ -305,6 +307,81 @@ static void inject_undef32_exception(struct cpu_user_regs *regs)
     regs->pc32 = exception_handler(VECTOR32_UND);
 }
 
+/* Injects an Abort exception into the current vcpu, PC is the exact
+ * address of the faulting instruction (without pipeline
+ * adjustments). See TakePrefetchAbortException and
+ * TakeDataAbortException pseudocode in ARM ARM.
+ */
+static void inject_abt32_exception(struct cpu_user_regs *regs,
+                                   int prefetch,
+                                   register_t addr)
+{
+    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 ? 4 : 0;
+    register_t fsr;
+
+    BUG_ON( !is_pv32_domain(current->domain) );
+
+    cpsr_switch_mode(regs, PSR_MODE_ABT);
+
+    /* Update banked registers */
+    regs->spsr_abt = spsr;
+    regs->lr_abt = regs->pc32 + return_offset;
+
+    regs->pc32 = exception_handler(prefetch ? VECTOR32_PABT : VECTOR32_DABT);
+
+    /* Inject a debug fault, best we can do right now */
+    if ( READ_SYSREG(TCR_EL1) & TTBCR_EAE )
+        fsr = FSR_LPAE | FSRL_STATUS_DEBUG;
+    else
+        fsr = FSRS_FS_DEBUG;
+
+    if ( prefetch )
+    {
+        /* Set IFAR and IFSR */
+#ifdef CONFIG_ARM_32
+        WRITE_SYSREG(addr, IFAR);
+        WRITE_SYSREG(fsr, IFSR);
+#else
+        /* FAR_EL1[63:32] is AArch32 register IFAR */
+        register_t far = READ_SYSREG(FAR_EL1) & 0xffffffffUL;
+        far |= addr << 32;
+        WRITE_SYSREG(far, FAR_EL1);
+        WRITE_SYSREG(fsr, IFSR32_EL2);
+
+#endif
+    }
+    else
+    {
+#ifdef CONFIG_ARM_32
+        /* Set DFAR and DFSR */
+        WRITE_SYSREG(addr, DFAR);
+        WRITE_SYSREG(fsr, DFSR);
+#else
+        /* FAR_EL1[31:0] is AArch32 register DFAR */
+        register_t far = READ_SYSREG(FAR_EL1) & ~0xffffffffUL;
+        far |= addr;
+        WRITE_SYSREG(far, FAR_EL1);
+        /* ESR_EL1 is AArch32 register DFSR */
+        WRITE_SYSREG(fsr, ESR_EL1);
+#endif
+    }
+}
+
+static void inject_dabt32_exception(struct cpu_user_regs *regs,
+                                    register_t addr)
+{
+    inject_abt32_exception(regs, 0, addr);
+}
+
+static void inject_pabt32_exception(struct cpu_user_regs *regs,
+                                    register_t addr)
+{
+    inject_abt32_exception(regs, 1, addr);
+}
+
 #ifdef CONFIG_ARM_64
 /* Inject an undefined exception into a 64 bit guest */
 static void inject_undef64_exception(struct cpu_user_regs *regs, int instr_len)
@@ -326,8 +403,85 @@ static void inject_undef64_exception(struct cpu_user_regs *regs, int instr_len)
 
     WRITE_SYSREG32(esr.bits, ESR_EL1);
 }
+
+/* Inject an abort exception into a 64 bit guest */
+static void inject_abt64_exception(struct cpu_user_regs *regs,
+                                   int prefetch,
+                                   register_t addr,
+                                   int instr_len)
+{
+    union hsr esr = {
+        .iss = 0,
+        .len = instr_len,
+    };
+
+    /*
+     * Trap may have been taken from EL0, which might be in AArch32
+     * mode (PSR_MODE_BIT set), or in AArch64 mode (PSR_MODE_EL0t).
+     *
+     * Since we know the kernel must be 64-bit any trap from a 32-bit
+     * mode must have been from EL0.
+     */
+    if ( psr_mode_is_32bit(regs->cpsr) || psr_mode(regs->cpsr,PSR_MODE_EL0t) )
+        esr.ec = prefetch
+            ? HSR_EC_INSTR_ABORT_LOWER_EL : HSR_EC_DATA_ABORT_LOWER_EL;
+    else
+        esr.ec = prefetch
+            ? HSR_EC_INSTR_ABORT_CURR_EL : HSR_EC_DATA_ABORT_CURR_EL;
+
+    BUG_ON( is_pv32_domain(current->domain) );
+
+    regs->spsr_el1 = regs->cpsr;
+    regs->elr_el1 = regs->pc;
+
+    regs->cpsr = PSR_MODE_EL1h | PSR_ABT_MASK | PSR_FIQ_MASK | \
+        PSR_IRQ_MASK | PSR_DBG_MASK;
+    regs->pc = READ_SYSREG(VBAR_EL1) + VECTOR64_CURRENT_SPx_SYNC;
+
+    WRITE_SYSREG(addr, FAR_EL1);
+    WRITE_SYSREG32(esr.bits, ESR_EL1);
+}
+
+static void inject_dabt64_exception(struct cpu_user_regs *regs,
+                                   register_t addr,
+                                   int instr_len)
+{
+    inject_abt64_exception(regs, 0, addr, instr_len);
+}
+
+static void inject_iabt64_exception(struct cpu_user_regs *regs,
+                                   register_t addr,
+                                   int instr_len)
+{
+    inject_abt64_exception(regs, 1, addr, instr_len);
+}
+
 #endif
 
+static void inject_iabt_exception(struct cpu_user_regs *regs,
+                                  register_t addr,
+                                  int instr_len)
+{
+        if ( is_pv32_domain(current->domain) )
+            inject_pabt32_exception(regs, addr);
+#ifdef CONFIG_ARM_64
+        else
+            inject_iabt64_exception(regs, addr, instr_len);
+#endif
+}
+
+static void inject_dabt_exception(struct cpu_user_regs *regs,
+                                  register_t addr,
+                                  int instr_len)
+{
+        if ( is_pv32_domain(current->domain) )
+            inject_dabt32_exception(regs, addr);
+#ifdef CONFIG_ARM_64
+        else
+            inject_dabt64_exception(regs, addr, instr_len);
+#endif
+}
+
 struct reg_ctxt {
     /* Guest-side state */
     uint32_t sctlr_el1;
@@ -1312,12 +1466,19 @@ done:
     if (first) unmap_domain_page(first);
 }
 
+
+static void do_trap_instr_abort_guest(struct cpu_user_regs *regs,
+                                      union hsr hsr)
+{
+    register_t addr = READ_SYSREG(FAR_EL2);
+    inject_iabt_exception(regs, addr, hsr.len);
+}
+
 static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
                                      union hsr hsr)
 {
     struct hsr_dabt dabt = hsr.dabt;
-    const char *msg;
-    int rc, level = -1;
+    int rc;
     mmio_info_t info;
 
     if ( !check_conditional_instr(regs, hsr) )
@@ -1353,7 +1514,7 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
         rc = decode_instruction(regs, &info.dabt);
         if ( rc )
         {
-            gdprintk(XENLOG_ERR, "Unable to decode instruction\n");
+            gdprintk(XENLOG_DEBUG, "Unable to decode instruction\n");
             goto bad_data_abort;
         }
     }
@@ -1365,30 +1526,7 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
     }
 
 bad_data_abort:
-
-    msg = decode_fsc( dabt.dfsc, &level);
-
-    /* XXX inject a suitable fault into the guest */
-    printk("Guest data abort: %s%s%s\n"
-           "    gva=%"PRIvaddr"\n",
-           msg, dabt.s1ptw ? " S2 during S1" : "",
-           fsc_level_str(level),
-           info.gva);
-    if ( !dabt.s1ptw )
-        printk("    gpa=%"PRIpaddr"\n", info.gpa);
-    if ( dabt.valid )
-        printk("    size=%d sign=%d write=%d reg=%d\n",
-               dabt.size, dabt.sign, dabt.write, dabt.reg);
-    else
-        printk("    instruction syndrome invalid\n");
-    printk("    eat=%d cm=%d s1ptw=%d dfsc=%d\n",
-           dabt.eat, dabt.cache, dabt.s1ptw, dabt.dfsc);
-    if ( !dabt.s1ptw )
-        dump_p2m_lookup(current->domain, info.gpa);
-    else
-        dump_guest_s1_walk(current->domain, info.gva);
-    show_execution_state(regs);
-    domain_crash_synchronous();
+    inject_dabt_exception(regs, info.gva, hsr.len);
 }
 
 asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
@@ -1456,7 +1594,10 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
         break;
 #endif
 
-    case HSR_EC_DATA_ABORT_GUEST:
+    case HSR_EC_INSTR_ABORT_LOWER_EL:
+        do_trap_instr_abort_guest(regs, hsr);
+        break;
+    case HSR_EC_DATA_ABORT_LOWER_EL:
         do_trap_data_abort_guest(regs, hsr);
         break;
     default:
diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index 29cd9d7..d5f138a 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -259,6 +259,7 @@
 #define CSSELR_EL1              CSSELR
 #define DACR32_EL2              DACR
 #define ESR_EL2                 HSR
+#define FAR_EL2                 HIFAR
 #define HCR_EL2                 HCR
 #define HPFAR_EL2               HPFAR
 #define ID_AFR0_EL1             ID_AFR0
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index b2746cc..dfe807d 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -103,10 +103,17 @@
 #define HSR_EC_SMC64                0x17
 #define HSR_EC_SYSREG               0x18
 #endif
-#define HSR_EC_INSTR_ABORT_GUEST    0x20
-#define HSR_EC_INSTR_ABORT_HYP      0x21
-#define HSR_EC_DATA_ABORT_GUEST     0x24
-#define HSR_EC_DATA_ABORT_HYP       0x25
+#define HSR_EC_INSTR_ABORT_LOWER_EL 0x20
+#define HSR_EC_INSTR_ABORT_CURR_EL  0x21
+#define HSR_EC_DATA_ABORT_LOWER_EL  0x24
+#define HSR_EC_DATA_ABORT_CURR_EL   0x25
+
+/* FSR format, common */
+#define FSR_LPAE                (_AC(1,UL)<<9)
+/* FSR short format */
+#define FSRS_FS_DEBUG           (_AC(0,UL)<<10|_AC(0x2,UL)<<0)
+/* FSR long format */
+#define FSRL_STATUS_DEBUG       (_AC(0x22,UL)<<0)
 
 #ifndef __ASSEMBLY__
 
diff --git a/xen/include/asm-arm/regs.h b/xen/include/asm-arm/regs.h
index 0130b94..0951857 100644
--- a/xen/include/asm-arm/regs.h
+++ b/xen/include/asm-arm/regs.h
@@ -11,6 +11,8 @@
 
 #define psr_mode(psr,m) (((psr) & PSR_MODE_MASK) == m)
 
+#define psr_mode_is_32bit(psr) !!((psr) & PSR_MODE_BIT)
+
 #define usr_mode(r)     psr_mode((r)->cpsr,PSR_MODE_USR)
 #define fiq_mode(r)     psr_mode((r)->cpsr,PSR_MODE_FIQ)
 #define irq_mode(r)     psr_mode((r)->cpsr,PSR_MODE_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 Fri Dec 13 08:22:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22: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 1VrO1I-0003Oq-OZ; Fri, 13 Dec 2013 08:22:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1H-0003OS-9Y
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:47 +0000
Received: from [85.158.137.68:7099] by server-10.bemta-3.messagelabs.com id
	D9/7F-23989-6D3CAA25; Fri, 13 Dec 2013 08:22:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1386922964!3651658!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9090 invoked from network); 13 Dec 2013 08:22:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:22: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 1VrO1E-0001Yl-9q
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1E-0005rh-7n
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:44 +0000
Date: Fri, 13 Dec 2013 08:22:44 +0000
Message-Id: <E1VrO1E-0005rh-7n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: add simple test case for
	xentoollog
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 49269dd31e2d84d68dca63b60349c125c36bc8e0
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:25 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:24 2013 +0000

    libxl: ocaml: add simple test case for xentoollog
    
    Add a simple noddy test case (tools/ocaml/test) for the the Xentoollog OCaml
    module.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
---
 .gitignore                |    1 +
 .hgignore                 |    1 +
 tools/ocaml/Makefile      |    2 +-
 tools/ocaml/test/Makefile |   28 ++++++++++++++++++++++++++++
 tools/ocaml/test/xtl.ml   |   40 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 71 insertions(+), 1 deletions(-)

diff --git a/.gitignore b/.gitignore
index 93aae71..20f20ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -385,6 +385,7 @@ tools/ocaml/libs/xentoollog/_xtl_levels.*
 tools/ocaml/libs/xentoollog/xentoollog.ml
 tools/ocaml/libs/xentoollog/xentoollog.mli
 tools/ocaml/xenstored/oxenstored
+tools/ocaml/test/xtl
 
 tools/debugger/kdd/kdd
 tools/firmware/etherboot/ipxe.tar.gz
diff --git a/.hgignore b/.hgignore
index 05cb0de..bb1b67d 100644
--- a/.hgignore
+++ b/.hgignore
@@ -308,6 +308,7 @@
 ^tools/ocaml/libs/xl/xenlight\.ml$
 ^tools/ocaml/libs/xl/xenlight\.mli$
 ^tools/ocaml/xenstored/oxenstored$
+^tools/ocaml/test/xtl$
 ^tools/autom4te\.cache$
 ^tools/config\.h$
 ^tools/config\.log$
diff --git a/tools/ocaml/Makefile b/tools/ocaml/Makefile
index 6b22bbe..8e4ca36 100644
--- a/tools/ocaml/Makefile
+++ b/tools/ocaml/Makefile
@@ -1,7 +1,7 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SUBDIRS_PROGRAMS = xenstored
+SUBDIRS_PROGRAMS = xenstored test
 
 SUBDIRS = libs $(SUBDIRS_PROGRAMS)
 
diff --git a/tools/ocaml/test/Makefile b/tools/ocaml/test/Makefile
new file mode 100644
index 0000000..3a35d04
--- /dev/null
+++ b/tools/ocaml/test/Makefile
@@ -0,0 +1,28 @@
+XEN_ROOT = $(CURDIR)/../../..
+OCAML_TOPLEVEL = $(CURDIR)/..
+include $(OCAML_TOPLEVEL)/common.make
+
+OCAMLINCLUDE += \
+	-I $(OCAML_TOPLEVEL)/libs/xentoollog
+
+OBJS = xtl
+
+PROGRAMS = xtl
+
+xtl_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-cclib $(LDLIBS_libxenctrl)
+
+xtl_OBJS = xtl
+
+OCAML_PROGRAM = xtl
+
+all: $(PROGRAMS)
+
+bins: $(PROGRAMS)
+
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
+	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(BINDIR)
+
+include $(OCAML_TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/test/xtl.ml b/tools/ocaml/test/xtl.ml
new file mode 100644
index 0000000..6f4d85b
--- /dev/null
+++ b/tools/ocaml/test/xtl.ml
@@ -0,0 +1,40 @@
+open Arg
+open Printf
+open Xentoollog
+
+let stdio_vmessage min_level level errno ctx msg =
+	let level_str = level_to_string level
+	and errno_str = match errno with None -> "" | Some s -> sprintf ": errno=%d" s
+	and ctx_str = match ctx with None -> "" | Some s -> sprintf ": %s" s in
+	if compare min_level level <= 0 then begin
+		printf "%s%s%s: %s\n" level_str ctx_str errno_str msg;
+		flush stdout;
+	end
+
+let stdio_progress ctx what percent dne total =
+	let nl = if dne = total then "\n" else "" in
+	printf "\rProgress %s %d%% (%Ld/%Ld)%s" what percent dne total nl;
+	flush stdout
+
+let create_stdio_logger ?(level=Info) () =
+	let cbs = {
+		vmessage = stdio_vmessage level;
+		progress = stdio_progress; } in
+	create "Xentoollog.stdio_logger" cbs
+
+let do_test level =
+  let lgr = create_stdio_logger ~level:level () in
+  begin
+    test lgr;
+  end
+
+let () =
+  let debug_level = ref Info in
+  let speclist = [
+    ("-v", Arg.Unit (fun () -> debug_level := Debug), "Verbose");
+    ("-q", Arg.Unit (fun () -> debug_level := Critical), "Quiet");
+  ] in
+  let usage_msg = "usage: xtl [OPTIONS]" in
+  Arg.parse speclist (fun s -> ()) usage_msg;
+
+  do_test !debug_level
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:22:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22: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 1VrO1I-0003Oq-OZ; Fri, 13 Dec 2013 08:22:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1H-0003OS-9Y
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:47 +0000
Received: from [85.158.137.68:7099] by server-10.bemta-3.messagelabs.com id
	D9/7F-23989-6D3CAA25; Fri, 13 Dec 2013 08:22:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1386922964!3651658!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9090 invoked from network); 13 Dec 2013 08:22:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:22: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 1VrO1E-0001Yl-9q
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1E-0005rh-7n
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:44 +0000
Date: Fri, 13 Dec 2013 08:22:44 +0000
Message-Id: <E1VrO1E-0005rh-7n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: add simple test case for
	xentoollog
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 49269dd31e2d84d68dca63b60349c125c36bc8e0
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:25 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:24 2013 +0000

    libxl: ocaml: add simple test case for xentoollog
    
    Add a simple noddy test case (tools/ocaml/test) for the the Xentoollog OCaml
    module.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
---
 .gitignore                |    1 +
 .hgignore                 |    1 +
 tools/ocaml/Makefile      |    2 +-
 tools/ocaml/test/Makefile |   28 ++++++++++++++++++++++++++++
 tools/ocaml/test/xtl.ml   |   40 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 71 insertions(+), 1 deletions(-)

diff --git a/.gitignore b/.gitignore
index 93aae71..20f20ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -385,6 +385,7 @@ tools/ocaml/libs/xentoollog/_xtl_levels.*
 tools/ocaml/libs/xentoollog/xentoollog.ml
 tools/ocaml/libs/xentoollog/xentoollog.mli
 tools/ocaml/xenstored/oxenstored
+tools/ocaml/test/xtl
 
 tools/debugger/kdd/kdd
 tools/firmware/etherboot/ipxe.tar.gz
diff --git a/.hgignore b/.hgignore
index 05cb0de..bb1b67d 100644
--- a/.hgignore
+++ b/.hgignore
@@ -308,6 +308,7 @@
 ^tools/ocaml/libs/xl/xenlight\.ml$
 ^tools/ocaml/libs/xl/xenlight\.mli$
 ^tools/ocaml/xenstored/oxenstored$
+^tools/ocaml/test/xtl$
 ^tools/autom4te\.cache$
 ^tools/config\.h$
 ^tools/config\.log$
diff --git a/tools/ocaml/Makefile b/tools/ocaml/Makefile
index 6b22bbe..8e4ca36 100644
--- a/tools/ocaml/Makefile
+++ b/tools/ocaml/Makefile
@@ -1,7 +1,7 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SUBDIRS_PROGRAMS = xenstored
+SUBDIRS_PROGRAMS = xenstored test
 
 SUBDIRS = libs $(SUBDIRS_PROGRAMS)
 
diff --git a/tools/ocaml/test/Makefile b/tools/ocaml/test/Makefile
new file mode 100644
index 0000000..3a35d04
--- /dev/null
+++ b/tools/ocaml/test/Makefile
@@ -0,0 +1,28 @@
+XEN_ROOT = $(CURDIR)/../../..
+OCAML_TOPLEVEL = $(CURDIR)/..
+include $(OCAML_TOPLEVEL)/common.make
+
+OCAMLINCLUDE += \
+	-I $(OCAML_TOPLEVEL)/libs/xentoollog
+
+OBJS = xtl
+
+PROGRAMS = xtl
+
+xtl_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-cclib $(LDLIBS_libxenctrl)
+
+xtl_OBJS = xtl
+
+OCAML_PROGRAM = xtl
+
+all: $(PROGRAMS)
+
+bins: $(PROGRAMS)
+
+install: all
+	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
+	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(BINDIR)
+
+include $(OCAML_TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/test/xtl.ml b/tools/ocaml/test/xtl.ml
new file mode 100644
index 0000000..6f4d85b
--- /dev/null
+++ b/tools/ocaml/test/xtl.ml
@@ -0,0 +1,40 @@
+open Arg
+open Printf
+open Xentoollog
+
+let stdio_vmessage min_level level errno ctx msg =
+	let level_str = level_to_string level
+	and errno_str = match errno with None -> "" | Some s -> sprintf ": errno=%d" s
+	and ctx_str = match ctx with None -> "" | Some s -> sprintf ": %s" s in
+	if compare min_level level <= 0 then begin
+		printf "%s%s%s: %s\n" level_str ctx_str errno_str msg;
+		flush stdout;
+	end
+
+let stdio_progress ctx what percent dne total =
+	let nl = if dne = total then "\n" else "" in
+	printf "\rProgress %s %d%% (%Ld/%Ld)%s" what percent dne total nl;
+	flush stdout
+
+let create_stdio_logger ?(level=Info) () =
+	let cbs = {
+		vmessage = stdio_vmessage level;
+		progress = stdio_progress; } in
+	create "Xentoollog.stdio_logger" cbs
+
+let do_test level =
+  let lgr = create_stdio_logger ~level:level () in
+  begin
+    test lgr;
+  end
+
+let () =
+  let debug_level = ref Info in
+  let speclist = [
+    ("-v", Arg.Unit (fun () -> debug_level := Debug), "Verbose");
+    ("-q", Arg.Unit (fun () -> debug_level := Critical), "Quiet");
+  ] in
+  let usage_msg = "usage: xtl [OPTIONS]" in
+  Arg.parse speclist (fun s -> ()) usage_msg;
+
+  do_test !debug_level
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:22:58 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22: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 1VrO1S-0003Re-TV; Fri, 13 Dec 2013 08:22: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 1VrO1R-0003R6-6V
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:57 +0000
Received: from [85.158.143.35:11720] by server-1.bemta-4.messagelabs.com id
	EC/07-02132-0E3CAA25; Fri, 13 Dec 2013 08:22:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1386922974!5423003!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2557 invoked from network); 13 Dec 2013 08:22:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:22: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 1VrO1O-0001Yu-Ef
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1O-0005s4-Cn
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:54 +0000
Date: Fri, 13 Dec 2013 08:22:54 +0000
Message-Id: <E1VrO1O-0005s4-Cn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: implement some simple
	tests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 00d46451e3751404a4f4fe243315bf0c7e4f3280
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:26 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:25 2013 +0000

    libxl: ocaml: implement some simple tests
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
---
 .gitignore                          |    3 ++-
 .hgignore                           |    2 ++
 tools/ocaml/test/Makefile           |   30 ++++++++++++++++++++++++++----
 tools/ocaml/test/list_domains.ml    |   28 ++++++++++++++++++++++++++++
 tools/ocaml/test/raise_exception.ml |   11 +++++++++++
 tools/ocaml/test/send_debug_keys.ml |   15 +++++++++++++++
 6 files changed, 84 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index 20f20ed..ce5fd39 100644
--- a/.gitignore
+++ b/.gitignore
@@ -386,7 +386,8 @@ tools/ocaml/libs/xentoollog/xentoollog.ml
 tools/ocaml/libs/xentoollog/xentoollog.mli
 tools/ocaml/xenstored/oxenstored
 tools/ocaml/test/xtl
-
+tools/ocaml/test/send_debug_keys
+tools/ocaml/test/list_domains
 tools/debugger/kdd/kdd
 tools/firmware/etherboot/ipxe.tar.gz
 tools/firmware/etherboot/ipxe/
diff --git a/.hgignore b/.hgignore
index bb1b67d..ee5c084 100644
--- a/.hgignore
+++ b/.hgignore
@@ -309,6 +309,8 @@
 ^tools/ocaml/libs/xl/xenlight\.mli$
 ^tools/ocaml/xenstored/oxenstored$
 ^tools/ocaml/test/xtl$
+^tools/ocaml/test/send_debug_keys$
+^tools/ocaml/test/list_domains$
 ^tools/autom4te\.cache$
 ^tools/config\.h$
 ^tools/config\.log$
diff --git a/tools/ocaml/test/Makefile b/tools/ocaml/test/Makefile
index 3a35d04..dfa6437 100644
--- a/tools/ocaml/test/Makefile
+++ b/tools/ocaml/test/Makefile
@@ -2,12 +2,16 @@ XEN_ROOT = $(CURDIR)/../../..
 OCAML_TOPLEVEL = $(CURDIR)/..
 include $(OCAML_TOPLEVEL)/common.make
 
+CFLAGS += $(CFLAGS_libxenlight)
+LIBS_xenlight = $(LDLIBS_libxenlight)
+
 OCAMLINCLUDE += \
-	-I $(OCAML_TOPLEVEL)/libs/xentoollog
+	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
+	-I $(OCAML_TOPLEVEL)/libs/xl
 
-OBJS = xtl
+OBJS = xtl send_debug_keys list_domains raise_exception
 
-PROGRAMS = xtl
+PROGRAMS = xtl send_debug_keys list_domains raise_exception
 
 xtl_LIBS =  \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
@@ -15,7 +19,25 @@ xtl_LIBS =  \
 
 xtl_OBJS = xtl
 
-OCAML_PROGRAM = xtl
+send_debug_keys_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+send_debug_keys_OBJS = xtl send_debug_keys
+
+list_domains_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+list_domains_OBJS = xtl list_domains
+
+raise_exception_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+raise_exception_OBJS = raise_exception
+
+OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception
 
 all: $(PROGRAMS)
 
diff --git a/tools/ocaml/test/list_domains.ml b/tools/ocaml/test/list_domains.ml
new file mode 100644
index 0000000..c82d40d
--- /dev/null
+++ b/tools/ocaml/test/list_domains.ml
@@ -0,0 +1,28 @@
+open Arg
+open Printf
+open Xenlight
+
+let bool_as_char b c = if b then c else '-'
+
+let print_dominfo dominfo =
+  let id = dominfo.Xenlight.Dominfo.domid
+  and running = bool_as_char dominfo.Xenlight.Dominfo.running 'r'
+  and blocked = bool_as_char dominfo.Xenlight.Dominfo.blocked 'b'
+  and paused = bool_as_char dominfo.Xenlight.Dominfo.paused 'p'
+  and shutdown = bool_as_char dominfo.Xenlight.Dominfo.shutdown 's'
+  and dying = bool_as_char dominfo.Xenlight.Dominfo.dying 'd'
+  and memory = dominfo.Xenlight.Dominfo.current_memkb
+  in
+  printf "Dom %d: %c%c%c%c%c %LdKB\n" id running blocked paused shutdown dying memory
+
+let _ =
+  let logger = Xtl.create_stdio_logger (*~level:Xentoollog.Debug*) () in
+  let ctx = Xenlight.ctx_alloc logger in
+  try
+    let domains = Xenlight.Dominfo.list ctx in
+    List.iter (fun d -> print_dominfo d) domains
+  with Xenlight.Error(err, fn) -> begin
+    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
+  end
+
+
diff --git a/tools/ocaml/test/raise_exception.ml b/tools/ocaml/test/raise_exception.ml
new file mode 100644
index 0000000..f048a46
--- /dev/null
+++ b/tools/ocaml/test/raise_exception.ml
@@ -0,0 +1,11 @@
+open Printf
+open Xentoollog
+open Xenlight
+
+let _ =
+  try
+    Xenlight.test_raise_exception ()
+  with Xenlight.Error(err, fn) -> begin
+    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
+  end
+
diff --git a/tools/ocaml/test/send_debug_keys.ml b/tools/ocaml/test/send_debug_keys.ml
new file mode 100644
index 0000000..5900cf9
--- /dev/null
+++ b/tools/ocaml/test/send_debug_keys.ml
@@ -0,0 +1,15 @@
+open Arg
+open Printf
+open Xenlight
+
+let send_keys ctx s =
+  printf "Sending debug key %s\n" s;
+  Xenlight.send_debug_keys ctx s;
+  ()
+  
+let _ =
+  let logger = Xtl.create_stdio_logger () in
+  let ctx = Xenlight.ctx_alloc logger in
+  Arg.parse [
+  ] (fun s -> send_keys ctx s) "usage: send_debug_keys <keys>"
+
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:22:58 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:22: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 1VrO1S-0003Re-TV; Fri, 13 Dec 2013 08:22: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 1VrO1R-0003R6-6V
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:57 +0000
Received: from [85.158.143.35:11720] by server-1.bemta-4.messagelabs.com id
	EC/07-02132-0E3CAA25; Fri, 13 Dec 2013 08:22:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1386922974!5423003!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2557 invoked from network); 13 Dec 2013 08:22:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:22: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 1VrO1O-0001Yu-Ef
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1O-0005s4-Cn
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:22:54 +0000
Date: Fri, 13 Dec 2013 08:22:54 +0000
Message-Id: <E1VrO1O-0005s4-Cn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: implement some simple
	tests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 00d46451e3751404a4f4fe243315bf0c7e4f3280
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:26 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:25 2013 +0000

    libxl: ocaml: implement some simple tests
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
---
 .gitignore                          |    3 ++-
 .hgignore                           |    2 ++
 tools/ocaml/test/Makefile           |   30 ++++++++++++++++++++++++++----
 tools/ocaml/test/list_domains.ml    |   28 ++++++++++++++++++++++++++++
 tools/ocaml/test/raise_exception.ml |   11 +++++++++++
 tools/ocaml/test/send_debug_keys.ml |   15 +++++++++++++++
 6 files changed, 84 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index 20f20ed..ce5fd39 100644
--- a/.gitignore
+++ b/.gitignore
@@ -386,7 +386,8 @@ tools/ocaml/libs/xentoollog/xentoollog.ml
 tools/ocaml/libs/xentoollog/xentoollog.mli
 tools/ocaml/xenstored/oxenstored
 tools/ocaml/test/xtl
-
+tools/ocaml/test/send_debug_keys
+tools/ocaml/test/list_domains
 tools/debugger/kdd/kdd
 tools/firmware/etherboot/ipxe.tar.gz
 tools/firmware/etherboot/ipxe/
diff --git a/.hgignore b/.hgignore
index bb1b67d..ee5c084 100644
--- a/.hgignore
+++ b/.hgignore
@@ -309,6 +309,8 @@
 ^tools/ocaml/libs/xl/xenlight\.mli$
 ^tools/ocaml/xenstored/oxenstored$
 ^tools/ocaml/test/xtl$
+^tools/ocaml/test/send_debug_keys$
+^tools/ocaml/test/list_domains$
 ^tools/autom4te\.cache$
 ^tools/config\.h$
 ^tools/config\.log$
diff --git a/tools/ocaml/test/Makefile b/tools/ocaml/test/Makefile
index 3a35d04..dfa6437 100644
--- a/tools/ocaml/test/Makefile
+++ b/tools/ocaml/test/Makefile
@@ -2,12 +2,16 @@ XEN_ROOT = $(CURDIR)/../../..
 OCAML_TOPLEVEL = $(CURDIR)/..
 include $(OCAML_TOPLEVEL)/common.make
 
+CFLAGS += $(CFLAGS_libxenlight)
+LIBS_xenlight = $(LDLIBS_libxenlight)
+
 OCAMLINCLUDE += \
-	-I $(OCAML_TOPLEVEL)/libs/xentoollog
+	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
+	-I $(OCAML_TOPLEVEL)/libs/xl
 
-OBJS = xtl
+OBJS = xtl send_debug_keys list_domains raise_exception
 
-PROGRAMS = xtl
+PROGRAMS = xtl send_debug_keys list_domains raise_exception
 
 xtl_LIBS =  \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
@@ -15,7 +19,25 @@ xtl_LIBS =  \
 
 xtl_OBJS = xtl
 
-OCAML_PROGRAM = xtl
+send_debug_keys_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+send_debug_keys_OBJS = xtl send_debug_keys
+
+list_domains_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+list_domains_OBJS = xtl list_domains
+
+raise_exception_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+raise_exception_OBJS = raise_exception
+
+OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception
 
 all: $(PROGRAMS)
 
diff --git a/tools/ocaml/test/list_domains.ml b/tools/ocaml/test/list_domains.ml
new file mode 100644
index 0000000..c82d40d
--- /dev/null
+++ b/tools/ocaml/test/list_domains.ml
@@ -0,0 +1,28 @@
+open Arg
+open Printf
+open Xenlight
+
+let bool_as_char b c = if b then c else '-'
+
+let print_dominfo dominfo =
+  let id = dominfo.Xenlight.Dominfo.domid
+  and running = bool_as_char dominfo.Xenlight.Dominfo.running 'r'
+  and blocked = bool_as_char dominfo.Xenlight.Dominfo.blocked 'b'
+  and paused = bool_as_char dominfo.Xenlight.Dominfo.paused 'p'
+  and shutdown = bool_as_char dominfo.Xenlight.Dominfo.shutdown 's'
+  and dying = bool_as_char dominfo.Xenlight.Dominfo.dying 'd'
+  and memory = dominfo.Xenlight.Dominfo.current_memkb
+  in
+  printf "Dom %d: %c%c%c%c%c %LdKB\n" id running blocked paused shutdown dying memory
+
+let _ =
+  let logger = Xtl.create_stdio_logger (*~level:Xentoollog.Debug*) () in
+  let ctx = Xenlight.ctx_alloc logger in
+  try
+    let domains = Xenlight.Dominfo.list ctx in
+    List.iter (fun d -> print_dominfo d) domains
+  with Xenlight.Error(err, fn) -> begin
+    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
+  end
+
+
diff --git a/tools/ocaml/test/raise_exception.ml b/tools/ocaml/test/raise_exception.ml
new file mode 100644
index 0000000..f048a46
--- /dev/null
+++ b/tools/ocaml/test/raise_exception.ml
@@ -0,0 +1,11 @@
+open Printf
+open Xentoollog
+open Xenlight
+
+let _ =
+  try
+    Xenlight.test_raise_exception ()
+  with Xenlight.Error(err, fn) -> begin
+    printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
+  end
+
diff --git a/tools/ocaml/test/send_debug_keys.ml b/tools/ocaml/test/send_debug_keys.ml
new file mode 100644
index 0000000..5900cf9
--- /dev/null
+++ b/tools/ocaml/test/send_debug_keys.ml
@@ -0,0 +1,15 @@
+open Arg
+open Printf
+open Xenlight
+
+let send_keys ctx s =
+  printf "Sending debug key %s\n" s;
+  Xenlight.send_debug_keys ctx s;
+  ()
+  
+let _ =
+  let logger = Xtl.create_stdio_logger () in
+  let ctx = Xenlight.ctx_alloc logger in
+  Arg.parse [
+  ] (fun s -> send_keys ctx s) "usage: send_debug_keys <keys>"
+
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:23:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:23: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 1VrO1e-0003UW-0G; Fri, 13 Dec 2013 08:23: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 1VrO1c-0003U4-6f
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:08 +0000
Received: from [85.158.139.211:30483] by server-6.bemta-5.messagelabs.com id
	64/23-16310-BE3CAA25; Fri, 13 Dec 2013 08:23:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386922984!1567702!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2400 invoked from network); 13 Dec 2013 08:23:05 -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;
	13 Dec 2013 08:23: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 1VrO1Y-0001ZT-IQ
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1Y-0005sa-HQ
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:04 +0000
Date: Fri, 13 Dec 2013 08:23:04 +0000
Message-Id: <E1VrO1Y-0005sa-HQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: event management
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd8c37da4e75e92eb2b38283ab0cab1018de2feb
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:27 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:38 2013 +0000

    libxl: ocaml: event management
    
    Having bindings to the low-level functions libxl_osevent_register_hooks and
    related, allows to run an event loop in OCaml; either one we write ourselves,
    or one that is available elsewhere.
    
    The Lwt cooperative threads library (http://ocsigen.org/lwt/), which is quite
    popular these days, has an event loop that can be easily extended to poll any
    additional fds that we get from libxl. Lwt provides a "lightweight" threading
    model, which does not let you run any other (POSIX) threads in your
    application, and therefore excludes an event loop implemented in the C
    bindings.
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xl/xenlight.ml.in   |   37 ++++
 tools/ocaml/libs/xl/xenlight.mli.in  |   38 ++++
 tools/ocaml/libs/xl/xenlight_stubs.c |  354 ++++++++++++++++++++++++++++++++++
 3 files changed, 429 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/libs/xl/xenlight.ml.in b/tools/ocaml/libs/xl/xenlight.ml.in
index a281425..46106b5 100644
--- a/tools/ocaml/libs/xl/xenlight.ml.in
+++ b/tools/ocaml/libs/xl/xenlight.ml.in
@@ -25,10 +25,47 @@ external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
 
 external test_raise_exception: unit -> unit = "stub_raise_exception"
 
+type event =
+	| POLLIN (* There is data to read *)
+	| POLLPRI (* There is urgent data to read *)
+	| POLLOUT (* Writing now will not block *)
+	| POLLERR (* Error condition (revents only) *)
+	| POLLHUP (* Device has been disconnected (revents only) *)
+	| POLLNVAL (* Invalid request: fd not open (revents only). *)
+
 external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
+module Async = struct
+	type for_libxl
+	type event_hooks
+	type osevent_hooks
+
+	external osevent_register_hooks' : ctx -> 'a -> osevent_hooks = "stub_libxl_osevent_register_hooks"
+	external osevent_occurred_fd : ctx -> for_libxl -> Unix.file_descr -> event list -> event list -> unit = "stub_libxl_osevent_occurred_fd"
+	external osevent_occurred_timeout : ctx -> for_libxl -> unit = "stub_libxl_osevent_occurred_timeout"
+
+	let osevent_register_hooks ctx ~user ~fd_register ~fd_modify ~fd_deregister ~timeout_register ~timeout_modify =
+		Callback.register "libxl_fd_register" fd_register;
+		Callback.register "libxl_fd_modify" fd_modify;
+		Callback.register "libxl_fd_deregister" fd_deregister;
+		Callback.register "libxl_timeout_register" timeout_register;
+		Callback.register "libxl_timeout_modify" timeout_modify;
+		osevent_register_hooks' ctx user
+
+	let async_register_callback ~async_callback =
+		Callback.register "libxl_async_callback" async_callback
+
+	external evenable_domain_death : ctx -> domid -> int -> unit = "stub_libxl_evenable_domain_death"
+	external event_register_callbacks' : ctx -> 'a -> event_hooks = "stub_libxl_event_register_callbacks"
+
+	let event_register_callbacks ctx ~user ~event_occurs_callback ~event_disaster_callback =
+		Callback.register "libxl_event_occurs_callback" event_occurs_callback;
+		Callback.register "libxl_event_disaster_callback" event_disaster_callback;
+		event_register_callbacks' ctx user
+end
+
 let register_exceptions () =
 	Callback.register_exception "Xenlight.Error" (Error(ERROR_FAIL, ""))
 
diff --git a/tools/ocaml/libs/xl/xenlight.mli.in b/tools/ocaml/libs/xl/xenlight.mli.in
index d663196..170e0e0 100644
--- a/tools/ocaml/libs/xl/xenlight.mli.in
+++ b/tools/ocaml/libs/xl/xenlight.mli.in
@@ -27,7 +27,45 @@ external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
 
 external test_raise_exception: unit -> unit = "stub_raise_exception"
 
+type event =
+	| POLLIN (* There is data to read *)
+	| POLLPRI (* There is urgent data to read *)
+	| POLLOUT (* Writing now will not block *)
+	| POLLERR (* Error condition (revents only) *)
+	| POLLHUP (* Device has been disconnected (revents only) *)
+	| POLLNVAL (* Invalid request: fd not open (revents only). *)
+
 external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
+module Async : sig
+	type for_libxl
+	type event_hooks
+	type osevent_hooks
+
+	val osevent_register_hooks : ctx ->
+		user:'a ->
+		fd_register:('a -> Unix.file_descr -> event list -> for_libxl -> unit) ->
+		fd_modify:('a -> Unix.file_descr -> event list -> unit) ->
+		fd_deregister:('a -> Unix.file_descr -> unit) ->
+		timeout_register:('a -> int -> int -> for_libxl -> unit) ->
+		timeout_modify:('a -> unit) ->
+		osevent_hooks
+
+	external osevent_occurred_fd : ctx -> for_libxl -> Unix.file_descr -> event list -> event list -> unit = "stub_libxl_osevent_occurred_fd"
+	external osevent_occurred_timeout : ctx -> for_libxl -> unit = "stub_libxl_osevent_occurred_timeout"
+
+	val async_register_callback :
+		async_callback:(result:error option -> user:'a -> unit) ->
+		unit
+
+	external evenable_domain_death : ctx -> domid -> int -> unit = "stub_libxl_evenable_domain_death"
+
+	val event_register_callbacks : ctx ->
+		user:'a ->
+		event_occurs_callback:('a -> Event.t -> unit) ->
+		event_disaster_callback:('a -> event_type -> string -> int -> unit) ->
+		event_hooks
+end
+
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 4ea2047..39a9632 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -30,6 +30,8 @@
 #include <libxl.h>
 #include <libxl_utils.h>
 
+#include <unistd.h>
+
 #include "caml_xentoollog.h"
 
 #define Ctx_val(x)(*((libxl_ctx **) Data_custom_val(x)))
@@ -370,6 +372,35 @@ static char *String_option_val(value v)
 
 #include "_libxl_types.inc"
 
+void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
+{
+	CAMLparam0();
+	CAMLlocal2(error, tmp);
+	static value *func = NULL;
+	value *p = (value *) for_callback;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_async_callback");
+	}
+
+	if (rc == 0)
+		error = Val_none;
+	else {
+		tmp = Val_error(rc);
+		error = Val_some(tmp);
+	}
+
+	/* for_callback is a pointer to a "value" that was malloc'ed and
+	 * registered with the OCaml GC. The value is handed back to OCaml
+	 * in the following callback, after which the pointer is unregistered
+	 * and freed. */
+	caml_callback2(*func, error, *p);
+
+	caml_remove_global_root(p);
+	free(p);
+}
+
 #define _STRINGIFY(x) #x
 #define STRINGIFY(x) _STRINGIFY(x)
 
@@ -703,6 +734,329 @@ value stub_xl_send_debug_keys(value ctx, value keys)
 	CAMLreturn(Val_unit);
 }
 
+
+/* Event handling */
+
+short Poll_val(value event)
+{
+	CAMLparam1(event);
+	short res = -1;
+
+	switch (Int_val(event)) {
+		case 0: res = POLLIN; break;
+		case 1: res = POLLPRI; break;
+		case 2: res = POLLOUT; break;
+		case 3: res = POLLERR; break;
+		case 4: res = POLLHUP; break;
+		case 5: res = POLLNVAL; break;
+	}
+
+	CAMLreturn(res);
+}
+
+short Poll_events_val(value event_list)
+{
+	CAMLparam1(event_list);
+	short events = 0;
+
+	while (event_list != Val_emptylist) {
+		events |= Poll_val(Field(event_list, 0));
+		event_list = Field(event_list, 1);
+	}
+
+	CAMLreturn(events);
+}
+
+value Val_poll(short event)
+{
+	CAMLparam0();
+	CAMLlocal1(res);
+
+	switch (event) {
+		case POLLIN: res = Val_int(0); break;
+		case POLLPRI: res = Val_int(1); break;
+		case POLLOUT: res = Val_int(2); break;
+		case POLLERR: res = Val_int(3); break;
+		case POLLHUP: res = Val_int(4); break;
+		case POLLNVAL: res = Val_int(5); break;
+		default: failwith_xl(ERROR_FAIL, "cannot convert poll event value"); break;
+	}
+
+	CAMLreturn(res);
+}
+
+value add_event(value event_list, short event)
+{
+	CAMLparam1(event_list);
+	CAMLlocal1(new_list);
+
+	new_list = caml_alloc(2, 0);
+	Store_field(new_list, 0, Val_poll(event));
+	Store_field(new_list, 1, event_list);
+
+	CAMLreturn(new_list);
+}
+
+value Val_poll_events(short events)
+{
+	CAMLparam0();
+	CAMLlocal1(event_list);
+
+	event_list = Val_emptylist;
+	if (events & POLLIN)
+		event_list = add_event(event_list, POLLIN);
+	if (events & POLLPRI)
+		event_list = add_event(event_list, POLLPRI);
+	if (events & POLLOUT)
+		event_list = add_event(event_list, POLLOUT);
+	if (events & POLLERR)
+		event_list = add_event(event_list, POLLERR);
+	if (events & POLLHUP)
+		event_list = add_event(event_list, POLLHUP);
+	if (events & POLLNVAL)
+		event_list = add_event(event_list, POLLNVAL);
+
+	CAMLreturn(event_list);
+}
+
+int fd_register(void *user, int fd, void **for_app_registration_out,
+                     short events, void *for_libxl)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 4);
+	static value *func = NULL;
+	value *p = (value *) user;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_fd_register");
+	}
+
+	args[0] = *p;
+	args[1] = Val_int(fd);
+	args[2] = Val_poll_events(events);
+	args[3] = (value) for_libxl;
+
+	caml_callbackN(*func, 4, args);
+	CAMLreturn(0);
+}
+
+int fd_modify(void *user, int fd, void **for_app_registration_update,
+                   short events)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 3);
+	static value *func = NULL;
+	value *p = (value *) user;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_fd_modify");
+	}
+
+	args[0] = *p;
+	args[1] = Val_int(fd);
+	args[2] = Val_poll_events(events);
+
+	caml_callbackN(*func, 3, args);
+	CAMLreturn(0);
+}
+
+void fd_deregister(void *user, int fd, void *for_app_registration)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 2);
+	static value *func = NULL;
+	value *p = (value *) user;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_fd_deregister");
+	}
+
+	args[0] = *p;
+	args[1] = Val_int(fd);
+
+	caml_callbackN(*func, 2, args);
+	CAMLreturn0;
+}
+
+int timeout_register(void *user, void **for_app_registration_out,
+                          struct timeval abs, void *for_libxl)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 4);
+	static value *func = NULL;
+	value *p = (value *) user;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_timeout_register");
+	}
+
+	args[0] = *p;
+	args[1] = Val_int(abs.tv_sec);
+	args[2] = Val_int(abs.tv_usec);
+	args[3] = (value) for_libxl;
+
+	caml_callbackN(*func, 4, args);
+	CAMLreturn(0);
+}
+
+int timeout_modify(void *user, void **for_app_registration_update,
+                         struct timeval abs)
+{
+	CAMLparam0();
+	static value *func = NULL;
+	value *p = (value *) user;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_timeout_modify");
+	}
+
+	caml_callback(*func, *p);
+	CAMLreturn(0);
+}
+
+void timeout_deregister(void *user, void *for_app_registration)
+{
+	failwith_xl(ERROR_FAIL, "timeout_deregister not yet implemented");
+	return;
+}
+
+value stub_libxl_osevent_register_hooks(value ctx, value user)
+{
+	CAMLparam2(ctx, user);
+	CAMLlocal1(result);
+	libxl_osevent_hooks *hooks;
+	value *p;
+
+	hooks = malloc(sizeof(*hooks));
+	if (!hooks)
+		failwith_xl(ERROR_NOMEM, "cannot allocate osevent hooks");
+	hooks->fd_register = fd_register;
+	hooks->fd_modify = fd_modify;
+	hooks->fd_deregister = fd_deregister;
+	hooks->timeout_register = timeout_register;
+	hooks->timeout_modify = timeout_modify;
+	hooks->timeout_deregister = timeout_deregister;
+
+	p = malloc(sizeof(value));
+	if (!p)
+		failwith_xl(ERROR_NOMEM, "cannot allocate value");
+	*p = user;
+	caml_register_global_root(p);
+
+	libxl_osevent_register_hooks(CTX, hooks, (void *) p);
+
+	result = caml_alloc(1, Abstract_tag);
+	*((libxl_osevent_hooks **) result) = hooks;
+
+	CAMLreturn(result);
+}
+
+value stub_libxl_osevent_occurred_fd(value ctx, value for_libxl, value fd,
+	value events, value revents)
+{
+	CAMLparam5(ctx, for_libxl, fd, events, revents);
+	libxl_osevent_occurred_fd(CTX, (void *) for_libxl, Int_val(fd),
+		Poll_events_val(events), Poll_events_val(revents));
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_osevent_occurred_timeout(value ctx, value for_libxl)
+{
+	CAMLparam2(ctx, for_libxl);
+	libxl_osevent_occurred_timeout(CTX, (void *) for_libxl);
+	CAMLreturn(Val_unit);
+}
+
+struct user_with_ctx {
+	libxl_ctx *ctx;
+	value user;
+};
+
+void event_occurs(void *user, libxl_event *event)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 2);
+	struct user_with_ctx *c_user = (struct user_with_ctx *) user;
+	static value *func = NULL;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_event_occurs_callback");
+	}
+
+	args[0] = c_user->user;
+	args[1] = Val_event(event);
+	libxl_event_free(c_user->ctx, event);
+
+	caml_callbackN(*func, 2, args);
+	CAMLreturn0;
+}
+
+void disaster(void *user, libxl_event_type type,
+                     const char *msg, int errnoval)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 4);
+	struct user_with_ctx *c_user = (struct user_with_ctx *) user;
+	static value *func = NULL;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_event_disaster_callback");
+	}
+
+	args[0] = c_user->user;
+	args[1] = Val_event_type(type);
+	args[2] = caml_copy_string(msg);
+	args[3] = Val_int(errnoval);
+
+	caml_callbackN(*func, 4, args);
+	CAMLreturn0;
+}
+
+value stub_libxl_event_register_callbacks(value ctx, value user)
+{
+	CAMLparam2(ctx, user);
+	CAMLlocal1(result);
+	struct user_with_ctx *c_user = NULL;
+	libxl_event_hooks *hooks;
+
+	c_user = malloc(sizeof(*c_user));
+	if (!c_user)
+		failwith_xl(ERROR_NOMEM, "cannot allocate user value");
+	c_user->user = user;
+	c_user->ctx = CTX;
+	caml_register_global_root(&c_user->user);
+
+	hooks = malloc(sizeof(*hooks));
+	if (!hooks)
+		failwith_xl(ERROR_NOMEM, "cannot allocate event hooks");
+	hooks->event_occurs_mask = LIBXL_EVENTMASK_ALL;
+	hooks->event_occurs = event_occurs;
+	hooks->disaster = disaster;
+
+	libxl_event_register_callbacks(CTX, hooks, (void *) c_user);
+	result = caml_alloc(1, Abstract_tag);
+	*((libxl_event_hooks **) result) = hooks;
+
+	CAMLreturn(result);
+}
+
+value stub_libxl_evenable_domain_death(value ctx, value domid, value user)
+{
+	CAMLparam3(ctx, domid, user);
+	libxl_evgen_domain_death *evgen_out;
+
+	libxl_evenable_domain_death(CTX, Int_val(domid), Int_val(user), &evgen_out);
+
+	CAMLreturn(Val_unit);
+}
+
 /*
  * Local variables:
  *  indent-tabs-mode: t
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:23:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:23: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 1VrO1e-0003UW-0G; Fri, 13 Dec 2013 08:23: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 1VrO1c-0003U4-6f
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:08 +0000
Received: from [85.158.139.211:30483] by server-6.bemta-5.messagelabs.com id
	64/23-16310-BE3CAA25; Fri, 13 Dec 2013 08:23:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1386922984!1567702!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2400 invoked from network); 13 Dec 2013 08:23:05 -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;
	13 Dec 2013 08:23: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 1VrO1Y-0001ZT-IQ
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1Y-0005sa-HQ
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:04 +0000
Date: Fri, 13 Dec 2013 08:23:04 +0000
Message-Id: <E1VrO1Y-0005sa-HQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: event management
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd8c37da4e75e92eb2b38283ab0cab1018de2feb
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:27 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:38 2013 +0000

    libxl: ocaml: event management
    
    Having bindings to the low-level functions libxl_osevent_register_hooks and
    related, allows to run an event loop in OCaml; either one we write ourselves,
    or one that is available elsewhere.
    
    The Lwt cooperative threads library (http://ocsigen.org/lwt/), which is quite
    popular these days, has an event loop that can be easily extended to poll any
    additional fds that we get from libxl. Lwt provides a "lightweight" threading
    model, which does not let you run any other (POSIX) threads in your
    application, and therefore excludes an event loop implemented in the C
    bindings.
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xl/xenlight.ml.in   |   37 ++++
 tools/ocaml/libs/xl/xenlight.mli.in  |   38 ++++
 tools/ocaml/libs/xl/xenlight_stubs.c |  354 ++++++++++++++++++++++++++++++++++
 3 files changed, 429 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/libs/xl/xenlight.ml.in b/tools/ocaml/libs/xl/xenlight.ml.in
index a281425..46106b5 100644
--- a/tools/ocaml/libs/xl/xenlight.ml.in
+++ b/tools/ocaml/libs/xl/xenlight.ml.in
@@ -25,10 +25,47 @@ external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
 
 external test_raise_exception: unit -> unit = "stub_raise_exception"
 
+type event =
+	| POLLIN (* There is data to read *)
+	| POLLPRI (* There is urgent data to read *)
+	| POLLOUT (* Writing now will not block *)
+	| POLLERR (* Error condition (revents only) *)
+	| POLLHUP (* Device has been disconnected (revents only) *)
+	| POLLNVAL (* Invalid request: fd not open (revents only). *)
+
 external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
+module Async = struct
+	type for_libxl
+	type event_hooks
+	type osevent_hooks
+
+	external osevent_register_hooks' : ctx -> 'a -> osevent_hooks = "stub_libxl_osevent_register_hooks"
+	external osevent_occurred_fd : ctx -> for_libxl -> Unix.file_descr -> event list -> event list -> unit = "stub_libxl_osevent_occurred_fd"
+	external osevent_occurred_timeout : ctx -> for_libxl -> unit = "stub_libxl_osevent_occurred_timeout"
+
+	let osevent_register_hooks ctx ~user ~fd_register ~fd_modify ~fd_deregister ~timeout_register ~timeout_modify =
+		Callback.register "libxl_fd_register" fd_register;
+		Callback.register "libxl_fd_modify" fd_modify;
+		Callback.register "libxl_fd_deregister" fd_deregister;
+		Callback.register "libxl_timeout_register" timeout_register;
+		Callback.register "libxl_timeout_modify" timeout_modify;
+		osevent_register_hooks' ctx user
+
+	let async_register_callback ~async_callback =
+		Callback.register "libxl_async_callback" async_callback
+
+	external evenable_domain_death : ctx -> domid -> int -> unit = "stub_libxl_evenable_domain_death"
+	external event_register_callbacks' : ctx -> 'a -> event_hooks = "stub_libxl_event_register_callbacks"
+
+	let event_register_callbacks ctx ~user ~event_occurs_callback ~event_disaster_callback =
+		Callback.register "libxl_event_occurs_callback" event_occurs_callback;
+		Callback.register "libxl_event_disaster_callback" event_disaster_callback;
+		event_register_callbacks' ctx user
+end
+
 let register_exceptions () =
 	Callback.register_exception "Xenlight.Error" (Error(ERROR_FAIL, ""))
 
diff --git a/tools/ocaml/libs/xl/xenlight.mli.in b/tools/ocaml/libs/xl/xenlight.mli.in
index d663196..170e0e0 100644
--- a/tools/ocaml/libs/xl/xenlight.mli.in
+++ b/tools/ocaml/libs/xl/xenlight.mli.in
@@ -27,7 +27,45 @@ external ctx_alloc: Xentoollog.handle -> ctx = "stub_libxl_ctx_alloc"
 
 external test_raise_exception: unit -> unit = "stub_raise_exception"
 
+type event =
+	| POLLIN (* There is data to read *)
+	| POLLPRI (* There is urgent data to read *)
+	| POLLOUT (* Writing now will not block *)
+	| POLLERR (* Error condition (revents only) *)
+	| POLLHUP (* Device has been disconnected (revents only) *)
+	| POLLNVAL (* Invalid request: fd not open (revents only). *)
+
 external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
 external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
 external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 
+module Async : sig
+	type for_libxl
+	type event_hooks
+	type osevent_hooks
+
+	val osevent_register_hooks : ctx ->
+		user:'a ->
+		fd_register:('a -> Unix.file_descr -> event list -> for_libxl -> unit) ->
+		fd_modify:('a -> Unix.file_descr -> event list -> unit) ->
+		fd_deregister:('a -> Unix.file_descr -> unit) ->
+		timeout_register:('a -> int -> int -> for_libxl -> unit) ->
+		timeout_modify:('a -> unit) ->
+		osevent_hooks
+
+	external osevent_occurred_fd : ctx -> for_libxl -> Unix.file_descr -> event list -> event list -> unit = "stub_libxl_osevent_occurred_fd"
+	external osevent_occurred_timeout : ctx -> for_libxl -> unit = "stub_libxl_osevent_occurred_timeout"
+
+	val async_register_callback :
+		async_callback:(result:error option -> user:'a -> unit) ->
+		unit
+
+	external evenable_domain_death : ctx -> domid -> int -> unit = "stub_libxl_evenable_domain_death"
+
+	val event_register_callbacks : ctx ->
+		user:'a ->
+		event_occurs_callback:('a -> Event.t -> unit) ->
+		event_disaster_callback:('a -> event_type -> string -> int -> unit) ->
+		event_hooks
+end
+
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 4ea2047..39a9632 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -30,6 +30,8 @@
 #include <libxl.h>
 #include <libxl_utils.h>
 
+#include <unistd.h>
+
 #include "caml_xentoollog.h"
 
 #define Ctx_val(x)(*((libxl_ctx **) Data_custom_val(x)))
@@ -370,6 +372,35 @@ static char *String_option_val(value v)
 
 #include "_libxl_types.inc"
 
+void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
+{
+	CAMLparam0();
+	CAMLlocal2(error, tmp);
+	static value *func = NULL;
+	value *p = (value *) for_callback;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_async_callback");
+	}
+
+	if (rc == 0)
+		error = Val_none;
+	else {
+		tmp = Val_error(rc);
+		error = Val_some(tmp);
+	}
+
+	/* for_callback is a pointer to a "value" that was malloc'ed and
+	 * registered with the OCaml GC. The value is handed back to OCaml
+	 * in the following callback, after which the pointer is unregistered
+	 * and freed. */
+	caml_callback2(*func, error, *p);
+
+	caml_remove_global_root(p);
+	free(p);
+}
+
 #define _STRINGIFY(x) #x
 #define STRINGIFY(x) _STRINGIFY(x)
 
@@ -703,6 +734,329 @@ value stub_xl_send_debug_keys(value ctx, value keys)
 	CAMLreturn(Val_unit);
 }
 
+
+/* Event handling */
+
+short Poll_val(value event)
+{
+	CAMLparam1(event);
+	short res = -1;
+
+	switch (Int_val(event)) {
+		case 0: res = POLLIN; break;
+		case 1: res = POLLPRI; break;
+		case 2: res = POLLOUT; break;
+		case 3: res = POLLERR; break;
+		case 4: res = POLLHUP; break;
+		case 5: res = POLLNVAL; break;
+	}
+
+	CAMLreturn(res);
+}
+
+short Poll_events_val(value event_list)
+{
+	CAMLparam1(event_list);
+	short events = 0;
+
+	while (event_list != Val_emptylist) {
+		events |= Poll_val(Field(event_list, 0));
+		event_list = Field(event_list, 1);
+	}
+
+	CAMLreturn(events);
+}
+
+value Val_poll(short event)
+{
+	CAMLparam0();
+	CAMLlocal1(res);
+
+	switch (event) {
+		case POLLIN: res = Val_int(0); break;
+		case POLLPRI: res = Val_int(1); break;
+		case POLLOUT: res = Val_int(2); break;
+		case POLLERR: res = Val_int(3); break;
+		case POLLHUP: res = Val_int(4); break;
+		case POLLNVAL: res = Val_int(5); break;
+		default: failwith_xl(ERROR_FAIL, "cannot convert poll event value"); break;
+	}
+
+	CAMLreturn(res);
+}
+
+value add_event(value event_list, short event)
+{
+	CAMLparam1(event_list);
+	CAMLlocal1(new_list);
+
+	new_list = caml_alloc(2, 0);
+	Store_field(new_list, 0, Val_poll(event));
+	Store_field(new_list, 1, event_list);
+
+	CAMLreturn(new_list);
+}
+
+value Val_poll_events(short events)
+{
+	CAMLparam0();
+	CAMLlocal1(event_list);
+
+	event_list = Val_emptylist;
+	if (events & POLLIN)
+		event_list = add_event(event_list, POLLIN);
+	if (events & POLLPRI)
+		event_list = add_event(event_list, POLLPRI);
+	if (events & POLLOUT)
+		event_list = add_event(event_list, POLLOUT);
+	if (events & POLLERR)
+		event_list = add_event(event_list, POLLERR);
+	if (events & POLLHUP)
+		event_list = add_event(event_list, POLLHUP);
+	if (events & POLLNVAL)
+		event_list = add_event(event_list, POLLNVAL);
+
+	CAMLreturn(event_list);
+}
+
+int fd_register(void *user, int fd, void **for_app_registration_out,
+                     short events, void *for_libxl)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 4);
+	static value *func = NULL;
+	value *p = (value *) user;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_fd_register");
+	}
+
+	args[0] = *p;
+	args[1] = Val_int(fd);
+	args[2] = Val_poll_events(events);
+	args[3] = (value) for_libxl;
+
+	caml_callbackN(*func, 4, args);
+	CAMLreturn(0);
+}
+
+int fd_modify(void *user, int fd, void **for_app_registration_update,
+                   short events)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 3);
+	static value *func = NULL;
+	value *p = (value *) user;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_fd_modify");
+	}
+
+	args[0] = *p;
+	args[1] = Val_int(fd);
+	args[2] = Val_poll_events(events);
+
+	caml_callbackN(*func, 3, args);
+	CAMLreturn(0);
+}
+
+void fd_deregister(void *user, int fd, void *for_app_registration)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 2);
+	static value *func = NULL;
+	value *p = (value *) user;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_fd_deregister");
+	}
+
+	args[0] = *p;
+	args[1] = Val_int(fd);
+
+	caml_callbackN(*func, 2, args);
+	CAMLreturn0;
+}
+
+int timeout_register(void *user, void **for_app_registration_out,
+                          struct timeval abs, void *for_libxl)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 4);
+	static value *func = NULL;
+	value *p = (value *) user;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_timeout_register");
+	}
+
+	args[0] = *p;
+	args[1] = Val_int(abs.tv_sec);
+	args[2] = Val_int(abs.tv_usec);
+	args[3] = (value) for_libxl;
+
+	caml_callbackN(*func, 4, args);
+	CAMLreturn(0);
+}
+
+int timeout_modify(void *user, void **for_app_registration_update,
+                         struct timeval abs)
+{
+	CAMLparam0();
+	static value *func = NULL;
+	value *p = (value *) user;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_timeout_modify");
+	}
+
+	caml_callback(*func, *p);
+	CAMLreturn(0);
+}
+
+void timeout_deregister(void *user, void *for_app_registration)
+{
+	failwith_xl(ERROR_FAIL, "timeout_deregister not yet implemented");
+	return;
+}
+
+value stub_libxl_osevent_register_hooks(value ctx, value user)
+{
+	CAMLparam2(ctx, user);
+	CAMLlocal1(result);
+	libxl_osevent_hooks *hooks;
+	value *p;
+
+	hooks = malloc(sizeof(*hooks));
+	if (!hooks)
+		failwith_xl(ERROR_NOMEM, "cannot allocate osevent hooks");
+	hooks->fd_register = fd_register;
+	hooks->fd_modify = fd_modify;
+	hooks->fd_deregister = fd_deregister;
+	hooks->timeout_register = timeout_register;
+	hooks->timeout_modify = timeout_modify;
+	hooks->timeout_deregister = timeout_deregister;
+
+	p = malloc(sizeof(value));
+	if (!p)
+		failwith_xl(ERROR_NOMEM, "cannot allocate value");
+	*p = user;
+	caml_register_global_root(p);
+
+	libxl_osevent_register_hooks(CTX, hooks, (void *) p);
+
+	result = caml_alloc(1, Abstract_tag);
+	*((libxl_osevent_hooks **) result) = hooks;
+
+	CAMLreturn(result);
+}
+
+value stub_libxl_osevent_occurred_fd(value ctx, value for_libxl, value fd,
+	value events, value revents)
+{
+	CAMLparam5(ctx, for_libxl, fd, events, revents);
+	libxl_osevent_occurred_fd(CTX, (void *) for_libxl, Int_val(fd),
+		Poll_events_val(events), Poll_events_val(revents));
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_osevent_occurred_timeout(value ctx, value for_libxl)
+{
+	CAMLparam2(ctx, for_libxl);
+	libxl_osevent_occurred_timeout(CTX, (void *) for_libxl);
+	CAMLreturn(Val_unit);
+}
+
+struct user_with_ctx {
+	libxl_ctx *ctx;
+	value user;
+};
+
+void event_occurs(void *user, libxl_event *event)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 2);
+	struct user_with_ctx *c_user = (struct user_with_ctx *) user;
+	static value *func = NULL;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_event_occurs_callback");
+	}
+
+	args[0] = c_user->user;
+	args[1] = Val_event(event);
+	libxl_event_free(c_user->ctx, event);
+
+	caml_callbackN(*func, 2, args);
+	CAMLreturn0;
+}
+
+void disaster(void *user, libxl_event_type type,
+                     const char *msg, int errnoval)
+{
+	CAMLparam0();
+	CAMLlocalN(args, 4);
+	struct user_with_ctx *c_user = (struct user_with_ctx *) user;
+	static value *func = NULL;
+
+	if (func == NULL) {
+		/* First time around, lookup by name */
+		func = caml_named_value("libxl_event_disaster_callback");
+	}
+
+	args[0] = c_user->user;
+	args[1] = Val_event_type(type);
+	args[2] = caml_copy_string(msg);
+	args[3] = Val_int(errnoval);
+
+	caml_callbackN(*func, 4, args);
+	CAMLreturn0;
+}
+
+value stub_libxl_event_register_callbacks(value ctx, value user)
+{
+	CAMLparam2(ctx, user);
+	CAMLlocal1(result);
+	struct user_with_ctx *c_user = NULL;
+	libxl_event_hooks *hooks;
+
+	c_user = malloc(sizeof(*c_user));
+	if (!c_user)
+		failwith_xl(ERROR_NOMEM, "cannot allocate user value");
+	c_user->user = user;
+	c_user->ctx = CTX;
+	caml_register_global_root(&c_user->user);
+
+	hooks = malloc(sizeof(*hooks));
+	if (!hooks)
+		failwith_xl(ERROR_NOMEM, "cannot allocate event hooks");
+	hooks->event_occurs_mask = LIBXL_EVENTMASK_ALL;
+	hooks->event_occurs = event_occurs;
+	hooks->disaster = disaster;
+
+	libxl_event_register_callbacks(CTX, hooks, (void *) c_user);
+	result = caml_alloc(1, Abstract_tag);
+	*((libxl_event_hooks **) result) = hooks;
+
+	CAMLreturn(result);
+}
+
+value stub_libxl_evenable_domain_death(value ctx, value domid, value user)
+{
+	CAMLparam3(ctx, domid, user);
+	libxl_evgen_domain_death *evgen_out;
+
+	libxl_evenable_domain_death(CTX, Int_val(domid), Int_val(user), &evgen_out);
+
+	CAMLreturn(Val_unit);
+}
+
 /*
  * Local variables:
  *  indent-tabs-mode: t
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:23:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:23: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 1VrO1n-0003WW-3N; Fri, 13 Dec 2013 08:23: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 1VrO1l-0003WC-F6
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:17 +0000
Received: from [85.158.137.68:13048] by server-10.bemta-3.messagelabs.com id
	80/10-23989-4F3CAA25; Fri, 13 Dec 2013 08:23:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1386922994!3663129!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9531 invoked from network); 13 Dec 2013 08:23:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:23: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 1VrO1i-0001ZZ-Me
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1i-0005t1-L4
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:14 +0000
Date: Fri, 13 Dec 2013 08:23:14 +0000
Message-Id: <E1VrO1i-0005t1-L4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: allow device operations
	to be called asynchronously
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit df27715fe187b2d77ce40c8c2c3a15b89bc8d112
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:28 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:49 2013 +0000

    libxl: ocaml: allow device operations to be called asynchronously
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    CC: David Scott <dave.scott@eu.citrix.com>
---
 tools/ocaml/libs/xl/genwrap.py       |    6 +++---
 tools/ocaml/libs/xl/xenlight_stubs.c |   18 +++++++++++++++---
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/tools/ocaml/libs/xl/genwrap.py b/tools/ocaml/libs/xl/genwrap.py
index f5d2224..dd43069 100644
--- a/tools/ocaml/libs/xl/genwrap.py
+++ b/tools/ocaml/libs/xl/genwrap.py
@@ -22,9 +22,9 @@ builtins = {
     "libxl_cpuid_policy_list": ("unit",                "%(c)s = 0",                         "Val_unit"),
     }
 
-DEVICE_FUNCTIONS = [ ("add",            ["ctx", "t", "domid", "unit"]),
-                     ("remove",         ["ctx", "t", "domid", "unit"]),
-                     ("destroy",        ["ctx", "t", "domid", "unit"]),
+DEVICE_FUNCTIONS = [ ("add",            ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
+                     ("remove",         ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
+                     ("destroy",        ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
                    ]
 
 functions = { # ( name , [type1,type2,....] )
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 39a9632..1a0fab3 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -405,15 +405,27 @@ void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
 #define STRINGIFY(x) _STRINGIFY(x)
 
 #define _DEVICE_ADDREMOVE(type,op)					\
-value stub_xl_device_##type##_##op(value ctx, value info, value domid)	\
+value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
+	value async, value unit)					\
 {									\
-	CAMLparam3(ctx, info, domid);					\
+	CAMLparam5(ctx, info, domid, async, unit);			\
 	libxl_device_##type c_info;					\
 	int ret, marker_var;						\
+	libxl_asyncop_how ao_how;					\
+	value *p;							\
 									\
 	device_##type##_val(CTX, &c_info, info);			\
 									\
-	ret = libxl_device_##type##_##op(CTX, Int_val(domid), &c_info, 0); \
+	if (async != Val_none) {					\
+		p = malloc(sizeof(value));				\
+		*p = Some_val(async);					\
+		caml_register_global_root(p);				\
+		ao_how.callback = async_callback;			\
+		ao_how.u.for_callback = (void *) p;			\
+	}								\
+									\
+	ret = libxl_device_##type##_##op(CTX, Int_val(domid), &c_info,	\
+		async != Val_none ? &ao_how : NULL);			\
 									\
 	libxl_device_##type##_dispose(&c_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 Fri Dec 13 08:23:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:23: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 1VrO1n-0003WW-3N; Fri, 13 Dec 2013 08:23: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 1VrO1l-0003WC-F6
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:17 +0000
Received: from [85.158.137.68:13048] by server-10.bemta-3.messagelabs.com id
	80/10-23989-4F3CAA25; Fri, 13 Dec 2013 08:23:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1386922994!3663129!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9531 invoked from network); 13 Dec 2013 08:23:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:23: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 1VrO1i-0001ZZ-Me
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1i-0005t1-L4
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:14 +0000
Date: Fri, 13 Dec 2013 08:23:14 +0000
Message-Id: <E1VrO1i-0005t1-L4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: allow device operations
	to be called asynchronously
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit df27715fe187b2d77ce40c8c2c3a15b89bc8d112
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:28 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:49 2013 +0000

    libxl: ocaml: allow device operations to be called asynchronously
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    CC: David Scott <dave.scott@eu.citrix.com>
---
 tools/ocaml/libs/xl/genwrap.py       |    6 +++---
 tools/ocaml/libs/xl/xenlight_stubs.c |   18 +++++++++++++++---
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/tools/ocaml/libs/xl/genwrap.py b/tools/ocaml/libs/xl/genwrap.py
index f5d2224..dd43069 100644
--- a/tools/ocaml/libs/xl/genwrap.py
+++ b/tools/ocaml/libs/xl/genwrap.py
@@ -22,9 +22,9 @@ builtins = {
     "libxl_cpuid_policy_list": ("unit",                "%(c)s = 0",                         "Val_unit"),
     }
 
-DEVICE_FUNCTIONS = [ ("add",            ["ctx", "t", "domid", "unit"]),
-                     ("remove",         ["ctx", "t", "domid", "unit"]),
-                     ("destroy",        ["ctx", "t", "domid", "unit"]),
+DEVICE_FUNCTIONS = [ ("add",            ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
+                     ("remove",         ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
+                     ("destroy",        ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
                    ]
 
 functions = { # ( name , [type1,type2,....] )
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 39a9632..1a0fab3 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -405,15 +405,27 @@ void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
 #define STRINGIFY(x) _STRINGIFY(x)
 
 #define _DEVICE_ADDREMOVE(type,op)					\
-value stub_xl_device_##type##_##op(value ctx, value info, value domid)	\
+value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
+	value async, value unit)					\
 {									\
-	CAMLparam3(ctx, info, domid);					\
+	CAMLparam5(ctx, info, domid, async, unit);			\
 	libxl_device_##type c_info;					\
 	int ret, marker_var;						\
+	libxl_asyncop_how ao_how;					\
+	value *p;							\
 									\
 	device_##type##_val(CTX, &c_info, info);			\
 									\
-	ret = libxl_device_##type##_##op(CTX, Int_val(domid), &c_info, 0); \
+	if (async != Val_none) {					\
+		p = malloc(sizeof(value));				\
+		*p = Some_val(async);					\
+		caml_register_global_root(p);				\
+		ao_how.callback = async_callback;			\
+		ao_how.u.for_callback = (void *) p;			\
+	}								\
+									\
+	ret = libxl_device_##type##_##op(CTX, Int_val(domid), &c_info,	\
+		async != Val_none ? &ao_how : NULL);			\
 									\
 	libxl_device_##type##_dispose(&c_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 Fri Dec 13 08:23:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:23: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 1VrO1x-0003YZ-67; Fri, 13 Dec 2013 08:23: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 1VrO1v-0003YI-JI
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:27 +0000
Received: from [85.158.139.211:37871] by server-14.bemta-5.messagelabs.com id
	EA/5A-24200-EF3CAA25; Fri, 13 Dec 2013 08:23:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1386923005!4226150!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11102 invoked from network); 13 Dec 2013 08:23:26 -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;
	13 Dec 2013 08:23: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 1VrO1s-0001Zf-RL
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1s-0005tN-PP
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:24 +0000
Date: Fri, 13 Dec 2013 08:23:24 +0000
Message-Id: <E1VrO1s-0005tN-PP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: add disk and cdrom
	helper functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8f906e4e883d676b3193df026da76775e26a6c0b
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:29 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:50 2013 +0000

    libxl: ocaml: add disk and cdrom helper functions
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xl/genwrap.py       |   17 +++++++-----
 tools/ocaml/libs/xl/xenlight_stubs.c |   50 ++++++++++++++++++++++++++++++---
 2 files changed, 55 insertions(+), 12 deletions(-)

diff --git a/tools/ocaml/libs/xl/genwrap.py b/tools/ocaml/libs/xl/genwrap.py
index dd43069..5e43831 100644
--- a/tools/ocaml/libs/xl/genwrap.py
+++ b/tools/ocaml/libs/xl/genwrap.py
@@ -26,18 +26,21 @@ DEVICE_FUNCTIONS = [ ("add",            ["ctx", "t", "domid", "?async:'a", "unit
                      ("remove",         ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
                      ("destroy",        ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
                    ]
+DEVICE_LIST =      [ ("list",           ["ctx", "domid", "t list"]),
+                   ]
 
 functions = { # ( name , [type1,type2,....] )
     "device_vfb":     DEVICE_FUNCTIONS,
     "device_vkb":     DEVICE_FUNCTIONS,
-    "device_disk":    DEVICE_FUNCTIONS,
-    "device_nic":     DEVICE_FUNCTIONS +
-                      [ ("list",           ["ctx", "domid", "t list"]),
-                        ("of_devid",       ["ctx", "domid", "int", "t"]),
+    "device_disk":    DEVICE_FUNCTIONS + DEVICE_LIST +
+                      [ ("insert",         ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
+                        ("of_vdev",        ["ctx", "domid", "string", "t"]),
+                      ],
+    "device_nic":     DEVICE_FUNCTIONS + DEVICE_LIST +
+                      [ ("of_devid",       ["ctx", "domid", "int", "t"]),
                       ],
-    "device_pci":     DEVICE_FUNCTIONS +
-                      [ ("list",              ["ctx", "domid", "t list"]),
-                        ("assignable_add",    ["ctx", "t", "bool", "unit"]),
+    "device_pci":     DEVICE_FUNCTIONS + DEVICE_LIST +
+                      [ ("assignable_add",    ["ctx", "t", "bool", "unit"]),
                         ("assignable_remove", ["ctx", "t", "bool", "unit"]),
                         ("assignable_list",   ["ctx", "t list"]),
                       ],
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 1a0fab3..46642a6 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -404,7 +404,7 @@ void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
 #define _STRINGIFY(x) #x
 #define STRINGIFY(x) _STRINGIFY(x)
 
-#define _DEVICE_ADDREMOVE(type,op)					\
+#define _DEVICE_ADDREMOVE(type,fn,op)					\
 value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
 	value async, value unit)					\
 {									\
@@ -424,7 +424,7 @@ value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
 		ao_how.u.for_callback = (void *) p;			\
 	}								\
 									\
-	ret = libxl_device_##type##_##op(CTX, Int_val(domid), &c_info,	\
+	ret = libxl_##fn##_##op(CTX, Int_val(domid), &c_info,		\
 		async != Val_none ? &ao_how : NULL);			\
 									\
 	libxl_device_##type##_dispose(&c_info);				\
@@ -436,15 +436,16 @@ value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
 }
 
 #define DEVICE_ADDREMOVE(type) \
-	_DEVICE_ADDREMOVE(type, add) \
- 	_DEVICE_ADDREMOVE(type, remove) \
- 	_DEVICE_ADDREMOVE(type, destroy)
+	_DEVICE_ADDREMOVE(type, device_##type, add) \
+	_DEVICE_ADDREMOVE(type, device_##type, remove) \
+	_DEVICE_ADDREMOVE(type, device_##type, destroy)
 
 DEVICE_ADDREMOVE(disk)
 DEVICE_ADDREMOVE(nic)
 DEVICE_ADDREMOVE(vfb)
 DEVICE_ADDREMOVE(vkb)
 DEVICE_ADDREMOVE(pci)
+_DEVICE_ADDREMOVE(disk, cdrom, insert)
 
 value stub_xl_device_nic_of_devid(value ctx, value domid, value devid)
 {
@@ -485,6 +486,45 @@ value stub_xl_device_nic_list(value ctx, value domid)
 	CAMLreturn(list);
 }
 
+value stub_xl_device_disk_list(value ctx, value domid)
+{
+	CAMLparam2(ctx, domid);
+	CAMLlocal2(list, temp);
+	libxl_device_disk *c_list;
+	int i, nb;
+	uint32_t c_domid;
+
+	c_domid = Int_val(domid);
+
+	c_list = libxl_device_disk_list(CTX, c_domid, &nb);
+	if (!c_list)
+		failwith_xl(ERROR_FAIL, "disk_list");
+
+	list = temp = Val_emptylist;
+	for (i = 0; i < nb; i++) {
+		list = caml_alloc_small(2, Tag_cons);
+		Field(list, 0) = Val_int(0);
+		Field(list, 1) = temp;
+		temp = list;
+		Store_field(list, 0, Val_device_disk(&c_list[i]));
+		libxl_device_disk_dispose(&c_list[i]);
+	}
+	free(c_list);
+
+	CAMLreturn(list);
+}
+
+value stub_xl_device_disk_of_vdev(value ctx, value domid, value vdev)
+{
+	CAMLparam3(ctx, domid, vdev);
+	CAMLlocal1(disk);
+	libxl_device_disk c_disk;
+	libxl_vdev_to_device_disk(CTX, Int_val(domid), String_val(vdev), &c_disk);
+	disk = Val_device_disk(&c_disk);
+	libxl_device_disk_dispose(&c_disk);
+	CAMLreturn(disk);
+}
+
 value stub_xl_device_pci_list(value ctx, value domid)
 {
 	CAMLparam2(ctx, domid);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:23:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:23: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 1VrO1x-0003YZ-67; Fri, 13 Dec 2013 08:23: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 1VrO1v-0003YI-JI
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:27 +0000
Received: from [85.158.139.211:37871] by server-14.bemta-5.messagelabs.com id
	EA/5A-24200-EF3CAA25; Fri, 13 Dec 2013 08:23:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1386923005!4226150!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11102 invoked from network); 13 Dec 2013 08:23:26 -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;
	13 Dec 2013 08:23: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 1VrO1s-0001Zf-RL
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO1s-0005tN-PP
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:24 +0000
Date: Fri, 13 Dec 2013 08:23:24 +0000
Message-Id: <E1VrO1s-0005tN-PP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: add disk and cdrom
	helper functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8f906e4e883d676b3193df026da76775e26a6c0b
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:29 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:50 2013 +0000

    libxl: ocaml: add disk and cdrom helper functions
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xl/genwrap.py       |   17 +++++++-----
 tools/ocaml/libs/xl/xenlight_stubs.c |   50 ++++++++++++++++++++++++++++++---
 2 files changed, 55 insertions(+), 12 deletions(-)

diff --git a/tools/ocaml/libs/xl/genwrap.py b/tools/ocaml/libs/xl/genwrap.py
index dd43069..5e43831 100644
--- a/tools/ocaml/libs/xl/genwrap.py
+++ b/tools/ocaml/libs/xl/genwrap.py
@@ -26,18 +26,21 @@ DEVICE_FUNCTIONS = [ ("add",            ["ctx", "t", "domid", "?async:'a", "unit
                      ("remove",         ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
                      ("destroy",        ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
                    ]
+DEVICE_LIST =      [ ("list",           ["ctx", "domid", "t list"]),
+                   ]
 
 functions = { # ( name , [type1,type2,....] )
     "device_vfb":     DEVICE_FUNCTIONS,
     "device_vkb":     DEVICE_FUNCTIONS,
-    "device_disk":    DEVICE_FUNCTIONS,
-    "device_nic":     DEVICE_FUNCTIONS +
-                      [ ("list",           ["ctx", "domid", "t list"]),
-                        ("of_devid",       ["ctx", "domid", "int", "t"]),
+    "device_disk":    DEVICE_FUNCTIONS + DEVICE_LIST +
+                      [ ("insert",         ["ctx", "t", "domid", "?async:'a", "unit", "unit"]),
+                        ("of_vdev",        ["ctx", "domid", "string", "t"]),
+                      ],
+    "device_nic":     DEVICE_FUNCTIONS + DEVICE_LIST +
+                      [ ("of_devid",       ["ctx", "domid", "int", "t"]),
                       ],
-    "device_pci":     DEVICE_FUNCTIONS +
-                      [ ("list",              ["ctx", "domid", "t list"]),
-                        ("assignable_add",    ["ctx", "t", "bool", "unit"]),
+    "device_pci":     DEVICE_FUNCTIONS + DEVICE_LIST +
+                      [ ("assignable_add",    ["ctx", "t", "bool", "unit"]),
                         ("assignable_remove", ["ctx", "t", "bool", "unit"]),
                         ("assignable_list",   ["ctx", "t list"]),
                       ],
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 1a0fab3..46642a6 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -404,7 +404,7 @@ void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
 #define _STRINGIFY(x) #x
 #define STRINGIFY(x) _STRINGIFY(x)
 
-#define _DEVICE_ADDREMOVE(type,op)					\
+#define _DEVICE_ADDREMOVE(type,fn,op)					\
 value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
 	value async, value unit)					\
 {									\
@@ -424,7 +424,7 @@ value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
 		ao_how.u.for_callback = (void *) p;			\
 	}								\
 									\
-	ret = libxl_device_##type##_##op(CTX, Int_val(domid), &c_info,	\
+	ret = libxl_##fn##_##op(CTX, Int_val(domid), &c_info,		\
 		async != Val_none ? &ao_how : NULL);			\
 									\
 	libxl_device_##type##_dispose(&c_info);				\
@@ -436,15 +436,16 @@ value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
 }
 
 #define DEVICE_ADDREMOVE(type) \
-	_DEVICE_ADDREMOVE(type, add) \
- 	_DEVICE_ADDREMOVE(type, remove) \
- 	_DEVICE_ADDREMOVE(type, destroy)
+	_DEVICE_ADDREMOVE(type, device_##type, add) \
+	_DEVICE_ADDREMOVE(type, device_##type, remove) \
+	_DEVICE_ADDREMOVE(type, device_##type, destroy)
 
 DEVICE_ADDREMOVE(disk)
 DEVICE_ADDREMOVE(nic)
 DEVICE_ADDREMOVE(vfb)
 DEVICE_ADDREMOVE(vkb)
 DEVICE_ADDREMOVE(pci)
+_DEVICE_ADDREMOVE(disk, cdrom, insert)
 
 value stub_xl_device_nic_of_devid(value ctx, value domid, value devid)
 {
@@ -485,6 +486,45 @@ value stub_xl_device_nic_list(value ctx, value domid)
 	CAMLreturn(list);
 }
 
+value stub_xl_device_disk_list(value ctx, value domid)
+{
+	CAMLparam2(ctx, domid);
+	CAMLlocal2(list, temp);
+	libxl_device_disk *c_list;
+	int i, nb;
+	uint32_t c_domid;
+
+	c_domid = Int_val(domid);
+
+	c_list = libxl_device_disk_list(CTX, c_domid, &nb);
+	if (!c_list)
+		failwith_xl(ERROR_FAIL, "disk_list");
+
+	list = temp = Val_emptylist;
+	for (i = 0; i < nb; i++) {
+		list = caml_alloc_small(2, Tag_cons);
+		Field(list, 0) = Val_int(0);
+		Field(list, 1) = temp;
+		temp = list;
+		Store_field(list, 0, Val_device_disk(&c_list[i]));
+		libxl_device_disk_dispose(&c_list[i]);
+	}
+	free(c_list);
+
+	CAMLreturn(list);
+}
+
+value stub_xl_device_disk_of_vdev(value ctx, value domid, value vdev)
+{
+	CAMLparam3(ctx, domid, vdev);
+	CAMLlocal1(disk);
+	libxl_device_disk c_disk;
+	libxl_vdev_to_device_disk(CTX, Int_val(domid), String_val(vdev), &c_disk);
+	disk = Val_device_disk(&c_disk);
+	libxl_device_disk_dispose(&c_disk);
+	CAMLreturn(disk);
+}
+
 value stub_xl_device_pci_list(value ctx, value domid)
 {
 	CAMLparam2(ctx, domid);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:23:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:23: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 1VrO27-0003an-BM; Fri, 13 Dec 2013 08:23: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 1VrO25-0003aU-Pu
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:38 +0000
Received: from [85.158.143.35:16956] by server-2.bemta-4.messagelabs.com id
	9E/F6-11386-904CAA25; Fri, 13 Dec 2013 08:23:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386923015!5489942!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26649 invoked from network); 13 Dec 2013 08:23:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:23: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 1VrO22-0001Zn-Uz
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO22-0005tn-U5
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:34 +0000
Date: Fri, 13 Dec 2013 08:23:34 +0000
Message-Id: <E1VrO22-0005tn-U5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: add VM lifecycle
	operations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 78e2e6b59134aa6826abebea5dd2a05dae63532c
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:50 2013 +0000

    libxl: ocaml: add VM lifecycle operations
    
    Also:
    * Reorganise toplevel OCaml functions into modules of Xenlight.
    * Factor out the management of ao_how into the function aohow_val. The ao_how
      is now malloc'ed, just to make this function a little easier to use.
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
---
 tools/ocaml/libs/xl/xenlight.ml.in   |   21 ++++-
 tools/ocaml/libs/xl/xenlight.mli.in  |   21 ++++-
 tools/ocaml/libs/xl/xenlight_stubs.c |  173 ++++++++++++++++++++++++++++++++--
 tools/ocaml/test/send_debug_keys.ml  |    2 +-
 4 files changed, 200 insertions(+), 17 deletions(-)

diff --git a/tools/ocaml/libs/xl/xenlight.ml.in b/tools/ocaml/libs/xl/xenlight.ml.in
index 46106b5..fc05112 100644
--- a/tools/ocaml/libs/xl/xenlight.ml.in
+++ b/tools/ocaml/libs/xl/xenlight.ml.in
@@ -33,9 +33,24 @@ type event =
 	| POLLHUP (* Device has been disconnected (revents only) *)
 	| POLLNVAL (* Invalid request: fd not open (revents only). *)
 
-external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
-external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
-external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
+module Domain = struct
+	external create_new : ctx -> Domain_config.t -> ?async:'a -> unit -> domid = "stub_libxl_domain_create_new"
+	external create_restore : ctx -> Domain_config.t -> (Unix.file_descr * Domain_restore_params.t) ->
+		?async:'a -> unit -> domid = "stub_libxl_domain_create_restore"
+	external shutdown : ctx -> domid -> unit = "stub_libxl_domain_shutdown"
+	external reboot : ctx -> domid -> unit = "stub_libxl_domain_reboot"
+	external destroy : ctx -> domid -> ?async:'a -> unit -> unit = "stub_libxl_domain_destroy"
+	external suspend : ctx -> domid -> Unix.file_descr -> ?async:'a -> unit -> unit = "stub_libxl_domain_suspend"
+	external pause : ctx -> domid -> unit = "stub_libxl_domain_pause"
+	external unpause : ctx -> domid -> unit = "stub_libxl_domain_unpause"
+
+	external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
+	external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
+end
+
+module Host = struct
+	external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
+end
 
 module Async = struct
 	type for_libxl
diff --git a/tools/ocaml/libs/xl/xenlight.mli.in b/tools/ocaml/libs/xl/xenlight.mli.in
index 170e0e0..ee4efd8 100644
--- a/tools/ocaml/libs/xl/xenlight.mli.in
+++ b/tools/ocaml/libs/xl/xenlight.mli.in
@@ -35,9 +35,24 @@ type event =
 	| POLLHUP (* Device has been disconnected (revents only) *)
 	| POLLNVAL (* Invalid request: fd not open (revents only). *)
 
-external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
-external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
-external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
+module Domain : sig
+	external create_new : ctx -> Domain_config.t -> ?async:'a -> unit -> domid = "stub_libxl_domain_create_new"
+	external create_restore : ctx -> Domain_config.t -> (Unix.file_descr * Domain_restore_params.t) ->
+		?async:'a -> unit -> domid = "stub_libxl_domain_create_restore"
+	external shutdown : ctx -> domid -> unit = "stub_libxl_domain_shutdown"
+	external reboot : ctx -> domid -> unit = "stub_libxl_domain_reboot"
+	external destroy : ctx -> domid -> ?async:'a -> unit -> unit = "stub_libxl_domain_destroy"
+	external suspend : ctx -> domid -> Unix.file_descr -> ?async:'a -> unit -> unit = "stub_libxl_domain_suspend"
+	external pause : ctx -> domid -> unit = "stub_libxl_domain_pause"
+	external unpause : ctx -> domid -> unit = "stub_libxl_domain_unpause"
+
+	external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
+	external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
+end
+
+module Host : sig
+	external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
+end
 
 module Async : sig
 	type for_libxl
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 46642a6..6297c2f 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -401,6 +401,168 @@ void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
 	free(p);
 }
 
+static libxl_asyncop_how *aohow_val(value async, libxl_asyncop_how *ao_how)
+{
+	CAMLparam1(async);
+	value *p;
+
+	if (async != Val_none) {
+		/* for_callback must be a pointer to a "value" that is malloc'ed and
+		 * registered with the OCaml GC. This ensures that the GC does not remove
+		 * the corresponding OCaml heap blocks, and allows the GC to update the value
+		 * when blocks are moved around, while libxl is free to copy the pointer if
+		 * it needs to.
+		 * The for_callback pointer must always be non-NULL. */
+		p = malloc(sizeof(value));
+		if (!p)
+			failwith_xl(ERROR_NOMEM, "cannot allocate value");
+		*p = Some_val(async);
+		caml_register_global_root(p);
+		ao_how->callback = async_callback;
+		ao_how->u.for_callback = (void *) p;
+		CAMLreturnT(libxl_asyncop_how *, ao_how);
+	}
+	else
+		CAMLreturnT(libxl_asyncop_how *, NULL);
+}
+
+value stub_libxl_domain_create_new(value ctx, value domain_config, value async, value unit)
+{
+	CAMLparam4(ctx, async, domain_config, unit);
+	int ret;
+	libxl_domain_config c_dconfig;
+	uint32_t c_domid;
+	libxl_asyncop_how ao_how;
+
+	libxl_domain_config_init(&c_dconfig);
+	ret = domain_config_val(CTX, &c_dconfig, domain_config);
+	if (ret != 0) {
+		libxl_domain_config_dispose(&c_dconfig);
+		failwith_xl(ret, "domain_create_new");
+	}
+
+	ret = libxl_domain_create_new(CTX, &c_dconfig, &c_domid,
+		aohow_val(async, &ao_how), NULL);
+
+	libxl_domain_config_dispose(&c_dconfig);
+
+	if (ret != 0)
+		failwith_xl(ret, "domain_create_new");
+
+	CAMLreturn(Val_int(c_domid));
+}
+
+value stub_libxl_domain_create_restore(value ctx, value domain_config, value params,
+	value async, value unit)
+{
+	CAMLparam5(ctx, domain_config, params, async, unit);
+	int ret;
+	libxl_domain_config c_dconfig;
+	libxl_domain_restore_params c_params;
+	uint32_t c_domid;
+	libxl_asyncop_how ao_how;
+
+	libxl_domain_config_init(&c_dconfig);
+	ret = domain_config_val(CTX, &c_dconfig, domain_config);
+	if (ret != 0) {
+		libxl_domain_config_dispose(&c_dconfig);
+		failwith_xl(ret, "domain_create_restore");
+	}
+
+	libxl_domain_restore_params_init(&c_params);
+	ret = domain_restore_params_val(CTX, &c_params, Field(params, 1));
+	if (ret != 0) {
+		libxl_domain_restore_params_dispose(&c_params);
+		failwith_xl(ret, "domain_create_restore");
+	}
+
+	ret = libxl_domain_create_restore(CTX, &c_dconfig, &c_domid, Int_val(Field(params, 0)),
+		&c_params, aohow_val(async, &ao_how), NULL);
+
+	libxl_domain_config_dispose(&c_dconfig);
+	libxl_domain_restore_params_dispose(&c_params);
+
+	if (ret != 0)
+		failwith_xl(ret, "domain_create_restore");
+
+	CAMLreturn(Val_int(c_domid));
+}
+
+value stub_libxl_domain_shutdown(value ctx, value domid)
+{
+	CAMLparam2(ctx, domid);
+	int ret;
+
+	ret = libxl_domain_shutdown(CTX, Int_val(domid));
+	if (ret != 0)
+		failwith_xl(ret, "domain_shutdown");
+
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_domain_reboot(value ctx, value domid)
+{
+	CAMLparam2(ctx, domid);
+	int ret;
+
+	ret = libxl_domain_reboot(CTX, Int_val(domid));
+	if (ret != 0)
+		failwith_xl(ret, "domain_reboot");
+
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_domain_destroy(value ctx, value domid, value async, value unit)
+{
+	CAMLparam4(ctx, domid, async, unit);
+	int ret;
+	libxl_asyncop_how ao_how;
+
+	ret = libxl_domain_destroy(CTX, Int_val(domid), aohow_val(async, &ao_how));
+	if (ret != 0)
+		failwith_xl(ret, "domain_destroy");
+
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_domain_suspend(value ctx, value domid, value fd, value async, value unit)
+{
+	CAMLparam5(ctx, domid, fd, async, unit);
+	int ret;
+	libxl_asyncop_how ao_how;
+
+	ret = libxl_domain_suspend(CTX, Int_val(domid), Int_val(fd), 0,
+		aohow_val(async, &ao_how));
+	if (ret != 0)
+		failwith_xl(ret, "domain_suspend");
+
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_domain_pause(value ctx, value domid)
+{
+	CAMLparam2(ctx, domid);
+	int ret;
+
+	ret = libxl_domain_pause(CTX, Int_val(domid));
+	if (ret != 0)
+		failwith_xl(ret, "domain_pause");
+
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_domain_unpause(value ctx, value domid)
+{
+	CAMLparam2(ctx, domid);
+	int ret;
+
+	ret = libxl_domain_unpause(CTX, Int_val(domid));
+	if (ret != 0)
+		failwith_xl(ret, "domain_unpause");
+
+	CAMLreturn(Val_unit);
+}
+
 #define _STRINGIFY(x) #x
 #define STRINGIFY(x) _STRINGIFY(x)
 
@@ -412,20 +574,11 @@ value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
 	libxl_device_##type c_info;					\
 	int ret, marker_var;						\
 	libxl_asyncop_how ao_how;					\
-	value *p;							\
 									\
 	device_##type##_val(CTX, &c_info, info);			\
 									\
-	if (async != Val_none) {					\
-		p = malloc(sizeof(value));				\
-		*p = Some_val(async);					\
-		caml_register_global_root(p);				\
-		ao_how.callback = async_callback;			\
-		ao_how.u.for_callback = (void *) p;			\
-	}								\
-									\
 	ret = libxl_##fn##_##op(CTX, Int_val(domid), &c_info,		\
-		async != Val_none ? &ao_how : NULL);			\
+		aohow_val(async, &ao_how));				\
 									\
 	libxl_device_##type##_dispose(&c_info);				\
 									\
diff --git a/tools/ocaml/test/send_debug_keys.ml b/tools/ocaml/test/send_debug_keys.ml
index 5900cf9..0a42c3a 100644
--- a/tools/ocaml/test/send_debug_keys.ml
+++ b/tools/ocaml/test/send_debug_keys.ml
@@ -4,7 +4,7 @@ open Xenlight
 
 let send_keys ctx s =
   printf "Sending debug key %s\n" s;
-  Xenlight.send_debug_keys ctx s;
+  Xenlight.Host.send_debug_keys ctx s;
   ()
   
 let _ =
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:23:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:23: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 1VrO27-0003an-BM; Fri, 13 Dec 2013 08:23: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 1VrO25-0003aU-Pu
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:38 +0000
Received: from [85.158.143.35:16956] by server-2.bemta-4.messagelabs.com id
	9E/F6-11386-904CAA25; Fri, 13 Dec 2013 08:23:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1386923015!5489942!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26649 invoked from network); 13 Dec 2013 08:23:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:23: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 1VrO22-0001Zn-Uz
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO22-0005tn-U5
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:34 +0000
Date: Fri, 13 Dec 2013 08:23:34 +0000
Message-Id: <E1VrO22-0005tn-U5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: add VM lifecycle
	operations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 78e2e6b59134aa6826abebea5dd2a05dae63532c
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:50 2013 +0000

    libxl: ocaml: add VM lifecycle operations
    
    Also:
    * Reorganise toplevel OCaml functions into modules of Xenlight.
    * Factor out the management of ao_how into the function aohow_val. The ao_how
      is now malloc'ed, just to make this function a little easier to use.
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
---
 tools/ocaml/libs/xl/xenlight.ml.in   |   21 ++++-
 tools/ocaml/libs/xl/xenlight.mli.in  |   21 ++++-
 tools/ocaml/libs/xl/xenlight_stubs.c |  173 ++++++++++++++++++++++++++++++++--
 tools/ocaml/test/send_debug_keys.ml  |    2 +-
 4 files changed, 200 insertions(+), 17 deletions(-)

diff --git a/tools/ocaml/libs/xl/xenlight.ml.in b/tools/ocaml/libs/xl/xenlight.ml.in
index 46106b5..fc05112 100644
--- a/tools/ocaml/libs/xl/xenlight.ml.in
+++ b/tools/ocaml/libs/xl/xenlight.ml.in
@@ -33,9 +33,24 @@ type event =
 	| POLLHUP (* Device has been disconnected (revents only) *)
 	| POLLNVAL (* Invalid request: fd not open (revents only). *)
 
-external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
-external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
-external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
+module Domain = struct
+	external create_new : ctx -> Domain_config.t -> ?async:'a -> unit -> domid = "stub_libxl_domain_create_new"
+	external create_restore : ctx -> Domain_config.t -> (Unix.file_descr * Domain_restore_params.t) ->
+		?async:'a -> unit -> domid = "stub_libxl_domain_create_restore"
+	external shutdown : ctx -> domid -> unit = "stub_libxl_domain_shutdown"
+	external reboot : ctx -> domid -> unit = "stub_libxl_domain_reboot"
+	external destroy : ctx -> domid -> ?async:'a -> unit -> unit = "stub_libxl_domain_destroy"
+	external suspend : ctx -> domid -> Unix.file_descr -> ?async:'a -> unit -> unit = "stub_libxl_domain_suspend"
+	external pause : ctx -> domid -> unit = "stub_libxl_domain_pause"
+	external unpause : ctx -> domid -> unit = "stub_libxl_domain_unpause"
+
+	external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
+	external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
+end
+
+module Host = struct
+	external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
+end
 
 module Async = struct
 	type for_libxl
diff --git a/tools/ocaml/libs/xl/xenlight.mli.in b/tools/ocaml/libs/xl/xenlight.mli.in
index 170e0e0..ee4efd8 100644
--- a/tools/ocaml/libs/xl/xenlight.mli.in
+++ b/tools/ocaml/libs/xl/xenlight.mli.in
@@ -35,9 +35,24 @@ type event =
 	| POLLHUP (* Device has been disconnected (revents only) *)
 	| POLLNVAL (* Invalid request: fd not open (revents only). *)
 
-external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
-external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
-external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
+module Domain : sig
+	external create_new : ctx -> Domain_config.t -> ?async:'a -> unit -> domid = "stub_libxl_domain_create_new"
+	external create_restore : ctx -> Domain_config.t -> (Unix.file_descr * Domain_restore_params.t) ->
+		?async:'a -> unit -> domid = "stub_libxl_domain_create_restore"
+	external shutdown : ctx -> domid -> unit = "stub_libxl_domain_shutdown"
+	external reboot : ctx -> domid -> unit = "stub_libxl_domain_reboot"
+	external destroy : ctx -> domid -> ?async:'a -> unit -> unit = "stub_libxl_domain_destroy"
+	external suspend : ctx -> domid -> Unix.file_descr -> ?async:'a -> unit -> unit = "stub_libxl_domain_suspend"
+	external pause : ctx -> domid -> unit = "stub_libxl_domain_pause"
+	external unpause : ctx -> domid -> unit = "stub_libxl_domain_unpause"
+
+	external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
+	external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
+end
+
+module Host : sig
+	external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
+end
 
 module Async : sig
 	type for_libxl
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 46642a6..6297c2f 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -401,6 +401,168 @@ void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
 	free(p);
 }
 
+static libxl_asyncop_how *aohow_val(value async, libxl_asyncop_how *ao_how)
+{
+	CAMLparam1(async);
+	value *p;
+
+	if (async != Val_none) {
+		/* for_callback must be a pointer to a "value" that is malloc'ed and
+		 * registered with the OCaml GC. This ensures that the GC does not remove
+		 * the corresponding OCaml heap blocks, and allows the GC to update the value
+		 * when blocks are moved around, while libxl is free to copy the pointer if
+		 * it needs to.
+		 * The for_callback pointer must always be non-NULL. */
+		p = malloc(sizeof(value));
+		if (!p)
+			failwith_xl(ERROR_NOMEM, "cannot allocate value");
+		*p = Some_val(async);
+		caml_register_global_root(p);
+		ao_how->callback = async_callback;
+		ao_how->u.for_callback = (void *) p;
+		CAMLreturnT(libxl_asyncop_how *, ao_how);
+	}
+	else
+		CAMLreturnT(libxl_asyncop_how *, NULL);
+}
+
+value stub_libxl_domain_create_new(value ctx, value domain_config, value async, value unit)
+{
+	CAMLparam4(ctx, async, domain_config, unit);
+	int ret;
+	libxl_domain_config c_dconfig;
+	uint32_t c_domid;
+	libxl_asyncop_how ao_how;
+
+	libxl_domain_config_init(&c_dconfig);
+	ret = domain_config_val(CTX, &c_dconfig, domain_config);
+	if (ret != 0) {
+		libxl_domain_config_dispose(&c_dconfig);
+		failwith_xl(ret, "domain_create_new");
+	}
+
+	ret = libxl_domain_create_new(CTX, &c_dconfig, &c_domid,
+		aohow_val(async, &ao_how), NULL);
+
+	libxl_domain_config_dispose(&c_dconfig);
+
+	if (ret != 0)
+		failwith_xl(ret, "domain_create_new");
+
+	CAMLreturn(Val_int(c_domid));
+}
+
+value stub_libxl_domain_create_restore(value ctx, value domain_config, value params,
+	value async, value unit)
+{
+	CAMLparam5(ctx, domain_config, params, async, unit);
+	int ret;
+	libxl_domain_config c_dconfig;
+	libxl_domain_restore_params c_params;
+	uint32_t c_domid;
+	libxl_asyncop_how ao_how;
+
+	libxl_domain_config_init(&c_dconfig);
+	ret = domain_config_val(CTX, &c_dconfig, domain_config);
+	if (ret != 0) {
+		libxl_domain_config_dispose(&c_dconfig);
+		failwith_xl(ret, "domain_create_restore");
+	}
+
+	libxl_domain_restore_params_init(&c_params);
+	ret = domain_restore_params_val(CTX, &c_params, Field(params, 1));
+	if (ret != 0) {
+		libxl_domain_restore_params_dispose(&c_params);
+		failwith_xl(ret, "domain_create_restore");
+	}
+
+	ret = libxl_domain_create_restore(CTX, &c_dconfig, &c_domid, Int_val(Field(params, 0)),
+		&c_params, aohow_val(async, &ao_how), NULL);
+
+	libxl_domain_config_dispose(&c_dconfig);
+	libxl_domain_restore_params_dispose(&c_params);
+
+	if (ret != 0)
+		failwith_xl(ret, "domain_create_restore");
+
+	CAMLreturn(Val_int(c_domid));
+}
+
+value stub_libxl_domain_shutdown(value ctx, value domid)
+{
+	CAMLparam2(ctx, domid);
+	int ret;
+
+	ret = libxl_domain_shutdown(CTX, Int_val(domid));
+	if (ret != 0)
+		failwith_xl(ret, "domain_shutdown");
+
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_domain_reboot(value ctx, value domid)
+{
+	CAMLparam2(ctx, domid);
+	int ret;
+
+	ret = libxl_domain_reboot(CTX, Int_val(domid));
+	if (ret != 0)
+		failwith_xl(ret, "domain_reboot");
+
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_domain_destroy(value ctx, value domid, value async, value unit)
+{
+	CAMLparam4(ctx, domid, async, unit);
+	int ret;
+	libxl_asyncop_how ao_how;
+
+	ret = libxl_domain_destroy(CTX, Int_val(domid), aohow_val(async, &ao_how));
+	if (ret != 0)
+		failwith_xl(ret, "domain_destroy");
+
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_domain_suspend(value ctx, value domid, value fd, value async, value unit)
+{
+	CAMLparam5(ctx, domid, fd, async, unit);
+	int ret;
+	libxl_asyncop_how ao_how;
+
+	ret = libxl_domain_suspend(CTX, Int_val(domid), Int_val(fd), 0,
+		aohow_val(async, &ao_how));
+	if (ret != 0)
+		failwith_xl(ret, "domain_suspend");
+
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_domain_pause(value ctx, value domid)
+{
+	CAMLparam2(ctx, domid);
+	int ret;
+
+	ret = libxl_domain_pause(CTX, Int_val(domid));
+	if (ret != 0)
+		failwith_xl(ret, "domain_pause");
+
+	CAMLreturn(Val_unit);
+}
+
+value stub_libxl_domain_unpause(value ctx, value domid)
+{
+	CAMLparam2(ctx, domid);
+	int ret;
+
+	ret = libxl_domain_unpause(CTX, Int_val(domid));
+	if (ret != 0)
+		failwith_xl(ret, "domain_unpause");
+
+	CAMLreturn(Val_unit);
+}
+
 #define _STRINGIFY(x) #x
 #define STRINGIFY(x) _STRINGIFY(x)
 
@@ -412,20 +574,11 @@ value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
 	libxl_device_##type c_info;					\
 	int ret, marker_var;						\
 	libxl_asyncop_how ao_how;					\
-	value *p;							\
 									\
 	device_##type##_val(CTX, &c_info, info);			\
 									\
-	if (async != Val_none) {					\
-		p = malloc(sizeof(value));				\
-		*p = Some_val(async);					\
-		caml_register_global_root(p);				\
-		ao_how.callback = async_callback;			\
-		ao_how.u.for_callback = (void *) p;			\
-	}								\
-									\
 	ret = libxl_##fn##_##op(CTX, Int_val(domid), &c_info,		\
-		async != Val_none ? &ao_how : NULL);			\
+		aohow_val(async, &ao_how));				\
 									\
 	libxl_device_##type##_dispose(&c_info);				\
 									\
diff --git a/tools/ocaml/test/send_debug_keys.ml b/tools/ocaml/test/send_debug_keys.ml
index 5900cf9..0a42c3a 100644
--- a/tools/ocaml/test/send_debug_keys.ml
+++ b/tools/ocaml/test/send_debug_keys.ml
@@ -4,7 +4,7 @@ open Xenlight
 
 let send_keys ctx s =
   printf "Sending debug key %s\n" s;
-  Xenlight.send_debug_keys ctx s;
+  Xenlight.Host.send_debug_keys ctx s;
   ()
   
 let _ =
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:23:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:23: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 1VrO2I-0003cw-Eq; Fri, 13 Dec 2013 08:23:50 +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 1VrO2G-0003cS-6C
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:49 +0000
Received: from [85.158.137.68:3201] by server-11.bemta-3.messagelabs.com id
	59/C0-19379-314CAA25; Fri, 13 Dec 2013 08:23:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1386923025!3689848!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29297 invoked from network); 13 Dec 2013 08:23:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:23: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 1VrO2D-0001Zt-3Y
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO2D-0005us-1b
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:45 +0000
Date: Fri, 13 Dec 2013 08:23:45 +0000
Message-Id: <E1VrO2D-0005us-1b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: add console reader
	functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b5007806a1fb10d2ea4e2916c07a0439b5a2bbf
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:31 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:50 2013 +0000

    libxl: ocaml: add console reader functions
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xl/xenlight.ml.in   |   10 ++++-
 tools/ocaml/libs/xl/xenlight.mli.in  |    7 +++
 tools/ocaml/libs/xl/xenlight_stubs.c |   68 ++++++++++++++++++++++++++++++++++
 tools/ocaml/test/Makefile            |   12 ++++-
 tools/ocaml/test/dmesg.ml            |   18 +++++++++
 5 files changed, 111 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/libs/xl/xenlight.ml.in b/tools/ocaml/libs/xl/xenlight.ml.in
index fc05112..47f3487 100644
--- a/tools/ocaml/libs/xl/xenlight.ml.in
+++ b/tools/ocaml/libs/xl/xenlight.ml.in
@@ -49,6 +49,13 @@ module Domain = struct
 end
 
 module Host = struct
+	type console_reader
+	exception End_of_file
+
+	external xen_console_read_start : ctx -> int -> console_reader  = "stub_libxl_xen_console_read_start"
+	external xen_console_read_line : ctx -> console_reader -> string = "stub_libxl_xen_console_read_line"
+	external xen_console_read_finish : ctx -> console_reader -> unit = "stub_libxl_xen_console_read_finish"
+
 	external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 end
 
@@ -82,5 +89,6 @@ module Async = struct
 end
 
 let register_exceptions () =
-	Callback.register_exception "Xenlight.Error" (Error(ERROR_FAIL, ""))
+	Callback.register_exception "Xenlight.Error" (Error(ERROR_FAIL, ""));
+	Callback.register_exception "Xenlight.Host.End_of_file" (Host.End_of_file)
 
diff --git a/tools/ocaml/libs/xl/xenlight.mli.in b/tools/ocaml/libs/xl/xenlight.mli.in
index ee4efd8..794dbf1 100644
--- a/tools/ocaml/libs/xl/xenlight.mli.in
+++ b/tools/ocaml/libs/xl/xenlight.mli.in
@@ -51,6 +51,13 @@ module Domain : sig
 end
 
 module Host : sig
+	type console_reader
+	exception End_of_file
+
+	external xen_console_read_start : ctx -> int -> console_reader  = "stub_libxl_xen_console_read_start"
+	external xen_console_read_line : ctx -> console_reader -> string = "stub_libxl_xen_console_read_line"
+	external xen_console_read_finish : ctx -> console_reader -> unit = "stub_libxl_xen_console_read_finish"
+
 	external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 end
 
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 6297c2f..1d299ba 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -939,6 +939,74 @@ value stub_xl_send_debug_keys(value ctx, value keys)
 	CAMLreturn(Val_unit);
 }
 
+static struct custom_operations libxl_console_reader_custom_operations = {
+	"libxl_console_reader_custom_operations",
+	custom_finalize_default,
+	custom_compare_default,
+	custom_hash_default,
+	custom_serialize_default,
+	custom_deserialize_default
+};
+
+#define Console_reader_val(x)(*((libxl_xen_console_reader **) Data_custom_val(x)))
+
+value stub_libxl_xen_console_read_start(value ctx, value clear)
+{
+	CAMLparam2(ctx, clear);
+	CAMLlocal1(handle);
+	libxl_xen_console_reader *cr;
+
+	cr = libxl_xen_console_read_start(CTX, Int_val(clear));
+
+	handle = caml_alloc_custom(&libxl_console_reader_custom_operations, sizeof(cr), 0, 1);
+	Console_reader_val(handle) = cr;
+
+	CAMLreturn(handle);
+}
+
+static void raise_eof(void)
+{
+	static value *exc = NULL;
+
+	/* First time around, lookup by name */
+	if (!exc)
+		exc = caml_named_value("Xenlight.Host.End_of_file");
+
+	if (!exc)
+		caml_invalid_argument("Exception Xenlight.Host.End_of_file not initialized, please link xenlight.cma");
+
+	caml_raise_constant(*exc);
+}
+
+value stub_libxl_xen_console_read_line(value ctx, value reader)
+{
+	CAMLparam2(ctx, reader);
+	CAMLlocal1(line);
+	int ret;
+	char *c_line;
+	libxl_xen_console_reader *cr = (libxl_xen_console_reader *) Console_reader_val(reader);
+
+	ret = libxl_xen_console_read_line(CTX, cr, &c_line);
+
+	if (ret < 0)
+		failwith_xl(ret, "xen_console_read_line");
+	if (ret == 0)
+		raise_eof();
+
+	line = caml_copy_string(c_line);
+
+	CAMLreturn(line);
+}
+
+value stub_libxl_xen_console_read_finish(value ctx, value reader)
+{
+	CAMLparam2(ctx, reader);
+	libxl_xen_console_reader *cr = (libxl_xen_console_reader *) Console_reader_val(reader);
+
+	libxl_xen_console_read_finish(CTX, cr);
+
+	CAMLreturn(Val_unit);
+}
 
 /* Event handling */
 
diff --git a/tools/ocaml/test/Makefile b/tools/ocaml/test/Makefile
index dfa6437..827bd7c 100644
--- a/tools/ocaml/test/Makefile
+++ b/tools/ocaml/test/Makefile
@@ -9,9 +9,9 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
 	-I $(OCAML_TOPLEVEL)/libs/xl
 
-OBJS = xtl send_debug_keys list_domains raise_exception
+OBJS = xtl send_debug_keys list_domains raise_exception dmesg
 
-PROGRAMS = xtl send_debug_keys list_domains raise_exception
+PROGRAMS = xtl send_debug_keys list_domains raise_exception dmesg
 
 xtl_LIBS =  \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
@@ -37,7 +37,13 @@ raise_exception_LIBS =  \
 
 raise_exception_OBJS = raise_exception
 
-OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception
+dmesg_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+dmesg_OBJS = xtl dmesg
+
+OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception dmesg
 
 all: $(PROGRAMS)
 
diff --git a/tools/ocaml/test/dmesg.ml b/tools/ocaml/test/dmesg.ml
new file mode 100644
index 0000000..864fac4
--- /dev/null
+++ b/tools/ocaml/test/dmesg.ml
@@ -0,0 +1,18 @@
+open Printf
+
+let _ =
+	Xenlight.register_exceptions ();
+	let logger = Xtl.create_stdio_logger ~level:Xentoollog.Debug () in
+	let ctx = Xenlight.ctx_alloc logger in
+
+	let open Xenlight.Host in
+	let reader = xen_console_read_start ctx 0 in
+	(try
+		while true do
+			let line = xen_console_read_line ctx reader in
+			print_string line
+		done
+	with End_of_file -> ());
+	let _ = xen_console_read_finish ctx reader in
+	()
+
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:23:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:23: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 1VrO2I-0003cw-Eq; Fri, 13 Dec 2013 08:23:50 +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 1VrO2G-0003cS-6C
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:49 +0000
Received: from [85.158.137.68:3201] by server-11.bemta-3.messagelabs.com id
	59/C0-19379-314CAA25; Fri, 13 Dec 2013 08:23:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1386923025!3689848!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29297 invoked from network); 13 Dec 2013 08:23:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:23: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 1VrO2D-0001Zt-3Y
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO2D-0005us-1b
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:45 +0000
Date: Fri, 13 Dec 2013 08:23:45 +0000
Message-Id: <E1VrO2D-0005us-1b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: add console reader
	functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b5007806a1fb10d2ea4e2916c07a0439b5a2bbf
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:31 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:50 2013 +0000

    libxl: ocaml: add console reader functions
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xl/xenlight.ml.in   |   10 ++++-
 tools/ocaml/libs/xl/xenlight.mli.in  |    7 +++
 tools/ocaml/libs/xl/xenlight_stubs.c |   68 ++++++++++++++++++++++++++++++++++
 tools/ocaml/test/Makefile            |   12 ++++-
 tools/ocaml/test/dmesg.ml            |   18 +++++++++
 5 files changed, 111 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/libs/xl/xenlight.ml.in b/tools/ocaml/libs/xl/xenlight.ml.in
index fc05112..47f3487 100644
--- a/tools/ocaml/libs/xl/xenlight.ml.in
+++ b/tools/ocaml/libs/xl/xenlight.ml.in
@@ -49,6 +49,13 @@ module Domain = struct
 end
 
 module Host = struct
+	type console_reader
+	exception End_of_file
+
+	external xen_console_read_start : ctx -> int -> console_reader  = "stub_libxl_xen_console_read_start"
+	external xen_console_read_line : ctx -> console_reader -> string = "stub_libxl_xen_console_read_line"
+	external xen_console_read_finish : ctx -> console_reader -> unit = "stub_libxl_xen_console_read_finish"
+
 	external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 end
 
@@ -82,5 +89,6 @@ module Async = struct
 end
 
 let register_exceptions () =
-	Callback.register_exception "Xenlight.Error" (Error(ERROR_FAIL, ""))
+	Callback.register_exception "Xenlight.Error" (Error(ERROR_FAIL, ""));
+	Callback.register_exception "Xenlight.Host.End_of_file" (Host.End_of_file)
 
diff --git a/tools/ocaml/libs/xl/xenlight.mli.in b/tools/ocaml/libs/xl/xenlight.mli.in
index ee4efd8..794dbf1 100644
--- a/tools/ocaml/libs/xl/xenlight.mli.in
+++ b/tools/ocaml/libs/xl/xenlight.mli.in
@@ -51,6 +51,13 @@ module Domain : sig
 end
 
 module Host : sig
+	type console_reader
+	exception End_of_file
+
+	external xen_console_read_start : ctx -> int -> console_reader  = "stub_libxl_xen_console_read_start"
+	external xen_console_read_line : ctx -> console_reader -> string = "stub_libxl_xen_console_read_line"
+	external xen_console_read_finish : ctx -> console_reader -> unit = "stub_libxl_xen_console_read_finish"
+
 	external send_debug_keys : ctx -> string -> unit = "stub_xl_send_debug_keys"
 end
 
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 6297c2f..1d299ba 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -939,6 +939,74 @@ value stub_xl_send_debug_keys(value ctx, value keys)
 	CAMLreturn(Val_unit);
 }
 
+static struct custom_operations libxl_console_reader_custom_operations = {
+	"libxl_console_reader_custom_operations",
+	custom_finalize_default,
+	custom_compare_default,
+	custom_hash_default,
+	custom_serialize_default,
+	custom_deserialize_default
+};
+
+#define Console_reader_val(x)(*((libxl_xen_console_reader **) Data_custom_val(x)))
+
+value stub_libxl_xen_console_read_start(value ctx, value clear)
+{
+	CAMLparam2(ctx, clear);
+	CAMLlocal1(handle);
+	libxl_xen_console_reader *cr;
+
+	cr = libxl_xen_console_read_start(CTX, Int_val(clear));
+
+	handle = caml_alloc_custom(&libxl_console_reader_custom_operations, sizeof(cr), 0, 1);
+	Console_reader_val(handle) = cr;
+
+	CAMLreturn(handle);
+}
+
+static void raise_eof(void)
+{
+	static value *exc = NULL;
+
+	/* First time around, lookup by name */
+	if (!exc)
+		exc = caml_named_value("Xenlight.Host.End_of_file");
+
+	if (!exc)
+		caml_invalid_argument("Exception Xenlight.Host.End_of_file not initialized, please link xenlight.cma");
+
+	caml_raise_constant(*exc);
+}
+
+value stub_libxl_xen_console_read_line(value ctx, value reader)
+{
+	CAMLparam2(ctx, reader);
+	CAMLlocal1(line);
+	int ret;
+	char *c_line;
+	libxl_xen_console_reader *cr = (libxl_xen_console_reader *) Console_reader_val(reader);
+
+	ret = libxl_xen_console_read_line(CTX, cr, &c_line);
+
+	if (ret < 0)
+		failwith_xl(ret, "xen_console_read_line");
+	if (ret == 0)
+		raise_eof();
+
+	line = caml_copy_string(c_line);
+
+	CAMLreturn(line);
+}
+
+value stub_libxl_xen_console_read_finish(value ctx, value reader)
+{
+	CAMLparam2(ctx, reader);
+	libxl_xen_console_reader *cr = (libxl_xen_console_reader *) Console_reader_val(reader);
+
+	libxl_xen_console_read_finish(CTX, cr);
+
+	CAMLreturn(Val_unit);
+}
 
 /* Event handling */
 
diff --git a/tools/ocaml/test/Makefile b/tools/ocaml/test/Makefile
index dfa6437..827bd7c 100644
--- a/tools/ocaml/test/Makefile
+++ b/tools/ocaml/test/Makefile
@@ -9,9 +9,9 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xentoollog \
 	-I $(OCAML_TOPLEVEL)/libs/xl
 
-OBJS = xtl send_debug_keys list_domains raise_exception
+OBJS = xtl send_debug_keys list_domains raise_exception dmesg
 
-PROGRAMS = xtl send_debug_keys list_domains raise_exception
+PROGRAMS = xtl send_debug_keys list_domains raise_exception dmesg
 
 xtl_LIBS =  \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
@@ -37,7 +37,13 @@ raise_exception_LIBS =  \
 
 raise_exception_OBJS = raise_exception
 
-OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception
+dmesg_LIBS =  \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xl $(OCAML_TOPLEVEL)/libs/xl/xenlight.cmxa
+
+dmesg_OBJS = xtl dmesg
+
+OCAML_PROGRAM = xtl send_debug_keys list_domains raise_exception dmesg
 
 all: $(PROGRAMS)
 
diff --git a/tools/ocaml/test/dmesg.ml b/tools/ocaml/test/dmesg.ml
new file mode 100644
index 0000000..864fac4
--- /dev/null
+++ b/tools/ocaml/test/dmesg.ml
@@ -0,0 +1,18 @@
+open Printf
+
+let _ =
+	Xenlight.register_exceptions ();
+	let logger = Xtl.create_stdio_logger ~level:Xentoollog.Debug () in
+	let ctx = Xenlight.ctx_alloc logger in
+
+	let open Xenlight.Host in
+	let reader = xen_console_read_start ctx 0 in
+	(try
+		while true do
+			let line = xen_console_read_line ctx reader in
+			print_string line
+		done
+	with End_of_file -> ());
+	let _ = xen_console_read_finish ctx reader in
+	()
+
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:24:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO2S-0003eo-IS; Fri, 13 Dec 2013 08:24: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 1VrO2Q-0003eI-Os
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:59 +0000
Received: from [85.158.139.211:40362] by server-9.bemta-5.messagelabs.com id
	96/CF-15098-E14CAA25; Fri, 13 Dec 2013 08:23:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1386923035!4025959!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18457 invoked from network); 13 Dec 2013 08:23:56 -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;
	13 Dec 2013 08:23: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 1VrO2N-0001a2-7k
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO2N-0005vE-6M
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:55 +0000
Date: Fri, 13 Dec 2013 08:23:55 +0000
Message-Id: <E1VrO2N-0005vE-6M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: drop the ocaml heap lock
	before calling into libxl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8464b953324f8a8d29042ea32b65cdde3192201
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:50 2013 +0000

    libxl: ocaml: drop the ocaml heap lock before calling into libxl
    
    Ocaml has a heap lock which must be held whenever ocaml code is running. Ocaml
    usually drops this lock when it enters a potentially blocking low-level
    function, such as writing to a file. Libxl has its own lock, which it may
    acquire when being called.
    
    Things get interesting when libxl calls back into ocaml code. There is a risk
    of ending up in a deadlock when a thread holds both locks at the same time,
    then temporarily drop the ocaml lock, while another thread calls another libxl
    function.
    
    To avoid deadlocks, we drop the ocaml heap lock before entering libxl, and
    reacquire it in callbacks to ocaml. This way, the ocaml heap lock is never held
    together with the libxl lock, except in osevent registration callbacks, and
    xentoollog callbacks. If we guarantee to not call any libxl functions inside
    those callbacks, we can avoid deadlocks.
    
    This patch handle the dropping and reacquiring of the ocaml heap lock by the
    caml_enter_blocking_section and caml_leave_blocking_section functions, and
    related macros. We are also careful to not call any functions that access the
    ocaml heap while the ocaml heap lock is dropped. This often involves copying
    ocaml values to C before dropping the ocaml lock.
    
    The ao_how in aohow_val is now malloc'ed, just to make this function a little
    easier to use.
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xentoollog/Makefile           |    3 +
 tools/ocaml/libs/xentoollog/xentoollog_stubs.c |   13 +-
 tools/ocaml/libs/xl/Makefile                   |    5 +-
 tools/ocaml/libs/xl/xenlight_stubs.c           |  260 +++++++++++++++++++-----
 4 files changed, 224 insertions(+), 57 deletions(-)

diff --git a/tools/ocaml/libs/xentoollog/Makefile b/tools/ocaml/libs/xentoollog/Makefile
index e535ba5..471b428 100644
--- a/tools/ocaml/libs/xentoollog/Makefile
+++ b/tools/ocaml/libs/xentoollog/Makefile
@@ -2,6 +2,9 @@ TOPLEVEL=$(CURDIR)/../..
 XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
+# allow mixed declarations and code
+CFLAGS += -Wno-declaration-after-statement
+
 CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
 OCAMLINCLUDE +=
 
diff --git a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
index 122ed0d..aadc3d1 100644
--- a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
+++ b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
@@ -31,6 +31,11 @@
 
 #include "caml_xentoollog.h"
 
+/* The following is equal to the CAMLreturn macro, but without the return */
+#define CAMLdone do{ \
+caml_local_roots = caml__frame; \
+}while (0)
+
 #define XTL ((xentoollog_logger *) Xtl_val(handle))
 
 static char * dup_String_val(value s)
@@ -81,6 +86,7 @@ static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
 	const char *format,
 	va_list al)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 4);
 	struct caml_xtl *xtl = (struct caml_xtl*)logger;
@@ -101,7 +107,8 @@ static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
 	free(msg);
 
 	caml_callbackN(*func, 4, args);
-	CAMLreturn0;
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
 static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
@@ -109,6 +116,7 @@ static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
 	const char *doing_what /* no \r,\n */,
 	int percent, unsigned long done, unsigned long total)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 5);
 	struct caml_xtl *xtl = (struct caml_xtl*)logger;
@@ -125,7 +133,8 @@ static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
 	args[4] = caml_copy_int64(total);
 
 	caml_callbackN(*func, 5, args);
-	CAMLreturn0;
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
 static void xtl_destroy(struct xentoollog_logger *logger)
diff --git a/tools/ocaml/libs/xl/Makefile b/tools/ocaml/libs/xl/Makefile
index 0408cc2..61eb44c 100644
--- a/tools/ocaml/libs/xl/Makefile
+++ b/tools/ocaml/libs/xl/Makefile
@@ -2,8 +2,9 @@ TOPLEVEL=$(CURDIR)/../..
 XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
-# ignore unused generated functions
-CFLAGS += -Wno-unused
+# ignore unused generated functions and allow mixed declarations and code
+CFLAGS += -Wno-unused -Wno-declaration-after-statement
+
 CFLAGS += $(CFLAGS_libxenlight)
 CFLAGS += -I ../xentoollog
 
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 1d299ba..c1a9229 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -34,6 +34,11 @@
 
 #include "caml_xentoollog.h"
 
+/* The following is equal to the CAMLreturn macro, but without the return */
+#define CAMLdone do{ \
+caml_local_roots = caml__frame; \
+}while (0)
+
 #define Ctx_val(x)(*((libxl_ctx **) Data_custom_val(x)))
 #define CTX ((libxl_ctx *) Ctx_val(ctx))
 
@@ -374,6 +379,7 @@ static char *String_option_val(value v)
 
 void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocal2(error, tmp);
 	static value *func = NULL;
@@ -399,11 +405,15 @@ void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
 
 	caml_remove_global_root(p);
 	free(p);
+
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
-static libxl_asyncop_how *aohow_val(value async, libxl_asyncop_how *ao_how)
+static libxl_asyncop_how *aohow_val(value async)
 {
 	CAMLparam1(async);
+	libxl_asyncop_how *ao_how = NULL;
 	value *p;
 
 	if (async != Val_none) {
@@ -418,12 +428,12 @@ static libxl_asyncop_how *aohow_val(value async, libxl_asyncop_how *ao_how)
 			failwith_xl(ERROR_NOMEM, "cannot allocate value");
 		*p = Some_val(async);
 		caml_register_global_root(p);
+		ao_how = malloc(sizeof(*ao_how));
 		ao_how->callback = async_callback;
 		ao_how->u.for_callback = (void *) p;
-		CAMLreturnT(libxl_asyncop_how *, ao_how);
 	}
-	else
-		CAMLreturnT(libxl_asyncop_how *, NULL);
+
+	CAMLreturnT(libxl_asyncop_how *, ao_how);
 }
 
 value stub_libxl_domain_create_new(value ctx, value domain_config, value async, value unit)
@@ -432,7 +442,7 @@ value stub_libxl_domain_create_new(value ctx, value domain_config, value async,
 	int ret;
 	libxl_domain_config c_dconfig;
 	uint32_t c_domid;
-	libxl_asyncop_how ao_how;
+	libxl_asyncop_how *ao_how;
 
 	libxl_domain_config_init(&c_dconfig);
 	ret = domain_config_val(CTX, &c_dconfig, domain_config);
@@ -441,9 +451,13 @@ value stub_libxl_domain_create_new(value ctx, value domain_config, value async,
 		failwith_xl(ret, "domain_create_new");
 	}
 
-	ret = libxl_domain_create_new(CTX, &c_dconfig, &c_domid,
-		aohow_val(async, &ao_how), NULL);
+	ao_how = aohow_val(async);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_create_new(CTX, &c_dconfig, &c_domid, ao_how, NULL);
+	caml_leave_blocking_section();
 
+	free(ao_how);
 	libxl_domain_config_dispose(&c_dconfig);
 
 	if (ret != 0)
@@ -460,7 +474,8 @@ value stub_libxl_domain_create_restore(value ctx, value domain_config, value par
 	libxl_domain_config c_dconfig;
 	libxl_domain_restore_params c_params;
 	uint32_t c_domid;
-	libxl_asyncop_how ao_how;
+	libxl_asyncop_how *ao_how;
+	int restore_fd;
 
 	libxl_domain_config_init(&c_dconfig);
 	ret = domain_config_val(CTX, &c_dconfig, domain_config);
@@ -476,9 +491,15 @@ value stub_libxl_domain_create_restore(value ctx, value domain_config, value par
 		failwith_xl(ret, "domain_create_restore");
 	}
 
-	ret = libxl_domain_create_restore(CTX, &c_dconfig, &c_domid, Int_val(Field(params, 0)),
-		&c_params, aohow_val(async, &ao_how), NULL);
+	ao_how = aohow_val(async);
+	restore_fd = Int_val(Field(params, 0));
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_create_restore(CTX, &c_dconfig, &c_domid, restore_fd,
+		&c_params, ao_how, NULL);
+	caml_leave_blocking_section();
 
+	free(ao_how);
 	libxl_domain_config_dispose(&c_dconfig);
 	libxl_domain_restore_params_dispose(&c_params);
 
@@ -492,8 +513,12 @@ value stub_libxl_domain_shutdown(value ctx, value domid)
 {
 	CAMLparam2(ctx, domid);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_shutdown(CTX, c_domid);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_shutdown(CTX, Int_val(domid));
 	if (ret != 0)
 		failwith_xl(ret, "domain_shutdown");
 
@@ -504,8 +529,12 @@ value stub_libxl_domain_reboot(value ctx, value domid)
 {
 	CAMLparam2(ctx, domid);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_reboot(CTX, c_domid);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_reboot(CTX, Int_val(domid));
 	if (ret != 0)
 		failwith_xl(ret, "domain_reboot");
 
@@ -516,9 +545,15 @@ value stub_libxl_domain_destroy(value ctx, value domid, value async, value unit)
 {
 	CAMLparam4(ctx, domid, async, unit);
 	int ret;
-	libxl_asyncop_how ao_how;
+	uint32_t c_domid = Int_val(domid);
+	libxl_asyncop_how *ao_how = aohow_val(async);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_destroy(CTX, c_domid, ao_how);
+	caml_leave_blocking_section();
+
+	free(ao_how);
 
-	ret = libxl_domain_destroy(CTX, Int_val(domid), aohow_val(async, &ao_how));
 	if (ret != 0)
 		failwith_xl(ret, "domain_destroy");
 
@@ -529,10 +564,16 @@ value stub_libxl_domain_suspend(value ctx, value domid, value fd, value async, v
 {
 	CAMLparam5(ctx, domid, fd, async, unit);
 	int ret;
-	libxl_asyncop_how ao_how;
+	uint32_t c_domid = Int_val(domid);
+	int c_fd = Int_val(fd);
+	libxl_asyncop_how *ao_how = aohow_val(async);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_suspend(CTX, c_domid, c_fd, 0, ao_how);
+	caml_leave_blocking_section();
+
+	free(ao_how);
 
-	ret = libxl_domain_suspend(CTX, Int_val(domid), Int_val(fd), 0,
-		aohow_val(async, &ao_how));
 	if (ret != 0)
 		failwith_xl(ret, "domain_suspend");
 
@@ -543,8 +584,12 @@ value stub_libxl_domain_pause(value ctx, value domid)
 {
 	CAMLparam2(ctx, domid);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_pause(CTX, c_domid);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_pause(CTX, Int_val(domid));
 	if (ret != 0)
 		failwith_xl(ret, "domain_pause");
 
@@ -555,8 +600,12 @@ value stub_libxl_domain_unpause(value ctx, value domid)
 {
 	CAMLparam2(ctx, domid);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_unpause(CTX, c_domid);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_unpause(CTX, Int_val(domid));
 	if (ret != 0)
 		failwith_xl(ret, "domain_unpause");
 
@@ -573,13 +622,16 @@ value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
 	CAMLparam5(ctx, info, domid, async, unit);			\
 	libxl_device_##type c_info;					\
 	int ret, marker_var;						\
-	libxl_asyncop_how ao_how;					\
+	uint32_t c_domid = Int_val(domid);				\
+	libxl_asyncop_how *ao_how = aohow_val(async);			\
 									\
 	device_##type##_val(CTX, &c_info, info);			\
 									\
-	ret = libxl_##fn##_##op(CTX, Int_val(domid), &c_info,		\
-		aohow_val(async, &ao_how));				\
+	caml_enter_blocking_section();					\
+	ret = libxl_##fn##_##op(CTX, c_domid, &c_info, ao_how);		\
+	caml_leave_blocking_section();					\
 									\
+	free(ao_how);							\
 	libxl_device_##type##_dispose(&c_info);				\
 									\
 	if (ret != 0)							\
@@ -605,9 +657,16 @@ value stub_xl_device_nic_of_devid(value ctx, value domid, value devid)
 	CAMLparam3(ctx, domid, devid);
 	CAMLlocal1(nic);
 	libxl_device_nic c_nic;
-	libxl_devid_to_device_nic(CTX, Int_val(domid), Int_val(devid), &c_nic);
+	uint32_t c_domid = Int_val(domid);
+	int c_devid = Int_val(devid);
+
+	caml_enter_blocking_section();
+	libxl_devid_to_device_nic(CTX, c_domid, c_devid, &c_nic);
+	caml_leave_blocking_section();
+
 	nic = Val_device_nic(&c_nic);
 	libxl_device_nic_dispose(&c_nic);
+
 	CAMLreturn(nic);
 }
 
@@ -617,11 +676,12 @@ value stub_xl_device_nic_list(value ctx, value domid)
 	CAMLlocal2(list, temp);
 	libxl_device_nic *c_list;
 	int i, nb;
-	uint32_t c_domid;
-
-	c_domid = Int_val(domid);
+	uint32_t c_domid = Int_val(domid);
 
+	caml_enter_blocking_section();
 	c_list = libxl_device_nic_list(CTX, c_domid, &nb);
+	caml_leave_blocking_section();
+
 	if (!c_list)
 		failwith_xl(ERROR_FAIL, "nic_list");
 
@@ -645,11 +705,12 @@ value stub_xl_device_disk_list(value ctx, value domid)
 	CAMLlocal2(list, temp);
 	libxl_device_disk *c_list;
 	int i, nb;
-	uint32_t c_domid;
-
-	c_domid = Int_val(domid);
+	uint32_t c_domid = Int_val(domid);
 
+	caml_enter_blocking_section();
 	c_list = libxl_device_disk_list(CTX, c_domid, &nb);
+	caml_leave_blocking_section();
+
 	if (!c_list)
 		failwith_xl(ERROR_FAIL, "disk_list");
 
@@ -672,9 +733,19 @@ value stub_xl_device_disk_of_vdev(value ctx, value domid, value vdev)
 	CAMLparam3(ctx, domid, vdev);
 	CAMLlocal1(disk);
 	libxl_device_disk c_disk;
-	libxl_vdev_to_device_disk(CTX, Int_val(domid), String_val(vdev), &c_disk);
+	char *c_vdev;
+	uint32_t c_domid = Int_val(domid);
+
+	c_vdev = strdup(String_val(vdev));
+
+	caml_enter_blocking_section();
+	libxl_vdev_to_device_disk(CTX, c_domid, c_vdev, &c_disk);
+	caml_leave_blocking_section();
+
 	disk = Val_device_disk(&c_disk);
 	libxl_device_disk_dispose(&c_disk);
+	free(c_vdev);
+
 	CAMLreturn(disk);
 }
 
@@ -684,11 +755,12 @@ value stub_xl_device_pci_list(value ctx, value domid)
 	CAMLlocal2(list, temp);
 	libxl_device_pci *c_list;
 	int i, nb;
-	uint32_t c_domid;
-
-	c_domid = Int_val(domid);
+	uint32_t c_domid = Int_val(domid);
 
+	caml_enter_blocking_section();
 	c_list = libxl_device_pci_list(CTX, c_domid, &nb);
+	caml_leave_blocking_section();
+
 	if (!c_list)
 		failwith_xl(ERROR_FAIL, "pci_list");
 
@@ -711,10 +783,13 @@ value stub_xl_device_pci_assignable_add(value ctx, value info, value rebind)
 	CAMLparam3(ctx, info, rebind);
 	libxl_device_pci c_info;
 	int ret, marker_var;
+	int c_rebind = (int) Bool_val(rebind);
 
 	device_pci_val(CTX, &c_info, info);
 
-	ret = libxl_device_pci_assignable_add(CTX, &c_info, (int) Bool_val(rebind));
+	caml_enter_blocking_section();
+	ret = libxl_device_pci_assignable_add(CTX, &c_info, c_rebind);
+	caml_leave_blocking_section();
 
 	libxl_device_pci_dispose(&c_info);
 
@@ -729,10 +804,13 @@ value stub_xl_device_pci_assignable_remove(value ctx, value info, value rebind)
 	CAMLparam3(ctx, info, rebind);
 	libxl_device_pci c_info;
 	int ret, marker_var;
+	int c_rebind = (int) Bool_val(rebind);
 
 	device_pci_val(CTX, &c_info, info);
 
-	ret = libxl_device_pci_assignable_remove(CTX, &c_info, (int) Bool_val(rebind));
+	caml_enter_blocking_section();
+	ret = libxl_device_pci_assignable_remove(CTX, &c_info, c_rebind);
+	caml_leave_blocking_section();
 
 	libxl_device_pci_dispose(&c_info);
 
@@ -750,7 +828,10 @@ value stub_xl_device_pci_assignable_list(value ctx)
 	int i, nb;
 	uint32_t c_domid;
 
+	caml_enter_blocking_section();
 	c_list = libxl_device_pci_assignable_list(CTX, &nb);
+	caml_leave_blocking_section();
+
 	if (!c_list)
 		failwith_xl(ERROR_FAIL, "pci_assignable_list");
 
@@ -775,7 +856,9 @@ value stub_xl_physinfo_get(value ctx)
 	libxl_physinfo c_physinfo;
 	int ret;
 
+	caml_enter_blocking_section();
 	ret = libxl_get_physinfo(CTX, &c_physinfo);
+	caml_leave_blocking_section();
 
 	if (ret != 0)
 		failwith_xl(ret, "get_physinfo");
@@ -794,7 +877,9 @@ value stub_xl_cputopology_get(value ctx)
 	libxl_cputopology *c_topology;
 	int i, nr;
 
+	caml_enter_blocking_section();
 	c_topology = libxl_get_cpu_topology(CTX, &nr);
+	caml_leave_blocking_section();
 
 	if (!c_topology)
 		failwith_xl(ERROR_FAIL, "get_cpu_topologyinfo");
@@ -822,7 +907,10 @@ value stub_xl_dominfo_list(value ctx)
 	libxl_dominfo *c_domlist;
 	int i, nb;
 
+	caml_enter_blocking_section();
 	c_domlist = libxl_list_domain(CTX, &nb);
+	caml_leave_blocking_section();
+
 	if (!c_domlist)
 		failwith_xl(ERROR_FAIL, "dominfo_list");
 
@@ -847,8 +935,12 @@ value stub_xl_dominfo_get(value ctx, value domid)
 	CAMLlocal1(dominfo);
 	libxl_dominfo c_dominfo;
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_info(CTX, &c_dominfo, c_domid);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_info(CTX, &c_dominfo, Int_val(domid));
 	if (ret != 0)
 		failwith_xl(ERROR_FAIL, "domain_info");
 	dominfo = Val_dominfo(&c_dominfo);
@@ -862,8 +954,12 @@ value stub_xl_domain_sched_params_get(value ctx, value domid)
 	CAMLlocal1(scinfo);
 	libxl_domain_sched_params c_scinfo;
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_sched_params_get(CTX, c_domid, &c_scinfo);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_sched_params_get(CTX, Int_val(domid), &c_scinfo);
 	if (ret != 0)
 		failwith_xl(ret, "domain_sched_params_get");
 
@@ -879,10 +975,13 @@ value stub_xl_domain_sched_params_set(value ctx, value domid, value scinfo)
 	CAMLparam3(ctx, domid, scinfo);
 	libxl_domain_sched_params c_scinfo;
 	int ret;
+	uint32_t c_domid = Int_val(domid);
 
 	domain_sched_params_val(CTX, &c_scinfo, scinfo);
 
-	ret = libxl_domain_sched_params_set(CTX, Int_val(domid), &c_scinfo);
+	caml_enter_blocking_section();
+	ret = libxl_domain_sched_params_set(CTX, c_domid, &c_scinfo);
+	caml_leave_blocking_section();
 
 	libxl_domain_sched_params_dispose(&c_scinfo);
 
@@ -896,12 +995,15 @@ value stub_xl_send_trigger(value ctx, value domid, value trigger, value vcpuid)
 {
 	CAMLparam4(ctx, domid, trigger, vcpuid);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
 	libxl_trigger c_trigger = LIBXL_TRIGGER_UNKNOWN;
+	int c_vcpuid = Int_val(vcpuid);
 
 	trigger_val(CTX, &c_trigger, trigger);
 
-	ret = libxl_send_trigger(CTX, Int_val(domid),
-				 c_trigger, Int_val(vcpuid));
+	caml_enter_blocking_section();
+	ret = libxl_send_trigger(CTX, c_domid, c_trigger, c_vcpuid);
+	caml_leave_blocking_section();
 
 	if (ret != 0)
 		failwith_xl(ret, "send_trigger");
@@ -913,8 +1015,12 @@ value stub_xl_send_sysrq(value ctx, value domid, value sysrq)
 {
 	CAMLparam3(ctx, domid, sysrq);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+	int c_sysrq = Int_val(sysrq);
 
-	ret = libxl_send_sysrq(CTX, Int_val(domid), Int_val(sysrq));
+	caml_enter_blocking_section();
+	ret = libxl_send_sysrq(CTX, c_domid, c_sysrq);
+	caml_leave_blocking_section();
 
 	if (ret != 0)
 		failwith_xl(ret, "send_sysrq");
@@ -930,7 +1036,10 @@ value stub_xl_send_debug_keys(value ctx, value keys)
 
 	c_keys = dup_String_val(keys);
 
+	caml_enter_blocking_section();
 	ret = libxl_send_debug_keys(CTX, c_keys);
+	caml_leave_blocking_section();
+
 	free(c_keys);
 
 	if (ret != 0)
@@ -954,9 +1063,12 @@ value stub_libxl_xen_console_read_start(value ctx, value clear)
 {
 	CAMLparam2(ctx, clear);
 	CAMLlocal1(handle);
+	int c_clear = Int_val(clear);
 	libxl_xen_console_reader *cr;
 
-	cr = libxl_xen_console_read_start(CTX, Int_val(clear));
+	caml_enter_blocking_section();
+	cr = libxl_xen_console_read_start(CTX, c_clear);
+	caml_leave_blocking_section();
 
 	handle = caml_alloc_custom(&libxl_console_reader_custom_operations, sizeof(cr), 0, 1);
 	Console_reader_val(handle) = cr;
@@ -986,7 +1098,9 @@ value stub_libxl_xen_console_read_line(value ctx, value reader)
 	char *c_line;
 	libxl_xen_console_reader *cr = (libxl_xen_console_reader *) Console_reader_val(reader);
 
+	caml_enter_blocking_section();
 	ret = libxl_xen_console_read_line(CTX, cr, &c_line);
+	caml_leave_blocking_section();
 
 	if (ret < 0)
 		failwith_xl(ret, "xen_console_read_line");
@@ -1003,7 +1117,9 @@ value stub_libxl_xen_console_read_finish(value ctx, value reader)
 	CAMLparam2(ctx, reader);
 	libxl_xen_console_reader *cr = (libxl_xen_console_reader *) Console_reader_val(reader);
 
+	caml_enter_blocking_section();
 	libxl_xen_console_read_finish(CTX, cr);
+	caml_leave_blocking_section();
 
 	CAMLreturn(Val_unit);
 }
@@ -1095,6 +1211,7 @@ value Val_poll_events(short events)
 int fd_register(void *user, int fd, void **for_app_registration_out,
                      short events, void *for_libxl)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 4);
 	static value *func = NULL;
@@ -1111,12 +1228,15 @@ int fd_register(void *user, int fd, void **for_app_registration_out,
 	args[3] = (value) for_libxl;
 
 	caml_callbackN(*func, 4, args);
-	CAMLreturn(0);
+	CAMLdone;
+	caml_enter_blocking_section();
+	return 0;
 }
 
 int fd_modify(void *user, int fd, void **for_app_registration_update,
                    short events)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 3);
 	static value *func = NULL;
@@ -1132,11 +1252,14 @@ int fd_modify(void *user, int fd, void **for_app_registration_update,
 	args[2] = Val_poll_events(events);
 
 	caml_callbackN(*func, 3, args);
-	CAMLreturn(0);
+	CAMLdone;
+	caml_enter_blocking_section();
+	return 0;
 }
 
 void fd_deregister(void *user, int fd, void *for_app_registration)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 2);
 	static value *func = NULL;
@@ -1151,12 +1274,14 @@ void fd_deregister(void *user, int fd, void *for_app_registration)
 	args[1] = Val_int(fd);
 
 	caml_callbackN(*func, 2, args);
-	CAMLreturn0;
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
 int timeout_register(void *user, void **for_app_registration_out,
                           struct timeval abs, void *for_libxl)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 4);
 	static value *func = NULL;
@@ -1173,12 +1298,15 @@ int timeout_register(void *user, void **for_app_registration_out,
 	args[3] = (value) for_libxl;
 
 	caml_callbackN(*func, 4, args);
-	CAMLreturn(0);
+	CAMLdone;
+	caml_enter_blocking_section();
+	return 0;
 }
 
 int timeout_modify(void *user, void **for_app_registration_update,
                          struct timeval abs)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	static value *func = NULL;
 	value *p = (value *) user;
@@ -1189,13 +1317,16 @@ int timeout_modify(void *user, void **for_app_registration_update,
 	}
 
 	caml_callback(*func, *p);
-	CAMLreturn(0);
+	CAMLdone;
+	caml_enter_blocking_section();
+	return 0;
 }
 
 void timeout_deregister(void *user, void *for_app_registration)
 {
+	caml_leave_blocking_section();
 	failwith_xl(ERROR_FAIL, "timeout_deregister not yet implemented");
-	return;
+	caml_enter_blocking_section();
 }
 
 value stub_libxl_osevent_register_hooks(value ctx, value user)
@@ -1221,7 +1352,9 @@ value stub_libxl_osevent_register_hooks(value ctx, value user)
 	*p = user;
 	caml_register_global_root(p);
 
+	caml_enter_blocking_section();
 	libxl_osevent_register_hooks(CTX, hooks, (void *) p);
+	caml_leave_blocking_section();
 
 	result = caml_alloc(1, Abstract_tag);
 	*((libxl_osevent_hooks **) result) = hooks;
@@ -1233,15 +1366,25 @@ value stub_libxl_osevent_occurred_fd(value ctx, value for_libxl, value fd,
 	value events, value revents)
 {
 	CAMLparam5(ctx, for_libxl, fd, events, revents);
-	libxl_osevent_occurred_fd(CTX, (void *) for_libxl, Int_val(fd),
-		Poll_events_val(events), Poll_events_val(revents));
+	int c_fd = Int_val(fd);
+	short c_events = Poll_events_val(events);
+	short c_revents = Poll_events_val(revents);
+
+	caml_enter_blocking_section();
+	libxl_osevent_occurred_fd(CTX, (void *) for_libxl, c_fd, c_events, c_revents);
+	caml_leave_blocking_section();
+
 	CAMLreturn(Val_unit);
 }
 
 value stub_libxl_osevent_occurred_timeout(value ctx, value for_libxl)
 {
 	CAMLparam2(ctx, for_libxl);
+
+	caml_enter_blocking_section();
 	libxl_osevent_occurred_timeout(CTX, (void *) for_libxl);
+	caml_leave_blocking_section();
+
 	CAMLreturn(Val_unit);
 }
 
@@ -1252,6 +1395,7 @@ struct user_with_ctx {
 
 void event_occurs(void *user, libxl_event *event)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 2);
 	struct user_with_ctx *c_user = (struct user_with_ctx *) user;
@@ -1267,12 +1411,14 @@ void event_occurs(void *user, libxl_event *event)
 	libxl_event_free(c_user->ctx, event);
 
 	caml_callbackN(*func, 2, args);
-	CAMLreturn0;
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
 void disaster(void *user, libxl_event_type type,
                      const char *msg, int errnoval)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 4);
 	struct user_with_ctx *c_user = (struct user_with_ctx *) user;
@@ -1289,7 +1435,8 @@ void disaster(void *user, libxl_event_type type,
 	args[3] = Val_int(errnoval);
 
 	caml_callbackN(*func, 4, args);
-	CAMLreturn0;
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
 value stub_libxl_event_register_callbacks(value ctx, value user)
@@ -1313,7 +1460,10 @@ value stub_libxl_event_register_callbacks(value ctx, value user)
 	hooks->event_occurs = event_occurs;
 	hooks->disaster = disaster;
 
+	caml_enter_blocking_section();
 	libxl_event_register_callbacks(CTX, hooks, (void *) c_user);
+	caml_leave_blocking_section();
+
 	result = caml_alloc(1, Abstract_tag);
 	*((libxl_event_hooks **) result) = hooks;
 
@@ -1323,9 +1473,13 @@ value stub_libxl_event_register_callbacks(value ctx, value user)
 value stub_libxl_evenable_domain_death(value ctx, value domid, value user)
 {
 	CAMLparam3(ctx, domid, user);
+	uint32_t c_domid = Int_val(domid);
+	int c_user = Int_val(user);
 	libxl_evgen_domain_death *evgen_out;
 
-	libxl_evenable_domain_death(CTX, Int_val(domid), Int_val(user), &evgen_out);
+	caml_enter_blocking_section();
+	libxl_evenable_domain_death(CTX, c_domid, c_user, &evgen_out);
+	caml_leave_blocking_section();
 
 	CAMLreturn(Val_unit);
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:24:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO2S-0003eo-IS; Fri, 13 Dec 2013 08:24: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 1VrO2Q-0003eI-Os
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:59 +0000
Received: from [85.158.139.211:40362] by server-9.bemta-5.messagelabs.com id
	96/CF-15098-E14CAA25; Fri, 13 Dec 2013 08:23:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1386923035!4025959!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18457 invoked from network); 13 Dec 2013 08:23:56 -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;
	13 Dec 2013 08:23: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 1VrO2N-0001a2-7k
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO2N-0005vE-6M
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:23:55 +0000
Date: Fri, 13 Dec 2013 08:23:55 +0000
Message-Id: <E1VrO2N-0005vE-6M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: drop the ocaml heap lock
	before calling into libxl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8464b953324f8a8d29042ea32b65cdde3192201
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:50 2013 +0000

    libxl: ocaml: drop the ocaml heap lock before calling into libxl
    
    Ocaml has a heap lock which must be held whenever ocaml code is running. Ocaml
    usually drops this lock when it enters a potentially blocking low-level
    function, such as writing to a file. Libxl has its own lock, which it may
    acquire when being called.
    
    Things get interesting when libxl calls back into ocaml code. There is a risk
    of ending up in a deadlock when a thread holds both locks at the same time,
    then temporarily drop the ocaml lock, while another thread calls another libxl
    function.
    
    To avoid deadlocks, we drop the ocaml heap lock before entering libxl, and
    reacquire it in callbacks to ocaml. This way, the ocaml heap lock is never held
    together with the libxl lock, except in osevent registration callbacks, and
    xentoollog callbacks. If we guarantee to not call any libxl functions inside
    those callbacks, we can avoid deadlocks.
    
    This patch handle the dropping and reacquiring of the ocaml heap lock by the
    caml_enter_blocking_section and caml_leave_blocking_section functions, and
    related macros. We are also careful to not call any functions that access the
    ocaml heap while the ocaml heap lock is dropped. This often involves copying
    ocaml values to C before dropping the ocaml lock.
    
    The ao_how in aohow_val is now malloc'ed, just to make this function a little
    easier to use.
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xentoollog/Makefile           |    3 +
 tools/ocaml/libs/xentoollog/xentoollog_stubs.c |   13 +-
 tools/ocaml/libs/xl/Makefile                   |    5 +-
 tools/ocaml/libs/xl/xenlight_stubs.c           |  260 +++++++++++++++++++-----
 4 files changed, 224 insertions(+), 57 deletions(-)

diff --git a/tools/ocaml/libs/xentoollog/Makefile b/tools/ocaml/libs/xentoollog/Makefile
index e535ba5..471b428 100644
--- a/tools/ocaml/libs/xentoollog/Makefile
+++ b/tools/ocaml/libs/xentoollog/Makefile
@@ -2,6 +2,9 @@ TOPLEVEL=$(CURDIR)/../..
 XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
+# allow mixed declarations and code
+CFLAGS += -Wno-declaration-after-statement
+
 CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
 OCAMLINCLUDE +=
 
diff --git a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
index 122ed0d..aadc3d1 100644
--- a/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
+++ b/tools/ocaml/libs/xentoollog/xentoollog_stubs.c
@@ -31,6 +31,11 @@
 
 #include "caml_xentoollog.h"
 
+/* The following is equal to the CAMLreturn macro, but without the return */
+#define CAMLdone do{ \
+caml_local_roots = caml__frame; \
+}while (0)
+
 #define XTL ((xentoollog_logger *) Xtl_val(handle))
 
 static char * dup_String_val(value s)
@@ -81,6 +86,7 @@ static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
 	const char *format,
 	va_list al)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 4);
 	struct caml_xtl *xtl = (struct caml_xtl*)logger;
@@ -101,7 +107,8 @@ static void stub_xtl_ocaml_vmessage(struct xentoollog_logger *logger,
 	free(msg);
 
 	caml_callbackN(*func, 4, args);
-	CAMLreturn0;
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
 static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
@@ -109,6 +116,7 @@ static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
 	const char *doing_what /* no \r,\n */,
 	int percent, unsigned long done, unsigned long total)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 5);
 	struct caml_xtl *xtl = (struct caml_xtl*)logger;
@@ -125,7 +133,8 @@ static void stub_xtl_ocaml_progress(struct xentoollog_logger *logger,
 	args[4] = caml_copy_int64(total);
 
 	caml_callbackN(*func, 5, args);
-	CAMLreturn0;
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
 static void xtl_destroy(struct xentoollog_logger *logger)
diff --git a/tools/ocaml/libs/xl/Makefile b/tools/ocaml/libs/xl/Makefile
index 0408cc2..61eb44c 100644
--- a/tools/ocaml/libs/xl/Makefile
+++ b/tools/ocaml/libs/xl/Makefile
@@ -2,8 +2,9 @@ TOPLEVEL=$(CURDIR)/../..
 XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
-# ignore unused generated functions
-CFLAGS += -Wno-unused
+# ignore unused generated functions and allow mixed declarations and code
+CFLAGS += -Wno-unused -Wno-declaration-after-statement
+
 CFLAGS += $(CFLAGS_libxenlight)
 CFLAGS += -I ../xentoollog
 
diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index 1d299ba..c1a9229 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -34,6 +34,11 @@
 
 #include "caml_xentoollog.h"
 
+/* The following is equal to the CAMLreturn macro, but without the return */
+#define CAMLdone do{ \
+caml_local_roots = caml__frame; \
+}while (0)
+
 #define Ctx_val(x)(*((libxl_ctx **) Data_custom_val(x)))
 #define CTX ((libxl_ctx *) Ctx_val(ctx))
 
@@ -374,6 +379,7 @@ static char *String_option_val(value v)
 
 void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocal2(error, tmp);
 	static value *func = NULL;
@@ -399,11 +405,15 @@ void async_callback(libxl_ctx *ctx, int rc, void *for_callback)
 
 	caml_remove_global_root(p);
 	free(p);
+
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
-static libxl_asyncop_how *aohow_val(value async, libxl_asyncop_how *ao_how)
+static libxl_asyncop_how *aohow_val(value async)
 {
 	CAMLparam1(async);
+	libxl_asyncop_how *ao_how = NULL;
 	value *p;
 
 	if (async != Val_none) {
@@ -418,12 +428,12 @@ static libxl_asyncop_how *aohow_val(value async, libxl_asyncop_how *ao_how)
 			failwith_xl(ERROR_NOMEM, "cannot allocate value");
 		*p = Some_val(async);
 		caml_register_global_root(p);
+		ao_how = malloc(sizeof(*ao_how));
 		ao_how->callback = async_callback;
 		ao_how->u.for_callback = (void *) p;
-		CAMLreturnT(libxl_asyncop_how *, ao_how);
 	}
-	else
-		CAMLreturnT(libxl_asyncop_how *, NULL);
+
+	CAMLreturnT(libxl_asyncop_how *, ao_how);
 }
 
 value stub_libxl_domain_create_new(value ctx, value domain_config, value async, value unit)
@@ -432,7 +442,7 @@ value stub_libxl_domain_create_new(value ctx, value domain_config, value async,
 	int ret;
 	libxl_domain_config c_dconfig;
 	uint32_t c_domid;
-	libxl_asyncop_how ao_how;
+	libxl_asyncop_how *ao_how;
 
 	libxl_domain_config_init(&c_dconfig);
 	ret = domain_config_val(CTX, &c_dconfig, domain_config);
@@ -441,9 +451,13 @@ value stub_libxl_domain_create_new(value ctx, value domain_config, value async,
 		failwith_xl(ret, "domain_create_new");
 	}
 
-	ret = libxl_domain_create_new(CTX, &c_dconfig, &c_domid,
-		aohow_val(async, &ao_how), NULL);
+	ao_how = aohow_val(async);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_create_new(CTX, &c_dconfig, &c_domid, ao_how, NULL);
+	caml_leave_blocking_section();
 
+	free(ao_how);
 	libxl_domain_config_dispose(&c_dconfig);
 
 	if (ret != 0)
@@ -460,7 +474,8 @@ value stub_libxl_domain_create_restore(value ctx, value domain_config, value par
 	libxl_domain_config c_dconfig;
 	libxl_domain_restore_params c_params;
 	uint32_t c_domid;
-	libxl_asyncop_how ao_how;
+	libxl_asyncop_how *ao_how;
+	int restore_fd;
 
 	libxl_domain_config_init(&c_dconfig);
 	ret = domain_config_val(CTX, &c_dconfig, domain_config);
@@ -476,9 +491,15 @@ value stub_libxl_domain_create_restore(value ctx, value domain_config, value par
 		failwith_xl(ret, "domain_create_restore");
 	}
 
-	ret = libxl_domain_create_restore(CTX, &c_dconfig, &c_domid, Int_val(Field(params, 0)),
-		&c_params, aohow_val(async, &ao_how), NULL);
+	ao_how = aohow_val(async);
+	restore_fd = Int_val(Field(params, 0));
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_create_restore(CTX, &c_dconfig, &c_domid, restore_fd,
+		&c_params, ao_how, NULL);
+	caml_leave_blocking_section();
 
+	free(ao_how);
 	libxl_domain_config_dispose(&c_dconfig);
 	libxl_domain_restore_params_dispose(&c_params);
 
@@ -492,8 +513,12 @@ value stub_libxl_domain_shutdown(value ctx, value domid)
 {
 	CAMLparam2(ctx, domid);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_shutdown(CTX, c_domid);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_shutdown(CTX, Int_val(domid));
 	if (ret != 0)
 		failwith_xl(ret, "domain_shutdown");
 
@@ -504,8 +529,12 @@ value stub_libxl_domain_reboot(value ctx, value domid)
 {
 	CAMLparam2(ctx, domid);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_reboot(CTX, c_domid);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_reboot(CTX, Int_val(domid));
 	if (ret != 0)
 		failwith_xl(ret, "domain_reboot");
 
@@ -516,9 +545,15 @@ value stub_libxl_domain_destroy(value ctx, value domid, value async, value unit)
 {
 	CAMLparam4(ctx, domid, async, unit);
 	int ret;
-	libxl_asyncop_how ao_how;
+	uint32_t c_domid = Int_val(domid);
+	libxl_asyncop_how *ao_how = aohow_val(async);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_destroy(CTX, c_domid, ao_how);
+	caml_leave_blocking_section();
+
+	free(ao_how);
 
-	ret = libxl_domain_destroy(CTX, Int_val(domid), aohow_val(async, &ao_how));
 	if (ret != 0)
 		failwith_xl(ret, "domain_destroy");
 
@@ -529,10 +564,16 @@ value stub_libxl_domain_suspend(value ctx, value domid, value fd, value async, v
 {
 	CAMLparam5(ctx, domid, fd, async, unit);
 	int ret;
-	libxl_asyncop_how ao_how;
+	uint32_t c_domid = Int_val(domid);
+	int c_fd = Int_val(fd);
+	libxl_asyncop_how *ao_how = aohow_val(async);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_suspend(CTX, c_domid, c_fd, 0, ao_how);
+	caml_leave_blocking_section();
+
+	free(ao_how);
 
-	ret = libxl_domain_suspend(CTX, Int_val(domid), Int_val(fd), 0,
-		aohow_val(async, &ao_how));
 	if (ret != 0)
 		failwith_xl(ret, "domain_suspend");
 
@@ -543,8 +584,12 @@ value stub_libxl_domain_pause(value ctx, value domid)
 {
 	CAMLparam2(ctx, domid);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_pause(CTX, c_domid);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_pause(CTX, Int_val(domid));
 	if (ret != 0)
 		failwith_xl(ret, "domain_pause");
 
@@ -555,8 +600,12 @@ value stub_libxl_domain_unpause(value ctx, value domid)
 {
 	CAMLparam2(ctx, domid);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_unpause(CTX, c_domid);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_unpause(CTX, Int_val(domid));
 	if (ret != 0)
 		failwith_xl(ret, "domain_unpause");
 
@@ -573,13 +622,16 @@ value stub_xl_device_##type##_##op(value ctx, value info, value domid,	\
 	CAMLparam5(ctx, info, domid, async, unit);			\
 	libxl_device_##type c_info;					\
 	int ret, marker_var;						\
-	libxl_asyncop_how ao_how;					\
+	uint32_t c_domid = Int_val(domid);				\
+	libxl_asyncop_how *ao_how = aohow_val(async);			\
 									\
 	device_##type##_val(CTX, &c_info, info);			\
 									\
-	ret = libxl_##fn##_##op(CTX, Int_val(domid), &c_info,		\
-		aohow_val(async, &ao_how));				\
+	caml_enter_blocking_section();					\
+	ret = libxl_##fn##_##op(CTX, c_domid, &c_info, ao_how);		\
+	caml_leave_blocking_section();					\
 									\
+	free(ao_how);							\
 	libxl_device_##type##_dispose(&c_info);				\
 									\
 	if (ret != 0)							\
@@ -605,9 +657,16 @@ value stub_xl_device_nic_of_devid(value ctx, value domid, value devid)
 	CAMLparam3(ctx, domid, devid);
 	CAMLlocal1(nic);
 	libxl_device_nic c_nic;
-	libxl_devid_to_device_nic(CTX, Int_val(domid), Int_val(devid), &c_nic);
+	uint32_t c_domid = Int_val(domid);
+	int c_devid = Int_val(devid);
+
+	caml_enter_blocking_section();
+	libxl_devid_to_device_nic(CTX, c_domid, c_devid, &c_nic);
+	caml_leave_blocking_section();
+
 	nic = Val_device_nic(&c_nic);
 	libxl_device_nic_dispose(&c_nic);
+
 	CAMLreturn(nic);
 }
 
@@ -617,11 +676,12 @@ value stub_xl_device_nic_list(value ctx, value domid)
 	CAMLlocal2(list, temp);
 	libxl_device_nic *c_list;
 	int i, nb;
-	uint32_t c_domid;
-
-	c_domid = Int_val(domid);
+	uint32_t c_domid = Int_val(domid);
 
+	caml_enter_blocking_section();
 	c_list = libxl_device_nic_list(CTX, c_domid, &nb);
+	caml_leave_blocking_section();
+
 	if (!c_list)
 		failwith_xl(ERROR_FAIL, "nic_list");
 
@@ -645,11 +705,12 @@ value stub_xl_device_disk_list(value ctx, value domid)
 	CAMLlocal2(list, temp);
 	libxl_device_disk *c_list;
 	int i, nb;
-	uint32_t c_domid;
-
-	c_domid = Int_val(domid);
+	uint32_t c_domid = Int_val(domid);
 
+	caml_enter_blocking_section();
 	c_list = libxl_device_disk_list(CTX, c_domid, &nb);
+	caml_leave_blocking_section();
+
 	if (!c_list)
 		failwith_xl(ERROR_FAIL, "disk_list");
 
@@ -672,9 +733,19 @@ value stub_xl_device_disk_of_vdev(value ctx, value domid, value vdev)
 	CAMLparam3(ctx, domid, vdev);
 	CAMLlocal1(disk);
 	libxl_device_disk c_disk;
-	libxl_vdev_to_device_disk(CTX, Int_val(domid), String_val(vdev), &c_disk);
+	char *c_vdev;
+	uint32_t c_domid = Int_val(domid);
+
+	c_vdev = strdup(String_val(vdev));
+
+	caml_enter_blocking_section();
+	libxl_vdev_to_device_disk(CTX, c_domid, c_vdev, &c_disk);
+	caml_leave_blocking_section();
+
 	disk = Val_device_disk(&c_disk);
 	libxl_device_disk_dispose(&c_disk);
+	free(c_vdev);
+
 	CAMLreturn(disk);
 }
 
@@ -684,11 +755,12 @@ value stub_xl_device_pci_list(value ctx, value domid)
 	CAMLlocal2(list, temp);
 	libxl_device_pci *c_list;
 	int i, nb;
-	uint32_t c_domid;
-
-	c_domid = Int_val(domid);
+	uint32_t c_domid = Int_val(domid);
 
+	caml_enter_blocking_section();
 	c_list = libxl_device_pci_list(CTX, c_domid, &nb);
+	caml_leave_blocking_section();
+
 	if (!c_list)
 		failwith_xl(ERROR_FAIL, "pci_list");
 
@@ -711,10 +783,13 @@ value stub_xl_device_pci_assignable_add(value ctx, value info, value rebind)
 	CAMLparam3(ctx, info, rebind);
 	libxl_device_pci c_info;
 	int ret, marker_var;
+	int c_rebind = (int) Bool_val(rebind);
 
 	device_pci_val(CTX, &c_info, info);
 
-	ret = libxl_device_pci_assignable_add(CTX, &c_info, (int) Bool_val(rebind));
+	caml_enter_blocking_section();
+	ret = libxl_device_pci_assignable_add(CTX, &c_info, c_rebind);
+	caml_leave_blocking_section();
 
 	libxl_device_pci_dispose(&c_info);
 
@@ -729,10 +804,13 @@ value stub_xl_device_pci_assignable_remove(value ctx, value info, value rebind)
 	CAMLparam3(ctx, info, rebind);
 	libxl_device_pci c_info;
 	int ret, marker_var;
+	int c_rebind = (int) Bool_val(rebind);
 
 	device_pci_val(CTX, &c_info, info);
 
-	ret = libxl_device_pci_assignable_remove(CTX, &c_info, (int) Bool_val(rebind));
+	caml_enter_blocking_section();
+	ret = libxl_device_pci_assignable_remove(CTX, &c_info, c_rebind);
+	caml_leave_blocking_section();
 
 	libxl_device_pci_dispose(&c_info);
 
@@ -750,7 +828,10 @@ value stub_xl_device_pci_assignable_list(value ctx)
 	int i, nb;
 	uint32_t c_domid;
 
+	caml_enter_blocking_section();
 	c_list = libxl_device_pci_assignable_list(CTX, &nb);
+	caml_leave_blocking_section();
+
 	if (!c_list)
 		failwith_xl(ERROR_FAIL, "pci_assignable_list");
 
@@ -775,7 +856,9 @@ value stub_xl_physinfo_get(value ctx)
 	libxl_physinfo c_physinfo;
 	int ret;
 
+	caml_enter_blocking_section();
 	ret = libxl_get_physinfo(CTX, &c_physinfo);
+	caml_leave_blocking_section();
 
 	if (ret != 0)
 		failwith_xl(ret, "get_physinfo");
@@ -794,7 +877,9 @@ value stub_xl_cputopology_get(value ctx)
 	libxl_cputopology *c_topology;
 	int i, nr;
 
+	caml_enter_blocking_section();
 	c_topology = libxl_get_cpu_topology(CTX, &nr);
+	caml_leave_blocking_section();
 
 	if (!c_topology)
 		failwith_xl(ERROR_FAIL, "get_cpu_topologyinfo");
@@ -822,7 +907,10 @@ value stub_xl_dominfo_list(value ctx)
 	libxl_dominfo *c_domlist;
 	int i, nb;
 
+	caml_enter_blocking_section();
 	c_domlist = libxl_list_domain(CTX, &nb);
+	caml_leave_blocking_section();
+
 	if (!c_domlist)
 		failwith_xl(ERROR_FAIL, "dominfo_list");
 
@@ -847,8 +935,12 @@ value stub_xl_dominfo_get(value ctx, value domid)
 	CAMLlocal1(dominfo);
 	libxl_dominfo c_dominfo;
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_info(CTX, &c_dominfo, c_domid);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_info(CTX, &c_dominfo, Int_val(domid));
 	if (ret != 0)
 		failwith_xl(ERROR_FAIL, "domain_info");
 	dominfo = Val_dominfo(&c_dominfo);
@@ -862,8 +954,12 @@ value stub_xl_domain_sched_params_get(value ctx, value domid)
 	CAMLlocal1(scinfo);
 	libxl_domain_sched_params c_scinfo;
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+
+	caml_enter_blocking_section();
+	ret = libxl_domain_sched_params_get(CTX, c_domid, &c_scinfo);
+	caml_leave_blocking_section();
 
-	ret = libxl_domain_sched_params_get(CTX, Int_val(domid), &c_scinfo);
 	if (ret != 0)
 		failwith_xl(ret, "domain_sched_params_get");
 
@@ -879,10 +975,13 @@ value stub_xl_domain_sched_params_set(value ctx, value domid, value scinfo)
 	CAMLparam3(ctx, domid, scinfo);
 	libxl_domain_sched_params c_scinfo;
 	int ret;
+	uint32_t c_domid = Int_val(domid);
 
 	domain_sched_params_val(CTX, &c_scinfo, scinfo);
 
-	ret = libxl_domain_sched_params_set(CTX, Int_val(domid), &c_scinfo);
+	caml_enter_blocking_section();
+	ret = libxl_domain_sched_params_set(CTX, c_domid, &c_scinfo);
+	caml_leave_blocking_section();
 
 	libxl_domain_sched_params_dispose(&c_scinfo);
 
@@ -896,12 +995,15 @@ value stub_xl_send_trigger(value ctx, value domid, value trigger, value vcpuid)
 {
 	CAMLparam4(ctx, domid, trigger, vcpuid);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
 	libxl_trigger c_trigger = LIBXL_TRIGGER_UNKNOWN;
+	int c_vcpuid = Int_val(vcpuid);
 
 	trigger_val(CTX, &c_trigger, trigger);
 
-	ret = libxl_send_trigger(CTX, Int_val(domid),
-				 c_trigger, Int_val(vcpuid));
+	caml_enter_blocking_section();
+	ret = libxl_send_trigger(CTX, c_domid, c_trigger, c_vcpuid);
+	caml_leave_blocking_section();
 
 	if (ret != 0)
 		failwith_xl(ret, "send_trigger");
@@ -913,8 +1015,12 @@ value stub_xl_send_sysrq(value ctx, value domid, value sysrq)
 {
 	CAMLparam3(ctx, domid, sysrq);
 	int ret;
+	uint32_t c_domid = Int_val(domid);
+	int c_sysrq = Int_val(sysrq);
 
-	ret = libxl_send_sysrq(CTX, Int_val(domid), Int_val(sysrq));
+	caml_enter_blocking_section();
+	ret = libxl_send_sysrq(CTX, c_domid, c_sysrq);
+	caml_leave_blocking_section();
 
 	if (ret != 0)
 		failwith_xl(ret, "send_sysrq");
@@ -930,7 +1036,10 @@ value stub_xl_send_debug_keys(value ctx, value keys)
 
 	c_keys = dup_String_val(keys);
 
+	caml_enter_blocking_section();
 	ret = libxl_send_debug_keys(CTX, c_keys);
+	caml_leave_blocking_section();
+
 	free(c_keys);
 
 	if (ret != 0)
@@ -954,9 +1063,12 @@ value stub_libxl_xen_console_read_start(value ctx, value clear)
 {
 	CAMLparam2(ctx, clear);
 	CAMLlocal1(handle);
+	int c_clear = Int_val(clear);
 	libxl_xen_console_reader *cr;
 
-	cr = libxl_xen_console_read_start(CTX, Int_val(clear));
+	caml_enter_blocking_section();
+	cr = libxl_xen_console_read_start(CTX, c_clear);
+	caml_leave_blocking_section();
 
 	handle = caml_alloc_custom(&libxl_console_reader_custom_operations, sizeof(cr), 0, 1);
 	Console_reader_val(handle) = cr;
@@ -986,7 +1098,9 @@ value stub_libxl_xen_console_read_line(value ctx, value reader)
 	char *c_line;
 	libxl_xen_console_reader *cr = (libxl_xen_console_reader *) Console_reader_val(reader);
 
+	caml_enter_blocking_section();
 	ret = libxl_xen_console_read_line(CTX, cr, &c_line);
+	caml_leave_blocking_section();
 
 	if (ret < 0)
 		failwith_xl(ret, "xen_console_read_line");
@@ -1003,7 +1117,9 @@ value stub_libxl_xen_console_read_finish(value ctx, value reader)
 	CAMLparam2(ctx, reader);
 	libxl_xen_console_reader *cr = (libxl_xen_console_reader *) Console_reader_val(reader);
 
+	caml_enter_blocking_section();
 	libxl_xen_console_read_finish(CTX, cr);
+	caml_leave_blocking_section();
 
 	CAMLreturn(Val_unit);
 }
@@ -1095,6 +1211,7 @@ value Val_poll_events(short events)
 int fd_register(void *user, int fd, void **for_app_registration_out,
                      short events, void *for_libxl)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 4);
 	static value *func = NULL;
@@ -1111,12 +1228,15 @@ int fd_register(void *user, int fd, void **for_app_registration_out,
 	args[3] = (value) for_libxl;
 
 	caml_callbackN(*func, 4, args);
-	CAMLreturn(0);
+	CAMLdone;
+	caml_enter_blocking_section();
+	return 0;
 }
 
 int fd_modify(void *user, int fd, void **for_app_registration_update,
                    short events)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 3);
 	static value *func = NULL;
@@ -1132,11 +1252,14 @@ int fd_modify(void *user, int fd, void **for_app_registration_update,
 	args[2] = Val_poll_events(events);
 
 	caml_callbackN(*func, 3, args);
-	CAMLreturn(0);
+	CAMLdone;
+	caml_enter_blocking_section();
+	return 0;
 }
 
 void fd_deregister(void *user, int fd, void *for_app_registration)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 2);
 	static value *func = NULL;
@@ -1151,12 +1274,14 @@ void fd_deregister(void *user, int fd, void *for_app_registration)
 	args[1] = Val_int(fd);
 
 	caml_callbackN(*func, 2, args);
-	CAMLreturn0;
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
 int timeout_register(void *user, void **for_app_registration_out,
                           struct timeval abs, void *for_libxl)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 4);
 	static value *func = NULL;
@@ -1173,12 +1298,15 @@ int timeout_register(void *user, void **for_app_registration_out,
 	args[3] = (value) for_libxl;
 
 	caml_callbackN(*func, 4, args);
-	CAMLreturn(0);
+	CAMLdone;
+	caml_enter_blocking_section();
+	return 0;
 }
 
 int timeout_modify(void *user, void **for_app_registration_update,
                          struct timeval abs)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	static value *func = NULL;
 	value *p = (value *) user;
@@ -1189,13 +1317,16 @@ int timeout_modify(void *user, void **for_app_registration_update,
 	}
 
 	caml_callback(*func, *p);
-	CAMLreturn(0);
+	CAMLdone;
+	caml_enter_blocking_section();
+	return 0;
 }
 
 void timeout_deregister(void *user, void *for_app_registration)
 {
+	caml_leave_blocking_section();
 	failwith_xl(ERROR_FAIL, "timeout_deregister not yet implemented");
-	return;
+	caml_enter_blocking_section();
 }
 
 value stub_libxl_osevent_register_hooks(value ctx, value user)
@@ -1221,7 +1352,9 @@ value stub_libxl_osevent_register_hooks(value ctx, value user)
 	*p = user;
 	caml_register_global_root(p);
 
+	caml_enter_blocking_section();
 	libxl_osevent_register_hooks(CTX, hooks, (void *) p);
+	caml_leave_blocking_section();
 
 	result = caml_alloc(1, Abstract_tag);
 	*((libxl_osevent_hooks **) result) = hooks;
@@ -1233,15 +1366,25 @@ value stub_libxl_osevent_occurred_fd(value ctx, value for_libxl, value fd,
 	value events, value revents)
 {
 	CAMLparam5(ctx, for_libxl, fd, events, revents);
-	libxl_osevent_occurred_fd(CTX, (void *) for_libxl, Int_val(fd),
-		Poll_events_val(events), Poll_events_val(revents));
+	int c_fd = Int_val(fd);
+	short c_events = Poll_events_val(events);
+	short c_revents = Poll_events_val(revents);
+
+	caml_enter_blocking_section();
+	libxl_osevent_occurred_fd(CTX, (void *) for_libxl, c_fd, c_events, c_revents);
+	caml_leave_blocking_section();
+
 	CAMLreturn(Val_unit);
 }
 
 value stub_libxl_osevent_occurred_timeout(value ctx, value for_libxl)
 {
 	CAMLparam2(ctx, for_libxl);
+
+	caml_enter_blocking_section();
 	libxl_osevent_occurred_timeout(CTX, (void *) for_libxl);
+	caml_leave_blocking_section();
+
 	CAMLreturn(Val_unit);
 }
 
@@ -1252,6 +1395,7 @@ struct user_with_ctx {
 
 void event_occurs(void *user, libxl_event *event)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 2);
 	struct user_with_ctx *c_user = (struct user_with_ctx *) user;
@@ -1267,12 +1411,14 @@ void event_occurs(void *user, libxl_event *event)
 	libxl_event_free(c_user->ctx, event);
 
 	caml_callbackN(*func, 2, args);
-	CAMLreturn0;
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
 void disaster(void *user, libxl_event_type type,
                      const char *msg, int errnoval)
 {
+	caml_leave_blocking_section();
 	CAMLparam0();
 	CAMLlocalN(args, 4);
 	struct user_with_ctx *c_user = (struct user_with_ctx *) user;
@@ -1289,7 +1435,8 @@ void disaster(void *user, libxl_event_type type,
 	args[3] = Val_int(errnoval);
 
 	caml_callbackN(*func, 4, args);
-	CAMLreturn0;
+	CAMLdone;
+	caml_enter_blocking_section();
 }
 
 value stub_libxl_event_register_callbacks(value ctx, value user)
@@ -1313,7 +1460,10 @@ value stub_libxl_event_register_callbacks(value ctx, value user)
 	hooks->event_occurs = event_occurs;
 	hooks->disaster = disaster;
 
+	caml_enter_blocking_section();
 	libxl_event_register_callbacks(CTX, hooks, (void *) c_user);
+	caml_leave_blocking_section();
+
 	result = caml_alloc(1, Abstract_tag);
 	*((libxl_event_hooks **) result) = hooks;
 
@@ -1323,9 +1473,13 @@ value stub_libxl_event_register_callbacks(value ctx, value user)
 value stub_libxl_evenable_domain_death(value ctx, value domid, value user)
 {
 	CAMLparam3(ctx, domid, user);
+	uint32_t c_domid = Int_val(domid);
+	int c_user = Int_val(user);
 	libxl_evgen_domain_death *evgen_out;
 
-	libxl_evenable_domain_death(CTX, Int_val(domid), Int_val(user), &evgen_out);
+	caml_enter_blocking_section();
+	libxl_evenable_domain_death(CTX, c_domid, c_user, &evgen_out);
+	caml_leave_blocking_section();
 
 	CAMLreturn(Val_unit);
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:24:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO2b-0003hJ-PF; Fri, 13 Dec 2013 08:24: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 1VrO2a-0003gi-1G
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:08 +0000
Received: from [85.158.139.211:44968] by server-12.bemta-5.messagelabs.com id
	75/5C-30017-724CAA25; Fri, 13 Dec 2013 08:24:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386923045!4232098!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7401 invoked from network); 13 Dec 2013 08:24:06 -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;
	13 Dec 2013 08:24: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 1VrO2X-0001ab-C7
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO2X-0005vm-AR
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:05 +0000
Date: Fri, 13 Dec 2013 08:24:05 +0000
Message-Id: <E1VrO2X-0005vm-AR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: add some missing CAML
	macros
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db94bdb3145c48356d17637a33c4298613215c21
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:33 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:50 2013 +0000

    libxl: ocaml: add some missing CAML macros
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xl/xenlight_stubs.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index c1a9229..a61c222 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -59,6 +59,7 @@ static value Val_error (libxl_error error_c);
 
 static void failwith_xl(int error, char *fname)
 {
+	CAMLparam0();
 	CAMLlocal1(arg);
 	static value *exc = NULL;
 
@@ -75,6 +76,7 @@ static void failwith_xl(int error, char *fname)
 	Store_field(arg, 1, caml_copy_string(fname));
 
 	caml_raise_with_arg(*exc, arg);
+	CAMLreturn0;
 }
 
 CAMLprim value stub_raise_exception(value unit)
@@ -338,7 +340,7 @@ static libxl_defbool Defbool_val(value v)
 		bool b = Bool_val(Some_val(v));
 		libxl_defbool_set(&db, b);
 	}
-	return db;
+	CAMLreturnT(libxl_defbool, db);
 }
 
 static value Val_hwcap(libxl_hwcap *c_val)
@@ -369,10 +371,11 @@ static value Val_string_option(const char *c_val)
 
 static char *String_option_val(value v)
 {
+	CAMLparam1(v);
 	char *s = NULL;
 	if (v != Val_none)
 		s = dup_String_val(Some_val(v));
-	return s;
+	CAMLreturnT(char *, s);
 }
 
 #include "_libxl_types.inc"
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:24:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO2b-0003hJ-PF; Fri, 13 Dec 2013 08:24: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 1VrO2a-0003gi-1G
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:08 +0000
Received: from [85.158.139.211:44968] by server-12.bemta-5.messagelabs.com id
	75/5C-30017-724CAA25; Fri, 13 Dec 2013 08:24:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1386923045!4232098!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7401 invoked from network); 13 Dec 2013 08:24:06 -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;
	13 Dec 2013 08:24: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 1VrO2X-0001ab-C7
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO2X-0005vm-AR
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:05 +0000
Date: Fri, 13 Dec 2013 08:24:05 +0000
Message-Id: <E1VrO2X-0005vm-AR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: ocaml: add some missing CAML
	macros
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db94bdb3145c48356d17637a33c4298613215c21
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Tue Dec 10 16:48:33 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:17:50 2013 +0000

    libxl: ocaml: add some missing CAML macros
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/xl/xenlight_stubs.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xenlight_stubs.c
index c1a9229..a61c222 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -59,6 +59,7 @@ static value Val_error (libxl_error error_c);
 
 static void failwith_xl(int error, char *fname)
 {
+	CAMLparam0();
 	CAMLlocal1(arg);
 	static value *exc = NULL;
 
@@ -75,6 +76,7 @@ static void failwith_xl(int error, char *fname)
 	Store_field(arg, 1, caml_copy_string(fname));
 
 	caml_raise_with_arg(*exc, arg);
+	CAMLreturn0;
 }
 
 CAMLprim value stub_raise_exception(value unit)
@@ -338,7 +340,7 @@ static libxl_defbool Defbool_val(value v)
 		bool b = Bool_val(Some_val(v));
 		libxl_defbool_set(&db, b);
 	}
-	return db;
+	CAMLreturnT(libxl_defbool, db);
 }
 
 static value Val_hwcap(libxl_hwcap *c_val)
@@ -369,10 +371,11 @@ static value Val_string_option(const char *c_val)
 
 static char *String_option_val(value v)
 {
+	CAMLparam1(v);
 	char *s = NULL;
 	if (v != Val_none)
 		s = dup_String_val(Some_val(v));
-	return s;
+	CAMLreturnT(char *, s);
 }
 
 #include "_libxl_types.inc"
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:24:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO2m-0003jj-Uj; Fri, 13 Dec 2013 08:24: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 1VrO2l-0003jL-2O
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:19 +0000
Received: from [85.158.139.211:51656] by server-9.bemta-5.messagelabs.com id
	B2/40-15098-234CAA25; Fri, 13 Dec 2013 08:24:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386923056!4231950!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19081 invoked from network); 13 Dec 2013 08:24:17 -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;
	13 Dec 2013 08:24: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 1VrO2h-0001at-S2
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO2h-0005y6-QT
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:15 +0000
Date: Fri, 13 Dec 2013 08:24:15 +0000
Message-Id: <E1VrO2h-0005y6-QT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: list interfaces subject to the
	security process exception in XSA-77
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5da5288a0a767c16705dd16ee5e5bb5cf7929397
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Dec 10 16:09:24 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:09:24 2013 +0100

    xen: list interfaces subject to the security process exception in XSA-77
    
    List all the sub ops of:
      __HYPERVISOR_domctl
      __HYPERVISOR_sysctl
      __HYPERVISOR_memory_op
      __HYPERVISOR_tmem_op
    which are subject to the policy given in
    http://xenbits.xen.org/xsa/advisory-77.html
    
    It is expected that these lists will be whittled away as each interface is
    audited for safety.
    
    New interfaces should be expected to be safe when introduced (IOW the list
    should never be expanded).
    
    This is XSA-77.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xsm-flask.txt |  183 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 183 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index ff81b01..ddd5831 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -17,6 +17,189 @@ Some examples of what FLASK can do:
 Some of these examples require dom0 disaggregation to be useful, since the
 domain build process requires the ability to write to the new domain's memory.
 
+Security Status of dom0 disaggregation
+--------------------------------------
+
+Xen supports disaggregation of various support and management
+functions into their own domains, via the XSM mechanisms described in
+this document.
+
+However the implementations of these support and management interfaces
+were originally written to be used only by the totally-privileged
+dom0, and have not been reviewed for security when exposed to
+supposedly-only-semi-privileged disaggregated management domains.  But
+such management domains are (in such a design) to be seen as
+potentially hostile, e.g. due to privilege escalation following
+exploitation of a bug in the management domain.
+
+Until the interfaces have been properly reviewed for security against
+hostile callers, the Xen.org security team intends (subject of course
+to the permission of anyone disclosing to us) to handle these and
+future vulnerabilities in these interfaces in public, as if they were
+normal non-security-related bugs.
+
+This applies only to bugs which do no more than reduce the security of
+a radically disaggregated system to the security of a
+non-disaggregated one.  Here a "radically disaggregated system" is one
+which uses the XSM mechanism to delegate the affected interfaces to
+other-than-fully-trusted domains.
+
+This policy does not apply to bugs which affect stub device models,
+driver domains, or stub xenstored - even if those bugs do no worse
+than reduce the security of such a system to one whose device models,
+backend drivers, or xenstore, run in dom0.
+
+For more information see http://xenbits.xen.org/xsa/advisory-77.html.
+
+The following interfaces are covered by this statement.  Interfaces
+not listed here are considered safe for disaggregation, security
+issues found in interfaces not listed here will be handled according
+to the normal security problem response policy
+http://www.xenproject.org/security-policy.html.
+
+__HYPERVISOR_domctl (xen/include/public/domctl.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XEN_DOMCTL_createdomain
+ * XEN_DOMCTL_destroydomain
+ * XEN_DOMCTL_pausedomain
+ * XEN_DOMCTL_unpausedomain
+ * XEN_DOMCTL_getdomaininfo
+ * XEN_DOMCTL_getmemlist
+ * XEN_DOMCTL_getpageframeinfo
+ * XEN_DOMCTL_getpageframeinfo2
+ * XEN_DOMCTL_setvcpuaffinity
+ * XEN_DOMCTL_shadow_op
+ * XEN_DOMCTL_max_mem
+ * XEN_DOMCTL_setvcpucontext
+ * XEN_DOMCTL_getvcpucontext
+ * XEN_DOMCTL_getvcpuinfo
+ * XEN_DOMCTL_max_vcpus
+ * XEN_DOMCTL_scheduler_op
+ * XEN_DOMCTL_setdomainhandle
+ * XEN_DOMCTL_setdebugging
+ * XEN_DOMCTL_irq_permission
+ * XEN_DOMCTL_iomem_permission
+ * XEN_DOMCTL_ioport_permission
+ * XEN_DOMCTL_hypercall_init
+ * XEN_DOMCTL_arch_setup
+ * XEN_DOMCTL_settimeoffset
+ * XEN_DOMCTL_getvcpuaffinity
+ * XEN_DOMCTL_real_mode_area
+ * XEN_DOMCTL_resumedomain
+ * XEN_DOMCTL_sendtrigger
+ * XEN_DOMCTL_subscribe
+ * XEN_DOMCTL_gethvmcontext
+ * XEN_DOMCTL_sethvmcontext
+ * XEN_DOMCTL_set_address_size
+ * XEN_DOMCTL_get_address_size
+ * XEN_DOMCTL_assign_device
+ * XEN_DOMCTL_pin_mem_cacheattr
+ * XEN_DOMCTL_set_ext_vcpucontext
+ * XEN_DOMCTL_get_ext_vcpucontext
+ * XEN_DOMCTL_set_opt_feature
+ * XEN_DOMCTL_test_assign_device
+ * XEN_DOMCTL_set_target
+ * XEN_DOMCTL_deassign_device
+ * XEN_DOMCTL_set_cpuid
+ * XEN_DOMCTL_get_device_group
+ * XEN_DOMCTL_set_machine_address_size
+ * XEN_DOMCTL_get_machine_address_size
+ * XEN_DOMCTL_suppress_spurious_page_faults
+ * XEN_DOMCTL_debug_op
+ * XEN_DOMCTL_gethvmcontext_partial
+ * XEN_DOMCTL_mem_event_op
+ * XEN_DOMCTL_mem_sharing_op
+ * XEN_DOMCTL_disable_migrate
+ * XEN_DOMCTL_gettscinfo
+ * XEN_DOMCTL_settscinfo
+ * XEN_DOMCTL_getpageframeinfo3
+ * XEN_DOMCTL_setvcpuextstate
+ * XEN_DOMCTL_getvcpuextstate
+ * XEN_DOMCTL_set_access_required
+ * XEN_DOMCTL_audit_p2m
+ * XEN_DOMCTL_set_virq_handler
+ * XEN_DOMCTL_set_broken_page_p2m
+ * XEN_DOMCTL_setnodeaffinity
+ * XEN_DOMCTL_getnodeaffinity
+ * XEN_DOMCTL_set_max_evtchn
+ * XEN_DOMCTL_gdbsx_guestmemio
+ * XEN_DOMCTL_gdbsx_pausevcpu
+ * XEN_DOMCTL_gdbsx_unpausevcpu
+ * XEN_DOMCTL_gdbsx_domstatus
+
+__HYPERVISOR_sysctl (xen/include/public/sysctl.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XEN_SYSCTL_readconsole
+ * XEN_SYSCTL_tbuf_op
+ * XEN_SYSCTL_physinfo
+ * XEN_SYSCTL_sched_id
+ * XEN_SYSCTL_perfc_op
+ * XEN_SYSCTL_getdomaininfolist
+ * XEN_SYSCTL_debug_keys
+ * XEN_SYSCTL_getcpuinfo
+ * XEN_SYSCTL_availheap
+ * XEN_SYSCTL_get_pmstat
+ * XEN_SYSCTL_cpu_hotplug
+ * XEN_SYSCTL_pm_op
+ * XEN_SYSCTL_page_offline_op
+ * XEN_SYSCTL_lockprof_op
+ * XEN_SYSCTL_topologyinfo
+ * XEN_SYSCTL_numainfo
+ * XEN_SYSCTL_cpupool_op
+ * XEN_SYSCTL_scheduler_op
+ * XEN_SYSCTL_coverage_op
+
+__HYPERVISOR_memory_op (xen/include/public/memory.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XENMEM_set_pod_target
+ * XENMEM_get_pod_target
+ * XENMEM_claim_pages
+
+__HYPERVISOR_tmem_op (xen/include/public/tmem.h)
+
+ The following tmem control ops, that is the sub-subops of
+ TMEM_CONTROL, are covered by this statement. 
+
+ Note that TMEM is also subject to a similar policy arising from
+ XSA-15 http://lists.xen.org/archives/html/xen-announce/2012-09/msg00006.html.
+ Due to this existing policy all TMEM Ops are already subject to
+ reduced security support.
+
+ * TMEMC_THAW
+ * TMEMC_FREEZE
+ * TMEMC_FLUSH
+ * TMEMC_DESTROY
+ * TMEMC_LIST
+ * TMEMC_SET_WEIGHT
+ * TMEMC_SET_CAP
+ * TMEMC_SET_COMPRESS
+ * TMEMC_QUERY_FREEABLE_MB
+ * TMEMC_SAVE_BEGIN
+ * TMEMC_SAVE_GET_VERSION
+ * TMEMC_SAVE_GET_MAXPOOLS
+ * TMEMC_SAVE_GET_CLIENT_WEIGHT
+ * TMEMC_SAVE_GET_CLIENT_CAP
+ * TMEMC_SAVE_GET_CLIENT_FLAGS
+ * TMEMC_SAVE_GET_POOL_FLAGS
+ * TMEMC_SAVE_GET_POOL_NPAGES
+ * TMEMC_SAVE_GET_POOL_UUID
+ * TMEMC_SAVE_GET_NEXT_PAGE
+ * TMEMC_SAVE_GET_NEXT_INV
+ * TMEMC_SAVE_END
+ * TMEMC_RESTORE_BEGIN
+ * TMEMC_RESTORE_PUT_PAGE
+ * TMEMC_RESTORE_FLUSH_PAGE
+
+
 
 Setting up FLASK
 ----------------
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:24:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO2m-0003jj-Uj; Fri, 13 Dec 2013 08:24: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 1VrO2l-0003jL-2O
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:19 +0000
Received: from [85.158.139.211:51656] by server-9.bemta-5.messagelabs.com id
	B2/40-15098-234CAA25; Fri, 13 Dec 2013 08:24:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1386923056!4231950!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19081 invoked from network); 13 Dec 2013 08:24:17 -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;
	13 Dec 2013 08:24: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 1VrO2h-0001at-S2
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO2h-0005y6-QT
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:15 +0000
Date: Fri, 13 Dec 2013 08:24:15 +0000
Message-Id: <E1VrO2h-0005y6-QT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: list interfaces subject to the
	security process exception in XSA-77
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5da5288a0a767c16705dd16ee5e5bb5cf7929397
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Dec 10 16:09:24 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:09:24 2013 +0100

    xen: list interfaces subject to the security process exception in XSA-77
    
    List all the sub ops of:
      __HYPERVISOR_domctl
      __HYPERVISOR_sysctl
      __HYPERVISOR_memory_op
      __HYPERVISOR_tmem_op
    which are subject to the policy given in
    http://xenbits.xen.org/xsa/advisory-77.html
    
    It is expected that these lists will be whittled away as each interface is
    audited for safety.
    
    New interfaces should be expected to be safe when introduced (IOW the list
    should never be expanded).
    
    This is XSA-77.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xsm-flask.txt |  183 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 183 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xsm-flask.txt b/docs/misc/xsm-flask.txt
index ff81b01..ddd5831 100644
--- a/docs/misc/xsm-flask.txt
+++ b/docs/misc/xsm-flask.txt
@@ -17,6 +17,189 @@ Some examples of what FLASK can do:
 Some of these examples require dom0 disaggregation to be useful, since the
 domain build process requires the ability to write to the new domain's memory.
 
+Security Status of dom0 disaggregation
+--------------------------------------
+
+Xen supports disaggregation of various support and management
+functions into their own domains, via the XSM mechanisms described in
+this document.
+
+However the implementations of these support and management interfaces
+were originally written to be used only by the totally-privileged
+dom0, and have not been reviewed for security when exposed to
+supposedly-only-semi-privileged disaggregated management domains.  But
+such management domains are (in such a design) to be seen as
+potentially hostile, e.g. due to privilege escalation following
+exploitation of a bug in the management domain.
+
+Until the interfaces have been properly reviewed for security against
+hostile callers, the Xen.org security team intends (subject of course
+to the permission of anyone disclosing to us) to handle these and
+future vulnerabilities in these interfaces in public, as if they were
+normal non-security-related bugs.
+
+This applies only to bugs which do no more than reduce the security of
+a radically disaggregated system to the security of a
+non-disaggregated one.  Here a "radically disaggregated system" is one
+which uses the XSM mechanism to delegate the affected interfaces to
+other-than-fully-trusted domains.
+
+This policy does not apply to bugs which affect stub device models,
+driver domains, or stub xenstored - even if those bugs do no worse
+than reduce the security of such a system to one whose device models,
+backend drivers, or xenstore, run in dom0.
+
+For more information see http://xenbits.xen.org/xsa/advisory-77.html.
+
+The following interfaces are covered by this statement.  Interfaces
+not listed here are considered safe for disaggregation, security
+issues found in interfaces not listed here will be handled according
+to the normal security problem response policy
+http://www.xenproject.org/security-policy.html.
+
+__HYPERVISOR_domctl (xen/include/public/domctl.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XEN_DOMCTL_createdomain
+ * XEN_DOMCTL_destroydomain
+ * XEN_DOMCTL_pausedomain
+ * XEN_DOMCTL_unpausedomain
+ * XEN_DOMCTL_getdomaininfo
+ * XEN_DOMCTL_getmemlist
+ * XEN_DOMCTL_getpageframeinfo
+ * XEN_DOMCTL_getpageframeinfo2
+ * XEN_DOMCTL_setvcpuaffinity
+ * XEN_DOMCTL_shadow_op
+ * XEN_DOMCTL_max_mem
+ * XEN_DOMCTL_setvcpucontext
+ * XEN_DOMCTL_getvcpucontext
+ * XEN_DOMCTL_getvcpuinfo
+ * XEN_DOMCTL_max_vcpus
+ * XEN_DOMCTL_scheduler_op
+ * XEN_DOMCTL_setdomainhandle
+ * XEN_DOMCTL_setdebugging
+ * XEN_DOMCTL_irq_permission
+ * XEN_DOMCTL_iomem_permission
+ * XEN_DOMCTL_ioport_permission
+ * XEN_DOMCTL_hypercall_init
+ * XEN_DOMCTL_arch_setup
+ * XEN_DOMCTL_settimeoffset
+ * XEN_DOMCTL_getvcpuaffinity
+ * XEN_DOMCTL_real_mode_area
+ * XEN_DOMCTL_resumedomain
+ * XEN_DOMCTL_sendtrigger
+ * XEN_DOMCTL_subscribe
+ * XEN_DOMCTL_gethvmcontext
+ * XEN_DOMCTL_sethvmcontext
+ * XEN_DOMCTL_set_address_size
+ * XEN_DOMCTL_get_address_size
+ * XEN_DOMCTL_assign_device
+ * XEN_DOMCTL_pin_mem_cacheattr
+ * XEN_DOMCTL_set_ext_vcpucontext
+ * XEN_DOMCTL_get_ext_vcpucontext
+ * XEN_DOMCTL_set_opt_feature
+ * XEN_DOMCTL_test_assign_device
+ * XEN_DOMCTL_set_target
+ * XEN_DOMCTL_deassign_device
+ * XEN_DOMCTL_set_cpuid
+ * XEN_DOMCTL_get_device_group
+ * XEN_DOMCTL_set_machine_address_size
+ * XEN_DOMCTL_get_machine_address_size
+ * XEN_DOMCTL_suppress_spurious_page_faults
+ * XEN_DOMCTL_debug_op
+ * XEN_DOMCTL_gethvmcontext_partial
+ * XEN_DOMCTL_mem_event_op
+ * XEN_DOMCTL_mem_sharing_op
+ * XEN_DOMCTL_disable_migrate
+ * XEN_DOMCTL_gettscinfo
+ * XEN_DOMCTL_settscinfo
+ * XEN_DOMCTL_getpageframeinfo3
+ * XEN_DOMCTL_setvcpuextstate
+ * XEN_DOMCTL_getvcpuextstate
+ * XEN_DOMCTL_set_access_required
+ * XEN_DOMCTL_audit_p2m
+ * XEN_DOMCTL_set_virq_handler
+ * XEN_DOMCTL_set_broken_page_p2m
+ * XEN_DOMCTL_setnodeaffinity
+ * XEN_DOMCTL_getnodeaffinity
+ * XEN_DOMCTL_set_max_evtchn
+ * XEN_DOMCTL_gdbsx_guestmemio
+ * XEN_DOMCTL_gdbsx_pausevcpu
+ * XEN_DOMCTL_gdbsx_unpausevcpu
+ * XEN_DOMCTL_gdbsx_domstatus
+
+__HYPERVISOR_sysctl (xen/include/public/sysctl.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XEN_SYSCTL_readconsole
+ * XEN_SYSCTL_tbuf_op
+ * XEN_SYSCTL_physinfo
+ * XEN_SYSCTL_sched_id
+ * XEN_SYSCTL_perfc_op
+ * XEN_SYSCTL_getdomaininfolist
+ * XEN_SYSCTL_debug_keys
+ * XEN_SYSCTL_getcpuinfo
+ * XEN_SYSCTL_availheap
+ * XEN_SYSCTL_get_pmstat
+ * XEN_SYSCTL_cpu_hotplug
+ * XEN_SYSCTL_pm_op
+ * XEN_SYSCTL_page_offline_op
+ * XEN_SYSCTL_lockprof_op
+ * XEN_SYSCTL_topologyinfo
+ * XEN_SYSCTL_numainfo
+ * XEN_SYSCTL_cpupool_op
+ * XEN_SYSCTL_scheduler_op
+ * XEN_SYSCTL_coverage_op
+
+__HYPERVISOR_memory_op (xen/include/public/memory.h)
+
+ The following subops are covered by this statement. subops not listed
+ here are considered safe for disaggregation.
+
+ * XENMEM_set_pod_target
+ * XENMEM_get_pod_target
+ * XENMEM_claim_pages
+
+__HYPERVISOR_tmem_op (xen/include/public/tmem.h)
+
+ The following tmem control ops, that is the sub-subops of
+ TMEM_CONTROL, are covered by this statement. 
+
+ Note that TMEM is also subject to a similar policy arising from
+ XSA-15 http://lists.xen.org/archives/html/xen-announce/2012-09/msg00006.html.
+ Due to this existing policy all TMEM Ops are already subject to
+ reduced security support.
+
+ * TMEMC_THAW
+ * TMEMC_FREEZE
+ * TMEMC_FLUSH
+ * TMEMC_DESTROY
+ * TMEMC_LIST
+ * TMEMC_SET_WEIGHT
+ * TMEMC_SET_CAP
+ * TMEMC_SET_COMPRESS
+ * TMEMC_QUERY_FREEABLE_MB
+ * TMEMC_SAVE_BEGIN
+ * TMEMC_SAVE_GET_VERSION
+ * TMEMC_SAVE_GET_MAXPOOLS
+ * TMEMC_SAVE_GET_CLIENT_WEIGHT
+ * TMEMC_SAVE_GET_CLIENT_CAP
+ * TMEMC_SAVE_GET_CLIENT_FLAGS
+ * TMEMC_SAVE_GET_POOL_FLAGS
+ * TMEMC_SAVE_GET_POOL_NPAGES
+ * TMEMC_SAVE_GET_POOL_UUID
+ * TMEMC_SAVE_GET_NEXT_PAGE
+ * TMEMC_SAVE_GET_NEXT_INV
+ * TMEMC_SAVE_END
+ * TMEMC_RESTORE_BEGIN
+ * TMEMC_RESTORE_PUT_PAGE
+ * TMEMC_RESTORE_FLUSH_PAGE
+
+
 
 Setting up FLASK
 ----------------
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:24:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO2x-0003lc-1K; Fri, 13 Dec 2013 08:24: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 1VrO2u-0003lB-Q2
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:29 +0000
Received: from [85.158.137.68:33355] by server-1.bemta-3.messagelabs.com id
	76/01-29598-C34CAA25; Fri, 13 Dec 2013 08:24:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1386923066!3703132!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 749 invoked from network); 13 Dec 2013 08:24:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:24: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 1VrO2s-0001az-28
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO2r-0005yS-V8
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:26 +0000
Date: Fri, 13 Dec 2013 08:24:25 +0000
Message-Id: <E1VrO2r-0005yS-V8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] IOMMU: clear "don't flush" override on
	error paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 552b7fcb9a70f1d4dd0e0cd5fb4d3d9da410104a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 10 16:10:37 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:10:37 2013 +0100

    IOMMU: clear "don't flush" override on error paths
    
    Both xenmem_add_to_physmap() and iommu_populate_page_table() each have
    an error path that fails to clear that flag, thus suppressing further
    flushes on the respective pCPU.
    
    In iommu_populate_page_table() also slightly re-arrange code to avoid
    the false impression of the flag in question being guarded by a
    domain's page_alloc_lock.
    
    This is CVE-2013-6400 / XSA-80.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/mm.c               |    2 +-
 xen/drivers/passthrough/iommu.c |   24 +++++++++++++-----------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6c26026..dd42bde 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4648,7 +4648,7 @@ static int xenmem_add_to_physmap(struct domain *d,
         {
             rc = xenmem_add_to_physmap_once(d, xatp);
             if ( rc < 0 )
-                return rc;
+                break;
 
             xatp->idx++;
             xatp->gpfn++;
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index bdc7261..d3dd683 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -322,11 +322,11 @@ static int iommu_populate_page_table(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
     struct page_info *page;
-    int rc;
+    int rc = 0;
 
+    this_cpu(iommu_dont_flush_iotlb) = 1;
     spin_lock(&d->page_alloc_lock);
 
-    this_cpu(iommu_dont_flush_iotlb) = 1;
     page_list_for_each ( page, &d->page_list )
     {
         if ( is_hvm_domain(d) ||
@@ -336,18 +336,20 @@ static int iommu_populate_page_table(struct domain *d)
             rc = hd->platform_ops->map_page(
                 d, mfn_to_gmfn(d, page_to_mfn(page)), page_to_mfn(page),
                 IOMMUF_readable|IOMMUF_writable);
-            if (rc)
-            {
-                spin_unlock(&d->page_alloc_lock);
-                hd->platform_ops->teardown(d);
-                return rc;
-            }
+            if ( rc )
+                break;
         }
     }
-    this_cpu(iommu_dont_flush_iotlb) = 0;
-    iommu_iotlb_flush_all(d);
+
     spin_unlock(&d->page_alloc_lock);
-    return 0;
+    this_cpu(iommu_dont_flush_iotlb) = 0;
+
+    if ( !rc )
+        iommu_iotlb_flush_all(d);
+    else
+        hd->platform_ops->teardown(d);
+
+    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 Dec 13 08:24:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO2x-0003lc-1K; Fri, 13 Dec 2013 08:24: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 1VrO2u-0003lB-Q2
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:29 +0000
Received: from [85.158.137.68:33355] by server-1.bemta-3.messagelabs.com id
	76/01-29598-C34CAA25; Fri, 13 Dec 2013 08:24:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1386923066!3703132!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 749 invoked from network); 13 Dec 2013 08:24:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:24: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 1VrO2s-0001az-28
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO2r-0005yS-V8
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:26 +0000
Date: Fri, 13 Dec 2013 08:24:25 +0000
Message-Id: <E1VrO2r-0005yS-V8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] IOMMU: clear "don't flush" override on
	error paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 552b7fcb9a70f1d4dd0e0cd5fb4d3d9da410104a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 10 16:10:37 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:10:37 2013 +0100

    IOMMU: clear "don't flush" override on error paths
    
    Both xenmem_add_to_physmap() and iommu_populate_page_table() each have
    an error path that fails to clear that flag, thus suppressing further
    flushes on the respective pCPU.
    
    In iommu_populate_page_table() also slightly re-arrange code to avoid
    the false impression of the flag in question being guarded by a
    domain's page_alloc_lock.
    
    This is CVE-2013-6400 / XSA-80.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/mm.c               |    2 +-
 xen/drivers/passthrough/iommu.c |   24 +++++++++++++-----------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6c26026..dd42bde 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4648,7 +4648,7 @@ static int xenmem_add_to_physmap(struct domain *d,
         {
             rc = xenmem_add_to_physmap_once(d, xatp);
             if ( rc < 0 )
-                return rc;
+                break;
 
             xatp->idx++;
             xatp->gpfn++;
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index bdc7261..d3dd683 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -322,11 +322,11 @@ static int iommu_populate_page_table(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
     struct page_info *page;
-    int rc;
+    int rc = 0;
 
+    this_cpu(iommu_dont_flush_iotlb) = 1;
     spin_lock(&d->page_alloc_lock);
 
-    this_cpu(iommu_dont_flush_iotlb) = 1;
     page_list_for_each ( page, &d->page_list )
     {
         if ( is_hvm_domain(d) ||
@@ -336,18 +336,20 @@ static int iommu_populate_page_table(struct domain *d)
             rc = hd->platform_ops->map_page(
                 d, mfn_to_gmfn(d, page_to_mfn(page)), page_to_mfn(page),
                 IOMMUF_readable|IOMMUF_writable);
-            if (rc)
-            {
-                spin_unlock(&d->page_alloc_lock);
-                hd->platform_ops->teardown(d);
-                return rc;
-            }
+            if ( rc )
+                break;
         }
     }
-    this_cpu(iommu_dont_flush_iotlb) = 0;
-    iommu_iotlb_flush_all(d);
+
     spin_unlock(&d->page_alloc_lock);
-    return 0;
+    this_cpu(iommu_dont_flush_iotlb) = 0;
+
+    if ( !rc )
+        iommu_iotlb_flush_all(d);
+    else
+        hd->platform_ops->teardown(d);
+
+    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 Dec 13 08:24:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO37-0003nO-5T; Fri, 13 Dec 2013 08:24: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 1VrO35-0003n7-2o
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:39 +0000
Received: from [85.158.137.68:18645] by server-17.bemta-3.messagelabs.com id
	9D/EB-15965-644CAA25; Fri, 13 Dec 2013 08:24:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1386923076!21397!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2869 invoked from network); 13 Dec 2013 08:24:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:24: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 1VrO32-0001bA-77
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO32-0005yv-4r
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:36 +0000
Date: Fri, 13 Dec 2013 08:24:36 +0000
Message-Id: <E1VrO32-0005yv-4r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] amd/passthrough: Do not leak domain
	mappings from do_invalidate_dte()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 80dbe90a4e6b31f8cb859f7450fa3eed8695fd1d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 10 16:16:49 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:16:49 2013 +0100

    amd/passthrough: Do not leak domain mappings from do_invalidate_dte()
    
    Coverity ID: 1135379
    
    As the code stands, the domain mapping will be leaked on each error path.
    
    The mapping can be for a much shorter period of time, and all the relevent
    information can be pulled out at once.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <JBeulich@suse.com>
    Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 xen/drivers/passthrough/amd/iommu_guest.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
index 952600a..477de20 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -424,12 +424,17 @@ static int do_invalidate_dte(struct domain *d, cmd_entry_t *cmd)
                                         sizeof(dev_entry_t), gbdf);
     ASSERT(mfn_valid(dte_mfn));
 
+    /* Read guest dte information */
     dte_base = map_domain_page(dte_mfn);
 
     gdte = dte_base + gbdf % (PAGE_SIZE / sizeof(dev_entry_t));
 
     gdom_id  = get_domid_from_dte(gdte);
     gcr3_gfn = get_guest_cr3_from_dte(gdte);
+    glx      = get_glx_from_dte(gdte);
+    gv       = get_gv_from_dte(gdte);
+
+    unmap_domain_page(dte_base);
 
     /* Do not update host dte before gcr3 has been set */
     if ( gcr3_gfn == 0 )
@@ -440,7 +445,6 @@ static int do_invalidate_dte(struct domain *d, cmd_entry_t *cmd)
 
     ASSERT(mfn_valid(gcr3_mfn));
 
-    /* Read guest dte information */
     iommu = find_iommu_for_device(0, mbdf);
     if ( !iommu )
     {
@@ -449,11 +453,6 @@ static int do_invalidate_dte(struct domain *d, cmd_entry_t *cmd)
         return -ENODEV;
     }
 
-    glx = get_glx_from_dte(gdte);
-    gv = get_gv_from_dte(gdte);
-
-    unmap_domain_page(dte_base);
-
     /* Setup host device entry */
     hdom_id = host_domid(d, gdom_id);
     req_id = get_dma_requestor_id(iommu->seg, mbdf);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:24:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO37-0003nO-5T; Fri, 13 Dec 2013 08:24: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 1VrO35-0003n7-2o
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:39 +0000
Received: from [85.158.137.68:18645] by server-17.bemta-3.messagelabs.com id
	9D/EB-15965-644CAA25; Fri, 13 Dec 2013 08:24:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1386923076!21397!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2869 invoked from network); 13 Dec 2013 08:24:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:24: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 1VrO32-0001bA-77
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO32-0005yv-4r
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:36 +0000
Date: Fri, 13 Dec 2013 08:24:36 +0000
Message-Id: <E1VrO32-0005yv-4r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] amd/passthrough: Do not leak domain
	mappings from do_invalidate_dte()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 80dbe90a4e6b31f8cb859f7450fa3eed8695fd1d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 10 16:16:49 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:16:49 2013 +0100

    amd/passthrough: Do not leak domain mappings from do_invalidate_dte()
    
    Coverity ID: 1135379
    
    As the code stands, the domain mapping will be leaked on each error path.
    
    The mapping can be for a much shorter period of time, and all the relevent
    information can be pulled out at once.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <JBeulich@suse.com>
    Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 xen/drivers/passthrough/amd/iommu_guest.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
index 952600a..477de20 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -424,12 +424,17 @@ static int do_invalidate_dte(struct domain *d, cmd_entry_t *cmd)
                                         sizeof(dev_entry_t), gbdf);
     ASSERT(mfn_valid(dte_mfn));
 
+    /* Read guest dte information */
     dte_base = map_domain_page(dte_mfn);
 
     gdte = dte_base + gbdf % (PAGE_SIZE / sizeof(dev_entry_t));
 
     gdom_id  = get_domid_from_dte(gdte);
     gcr3_gfn = get_guest_cr3_from_dte(gdte);
+    glx      = get_glx_from_dte(gdte);
+    gv       = get_gv_from_dte(gdte);
+
+    unmap_domain_page(dte_base);
 
     /* Do not update host dte before gcr3 has been set */
     if ( gcr3_gfn == 0 )
@@ -440,7 +445,6 @@ static int do_invalidate_dte(struct domain *d, cmd_entry_t *cmd)
 
     ASSERT(mfn_valid(gcr3_mfn));
 
-    /* Read guest dte information */
     iommu = find_iommu_for_device(0, mbdf);
     if ( !iommu )
     {
@@ -449,11 +453,6 @@ static int do_invalidate_dte(struct domain *d, cmd_entry_t *cmd)
         return -ENODEV;
     }
 
-    glx = get_glx_from_dte(gdte);
-    gv = get_gv_from_dte(gdte);
-
-    unmap_domain_page(dte_base);
-
     /* Setup host device entry */
     hdom_id = host_domid(d, gdom_id);
     req_id = get_dma_requestor_id(iommu->seg, mbdf);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:24:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO3G-0003pE-8J; Fri, 13 Dec 2013 08:24: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 1VrO3F-0003ow-4P
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:49 +0000
Received: from [85.158.139.211:48391] by server-8.bemta-5.messagelabs.com id
	B5/13-29838-054CAA25; Fri, 13 Dec 2013 08:24:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1386923086!4200477!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21095 invoked from network); 13 Dec 2013 08:24:47 -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;
	13 Dec 2013 08:24: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 1VrO3C-0001bG-Ao
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO3C-0005zq-9l
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:46 +0000
Date: Fri, 13 Dec 2013 08:24:46 +0000
Message-Id: <E1VrO3C-0005zq-9l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: Add Andres Lagar-Cavilla
	for mem-sharing/paging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 522277bf802b40da921e0fc69c7f7fcd093126d4
Author:     Andres Lagar-Cavilla <andres@lagarcavilla.org>
AuthorDate: Tue Dec 10 16:53:40 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:53:40 2013 +0100

    MAINTAINERS: Add Andres Lagar-Cavilla for mem-sharing/paging
    
    Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 MAINTAINERS |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 33130e5..4d9648f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -331,6 +331,14 @@ M:	Tim Deegan <tim@xen.org>
 S:	Supported
 F:	xen/arch/x86/mm/
 
+X86 MEMORY SHARING AND PAGING
+M:	Andres Lagar-Cavilla <andres@lagarcavilla.org>
+M:	Tim Deegan <tim@xen.org>
+S:	Supported
+F:	xen/arch/x86/mm/mem_sharing.c
+F:	xen/arch/x86/mm/mem_paging.c
+F:	tools/memshr
+
 XENTRACE
 M:	George Dunlap <george.dunlap@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 Fri Dec 13 08:24:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:24: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 1VrO3G-0003pE-8J; Fri, 13 Dec 2013 08:24: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 1VrO3F-0003ow-4P
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:49 +0000
Received: from [85.158.139.211:48391] by server-8.bemta-5.messagelabs.com id
	B5/13-29838-054CAA25; Fri, 13 Dec 2013 08:24:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1386923086!4200477!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21095 invoked from network); 13 Dec 2013 08:24:47 -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;
	13 Dec 2013 08:24: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 1VrO3C-0001bG-Ao
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO3C-0005zq-9l
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:46 +0000
Date: Fri, 13 Dec 2013 08:24:46 +0000
Message-Id: <E1VrO3C-0005zq-9l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: Add Andres Lagar-Cavilla
	for mem-sharing/paging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 522277bf802b40da921e0fc69c7f7fcd093126d4
Author:     Andres Lagar-Cavilla <andres@lagarcavilla.org>
AuthorDate: Tue Dec 10 16:53:40 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 10 16:53:40 2013 +0100

    MAINTAINERS: Add Andres Lagar-Cavilla for mem-sharing/paging
    
    Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 MAINTAINERS |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 33130e5..4d9648f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -331,6 +331,14 @@ M:	Tim Deegan <tim@xen.org>
 S:	Supported
 F:	xen/arch/x86/mm/
 
+X86 MEMORY SHARING AND PAGING
+M:	Andres Lagar-Cavilla <andres@lagarcavilla.org>
+M:	Tim Deegan <tim@xen.org>
+S:	Supported
+F:	xen/arch/x86/mm/mem_sharing.c
+F:	xen/arch/x86/mm/mem_paging.c
+F:	tools/memshr
+
 XENTRACE
 M:	George Dunlap <george.dunlap@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 Fri Dec 13 08:25:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25: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 1VrO3Q-0003qw-Bg; Fri, 13 Dec 2013 08:25:00 +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 1VrO3P-0003qj-Cd
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:59 +0000
Received: from [85.158.137.68:39375] by server-6.bemta-3.messagelabs.com id
	5F/35-04868-A54CAA25; Fri, 13 Dec 2013 08:24:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1386923096!3663558!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18325 invoked from network); 13 Dec 2013 08:24:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:24: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 1VrO3M-0001bP-Es
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO3M-00060C-Da
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:56 +0000
Date: Fri, 13 Dec 2013 08:24:56 +0000
Message-Id: <E1VrO3M-00060C-Da@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/cpuidle: publish new states only
	after fully initializing them
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4ca6f9f0377a30755a299cc60a6d44ab6c3b34d0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 11 10:30:02 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 11 10:30:02 2013 +0100

    x86/cpuidle: publish new states only after fully initializing them
    
    Since state information coming from Dom0 can arrive at any time, on
    any CPU, we ought to make sure that a new state is fully initialized
    before the target CPU might be using it.
    
    Once touching that code, also do minor cleanup: A missing (but benign)
    "break" and some white space adjustments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Liu Jinsong <jinsong.liu@intel.com>
---
 xen/arch/x86/acpi/cpu_idle.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 9313285..597befa 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -912,7 +912,7 @@ static void set_cx(
                    acpi_power->cpu, xen_cx->type);
             return;
         }
-        cx = &acpi_power->states[acpi_power->count++];
+        cx = &acpi_power->states[acpi_power->count];
         cx->type = xen_cx->type;
         break;
     }
@@ -937,11 +937,14 @@ static void set_cx(
         break;
     default:
         cx->entry_method = ACPI_CSTATE_EM_NONE;
+        break;
     }
 
-    cx->latency  = xen_cx->latency;
-    
+    cx->latency = xen_cx->latency;
     cx->target_residency = cx->latency * latency_factor;
+
+    smp_wmb();
+    acpi_power->count++;
     if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
         acpi_power->safe_state = cx;
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:25:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25: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 1VrO3Q-0003qw-Bg; Fri, 13 Dec 2013 08:25:00 +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 1VrO3P-0003qj-Cd
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:59 +0000
Received: from [85.158.137.68:39375] by server-6.bemta-3.messagelabs.com id
	5F/35-04868-A54CAA25; Fri, 13 Dec 2013 08:24:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1386923096!3663558!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18325 invoked from network); 13 Dec 2013 08:24:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:24: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 1VrO3M-0001bP-Es
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO3M-00060C-Da
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:24:56 +0000
Date: Fri, 13 Dec 2013 08:24:56 +0000
Message-Id: <E1VrO3M-00060C-Da@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/cpuidle: publish new states only
	after fully initializing them
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4ca6f9f0377a30755a299cc60a6d44ab6c3b34d0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 11 10:30:02 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 11 10:30:02 2013 +0100

    x86/cpuidle: publish new states only after fully initializing them
    
    Since state information coming from Dom0 can arrive at any time, on
    any CPU, we ought to make sure that a new state is fully initialized
    before the target CPU might be using it.
    
    Once touching that code, also do minor cleanup: A missing (but benign)
    "break" and some white space adjustments.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Liu Jinsong <jinsong.liu@intel.com>
---
 xen/arch/x86/acpi/cpu_idle.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 9313285..597befa 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -912,7 +912,7 @@ static void set_cx(
                    acpi_power->cpu, xen_cx->type);
             return;
         }
-        cx = &acpi_power->states[acpi_power->count++];
+        cx = &acpi_power->states[acpi_power->count];
         cx->type = xen_cx->type;
         break;
     }
@@ -937,11 +937,14 @@ static void set_cx(
         break;
     default:
         cx->entry_method = ACPI_CSTATE_EM_NONE;
+        break;
     }
 
-    cx->latency  = xen_cx->latency;
-    
+    cx->latency = xen_cx->latency;
     cx->target_residency = cx->latency * latency_factor;
+
+    smp_wmb();
+    acpi_power->count++;
     if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
         acpi_power->safe_state = cx;
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:25:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25: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 1VrO3a-0003tC-GU; Fri, 13 Dec 2013 08:25: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 1VrO3Z-0003t0-E0
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:09 +0000
Received: from [193.109.254.147:39587] by server-5.bemta-14.messagelabs.com id
	18/20-03510-464CAA25; Fri, 13 Dec 2013 08:25:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1386923107!4947152!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12828 invoked from network); 13 Dec 2013 08:25:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:25: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 1VrO3W-0001by-ML
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO3W-00060l-Hi
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:06 +0000
Date: Fri, 13 Dec 2013 08:25:06 +0000
Message-Id: <E1VrO3W-00060l-Hi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PV: don't commit debug register
	values early in arch_set_info_guest()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 398c39b6c18d0b55acfc88f5ee75b3a793e6eeec
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 11 10:33:19 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 11 10:33:19 2013 +0100

    x86/PV: don't commit debug register values early in arch_set_info_guest()
    
    They're being taken care of later (via set_debugreg()), and temporarily
    copying them into struct vcpu means that bad values may end up getting
    loaded during context switch if the vCPU is already running and the
    function errors out between the premature and real commit step, leading
    to the same issue that XSA-12 dealt with.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domain.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index c0ac5d6..da8e522 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -743,11 +743,12 @@ int arch_set_info_guest(
             XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i,
                            c.cmp->trap_ctxt + i);
     }
-    for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )
-        v->arch.debugreg[i] = c(debugreg[i]);
 
     if ( has_hvm_container_vcpu(v) )
     {
+        for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )
+            v->arch.debugreg[i] = c(debugreg[i]);
+
         hvm_set_info_guest(v);
 
         if ( is_hvm_vcpu(v) || v->is_initialised )
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:25:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25: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 1VrO3a-0003tC-GU; Fri, 13 Dec 2013 08:25: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 1VrO3Z-0003t0-E0
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:09 +0000
Received: from [193.109.254.147:39587] by server-5.bemta-14.messagelabs.com id
	18/20-03510-464CAA25; Fri, 13 Dec 2013 08:25:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1386923107!4947152!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12828 invoked from network); 13 Dec 2013 08:25:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:25: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 1VrO3W-0001by-ML
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO3W-00060l-Hi
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:06 +0000
Date: Fri, 13 Dec 2013 08:25:06 +0000
Message-Id: <E1VrO3W-00060l-Hi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PV: don't commit debug register
	values early in arch_set_info_guest()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 398c39b6c18d0b55acfc88f5ee75b3a793e6eeec
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Dec 11 10:33:19 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 11 10:33:19 2013 +0100

    x86/PV: don't commit debug register values early in arch_set_info_guest()
    
    They're being taken care of later (via set_debugreg()), and temporarily
    copying them into struct vcpu means that bad values may end up getting
    loaded during context switch if the vCPU is already running and the
    function errors out between the premature and real commit step, leading
    to the same issue that XSA-12 dealt with.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/domain.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index c0ac5d6..da8e522 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -743,11 +743,12 @@ int arch_set_info_guest(
             XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i,
                            c.cmp->trap_ctxt + i);
     }
-    for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )
-        v->arch.debugreg[i] = c(debugreg[i]);
 
     if ( has_hvm_container_vcpu(v) )
     {
+        for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )
+            v->arch.debugreg[i] = c(debugreg[i]);
+
         hvm_set_info_guest(v);
 
         if ( is_hvm_vcpu(v) || v->is_initialised )
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:25:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25: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 1VrO3k-0003v1-J5; Fri, 13 Dec 2013 08:25: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 1VrO3j-0003uj-FM
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:19 +0000
Received: from [85.158.137.68:40967] by server-16.bemta-3.messagelabs.com id
	F7/1A-26128-E64CAA25; Fri, 13 Dec 2013 08:25:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1386923117!3646840!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23638 invoked from network); 13 Dec 2013 08:25:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:25: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 1VrO3g-0001c4-Qo
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO3g-00061A-Pg
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:16 +0000
Date: Fri, 13 Dec 2013 08:25:16 +0000
Message-Id: <E1VrO3g-00061A-Pg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] kexec/x86: do not map crash kernel 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 7113a45451a9f656deeff070e47672043ed83664
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Wed Dec 11 10:37:25 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 11 10:37:25 2013 +0100

    kexec/x86: do not map crash kernel area
    
    This mapping was apparently never used.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/arch/x86/setup.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index f07ee2b..4833ca3 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1097,9 +1097,7 @@ void __init __start_xen(unsigned long mbi_p)
                          mod[i].mod_start,
                          PFN_UP(mod[i].mod_end), PAGE_HYPERVISOR);
     }
-    map_pages_to_xen((unsigned long)__va(kexec_crash_area.start),
-                     kexec_crash_area.start >> PAGE_SHIFT,
-                     PFN_UP(kexec_crash_area.size), PAGE_HYPERVISOR);
+
     xen_virt_end = ((unsigned long)_end + (1UL << L2_PAGETABLE_SHIFT) - 1) &
                    ~((1UL << L2_PAGETABLE_SHIFT) - 1);
     destroy_xen_mappings(xen_virt_end, XEN_VIRT_START + BOOTSTRAP_MAP_BASE);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:25:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25: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 1VrO3k-0003v1-J5; Fri, 13 Dec 2013 08:25: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 1VrO3j-0003uj-FM
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:19 +0000
Received: from [85.158.137.68:40967] by server-16.bemta-3.messagelabs.com id
	F7/1A-26128-E64CAA25; Fri, 13 Dec 2013 08:25:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1386923117!3646840!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23638 invoked from network); 13 Dec 2013 08:25:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:25: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 1VrO3g-0001c4-Qo
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO3g-00061A-Pg
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:16 +0000
Date: Fri, 13 Dec 2013 08:25:16 +0000
Message-Id: <E1VrO3g-00061A-Pg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] kexec/x86: do not map crash kernel 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 7113a45451a9f656deeff070e47672043ed83664
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Wed Dec 11 10:37:25 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Dec 11 10:37:25 2013 +0100

    kexec/x86: do not map crash kernel area
    
    This mapping was apparently never used.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Acked-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/arch/x86/setup.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index f07ee2b..4833ca3 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1097,9 +1097,7 @@ void __init __start_xen(unsigned long mbi_p)
                          mod[i].mod_start,
                          PFN_UP(mod[i].mod_end), PAGE_HYPERVISOR);
     }
-    map_pages_to_xen((unsigned long)__va(kexec_crash_area.start),
-                     kexec_crash_area.start >> PAGE_SHIFT,
-                     PFN_UP(kexec_crash_area.size), PAGE_HYPERVISOR);
+
     xen_virt_end = ((unsigned long)_end + (1UL << L2_PAGETABLE_SHIFT) - 1) &
                    ~((1UL << L2_PAGETABLE_SHIFT) - 1);
     destroy_xen_mappings(xen_virt_end, XEN_VIRT_START + BOOTSTRAP_MAP_BASE);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:25:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25: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 1VrO3u-0003wf-Qu; Fri, 13 Dec 2013 08:25: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 1VrO3t-0003wQ-D3
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:29 +0000
Received: from [85.158.143.35:30221] by server-1.bemta-4.messagelabs.com id
	D6/F9-02132-874CAA25; Fri, 13 Dec 2013 08:25:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1386923127!2806315!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25229 invoked from network); 13 Dec 2013 08:25:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:25: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 1VrO3q-0001cA-VS
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO3q-00061W-U3
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:26 +0000
Date: Fri, 13 Dec 2013 08:25:26 +0000
Message-Id: <E1VrO3q-00061W-U3@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 8faa4049cfc74fc8fa2887d3b5ed0d225a21a97b
Merge: db94bdb3145c48356d17637a33c4298613215c21 7113a45451a9f656deeff070e47672043ed83664
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 11 13:36:27 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:36:27 2013 +0000

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 MAINTAINERS                               |    8 ++
 docs/misc/xsm-flask.txt                   |  183 +++++++++++++++++++++++++++++
 xen/arch/x86/acpi/cpu_idle.c              |    9 +-
 xen/arch/x86/domain.c                     |    5 +-
 xen/arch/x86/mm.c                         |    2 +-
 xen/arch/x86/setup.c                      |    4 +-
 xen/drivers/passthrough/amd/iommu_guest.c |   11 +-
 xen/drivers/passthrough/iommu.c           |   24 ++--
 8 files changed, 220 insertions(+), 26 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 Dec 13 08:25:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25: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 1VrO3u-0003wf-Qu; Fri, 13 Dec 2013 08:25: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 1VrO3t-0003wQ-D3
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:29 +0000
Received: from [85.158.143.35:30221] by server-1.bemta-4.messagelabs.com id
	D6/F9-02132-874CAA25; Fri, 13 Dec 2013 08:25:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1386923127!2806315!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25229 invoked from network); 13 Dec 2013 08:25:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:25: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 1VrO3q-0001cA-VS
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO3q-00061W-U3
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:26 +0000
Date: Fri, 13 Dec 2013 08:25:26 +0000
Message-Id: <E1VrO3q-00061W-U3@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 8faa4049cfc74fc8fa2887d3b5ed0d225a21a97b
Merge: db94bdb3145c48356d17637a33c4298613215c21 7113a45451a9f656deeff070e47672043ed83664
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 11 13:36:27 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 11 13:36:27 2013 +0000

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 MAINTAINERS                               |    8 ++
 docs/misc/xsm-flask.txt                   |  183 +++++++++++++++++++++++++++++
 xen/arch/x86/acpi/cpu_idle.c              |    9 +-
 xen/arch/x86/domain.c                     |    5 +-
 xen/arch/x86/mm.c                         |    2 +-
 xen/arch/x86/setup.c                      |    4 +-
 xen/drivers/passthrough/amd/iommu_guest.c |   11 +-
 xen/drivers/passthrough/iommu.c           |   24 ++--
 8 files changed, 220 insertions(+), 26 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 Dec 13 08:25:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25: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 1VrO44-0003yQ-Tc; Fri, 13 Dec 2013 08:25:40 +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 1VrO43-0003yA-Ur
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:40 +0000
Received: from [85.158.137.68:46546] by server-11.bemta-3.messagelabs.com id
	9D/13-19379-384CAA25; Fri, 13 Dec 2013 08:25:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1386923137!3703311!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5689 invoked from network); 13 Dec 2013 08:25:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:25: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 1VrO41-0001cM-3e
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO41-00061x-1p
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:37 +0000
Date: Fri, 13 Dec 2013 08:25:37 +0000
Message-Id: <E1VrO41-00061x-1p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/elf: header: fix typoes in
	elfnote.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 9cc07b65c49d5492f3143f72d6076d8aebe43382
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Dec 11 18:50:11 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 12 09:32:45 2013 +0000

    xen/elf: header: fix typoes in elfnote.h
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/elfnote.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/public/elfnote.h b/xen/include/public/elfnote.h
index 8566a7e..3824a94 100644
--- a/xen/include/public/elfnote.h
+++ b/xen/include/public/elfnote.h
@@ -71,8 +71,8 @@
 #define XEN_ELFNOTE_VIRT_BASE      3
 
 /*
- * The offset of the ELF paddr field from the acutal required
- * psuedo-physical address (numeric).
+ * The offset of the ELF paddr field from the actual required
+ * pseudo-physical address (numeric).
  *
  * This is used to maintain backwards compatibility with older kernels
  * which wrote __PAGE_OFFSET into that field. This field defaults to 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 Dec 13 08:25:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25: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 1VrO44-0003yQ-Tc; Fri, 13 Dec 2013 08:25:40 +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 1VrO43-0003yA-Ur
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:40 +0000
Received: from [85.158.137.68:46546] by server-11.bemta-3.messagelabs.com id
	9D/13-19379-384CAA25; Fri, 13 Dec 2013 08:25:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1386923137!3703311!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5689 invoked from network); 13 Dec 2013 08:25:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2013 08:25: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 1VrO41-0001cM-3e
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO41-00061x-1p
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:37 +0000
Date: Fri, 13 Dec 2013 08:25:37 +0000
Message-Id: <E1VrO41-00061x-1p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/elf: header: fix typoes in
	elfnote.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 9cc07b65c49d5492f3143f72d6076d8aebe43382
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Dec 11 18:50:11 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 12 09:32:45 2013 +0000

    xen/elf: header: fix typoes in elfnote.h
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/elfnote.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/public/elfnote.h b/xen/include/public/elfnote.h
index 8566a7e..3824a94 100644
--- a/xen/include/public/elfnote.h
+++ b/xen/include/public/elfnote.h
@@ -71,8 +71,8 @@
 #define XEN_ELFNOTE_VIRT_BASE      3
 
 /*
- * The offset of the ELF paddr field from the acutal required
- * psuedo-physical address (numeric).
+ * The offset of the ELF paddr field from the actual required
+ * pseudo-physical address (numeric).
  *
  * This is used to maintain backwards compatibility with older kernels
  * which wrote __PAGE_OFFSET into that field. This field defaults to 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 Dec 13 08:25:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VrO4F-00040K-0J; Fri, 13 Dec 2013 08:25: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 1VrO4D-000403-Kr
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:49 +0000
Received: from [193.109.254.147:46842] by server-11.bemta-14.messagelabs.com
	id BF/E1-20576-C84CAA25; Fri, 13 Dec 2013 08:25:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1386923147!4956476!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12708 invoked from network); 13 Dec 2013 08:25:48 -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;
	13 Dec 2013 08:25: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 1VrO4B-0001cS-7g
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO4B-000632-6D
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:47 +0000
Date: Fri, 13 Dec 2013 08:25:47 +0000
Message-Id: <E1VrO4B-000632-6D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml: do not install test binaries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9ff19cb678c068387156e4a4ec514910a1c68adb
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Thu Dec 12 16:36:49 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 12 17:29:41 2013 +0000

    ocaml: do not install test binaries
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- added back an Empty install rule ]
---
 tools/ocaml/test/Makefile |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/test/Makefile b/tools/ocaml/test/Makefile
index 827bd7c..8033089 100644
--- a/tools/ocaml/test/Makefile
+++ b/tools/ocaml/test/Makefile
@@ -49,8 +49,6 @@ all: $(PROGRAMS)
 
 bins: $(PROGRAMS)
 
-install: all
-	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
-	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(BINDIR)
+install:
 
 include $(OCAML_TOPLEVEL)/Makefile.rules
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 08:25:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 08:25:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VrO4F-00040K-0J; Fri, 13 Dec 2013 08:25: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 1VrO4D-000403-Kr
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:49 +0000
Received: from [193.109.254.147:46842] by server-11.bemta-14.messagelabs.com
	id BF/E1-20576-C84CAA25; Fri, 13 Dec 2013 08:25:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1386923147!4956476!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12708 invoked from network); 13 Dec 2013 08:25:48 -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;
	13 Dec 2013 08:25: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 1VrO4B-0001cS-7g
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VrO4B-000632-6D
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 08:25:47 +0000
Date: Fri, 13 Dec 2013 08:25:47 +0000
Message-Id: <E1VrO4B-000632-6D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml: do not install test binaries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9ff19cb678c068387156e4a4ec514910a1c68adb
Author:     Rob Hoes <rob.hoes@citrix.com>
AuthorDate: Thu Dec 12 16:36:49 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 12 17:29:41 2013 +0000

    ocaml: do not install test binaries
    
    Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- added back an Empty install rule ]
---
 tools/ocaml/test/Makefile |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/test/Makefile b/tools/ocaml/test/Makefile
index 827bd7c..8033089 100644
--- a/tools/ocaml/test/Makefile
+++ b/tools/ocaml/test/Makefile
@@ -49,8 +49,6 @@ all: $(PROGRAMS)
 
 bins: $(PROGRAMS)
 
-install: all
-	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
-	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(BINDIR)
+install:
 
 include $(OCAML_TOPLEVEL)/Makefile.rules
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 13 09:44:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 09:44: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 1VrPHz-00013t-7R; Fri, 13 Dec 2013 09:44:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VrPHx-00013o-Ml
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 09:44:05 +0000
Received: from [85.158.139.211:31787] by server-12.bemta-5.messagelabs.com id
	7F/DA-30017-4E6DAA25; Fri, 13 Dec 2013 09:44:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1386927843!4245497!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3846 invoked from network); 13 Dec 2013 09:44:04 -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;
	13 Dec 2013 09:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VrPHv-0002QQ-2G
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 09:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VrPHv-0008R1-0g
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 09:44:03 +0000
Message-Id: <E1VrPHv-0008R1-0g@xenbits.xen.org>
Date: Fri, 13 Dec 2013 09:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] xencons: generalize use of
	add_preferred_console()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1386927110 -3600
# Node ID 731ff1f10c46453a84345f678a97523619e706ab
# Parent  2993033a77ca312a3370f0e77d74b68a9d0df708
xencons: generalize use of add_preferred_console()

Changeset 762:a070228ac76e ("add hvc compatibility mode to xencons"
added this call just for the HVC case, without giving any reason why
HVC would be special in this regard. Use the call for all cases.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 2993033a77ca -r 731ff1f10c46 drivers/xen/console/console.c
--- a/drivers/xen/console/console.c	Fri Dec 06 12:17:05 2013 +0100
+++ b/drivers/xen/console/console.c	Fri Dec 13 10:31:50 2013 +0100
@@ -214,8 +214,6 @@ static int __init xen_console_init(void)
 		strcpy(kcons_info.name, "hvc");
 		if (xc_num == -1)
 			xc_num = 0;
-		if (!is_initial_xendomain())
-			add_preferred_console(kcons_info.name, xc_num, NULL);
 		break;
 
 	case XC_SERIAL:
@@ -236,6 +234,8 @@ static int __init xen_console_init(void)
 
 	wbuf = alloc_bootmem(wbuf_size);
 
+	if (!is_initial_xendomain())
+		add_preferred_console(kcons_info.name, xc_num, NULL);
 	register_console(&kcons_info);
 
  out:

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

From xen-changelog-bounces@lists.xen.org Fri Dec 13 09:44:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Dec 2013 09:44: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 1VrPHz-00013t-7R; Fri, 13 Dec 2013 09:44:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VrPHx-00013o-Ml
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 09:44:05 +0000
Received: from [85.158.139.211:31787] by server-12.bemta-5.messagelabs.com id
	7F/DA-30017-4E6DAA25; Fri, 13 Dec 2013 09:44:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1386927843!4245497!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3846 invoked from network); 13 Dec 2013 09:44:04 -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;
	13 Dec 2013 09:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VrPHv-0002QQ-2G
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 09:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VrPHv-0008R1-0g
	for xen-changelog@lists.xensource.com; Fri, 13 Dec 2013 09:44:03 +0000
Message-Id: <E1VrPHv-0008R1-0g@xenbits.xen.org>
Date: Fri, 13 Dec 2013 09:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] xencons: generalize use of
	add_preferred_console()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1386927110 -3600
# Node ID 731ff1f10c46453a84345f678a97523619e706ab
# Parent  2993033a77ca312a3370f0e77d74b68a9d0df708
xencons: generalize use of add_preferred_console()

Changeset 762:a070228ac76e ("add hvc compatibility mode to xencons"
added this call just for the HVC case, without giving any reason why
HVC would be special in this regard. Use the call for all cases.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 2993033a77ca -r 731ff1f10c46 drivers/xen/console/console.c
--- a/drivers/xen/console/console.c	Fri Dec 06 12:17:05 2013 +0100
+++ b/drivers/xen/console/console.c	Fri Dec 13 10:31:50 2013 +0100
@@ -214,8 +214,6 @@ static int __init xen_console_init(void)
 		strcpy(kcons_info.name, "hvc");
 		if (xc_num == -1)
 			xc_num = 0;
-		if (!is_initial_xendomain())
-			add_preferred_console(kcons_info.name, xc_num, NULL);
 		break;
 
 	case XC_SERIAL:
@@ -236,6 +234,8 @@ static int __init xen_console_init(void)
 
 	wbuf = alloc_bootmem(wbuf_size);
 
+	if (!is_initial_xendomain())
+		add_preferred_console(kcons_info.name, xc_num, NULL);
 	register_console(&kcons_info);
 
  out:

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

From xen-changelog-bounces@lists.xen.org Sat Dec 14 01:22:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 01:22: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 1Vrdvj-0005eN-VV; Sat, 14 Dec 2013 01:22: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 1Vrdvh-0005eI-NQ
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 01:22:05 +0000
Received: from [85.158.139.211:25973] by server-11.bemta-5.messagelabs.com id
	53/4B-23268-DB2BBA25; Sat, 14 Dec 2013 01:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1386984123!4425168!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9526 invoked from network); 14 Dec 2013 01:22:04 -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;
	14 Dec 2013 01:22: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 1Vrdvf-00037T-1a
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 01:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrdve-0000mJ-LA
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 01:22:02 +0000
Date: Sat, 14 Dec 2013 01:22:02 +0000
Message-Id: <E1Vrdve-0000mJ-LA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m: restrict auditing to debug
	builds
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4476d05cf5e8d3880f88ce16649766df67e0791e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 13 15:06:11 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 13 15:06:11 2013 +0100

    x86/p2m: restrict auditing to debug builds
    
    ... since iterating through all of a guest's pages may take unduly
    long.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/include/asm-x86/p2m.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 43583b2..f4e7253 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -600,7 +600,11 @@ int set_p2m_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 extern void p2m_pt_init(struct p2m_domain *p2m);
 
 /* Debugging and auditing of the P2M code? */
+#ifndef NDEBUG
 #define P2M_AUDIT     1
+#else
+#define P2M_AUDIT     0
+#endif
 #define P2M_DEBUGGING 0
 
 #if P2M_AUDIT
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 14 01:22:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 01:22: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 1Vrdvj-0005eN-VV; Sat, 14 Dec 2013 01:22: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 1Vrdvh-0005eI-NQ
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 01:22:05 +0000
Received: from [85.158.139.211:25973] by server-11.bemta-5.messagelabs.com id
	53/4B-23268-DB2BBA25; Sat, 14 Dec 2013 01:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1386984123!4425168!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9526 invoked from network); 14 Dec 2013 01:22:04 -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;
	14 Dec 2013 01:22: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 1Vrdvf-00037T-1a
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 01:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrdve-0000mJ-LA
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 01:22:02 +0000
Date: Sat, 14 Dec 2013 01:22:02 +0000
Message-Id: <E1Vrdve-0000mJ-LA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/p2m: restrict auditing to debug
	builds
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4476d05cf5e8d3880f88ce16649766df67e0791e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 13 15:06:11 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 13 15:06:11 2013 +0100

    x86/p2m: restrict auditing to debug builds
    
    ... since iterating through all of a guest's pages may take unduly
    long.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/include/asm-x86/p2m.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 43583b2..f4e7253 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -600,7 +600,11 @@ int set_p2m_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 extern void p2m_pt_init(struct p2m_domain *p2m);
 
 /* Debugging and auditing of the P2M code? */
+#ifndef NDEBUG
 #define P2M_AUDIT     1
+#else
+#define P2M_AUDIT     0
+#endif
 #define P2M_DEBUGGING 0
 
 #if P2M_AUDIT
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 14 07:55:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 07:55: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 1Vrk45-0000LX-3K; Sat, 14 Dec 2013 07:55: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 1Vrk43-0000LK-SY
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:08 +0000
Received: from [85.158.143.35:42413] by server-1.bemta-4.messagelabs.com id
	83/13-02132-BDE0CA25; Sat, 14 Dec 2013 07:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1387007705!5672042!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8280 invoked from network); 14 Dec 2013 07:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2013 07: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 1Vrk40-0007k5-Fu
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrk3z-0002Gm-Ie
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:03 +0000
Date: Sat, 14 Dec 2013 07:55:03 +0000
Message-Id: <E1Vrk3z-0002Gm-Ie@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: check F_SETFL fcntl
	invocation in setnonblock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7e52bfb60520816a218c1505498298926421cd09
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 01:45:16 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 13 16:55:12 2013 +0000

    xenstore: check F_SETFL fcntl invocation in setnonblock
    
    ...and check the newly-added result of setnonblock itself where used.
    
    Coverity-ID: 1055103
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xs.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index 261b841..f1f1b9d 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -146,20 +146,20 @@ struct xs_handle {
 
 static int read_message(struct xs_handle *h, int nonblocking);
 
-static void setnonblock(int fd, int nonblock) {
-	int esave = errno;
+static bool setnonblock(int fd, int nonblock) {
 	int flags = fcntl(fd, F_GETFL);
 	if (flags == -1)
-		goto out;
+		return false;
 
 	if (nonblock)
 		flags |= O_NONBLOCK;
 	else
 		flags &= ~O_NONBLOCK;
 
-	fcntl(fd, F_SETFL, flags);
-out:
-	errno = esave;
+	if (fcntl(fd, F_SETFL, flags) == -1)
+		return false;
+
+	return true;
 }
 
 int xs_fileno(struct xs_handle *h)
@@ -369,8 +369,8 @@ static bool read_all(int fd, void *data, unsigned int len, int nonblocking)
 	if (!len)
 		return true;
 
-	if (nonblocking)
-		setnonblock(fd, 1);
+	if (nonblocking && !setnonblock(fd, 1))
+		return false;
 
 	while (len) {
 		int done;
@@ -390,8 +390,9 @@ static bool read_all(int fd, void *data, unsigned int len, int nonblocking)
 		len -= done;
 
 		if (nonblocking) {
-			setnonblock(fd, 0);
 			nonblocking = 0;
+			if (!setnonblock(fd, 0))
+				goto out_false;
 		}
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 14 07:55:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 07:55: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 1Vrk45-0000LX-3K; Sat, 14 Dec 2013 07:55: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 1Vrk43-0000LK-SY
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:08 +0000
Received: from [85.158.143.35:42413] by server-1.bemta-4.messagelabs.com id
	83/13-02132-BDE0CA25; Sat, 14 Dec 2013 07:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1387007705!5672042!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8280 invoked from network); 14 Dec 2013 07:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2013 07: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 1Vrk40-0007k5-Fu
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrk3z-0002Gm-Ie
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:03 +0000
Date: Sat, 14 Dec 2013 07:55:03 +0000
Message-Id: <E1Vrk3z-0002Gm-Ie@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: check F_SETFL fcntl
	invocation in setnonblock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7e52bfb60520816a218c1505498298926421cd09
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 01:45:16 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 13 16:55:12 2013 +0000

    xenstore: check F_SETFL fcntl invocation in setnonblock
    
    ...and check the newly-added result of setnonblock itself where used.
    
    Coverity-ID: 1055103
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xs.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index 261b841..f1f1b9d 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -146,20 +146,20 @@ struct xs_handle {
 
 static int read_message(struct xs_handle *h, int nonblocking);
 
-static void setnonblock(int fd, int nonblock) {
-	int esave = errno;
+static bool setnonblock(int fd, int nonblock) {
 	int flags = fcntl(fd, F_GETFL);
 	if (flags == -1)
-		goto out;
+		return false;
 
 	if (nonblock)
 		flags |= O_NONBLOCK;
 	else
 		flags &= ~O_NONBLOCK;
 
-	fcntl(fd, F_SETFL, flags);
-out:
-	errno = esave;
+	if (fcntl(fd, F_SETFL, flags) == -1)
+		return false;
+
+	return true;
 }
 
 int xs_fileno(struct xs_handle *h)
@@ -369,8 +369,8 @@ static bool read_all(int fd, void *data, unsigned int len, int nonblocking)
 	if (!len)
 		return true;
 
-	if (nonblocking)
-		setnonblock(fd, 1);
+	if (nonblocking && !setnonblock(fd, 1))
+		return false;
 
 	while (len) {
 		int done;
@@ -390,8 +390,9 @@ static bool read_all(int fd, void *data, unsigned int len, int nonblocking)
 		len -= done;
 
 		if (nonblocking) {
-			setnonblock(fd, 0);
 			nonblocking = 0;
+			if (!setnonblock(fd, 0))
+				goto out_false;
 		}
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 14 07:55:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 07:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vrk4F-0000Mx-66; Sat, 14 Dec 2013 07:55: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 1Vrk4D-0000Mk-Nu
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:17 +0000
Received: from [85.158.137.68:55902] by server-3.bemta-3.messagelabs.com id
	A8/87-10658-4EE0CA25; Sat, 14 Dec 2013 07:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1387007714!3850018!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32709 invoked from network); 14 Dec 2013 07:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2013 07: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 1Vrk4A-0007k9-MC
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrk4A-0002HA-JR
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:14 +0000
Date: Sat, 14 Dec 2013 07:55:14 +0000
Message-Id: <E1Vrk4A-0002HA-JR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't leak ptr in libxl_list_vm
	error case
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 44ad4f96b7ac6dc328efa60c7087dd198035e199
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 14:29:04 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 13 17:20:06 2013 +0000

    libxl: don't leak ptr in libxl_list_vm error case
    
    While at it, tidy up the function; there's no point in allocating more
    than the amount of domains actually returned by xc_domain_getinfolist
    (barring the caveat described in the newly-added comment)
    
    Coverity-ID: 1055888
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
---
 tools/libxl/libxl.c |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index fd8b988..e8ad610 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -669,20 +669,24 @@ out:
  * be an aggregate of multiple domains. */
 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out)
 {
-    libxl_vminfo *ptr;
+    GC_INIT(ctx);
+    libxl_vminfo *ptr = NULL;
     int idx, i, ret;
     xc_domaininfo_t info[1024];
-    int size = 1024;
 
-    ptr = calloc(size, sizeof(libxl_vminfo));
-    if (!ptr)
-        return NULL;
-
-    ret = xc_domain_getinfolist(ctx->xch, 1, 1024, info);
-    if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting domain info list");
-        return NULL;
+    ret = xc_domain_getinfolist(ctx->xch, 1, ARRAY_SIZE(info), info);
+    if (ret < 0) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
+        goto out;
     }
+
+    /*
+     * Always make sure to allocate at least one element; if we don't and we
+     * request zero, libxl__calloc (might) think its internal call to calloc
+     * has failed (if it returns null), if so it would kill our process.
+     */
+    ptr = libxl__calloc(NOGC, ret ? ret : 1, sizeof(libxl_vminfo));
+
     for (idx = i = 0; i < ret; i++) {
         if (libxl_is_stubdom(ctx, info[i].domain, NULL))
             continue;
@@ -692,6 +696,9 @@ libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out)
         idx++;
     }
     *nb_vm_out = idx;
+
+out:
+    GC_FREE;
     return ptr;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 14 07:55:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 07:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Vrk4F-0000Mx-66; Sat, 14 Dec 2013 07:55: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 1Vrk4D-0000Mk-Nu
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:17 +0000
Received: from [85.158.137.68:55902] by server-3.bemta-3.messagelabs.com id
	A8/87-10658-4EE0CA25; Sat, 14 Dec 2013 07:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1387007714!3850018!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32709 invoked from network); 14 Dec 2013 07:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2013 07: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 1Vrk4A-0007k9-MC
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrk4A-0002HA-JR
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:14 +0000
Date: Sat, 14 Dec 2013 07:55:14 +0000
Message-Id: <E1Vrk4A-0002HA-JR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: don't leak ptr in libxl_list_vm
	error case
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 44ad4f96b7ac6dc328efa60c7087dd198035e199
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 14:29:04 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 13 17:20:06 2013 +0000

    libxl: don't leak ptr in libxl_list_vm error case
    
    While at it, tidy up the function; there's no point in allocating more
    than the amount of domains actually returned by xc_domain_getinfolist
    (barring the caveat described in the newly-added comment)
    
    Coverity-ID: 1055888
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
---
 tools/libxl/libxl.c |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index fd8b988..e8ad610 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -669,20 +669,24 @@ out:
  * be an aggregate of multiple domains. */
 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out)
 {
-    libxl_vminfo *ptr;
+    GC_INIT(ctx);
+    libxl_vminfo *ptr = NULL;
     int idx, i, ret;
     xc_domaininfo_t info[1024];
-    int size = 1024;
 
-    ptr = calloc(size, sizeof(libxl_vminfo));
-    if (!ptr)
-        return NULL;
-
-    ret = xc_domain_getinfolist(ctx->xch, 1, 1024, info);
-    if (ret<0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting domain info list");
-        return NULL;
+    ret = xc_domain_getinfolist(ctx->xch, 1, ARRAY_SIZE(info), info);
+    if (ret < 0) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
+        goto out;
     }
+
+    /*
+     * Always make sure to allocate at least one element; if we don't and we
+     * request zero, libxl__calloc (might) think its internal call to calloc
+     * has failed (if it returns null), if so it would kill our process.
+     */
+    ptr = libxl__calloc(NOGC, ret ? ret : 1, sizeof(libxl_vminfo));
+
     for (idx = i = 0; i < ret; i++) {
         if (libxl_is_stubdom(ctx, info[i].domain, NULL))
             continue;
@@ -692,6 +696,9 @@ libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out)
         idx++;
     }
     *nb_vm_out = idx;
+
+out:
+    GC_FREE;
     return ptr;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 14 07:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 07: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 1Vrk4P-0000Oa-9A; Sat, 14 Dec 2013 07:55:29 +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 1Vrk4N-0000OM-TD
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:28 +0000
Received: from [193.109.254.147:52548] by server-8.bemta-14.messagelabs.com id
	33/A3-30921-FEE0CA25; Sat, 14 Dec 2013 07:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1387007725!5189792!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21415 invoked from network); 14 Dec 2013 07:55:26 -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 Dec 2013 07:55: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 1Vrk4K-0007kH-U4
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrk4K-0002HW-Ow
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:24 +0000
Date: Sat, 14 Dec 2013 07:55:24 +0000
Message-Id: <E1Vrk4K-0002HW-Ow@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: check for xc_domain_setmaxmem
	failure in libxl__build_pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aaa1223b7529c4415c6c9627dbf67a71f22f1260
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 01:11:43 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 13 17:22:32 2013 +0000

    libxl: check for xc_domain_setmaxmem failure in libxl__build_pre
    
    Coverity-ID: 1087115
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 tools/libxl/libxl_dom.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 078cff1..55f74b2 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -224,7 +224,6 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
      * whatever that turns out to be.
      */
     if (libxl_defbool_val(info->numa_placement)) {
-
         if (!libxl_bitmap_is_full(&info->cpumap)) {
             LOG(ERROR, "Can run NUMA placement only if no vcpu "
                        "affinity is specified");
@@ -238,7 +237,12 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
     libxl_domain_set_nodeaffinity(ctx, domid, &info->nodemap);
     libxl_set_vcpuaffinity_all(ctx, domid, info->max_vcpus, &info->cpumap);
 
-    xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + LIBXL_MAXMEM_CONSTANT);
+    if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb +
+        LIBXL_MAXMEM_CONSTANT) < 0) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't set max memory");
+        return ERROR_FAIL;
+    }
+
     xs_domid = xs_read(ctx->xsh, XBT_NULL, "/tool/xenstored/domid", NULL);
     state->store_domid = xs_domid ? atoi(xs_domid) : 0;
     free(xs_domid);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 14 07:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 07: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 1Vrk4P-0000Oa-9A; Sat, 14 Dec 2013 07:55:29 +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 1Vrk4N-0000OM-TD
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:28 +0000
Received: from [193.109.254.147:52548] by server-8.bemta-14.messagelabs.com id
	33/A3-30921-FEE0CA25; Sat, 14 Dec 2013 07:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1387007725!5189792!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21415 invoked from network); 14 Dec 2013 07:55:26 -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 Dec 2013 07:55: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 1Vrk4K-0007kH-U4
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrk4K-0002HW-Ow
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:24 +0000
Date: Sat, 14 Dec 2013 07:55:24 +0000
Message-Id: <E1Vrk4K-0002HW-Ow@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: check for xc_domain_setmaxmem
	failure in libxl__build_pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aaa1223b7529c4415c6c9627dbf67a71f22f1260
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Tue Dec 3 01:11:43 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 13 17:22:32 2013 +0000

    libxl: check for xc_domain_setmaxmem failure in libxl__build_pre
    
    Coverity-ID: 1087115
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 tools/libxl/libxl_dom.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 078cff1..55f74b2 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -224,7 +224,6 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
      * whatever that turns out to be.
      */
     if (libxl_defbool_val(info->numa_placement)) {
-
         if (!libxl_bitmap_is_full(&info->cpumap)) {
             LOG(ERROR, "Can run NUMA placement only if no vcpu "
                        "affinity is specified");
@@ -238,7 +237,12 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
     libxl_domain_set_nodeaffinity(ctx, domid, &info->nodemap);
     libxl_set_vcpuaffinity_all(ctx, domid, info->max_vcpus, &info->cpumap);
 
-    xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + LIBXL_MAXMEM_CONSTANT);
+    if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb +
+        LIBXL_MAXMEM_CONSTANT) < 0) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Couldn't set max memory");
+        return ERROR_FAIL;
+    }
+
     xs_domid = xs_read(ctx->xsh, XBT_NULL, "/tool/xenstored/domid", NULL);
     state->store_domid = xs_domid ? atoi(xs_domid) : 0;
     free(xs_domid);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 14 07:55:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 07: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 1Vrk4Y-0000QH-Ch; Sat, 14 Dec 2013 07:55:38 +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 1Vrk4X-0000Q1-C9
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:37 +0000
Received: from [85.158.143.35:8939] by server-1.bemta-4.messagelabs.com id
	A5/33-02132-8FE0CA25; Sat, 14 Dec 2013 07:55:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1387007735!4473916!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19430 invoked from network); 14 Dec 2013 07:55:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2013 07: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 1Vrk4V-0007kP-2T
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrk4V-0002Ig-0K
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:35 +0000
Date: Sat, 14 Dec 2013 07:55:35 +0000
Message-Id: <E1Vrk4V-0002Ig-0K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix unsigned less-than-0
	comparison in e820_sanitize
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5d71457def05299bfa69276bb7f31db705f05f19
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:14:55 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 13 17:30:52 2013 +0000

    libxl: fix unsigned less-than-0 comparison in e820_sanitize
    
    Both src[i].size and delta are unsigned, so checking their difference
    for being less than 0 doesn't work.
    
    Coverity-ID: 1055615
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.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 e1c183f..b11d036 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -125,7 +125,7 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
             src[i].type = E820_UNUSABLE;
             delta = ram_end - src[i].addr;
             /* The end < ram_end should weed this out */
-            if (src[i].size - delta < 0)
+            if (src[i].size < delta)
                 src[i].type = 0;
             else {
                 src[i].size -= delta;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 14 07:55:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 07: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 1Vrk4Y-0000QH-Ch; Sat, 14 Dec 2013 07:55:38 +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 1Vrk4X-0000Q1-C9
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:37 +0000
Received: from [85.158.143.35:8939] by server-1.bemta-4.messagelabs.com id
	A5/33-02132-8FE0CA25; Sat, 14 Dec 2013 07:55:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1387007735!4473916!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19430 invoked from network); 14 Dec 2013 07:55:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2013 07: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 1Vrk4V-0007kP-2T
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrk4V-0002Ig-0K
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:35 +0000
Date: Sat, 14 Dec 2013 07:55:35 +0000
Message-Id: <E1Vrk4V-0002Ig-0K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix unsigned less-than-0
	comparison in e820_sanitize
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5d71457def05299bfa69276bb7f31db705f05f19
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sun Dec 1 23:14:55 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 13 17:30:52 2013 +0000

    libxl: fix unsigned less-than-0 comparison in e820_sanitize
    
    Both src[i].size and delta are unsigned, so checking their difference
    for being less than 0 doesn't work.
    
    Coverity-ID: 1055615
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.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 e1c183f..b11d036 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -125,7 +125,7 @@ static int e820_sanitize(libxl_ctx *ctx, struct e820entry src[],
             src[i].type = E820_UNUSABLE;
             delta = ram_end - src[i].addr;
             /* The end < ram_end should weed this out */
-            if (src[i].size - delta < 0)
+            if (src[i].size < delta)
                 src[i].type = 0;
             else {
                 src[i].size -= delta;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 14 07:55:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 07:55: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 1Vrk4k-0000Sc-In; Sat, 14 Dec 2013 07:55: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 1Vrk4i-0000SK-VF
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:49 +0000
Received: from [193.109.254.147:53075] by server-7.bemta-14.messagelabs.com id
	9E/E7-15500-40F0CA25; Sat, 14 Dec 2013 07:55:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1387007745!2945952!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30922 invoked from network); 14 Dec 2013 07:55:46 -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;
	14 Dec 2013 07:55: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 1Vrk4f-0007kV-EN
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrk4f-0002J2-5D
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:45 +0000
Date: Sat, 14 Dec 2013 07:55:45 +0000
Message-Id: <E1Vrk4f-0002J2-5D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstored: Avoid buffer
	overflows while setting up sockets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e423b5cd60ff95ba3680e2e4a8440d4d19b2b13e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 14:38:41 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 13 18:26:29 2013 +0000

    tools/xenstored: Avoid buffer overflows while setting up sockets
    
    Coverity ID: 1055996 1056002
    
    Cache the xs_daemon_socket{,_ro}() strings to save pointlessly
    re-snprintf()'ing the same path, and add explicit size checks against
    addr.sun_path before strcpy()'ing into it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xenstored_core.c |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index ccfdaa3..2324e53 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1718,6 +1718,9 @@ static void init_sockets(int **psock, int **pro_sock)
 {
 	struct sockaddr_un addr;
 	int *sock, *ro_sock;
+	const char *soc_str = xs_daemon_socket();
+	const char *soc_str_ro = xs_daemon_socket_ro();
+
 	/* Create sockets for them to listen to. */
 	*psock = sock = talloc(talloc_autofree_context(), int);
 	*sock = socket(PF_UNIX, SOCK_STREAM, 0);
@@ -1731,19 +1734,25 @@ static void init_sockets(int **psock, int **pro_sock)
 	talloc_set_destructor(ro_sock, destroy_fd);
 
 	/* FIXME: Be more sophisticated, don't mug running daemon. */
-	unlink(xs_daemon_socket());
-	unlink(xs_daemon_socket_ro());
+	unlink(soc_str);
+	unlink(soc_str_ro);
 
 	addr.sun_family = AF_UNIX;
-	strcpy(addr.sun_path, xs_daemon_socket());
+
+	if(strlen(soc_str) >= sizeof(addr.sun_path))
+		barf_perror("socket string '%s' too long", soc_str);
+	strcpy(addr.sun_path, soc_str);
 	if (bind(*sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
-		barf_perror("Could not bind socket to %s", xs_daemon_socket());
-	strcpy(addr.sun_path, xs_daemon_socket_ro());
+		barf_perror("Could not bind socket to %s", soc_str);
+
+	if(strlen(soc_str_ro) >= sizeof(addr.sun_path))
+		barf_perror("socket string '%s' too long", soc_str_ro);
+	strcpy(addr.sun_path, soc_str_ro);
 	if (bind(*ro_sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
-		barf_perror("Could not bind socket to %s",
-			    xs_daemon_socket_ro());
-	if (chmod(xs_daemon_socket(), 0600) != 0
-	    || chmod(xs_daemon_socket_ro(), 0660) != 0)
+		barf_perror("Could not bind socket to %s", soc_str_ro);
+
+	if (chmod(soc_str, 0600) != 0
+	    || chmod(soc_str_ro, 0660) != 0)
 		barf_perror("Could not chmod sockets");
 
 	if (listen(*sock, 1) != 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 Sat Dec 14 07:55:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Dec 2013 07:55: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 1Vrk4k-0000Sc-In; Sat, 14 Dec 2013 07:55: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 1Vrk4i-0000SK-VF
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:49 +0000
Received: from [193.109.254.147:53075] by server-7.bemta-14.messagelabs.com id
	9E/E7-15500-40F0CA25; Sat, 14 Dec 2013 07:55:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1387007745!2945952!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30922 invoked from network); 14 Dec 2013 07:55:46 -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;
	14 Dec 2013 07:55: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 1Vrk4f-0007kV-EN
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vrk4f-0002J2-5D
	for xen-changelog@lists.xensource.com; Sat, 14 Dec 2013 07:55:45 +0000
Date: Sat, 14 Dec 2013 07:55:45 +0000
Message-Id: <E1Vrk4f-0002J2-5D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstored: Avoid buffer
	overflows while setting up sockets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e423b5cd60ff95ba3680e2e4a8440d4d19b2b13e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 25 14:38:41 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Fri Dec 13 18:26:29 2013 +0000

    tools/xenstored: Avoid buffer overflows while setting up sockets
    
    Coverity ID: 1055996 1056002
    
    Cache the xs_daemon_socket{,_ro}() strings to save pointlessly
    re-snprintf()'ing the same path, and add explicit size checks against
    addr.sun_path before strcpy()'ing into it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Matthew Daley <mattd@bugfuzz.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xenstored_core.c |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index ccfdaa3..2324e53 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1718,6 +1718,9 @@ static void init_sockets(int **psock, int **pro_sock)
 {
 	struct sockaddr_un addr;
 	int *sock, *ro_sock;
+	const char *soc_str = xs_daemon_socket();
+	const char *soc_str_ro = xs_daemon_socket_ro();
+
 	/* Create sockets for them to listen to. */
 	*psock = sock = talloc(talloc_autofree_context(), int);
 	*sock = socket(PF_UNIX, SOCK_STREAM, 0);
@@ -1731,19 +1734,25 @@ static void init_sockets(int **psock, int **pro_sock)
 	talloc_set_destructor(ro_sock, destroy_fd);
 
 	/* FIXME: Be more sophisticated, don't mug running daemon. */
-	unlink(xs_daemon_socket());
-	unlink(xs_daemon_socket_ro());
+	unlink(soc_str);
+	unlink(soc_str_ro);
 
 	addr.sun_family = AF_UNIX;
-	strcpy(addr.sun_path, xs_daemon_socket());
+
+	if(strlen(soc_str) >= sizeof(addr.sun_path))
+		barf_perror("socket string '%s' too long", soc_str);
+	strcpy(addr.sun_path, soc_str);
 	if (bind(*sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
-		barf_perror("Could not bind socket to %s", xs_daemon_socket());
-	strcpy(addr.sun_path, xs_daemon_socket_ro());
+		barf_perror("Could not bind socket to %s", soc_str);
+
+	if(strlen(soc_str_ro) >= sizeof(addr.sun_path))
+		barf_perror("socket string '%s' too long", soc_str_ro);
+	strcpy(addr.sun_path, soc_str_ro);
 	if (bind(*ro_sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
-		barf_perror("Could not bind socket to %s",
-			    xs_daemon_socket_ro());
-	if (chmod(xs_daemon_socket(), 0600) != 0
-	    || chmod(xs_daemon_socket_ro(), 0660) != 0)
+		barf_perror("Could not bind socket to %s", soc_str_ro);
+
+	if (chmod(soc_str, 0600) != 0
+	    || chmod(soc_str_ro, 0660) != 0)
 		barf_perror("Could not chmod sockets");
 
 	if (listen(*sock, 1) != 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 Mon Dec 16 12:44:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Dec 2013 12:44: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 1VsXWo-0005Fe-TF; Mon, 16 Dec 2013 12:44:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VsXWo-0005FL-4f
	for xen-changelog@lists.xensource.com; Mon, 16 Dec 2013 12:44:06 +0000
Received: from [85.158.137.68:59161] by server-11.bemta-3.messagelabs.com id
	8A/39-19379-595FEA25; Mon, 16 Dec 2013 12:44:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-31.messagelabs.com!1387197843!3443461!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7204 invoked from network); 16 Dec 2013 12:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Dec 2013 12:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VsXWl-0007c7-AH
	for xen-changelog@lists.xensource.com; Mon, 16 Dec 2013 12:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VsXWl-0003vy-8m
	for xen-changelog@lists.xensource.com; Mon, 16 Dec 2013 12:44:03 +0000
Message-Id: <E1VsXWl-0003vy-8m@xenbits.xen.org>
Date: Mon, 16 Dec 2013 12:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86-64: fix build with newer
	binutils
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1387197486 -3600
# Node ID c27b59a05b12679b05fef74b56a7b19ca31e791b
# Parent  731ff1f10c46453a84345f678a97523619e706ab
x86-64: fix build with newer binutils

END() has to always be before switching back to an earlier section.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 731ff1f10c46 -r c27b59a05b12 arch/x86_64/kernel/entry-xen.S
--- a/arch/x86_64/kernel/entry-xen.S	Fri Dec 13 10:31:50 2013 +0100
+++ b/arch/x86_64/kernel/entry-xen.S	Mon Dec 16 13:38:06 2013 +0100
@@ -939,26 +939,6 @@ 11:	incl %gs:pda_irqcount
 	CFI_ENDPROC
 END(do_hypervisor_callback)
 
-#ifdef CONFIG_X86_LOCAL_APIC
-KPROBE_ENTRY(nmi)
-	zeroentry do_nmi_callback
-ENTRY(do_nmi_callback)
-	CFI_STARTPROC
-        addq $8, %rsp
-	CFI_ENDPROC
-	CFI_DEFAULT_STACK
-        call do_nmi
-        orl  $NMI_MASK,EFLAGS(%rsp)
-        RESTORE_REST
-        XEN_BLOCK_EVENTS(%rsi)
-	TRACE_IRQS_OFF
-        GET_THREAD_INFO(%rcx)
-        jmp  retint_restore_args
-	CFI_ENDPROC
-	.previous .text
-END(nmi)
-#endif
-
         ALIGN
 restore_all_enable_events:  
 	CFI_DEFAULT_STACK adj=1
@@ -1168,20 +1148,25 @@ KPROBE_ENTRY(debug)
 END(debug)
 	.previous .text
 
-#if 0
+#ifdef CONFIG_X86_LOCAL_APIC
 	/* runs on exception stack */	
 KPROBE_ENTRY(nmi)
-	INTR_FRAME
-	pushq $-1
-	CFI_ADJUST_CFA_OFFSET 8
-	paranoidentry do_nmi, 0, 0
-#ifdef CONFIG_TRACE_IRQFLAGS
-	paranoidexit 0
-#else
-	jmp paranoid_exit1
- 	CFI_ENDPROC
-#endif
+	zeroentry do_nmi_callback
 END(nmi)
+ENTRY(do_nmi_callback)
+	CFI_STARTPROC
+	addq $8,%rsp
+	CFI_ENDPROC
+	CFI_DEFAULT_STACK
+	call do_nmi
+	orl  $NMI_MASK,EFLAGS(%rsp)
+	RESTORE_REST
+	XEN_BLOCK_EVENTS(%rsi)
+	TRACE_IRQS_OFF
+	GET_THREAD_INFO(%rcx)
+	jmp  retint_restore_args
+	CFI_ENDPROC
+END(do_nmi_callback)
 	.previous .text
 #endif        
 

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

From xen-changelog-bounces@lists.xen.org Mon Dec 16 12:44:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Dec 2013 12:44: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 1VsXWo-0005Fe-TF; Mon, 16 Dec 2013 12:44:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VsXWo-0005FL-4f
	for xen-changelog@lists.xensource.com; Mon, 16 Dec 2013 12:44:06 +0000
Received: from [85.158.137.68:59161] by server-11.bemta-3.messagelabs.com id
	8A/39-19379-595FEA25; Mon, 16 Dec 2013 12:44:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-31.messagelabs.com!1387197843!3443461!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7204 invoked from network); 16 Dec 2013 12:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Dec 2013 12:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VsXWl-0007c7-AH
	for xen-changelog@lists.xensource.com; Mon, 16 Dec 2013 12:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1VsXWl-0003vy-8m
	for xen-changelog@lists.xensource.com; Mon, 16 Dec 2013 12:44:03 +0000
Message-Id: <E1VsXWl-0003vy-8m@xenbits.xen.org>
Date: Mon, 16 Dec 2013 12:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86-64: fix build with newer
	binutils
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1387197486 -3600
# Node ID c27b59a05b12679b05fef74b56a7b19ca31e791b
# Parent  731ff1f10c46453a84345f678a97523619e706ab
x86-64: fix build with newer binutils

END() has to always be before switching back to an earlier section.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 731ff1f10c46 -r c27b59a05b12 arch/x86_64/kernel/entry-xen.S
--- a/arch/x86_64/kernel/entry-xen.S	Fri Dec 13 10:31:50 2013 +0100
+++ b/arch/x86_64/kernel/entry-xen.S	Mon Dec 16 13:38:06 2013 +0100
@@ -939,26 +939,6 @@ 11:	incl %gs:pda_irqcount
 	CFI_ENDPROC
 END(do_hypervisor_callback)
 
-#ifdef CONFIG_X86_LOCAL_APIC
-KPROBE_ENTRY(nmi)
-	zeroentry do_nmi_callback
-ENTRY(do_nmi_callback)
-	CFI_STARTPROC
-        addq $8, %rsp
-	CFI_ENDPROC
-	CFI_DEFAULT_STACK
-        call do_nmi
-        orl  $NMI_MASK,EFLAGS(%rsp)
-        RESTORE_REST
-        XEN_BLOCK_EVENTS(%rsi)
-	TRACE_IRQS_OFF
-        GET_THREAD_INFO(%rcx)
-        jmp  retint_restore_args
-	CFI_ENDPROC
-	.previous .text
-END(nmi)
-#endif
-
         ALIGN
 restore_all_enable_events:  
 	CFI_DEFAULT_STACK adj=1
@@ -1168,20 +1148,25 @@ KPROBE_ENTRY(debug)
 END(debug)
 	.previous .text
 
-#if 0
+#ifdef CONFIG_X86_LOCAL_APIC
 	/* runs on exception stack */	
 KPROBE_ENTRY(nmi)
-	INTR_FRAME
-	pushq $-1
-	CFI_ADJUST_CFA_OFFSET 8
-	paranoidentry do_nmi, 0, 0
-#ifdef CONFIG_TRACE_IRQFLAGS
-	paranoidexit 0
-#else
-	jmp paranoid_exit1
- 	CFI_ENDPROC
-#endif
+	zeroentry do_nmi_callback
 END(nmi)
+ENTRY(do_nmi_callback)
+	CFI_STARTPROC
+	addq $8,%rsp
+	CFI_ENDPROC
+	CFI_DEFAULT_STACK
+	call do_nmi
+	orl  $NMI_MASK,EFLAGS(%rsp)
+	RESTORE_REST
+	XEN_BLOCK_EVENTS(%rsi)
+	TRACE_IRQS_OFF
+	GET_THREAD_INFO(%rcx)
+	jmp  retint_restore_args
+	CFI_ENDPROC
+END(do_nmi_callback)
 	.previous .text
 #endif        
 

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

From xen-changelog-bounces@lists.xen.org Tue Dec 17 04:22:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:22: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 1VsmAY-00033p-Uj; Tue, 17 Dec 2013 04:22:06 +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 1VsmAX-00033j-N0
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:05 +0000
Received: from [193.109.254.147:46438] by server-16.bemta-14.messagelabs.com
	id 50/6B-20600-D61DFA25; Tue, 17 Dec 2013 04:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1387254123!5697999!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19649 invoked from network); 17 Dec 2013 04:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2013 04:22: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 1VsmAV-00009u-61
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmAU-0004dm-VX
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:03 +0000
Date: Tue, 17 Dec 2013 04:22:02 +0000
Message-Id: <E1VsmAU-0004dm-VX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn/fifo: map correct pages when
	guest is HVM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb84b989ee11d2368ec78e9669bb72f8c7a95c03
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Dec 16 10:51:24 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 16 10:51:24 2013 +0100

    evtchn/fifo: map correct pages when guest is HVM
    
    If a HVM guest attempts to use the FIFO-based ABI it will not receive
    any events and destroying the guest may crash Xen or trigger an assert
    when attempting to unmap a control block page.  This occurs because
    Xen maps the wrong page for both the control blocks and the event
    arrays.
    
    In map_guest_page(), use the MFN of the guest's page and not the GFN
    when calling map_domain_page_global().
    
    Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/common/event_fifo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 6048784..b0d3fc2 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -284,7 +284,7 @@ static int map_guest_page(struct domain *d, uint64_t gfn, void **virt)
         return -EINVAL;
     }
 
-    *virt = map_domain_page_global(gfn);
+    *virt = __map_domain_page_global(p);
     if ( !*virt )
     {
         put_page_and_type(p);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:22:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:22: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 1VsmAY-00033p-Uj; Tue, 17 Dec 2013 04:22:06 +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 1VsmAX-00033j-N0
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:05 +0000
Received: from [193.109.254.147:46438] by server-16.bemta-14.messagelabs.com
	id 50/6B-20600-D61DFA25; Tue, 17 Dec 2013 04:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1387254123!5697999!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19649 invoked from network); 17 Dec 2013 04:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2013 04:22: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 1VsmAV-00009u-61
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmAU-0004dm-VX
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:03 +0000
Date: Tue, 17 Dec 2013 04:22:02 +0000
Message-Id: <E1VsmAU-0004dm-VX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] evtchn/fifo: map correct pages when
	guest is HVM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb84b989ee11d2368ec78e9669bb72f8c7a95c03
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Dec 16 10:51:24 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 16 10:51:24 2013 +0100

    evtchn/fifo: map correct pages when guest is HVM
    
    If a HVM guest attempts to use the FIFO-based ABI it will not receive
    any events and destroying the guest may crash Xen or trigger an assert
    when attempting to unmap a control block page.  This occurs because
    Xen maps the wrong page for both the control blocks and the event
    arrays.
    
    In map_guest_page(), use the MFN of the guest's page and not the GFN
    when calling map_domain_page_global().
    
    Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/common/event_fifo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 6048784..b0d3fc2 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -284,7 +284,7 @@ static int map_guest_page(struct domain *d, uint64_t gfn, void **virt)
         return -EINVAL;
     }
 
-    *virt = map_domain_page_global(gfn);
+    *virt = __map_domain_page_global(p);
     if ( !*virt )
     {
         put_page_and_type(p);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:22:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VsmAk-00034e-1L; Tue, 17 Dec 2013 04:22:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmAi-00034T-1U
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:16 +0000
Received: from [193.109.254.147:20024] by server-13.bemta-14.messagelabs.com
	id 39/48-19374-771DFA25; Tue, 17 Dec 2013 04:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1387254133!5698013!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20193 invoked from network); 17 Dec 2013 04:22:14 -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;
	17 Dec 2013 04:22: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 1VsmAf-00009y-Ck
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmAf-0004eD-Ax
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:13 +0000
Date: Tue, 17 Dec 2013 04:22:13 +0000
Message-Id: <E1VsmAf-0004eD-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/pvh: disable MTRR feature on cpuid
	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: multipart/mixed; boundary="===============5900443006332178219=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 586ab6a055376ec3f3e1e82654eb87481005bc21
Author:     Roger Pau MonnÃ© <roger.pau@citrix.com>
AuthorDate: Mon Dec 16 10:52:43 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 16 10:52:43 2013 +0100

    x86/pvh: disable MTRR feature on cpuid for Dom0
    
    MTRR is not available for PVH Dom0, so prevent cpuid from
    reporting it as an available feature.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
 xen/arch/x86/traps.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 940bc33..3f7a3c7 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -796,6 +796,8 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_DS, &d);
         __clear_bit(X86_FEATURE_ACC, &d);
         __clear_bit(X86_FEATURE_PBE, &d);
+        if ( is_pvh_vcpu(current) )
+            __clear_bit(X86_FEATURE_MTRR, &d);
 
         __clear_bit(X86_FEATURE_DTES64 % 32, &c);
         __clear_bit(X86_FEATURE_MWAIT % 32, &c);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Tue Dec 17 04:22:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1VsmAk-00034e-1L; Tue, 17 Dec 2013 04:22:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmAi-00034T-1U
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:16 +0000
Received: from [193.109.254.147:20024] by server-13.bemta-14.messagelabs.com
	id 39/48-19374-771DFA25; Tue, 17 Dec 2013 04:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1387254133!5698013!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20193 invoked from network); 17 Dec 2013 04:22:14 -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;
	17 Dec 2013 04:22: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 1VsmAf-00009y-Ck
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmAf-0004eD-Ax
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:13 +0000
Date: Tue, 17 Dec 2013 04:22:13 +0000
Message-Id: <E1VsmAf-0004eD-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/pvh: disable MTRR feature on cpuid
	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: multipart/mixed; boundary="===============5900443006332178219=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 586ab6a055376ec3f3e1e82654eb87481005bc21
Author:     Roger Pau MonnÃ© <roger.pau@citrix.com>
AuthorDate: Mon Dec 16 10:52:43 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Dec 16 10:52:43 2013 +0100

    x86/pvh: disable MTRR feature on cpuid for Dom0
    
    MTRR is not available for PVH Dom0, so prevent cpuid from
    reporting it as an available feature.
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
 xen/arch/x86/traps.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 940bc33..3f7a3c7 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -796,6 +796,8 @@ void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_DS, &d);
         __clear_bit(X86_FEATURE_ACC, &d);
         __clear_bit(X86_FEATURE_PBE, &d);
+        if ( is_pvh_vcpu(current) )
+            __clear_bit(X86_FEATURE_MTRR, &d);
 
         __clear_bit(X86_FEATURE_DTES64 % 32, &c);
         __clear_bit(X86_FEATURE_MWAIT % 32, &c);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Tue Dec 17 04:22:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 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 1VsmAt-00035Z-49; Tue, 17 Dec 2013 04:22: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 1VsmAs-00035S-KB
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:26 +0000
Received: from [85.158.139.211:36600] by server-9.bemta-5.messagelabs.com id
	09/D7-15098-181DFA25; Tue, 17 Dec 2013 04:22:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1387254144!4728701!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18367 invoked from network); 17 Dec 2013 04:22:25 -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;
	17 Dec 2013 04:22: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 1VsmAp-0000A6-OF
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmAp-0004eZ-Hs
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:23 +0000
Date: Tue, 17 Dec 2013 04:22:23 +0000
Message-Id: <E1VsmAp-0004eZ-Hs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenconsole: adjust pty opening error
	checking and handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d97f52713c3850bd3d6d865697a7738a98540aa
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sat Dec 14 14:04:47 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 16 11:55:22 2013 +0000

    xenconsole: adjust pty opening error checking and handling
    
    Currently we check the pty path received from xenstore with access(); if
    it indicates that the pty is not accessible, we loop around and wait for
    a new path to appear in xenstore.
    
    This has several issues:
    * If a path has been written to xenstore, it can be assumed that that
      pty should already be accessible to xenconsole, and hence any error
      that occurs while trying to open it should be fatal and not ignored
    * If access() indicates no access to the pty, the memory allocated for
      the path is leaked when going around the loop again
    * The accessibility of the pty could change between the access() and
      open() calls, leading to a TOCTOU race (this is what Coverity is
      complaining about).
    
    By removing the explicit access() check and just erroring out whenever
    open() fails, we fix all these issues.
    
    Coverity-ID: 1056047
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/console/client/main.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 38c856a..3242008 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -116,12 +116,9 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 			 * disambiguate: just read the pty path */
 			pty_path = xs_read(xs, XBT_NULL, path, &len);
 			if (pty_path != NULL) {
-				if (access(pty_path, R_OK|W_OK) != 0)
-					continue;
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
-				if (pty_fd == -1) 
-					err(errno, "Could not open tty `%s'", 
-					    pty_path);
+				if (pty_fd == -1)
+					err(errno, "Could not open tty `%s'", pty_path);
 				free(pty_path);
 			}
 		}
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:22:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 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 1VsmAt-00035Z-49; Tue, 17 Dec 2013 04:22: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 1VsmAs-00035S-KB
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:26 +0000
Received: from [85.158.139.211:36600] by server-9.bemta-5.messagelabs.com id
	09/D7-15098-181DFA25; Tue, 17 Dec 2013 04:22:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1387254144!4728701!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18367 invoked from network); 17 Dec 2013 04:22:25 -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;
	17 Dec 2013 04:22: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 1VsmAp-0000A6-OF
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmAp-0004eZ-Hs
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:23 +0000
Date: Tue, 17 Dec 2013 04:22:23 +0000
Message-Id: <E1VsmAp-0004eZ-Hs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenconsole: adjust pty opening error
	checking and handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d97f52713c3850bd3d6d865697a7738a98540aa
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sat Dec 14 14:04:47 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 16 11:55:22 2013 +0000

    xenconsole: adjust pty opening error checking and handling
    
    Currently we check the pty path received from xenstore with access(); if
    it indicates that the pty is not accessible, we loop around and wait for
    a new path to appear in xenstore.
    
    This has several issues:
    * If a path has been written to xenstore, it can be assumed that that
      pty should already be accessible to xenconsole, and hence any error
      that occurs while trying to open it should be fatal and not ignored
    * If access() indicates no access to the pty, the memory allocated for
      the path is leaked when going around the loop again
    * The accessibility of the pty could change between the access() and
      open() calls, leading to a TOCTOU race (this is what Coverity is
      complaining about).
    
    By removing the explicit access() check and just erroring out whenever
    open() fails, we fix all these issues.
    
    Coverity-ID: 1056047
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/console/client/main.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 38c856a..3242008 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -116,12 +116,9 @@ static int get_pty_fd(struct xs_handle *xs, char *path, int seconds)
 			 * disambiguate: just read the pty path */
 			pty_path = xs_read(xs, XBT_NULL, path, &len);
 			if (pty_path != NULL) {
-				if (access(pty_path, R_OK|W_OK) != 0)
-					continue;
 				pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
-				if (pty_fd == -1) 
-					err(errno, "Could not open tty `%s'", 
-					    pty_path);
+				if (pty_fd == -1)
+					err(errno, "Could not open tty `%s'", pty_path);
 				free(pty_path);
 			}
 		}
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:22:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:22: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 1VsmB4-000375-6x; Tue, 17 Dec 2013 04:22:38 +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 1VsmB3-00036v-2n
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:37 +0000
Received: from [85.158.143.35:61914] by server-2.bemta-4.messagelabs.com id
	81/D2-11386-C81DFA25; Tue, 17 Dec 2013 04:22:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1387254154!6125801!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28067 invoked from network); 17 Dec 2013 04:22:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2013 04:22: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 1VsmB0-0000AE-7P
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmAz-0004fi-Se
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:33 +0000
Date: Tue, 17 Dec 2013 04:22:33 +0000
Message-Id: <E1VsmAz-0004fi-Se@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: check for libxl_list_vm failure in
	print_uptime
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit df34300fdbb63dffa32e2b158ab5c34fdd0facb5
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sat Dec 14 14:15:21 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 16 11:57:23 2013 +0000

    xl: check for libxl_list_vm failure in print_uptime
    
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
---
 tools/libxl/xl_cmdimpl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index bd26bcc..7c5b9ec 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -6245,6 +6245,10 @@ static void print_uptime(int short_mode, uint32_t doms[], int nb_doms)
     if (nb_doms == 0) {
         print_dom0_uptime(short_mode, now);
         info = libxl_list_vm(ctx, &nb_vm);
+        if (info == NULL) {
+            fprintf(stderr, "Could not list vms.\n");
+            return;
+        }
         for (i = 0; i < nb_vm; i++)
             print_domU_uptime(info[i].domid, short_mode, now);
         libxl_vminfo_list_free(info, nb_vm);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:22:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:22: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 1VsmB4-000375-6x; Tue, 17 Dec 2013 04:22:38 +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 1VsmB3-00036v-2n
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:37 +0000
Received: from [85.158.143.35:61914] by server-2.bemta-4.messagelabs.com id
	81/D2-11386-C81DFA25; Tue, 17 Dec 2013 04:22:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1387254154!6125801!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28067 invoked from network); 17 Dec 2013 04:22:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2013 04:22: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 1VsmB0-0000AE-7P
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmAz-0004fi-Se
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:33 +0000
Date: Tue, 17 Dec 2013 04:22:33 +0000
Message-Id: <E1VsmAz-0004fi-Se@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: check for libxl_list_vm failure in
	print_uptime
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit df34300fdbb63dffa32e2b158ab5c34fdd0facb5
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sat Dec 14 14:15:21 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Dec 16 11:57:23 2013 +0000

    xl: check for libxl_list_vm failure in print_uptime
    
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
---
 tools/libxl/xl_cmdimpl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index bd26bcc..7c5b9ec 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -6245,6 +6245,10 @@ static void print_uptime(int short_mode, uint32_t doms[], int nb_doms)
     if (nb_doms == 0) {
         print_dom0_uptime(short_mode, now);
         info = libxl_list_vm(ctx, &nb_vm);
+        if (info == NULL) {
+            fprintf(stderr, "Could not list vms.\n");
+            return;
+        }
         for (i = 0; i < nb_vm; i++)
             print_domU_uptime(info[i].domid, short_mode, now);
         libxl_vminfo_list_free(info, nb_vm);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:22:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:22: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 1VsmBF-00038Z-GJ; Tue, 17 Dec 2013 04:22:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBE-00038P-5v
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:48 +0000
Received: from [85.158.139.211:47911] by server-4.bemta-5.messagelabs.com id
	1F/03-26791-791DFA25; Tue, 17 Dec 2013 04:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1387254164!2255989!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12453 invoked from network); 17 Dec 2013 04:22:45 -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;
	17 Dec 2013 04:22: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 1VsmBA-0000AK-Lm
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBA-0004g8-Bk
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:44 +0000
Date: Tue, 17 Dec 2013 04:22:44 +0000
Message-Id: <E1VsmBA-0004g8-Bk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxc: flush data cache after
	loading images into guest memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a0035ecc0d82c1d4dcd5e429e2fcc3192d89747a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Dec 13 08:21:51 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 13:31:38 2013 +0000

    tools: libxc: flush data cache after loading images into guest memory
    
    On ARM guest OSes are started with MMU and Caches disables (as they are on
    native) however caching is enabled in the domain running the builder and
    therefore we must flush the cache as we load the blobs, otherwise when the
    guest starts running it may not see them. The dom0 build in the hypervisor has
    the same requirements and already does the right thing.
    
    The mechanism for performing a cache flush from userspace is OS specific, so
    implement this as a new osdep hook:
    
     - On 32-bit ARM Linux provides a system call to flush the cache.
     - On 64-bit ARM Linux the processor is configured to allow cache flushes
       directly from userspace.
     - Non-Linux platforms will need to provide their own implementation. If
       similar mechanisms are not available then a new privcmd ioctl should be a
       suitable alternative.
    
    No cache maintenance is required on x86, so provide a stub for all non-Linux
    platforms which returns success on x86 only and log an error otherwise.
    
    This fixes guest building on Xgene which has a very large L3 cache and so is
    particularly susceptible to this problem. It has also been observed
    sporadically on midway.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Andre Przywara <andre.przywara@calxeda.com>
    Cc: Pranavkumar Sawargaonkar <psawargaonkar@apm.com>
    Cc: Anup Patel <apatel@apm.com>
---
 tools/libxc/xc_dom_armzimageloader.c |    1 +
 tools/libxc/xc_dom_binloader.c       |    1 +
 tools/libxc/xc_dom_core.c            |    2 +
 tools/libxc/xc_linux_osdep.c         |   41 ++++++++++++++++++++++++++++++++++
 tools/libxc/xc_minios.c              |   12 ++++++++++
 tools/libxc/xc_netbsd.c              |   14 +++++++++++
 tools/libxc/xc_private.c             |    5 ++++
 tools/libxc/xc_private.h             |    3 ++
 tools/libxc/xc_solaris.c             |   14 +++++++++++
 tools/libxc/xenctrl_osdep_ENOSYS.c   |    9 +++++++
 tools/libxc/xenctrlosdep.h           |    1 +
 11 files changed, 103 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_dom_armzimageloader.c b/tools/libxc/xc_dom_armzimageloader.c
index e6516a1..508f74b 100644
--- a/tools/libxc/xc_dom_armzimageloader.c
+++ b/tools/libxc/xc_dom_armzimageloader.c
@@ -229,6 +229,7 @@ static int xc_dom_load_zimage_kernel(struct xc_dom_image *dom)
               __func__, dom->kernel_size, dom->kernel_blob, dst);
 
     memcpy(dst, dom->kernel_blob, dom->kernel_size);
+    xc_cache_flush(dom->xch, dst, dom->kernel_size);
 
     return 0;
 }
diff --git a/tools/libxc/xc_dom_binloader.c b/tools/libxc/xc_dom_binloader.c
index e1de5b5..aa0463c 100644
--- a/tools/libxc/xc_dom_binloader.c
+++ b/tools/libxc/xc_dom_binloader.c
@@ -301,6 +301,7 @@ static int xc_dom_load_bin_kernel(struct xc_dom_image *dom)
 
     memcpy(dest, image + skip, text_size);
     memset(dest + text_size, 0, bss_size);
+    xc_cache_flush(dom->xch, dest, text_size+bss_size);
 
     return 0;
 }
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 77a4e64..d46ac22 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -978,6 +978,7 @@ int xc_dom_build_image(struct xc_dom_image *dom)
         }
         else
             memcpy(ramdiskmap, dom->ramdisk_blob, dom->ramdisk_size);
+        xc_cache_flush(dom->xch, ramdiskmap, ramdisklen);
     }
 
     /* load devicetree */
@@ -997,6 +998,7 @@ int xc_dom_build_image(struct xc_dom_image *dom)
             goto err;
         }
         memcpy(devicetreemap, dom->devicetree_blob, dom->devicetree_size);
+        xc_cache_flush(dom->xch, devicetreemap, dom->devicetree_size);
     }
 
     /* allocate other pages */
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 73860a2..e219b24 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -30,6 +30,7 @@
 
 #include <sys/mman.h>
 #include <sys/ioctl.h>
+#include <sys/syscall.h>
 
 #include <xen/memory.h>
 #include <xen/sys/evtchn.h>
@@ -416,6 +417,44 @@ static void *linux_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handle
     return ret;
 }
 
+static void linux_privcmd_cache_flush(xc_interface *xch,
+				      const void *ptr, size_t nr)
+{
+#if defined(__arm__)
+    unsigned long start = (unsigned long)ptr;
+    unsigned long end = start + nr;
+    /* cacheflush(unsigned long start, unsigned long end, int flags) */
+    int rc = syscall(__ARM_NR_cacheflush, start, end, 0);
+    if ( rc < 0 )
+	    PERROR("cache flush operation failed: %d\n", errno);
+#elif defined(__aarch64__)
+    unsigned long start = (unsigned long)ptr;
+    unsigned long end = start + nr;
+    unsigned long p, ctr;
+    int stride;
+
+    /* Flush cache using direct DC CVAC instructions. This is
+     * available to EL0 when SCTLR_EL1.UCI is set, which Linux does.
+     *
+     * Bits 19:16 of CTR_EL0 are log2 of the minimum dcache line size
+     * in words, which we use as our stride length. This is readable
+     * with SCTLR_EL1.UCT is set, which Linux does.
+     */
+    asm volatile ("mrs %0, ctr_el0" : "=r" (ctr));
+
+    stride = 4 * (1 << ((ctr & 0xf0000UL) >> 16));
+
+    for ( p = start ; p < end ; p += stride )
+        asm volatile ("dc cvac, %0" :  : "r" (p));
+    asm volatile ("dsb sy");
+#elif defined(__i386__) || defined(__x86_64__)
+    /* No need for cache maintenance on x86 */
+#else
+    PERROR("No cache flush operation defined for architecture");
+    abort();
+#endif
+}
+
 static struct xc_osdep_ops linux_privcmd_ops = {
     .open = &linux_privcmd_open,
     .close = &linux_privcmd_close,
@@ -430,6 +469,8 @@ static struct xc_osdep_ops linux_privcmd_ops = {
         .map_foreign_bulk = &linux_privcmd_map_foreign_bulk,
         .map_foreign_range = &linux_privcmd_map_foreign_range,
         .map_foreign_ranges = &linux_privcmd_map_foreign_ranges,
+
+        .cache_flush = &linux_privcmd_cache_flush,
     },
 };
 
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index dec4d73..5026b2b 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -181,6 +181,16 @@ static void *minios_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handl
     return ret;
 }
 
+static void minios_privcmd_cache_flush(xc_interface *xch,
+                                       const void *ptr, size_t nr)
+{
+#if defined(__i386__) || defined(__x86_64__)
+    /* No need for cache maintenance on x86 */
+#else
+    printf("No cache flush operation defined for architecture");
+    BUG();
+#endif
+}
 
 static struct xc_osdep_ops minios_privcmd_ops = {
     .open = &minios_privcmd_open,
@@ -196,6 +206,8 @@ static struct xc_osdep_ops minios_privcmd_ops = {
         .map_foreign_bulk = &minios_privcmd_map_foreign_bulk,
         .map_foreign_range = &minios_privcmd_map_foreign_range,
         .map_foreign_ranges = &minios_privcmd_map_foreign_ranges,
+
+        .cache_flush = &minios_privcmd_cache_flush,
     },
 };
 
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 8a90ef3..0143305 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -22,6 +22,7 @@
 
 #include <xen/sys/evtchn.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include <fcntl.h>
 #include <malloc.h>
 #include <sys/mman.h>
@@ -207,6 +208,17 @@ mmap_failed:
 	return NULL;
 }
 
+static void netbsd_privcmd_cache_flush(xc_interface *xch,
+                                       const void *ptr, size_t nr)
+{
+#if defined(__i386__) || defined(__x86_64__)
+    /* No need for cache maintenance on x86 */
+#else
+    PERROR("No cache flush operation defined for architecture");
+    abort();
+#endif
+}
+
 static struct xc_osdep_ops netbsd_privcmd_ops = {
     .open = &netbsd_privcmd_open,
     .close = &netbsd_privcmd_close,
@@ -221,6 +233,8 @@ static struct xc_osdep_ops netbsd_privcmd_ops = {
         .map_foreign_bulk = &xc_map_foreign_bulk_compat,
         .map_foreign_range = &netbsd_privcmd_map_foreign_range,
         .map_foreign_ranges = &netbsd_privcmd_map_foreign_ranges,
+
+        .cache_flush = &netbsd_privcmd_cache_flush,
     },
 };
 
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 838fd21..3ccee2b 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -249,6 +249,11 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
     return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
 }
 
+void xc_cache_flush(xc_interface *xch, const void *p, size_t n)
+{
+    xch->ops->u.privcmd.cache_flush(xch, p, n);
+}
+
 xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
                              unsigned open_flags)
 {
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 92271c9..50a0aa7 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -304,6 +304,9 @@ void bitmap_byte_to_64(uint64_t *lp, const uint8_t *bp, int nbits);
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush);
 
+/* Flush data cache */
+void xc_cache_flush(xc_interface *xch, const void *p, size_t n);
+
 #define MAX_MMU_UPDATES 1024
 struct xc_mmu {
     mmu_update_t updates[MAX_MMU_UPDATES];
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 7257a54..edffab1 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -23,6 +23,7 @@
 #include <xen/memory.h>
 #include <xen/sys/evtchn.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include <fcntl.h>
 #include <malloc.h>
 
@@ -178,6 +179,17 @@ mmap_failed:
     return NULL;
 }
 
+static void solaris_privcmd_cache_flush(xc_interface *xch,
+                                        const void *ptr, size_t nr)
+{
+#if defined(__i386__) || defined(__x86_64__)
+    /* No need for cache maintenance on x86 */
+#else
+    PERROR("No cache flush operation defined for architecture");
+    abort();
+#endif
+}
+
 static struct xc_osdep_ops solaris_privcmd_ops = {
     .open = &solaris_privcmd_open,
     .close = &solaris_privcmd_close,
@@ -192,6 +204,8 @@ static struct xc_osdep_ops solaris_privcmd_ops = {
         .map_foreign_bulk = &xc_map_foreign_bulk_compat,
         .map_foreign_range = &solaris_privcmd_map_foreign_range,
         .map_foreign_ranges = &solaris_privcmd_map_foreign_ranges,
+
+        .cache_flush = &solaris_privcmd_cache_flush,
     },
 };
 
diff --git a/tools/libxc/xenctrl_osdep_ENOSYS.c b/tools/libxc/xenctrl_osdep_ENOSYS.c
index 4821342..d911b10 100644
--- a/tools/libxc/xenctrl_osdep_ENOSYS.c
+++ b/tools/libxc/xenctrl_osdep_ENOSYS.c
@@ -63,6 +63,13 @@ static void *ENOSYS_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handl
     return MAP_FAILED;
 }
 
+static void ENOSYS_privcmd_cache_flush(xc_interface *xch, const void *p, size_t n)
+{
+    unsigned long start = (unsigned long)p;
+    unsigned long end = start + n;
+    IPRINTF(xch, "ENOSYS_privcmd: cache_flush: %#lx-%#lx\n", start, end);
+}
+
 static struct xc_osdep_ops ENOSYS_privcmd_ops =
 {
     .open      = &ENOSYS_privcmd_open,
@@ -74,6 +81,8 @@ static struct xc_osdep_ops ENOSYS_privcmd_ops =
         .map_foreign_bulk = &ENOSYS_privcmd_map_foreign_bulk,
         .map_foreign_range = &ENOSYS_privcmd_map_foreign_range,
         .map_foreign_ranges = &ENOSYS_privcmd_map_foreign_ranges,
+
+        .cache_flush = &ENOSYS_privcmd_cache_flush,
     }
 };
 
diff --git a/tools/libxc/xenctrlosdep.h b/tools/libxc/xenctrlosdep.h
index e610a24..6c9a005 100644
--- a/tools/libxc/xenctrlosdep.h
+++ b/tools/libxc/xenctrlosdep.h
@@ -89,6 +89,7 @@ struct xc_osdep_ops
             void *(*map_foreign_ranges)(xc_interface *xch, xc_osdep_handle h, uint32_t dom, size_t size, int prot,
                                         size_t chunksize, privcmd_mmap_entry_t entries[],
                                         int nentries);
+            void (*cache_flush)(xc_interface *xch, const void *p, size_t n);
         } privcmd;
         struct {
             int (*fd)(xc_evtchn *xce, xc_osdep_handle 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 Dec 17 04:22:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:22: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 1VsmBF-00038Z-GJ; Tue, 17 Dec 2013 04:22:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBE-00038P-5v
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:48 +0000
Received: from [85.158.139.211:47911] by server-4.bemta-5.messagelabs.com id
	1F/03-26791-791DFA25; Tue, 17 Dec 2013 04:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1387254164!2255989!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12453 invoked from network); 17 Dec 2013 04:22:45 -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;
	17 Dec 2013 04:22: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 1VsmBA-0000AK-Lm
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBA-0004g8-Bk
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:44 +0000
Date: Tue, 17 Dec 2013 04:22:44 +0000
Message-Id: <E1VsmBA-0004g8-Bk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxc: flush data cache after
	loading images into guest memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a0035ecc0d82c1d4dcd5e429e2fcc3192d89747a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Dec 13 08:21:51 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 13:31:38 2013 +0000

    tools: libxc: flush data cache after loading images into guest memory
    
    On ARM guest OSes are started with MMU and Caches disables (as they are on
    native) however caching is enabled in the domain running the builder and
    therefore we must flush the cache as we load the blobs, otherwise when the
    guest starts running it may not see them. The dom0 build in the hypervisor has
    the same requirements and already does the right thing.
    
    The mechanism for performing a cache flush from userspace is OS specific, so
    implement this as a new osdep hook:
    
     - On 32-bit ARM Linux provides a system call to flush the cache.
     - On 64-bit ARM Linux the processor is configured to allow cache flushes
       directly from userspace.
     - Non-Linux platforms will need to provide their own implementation. If
       similar mechanisms are not available then a new privcmd ioctl should be a
       suitable alternative.
    
    No cache maintenance is required on x86, so provide a stub for all non-Linux
    platforms which returns success on x86 only and log an error otherwise.
    
    This fixes guest building on Xgene which has a very large L3 cache and so is
    particularly susceptible to this problem. It has also been observed
    sporadically on midway.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Andre Przywara <andre.przywara@calxeda.com>
    Cc: Pranavkumar Sawargaonkar <psawargaonkar@apm.com>
    Cc: Anup Patel <apatel@apm.com>
---
 tools/libxc/xc_dom_armzimageloader.c |    1 +
 tools/libxc/xc_dom_binloader.c       |    1 +
 tools/libxc/xc_dom_core.c            |    2 +
 tools/libxc/xc_linux_osdep.c         |   41 ++++++++++++++++++++++++++++++++++
 tools/libxc/xc_minios.c              |   12 ++++++++++
 tools/libxc/xc_netbsd.c              |   14 +++++++++++
 tools/libxc/xc_private.c             |    5 ++++
 tools/libxc/xc_private.h             |    3 ++
 tools/libxc/xc_solaris.c             |   14 +++++++++++
 tools/libxc/xenctrl_osdep_ENOSYS.c   |    9 +++++++
 tools/libxc/xenctrlosdep.h           |    1 +
 11 files changed, 103 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_dom_armzimageloader.c b/tools/libxc/xc_dom_armzimageloader.c
index e6516a1..508f74b 100644
--- a/tools/libxc/xc_dom_armzimageloader.c
+++ b/tools/libxc/xc_dom_armzimageloader.c
@@ -229,6 +229,7 @@ static int xc_dom_load_zimage_kernel(struct xc_dom_image *dom)
               __func__, dom->kernel_size, dom->kernel_blob, dst);
 
     memcpy(dst, dom->kernel_blob, dom->kernel_size);
+    xc_cache_flush(dom->xch, dst, dom->kernel_size);
 
     return 0;
 }
diff --git a/tools/libxc/xc_dom_binloader.c b/tools/libxc/xc_dom_binloader.c
index e1de5b5..aa0463c 100644
--- a/tools/libxc/xc_dom_binloader.c
+++ b/tools/libxc/xc_dom_binloader.c
@@ -301,6 +301,7 @@ static int xc_dom_load_bin_kernel(struct xc_dom_image *dom)
 
     memcpy(dest, image + skip, text_size);
     memset(dest + text_size, 0, bss_size);
+    xc_cache_flush(dom->xch, dest, text_size+bss_size);
 
     return 0;
 }
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 77a4e64..d46ac22 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -978,6 +978,7 @@ int xc_dom_build_image(struct xc_dom_image *dom)
         }
         else
             memcpy(ramdiskmap, dom->ramdisk_blob, dom->ramdisk_size);
+        xc_cache_flush(dom->xch, ramdiskmap, ramdisklen);
     }
 
     /* load devicetree */
@@ -997,6 +998,7 @@ int xc_dom_build_image(struct xc_dom_image *dom)
             goto err;
         }
         memcpy(devicetreemap, dom->devicetree_blob, dom->devicetree_size);
+        xc_cache_flush(dom->xch, devicetreemap, dom->devicetree_size);
     }
 
     /* allocate other pages */
diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 73860a2..e219b24 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -30,6 +30,7 @@
 
 #include <sys/mman.h>
 #include <sys/ioctl.h>
+#include <sys/syscall.h>
 
 #include <xen/memory.h>
 #include <xen/sys/evtchn.h>
@@ -416,6 +417,44 @@ static void *linux_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handle
     return ret;
 }
 
+static void linux_privcmd_cache_flush(xc_interface *xch,
+				      const void *ptr, size_t nr)
+{
+#if defined(__arm__)
+    unsigned long start = (unsigned long)ptr;
+    unsigned long end = start + nr;
+    /* cacheflush(unsigned long start, unsigned long end, int flags) */
+    int rc = syscall(__ARM_NR_cacheflush, start, end, 0);
+    if ( rc < 0 )
+	    PERROR("cache flush operation failed: %d\n", errno);
+#elif defined(__aarch64__)
+    unsigned long start = (unsigned long)ptr;
+    unsigned long end = start + nr;
+    unsigned long p, ctr;
+    int stride;
+
+    /* Flush cache using direct DC CVAC instructions. This is
+     * available to EL0 when SCTLR_EL1.UCI is set, which Linux does.
+     *
+     * Bits 19:16 of CTR_EL0 are log2 of the minimum dcache line size
+     * in words, which we use as our stride length. This is readable
+     * with SCTLR_EL1.UCT is set, which Linux does.
+     */
+    asm volatile ("mrs %0, ctr_el0" : "=r" (ctr));
+
+    stride = 4 * (1 << ((ctr & 0xf0000UL) >> 16));
+
+    for ( p = start ; p < end ; p += stride )
+        asm volatile ("dc cvac, %0" :  : "r" (p));
+    asm volatile ("dsb sy");
+#elif defined(__i386__) || defined(__x86_64__)
+    /* No need for cache maintenance on x86 */
+#else
+    PERROR("No cache flush operation defined for architecture");
+    abort();
+#endif
+}
+
 static struct xc_osdep_ops linux_privcmd_ops = {
     .open = &linux_privcmd_open,
     .close = &linux_privcmd_close,
@@ -430,6 +469,8 @@ static struct xc_osdep_ops linux_privcmd_ops = {
         .map_foreign_bulk = &linux_privcmd_map_foreign_bulk,
         .map_foreign_range = &linux_privcmd_map_foreign_range,
         .map_foreign_ranges = &linux_privcmd_map_foreign_ranges,
+
+        .cache_flush = &linux_privcmd_cache_flush,
     },
 };
 
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index dec4d73..5026b2b 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -181,6 +181,16 @@ static void *minios_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handl
     return ret;
 }
 
+static void minios_privcmd_cache_flush(xc_interface *xch,
+                                       const void *ptr, size_t nr)
+{
+#if defined(__i386__) || defined(__x86_64__)
+    /* No need for cache maintenance on x86 */
+#else
+    printf("No cache flush operation defined for architecture");
+    BUG();
+#endif
+}
 
 static struct xc_osdep_ops minios_privcmd_ops = {
     .open = &minios_privcmd_open,
@@ -196,6 +206,8 @@ static struct xc_osdep_ops minios_privcmd_ops = {
         .map_foreign_bulk = &minios_privcmd_map_foreign_bulk,
         .map_foreign_range = &minios_privcmd_map_foreign_range,
         .map_foreign_ranges = &minios_privcmd_map_foreign_ranges,
+
+        .cache_flush = &minios_privcmd_cache_flush,
     },
 };
 
diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c
index 8a90ef3..0143305 100644
--- a/tools/libxc/xc_netbsd.c
+++ b/tools/libxc/xc_netbsd.c
@@ -22,6 +22,7 @@
 
 #include <xen/sys/evtchn.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include <fcntl.h>
 #include <malloc.h>
 #include <sys/mman.h>
@@ -207,6 +208,17 @@ mmap_failed:
 	return NULL;
 }
 
+static void netbsd_privcmd_cache_flush(xc_interface *xch,
+                                       const void *ptr, size_t nr)
+{
+#if defined(__i386__) || defined(__x86_64__)
+    /* No need for cache maintenance on x86 */
+#else
+    PERROR("No cache flush operation defined for architecture");
+    abort();
+#endif
+}
+
 static struct xc_osdep_ops netbsd_privcmd_ops = {
     .open = &netbsd_privcmd_open,
     .close = &netbsd_privcmd_close,
@@ -221,6 +233,8 @@ static struct xc_osdep_ops netbsd_privcmd_ops = {
         .map_foreign_bulk = &xc_map_foreign_bulk_compat,
         .map_foreign_range = &netbsd_privcmd_map_foreign_range,
         .map_foreign_ranges = &netbsd_privcmd_map_foreign_ranges,
+
+        .cache_flush = &netbsd_privcmd_cache_flush,
     },
 };
 
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 838fd21..3ccee2b 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -249,6 +249,11 @@ int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
     return xch->ops->u.privcmd.hypercall(xch, xch->ops_handle, hypercall);
 }
 
+void xc_cache_flush(xc_interface *xch, const void *p, size_t n)
+{
+    xch->ops->u.privcmd.cache_flush(xch, p, n);
+}
+
 xc_evtchn *xc_evtchn_open(xentoollog_logger *logger,
                              unsigned open_flags)
 {
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 92271c9..50a0aa7 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -304,6 +304,9 @@ void bitmap_byte_to_64(uint64_t *lp, const uint8_t *bp, int nbits);
 /* Optionally flush file to disk and discard page cache */
 void discard_file_cache(xc_interface *xch, int fd, int flush);
 
+/* Flush data cache */
+void xc_cache_flush(xc_interface *xch, const void *p, size_t n);
+
 #define MAX_MMU_UPDATES 1024
 struct xc_mmu {
     mmu_update_t updates[MAX_MMU_UPDATES];
diff --git a/tools/libxc/xc_solaris.c b/tools/libxc/xc_solaris.c
index 7257a54..edffab1 100644
--- a/tools/libxc/xc_solaris.c
+++ b/tools/libxc/xc_solaris.c
@@ -23,6 +23,7 @@
 #include <xen/memory.h>
 #include <xen/sys/evtchn.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include <fcntl.h>
 #include <malloc.h>
 
@@ -178,6 +179,17 @@ mmap_failed:
     return NULL;
 }
 
+static void solaris_privcmd_cache_flush(xc_interface *xch,
+                                        const void *ptr, size_t nr)
+{
+#if defined(__i386__) || defined(__x86_64__)
+    /* No need for cache maintenance on x86 */
+#else
+    PERROR("No cache flush operation defined for architecture");
+    abort();
+#endif
+}
+
 static struct xc_osdep_ops solaris_privcmd_ops = {
     .open = &solaris_privcmd_open,
     .close = &solaris_privcmd_close,
@@ -192,6 +204,8 @@ static struct xc_osdep_ops solaris_privcmd_ops = {
         .map_foreign_bulk = &xc_map_foreign_bulk_compat,
         .map_foreign_range = &solaris_privcmd_map_foreign_range,
         .map_foreign_ranges = &solaris_privcmd_map_foreign_ranges,
+
+        .cache_flush = &solaris_privcmd_cache_flush,
     },
 };
 
diff --git a/tools/libxc/xenctrl_osdep_ENOSYS.c b/tools/libxc/xenctrl_osdep_ENOSYS.c
index 4821342..d911b10 100644
--- a/tools/libxc/xenctrl_osdep_ENOSYS.c
+++ b/tools/libxc/xenctrl_osdep_ENOSYS.c
@@ -63,6 +63,13 @@ static void *ENOSYS_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handl
     return MAP_FAILED;
 }
 
+static void ENOSYS_privcmd_cache_flush(xc_interface *xch, const void *p, size_t n)
+{
+    unsigned long start = (unsigned long)p;
+    unsigned long end = start + n;
+    IPRINTF(xch, "ENOSYS_privcmd: cache_flush: %#lx-%#lx\n", start, end);
+}
+
 static struct xc_osdep_ops ENOSYS_privcmd_ops =
 {
     .open      = &ENOSYS_privcmd_open,
@@ -74,6 +81,8 @@ static struct xc_osdep_ops ENOSYS_privcmd_ops =
         .map_foreign_bulk = &ENOSYS_privcmd_map_foreign_bulk,
         .map_foreign_range = &ENOSYS_privcmd_map_foreign_range,
         .map_foreign_ranges = &ENOSYS_privcmd_map_foreign_ranges,
+
+        .cache_flush = &ENOSYS_privcmd_cache_flush,
     }
 };
 
diff --git a/tools/libxc/xenctrlosdep.h b/tools/libxc/xenctrlosdep.h
index e610a24..6c9a005 100644
--- a/tools/libxc/xenctrlosdep.h
+++ b/tools/libxc/xenctrlosdep.h
@@ -89,6 +89,7 @@ struct xc_osdep_ops
             void *(*map_foreign_ranges)(xc_interface *xch, xc_osdep_handle h, uint32_t dom, size_t size, int prot,
                                         size_t chunksize, privcmd_mmap_entry_t entries[],
                                         int nentries);
+            void (*cache_flush)(xc_interface *xch, const void *p, size_t n);
         } privcmd;
         struct {
             int (*fd)(xc_evtchn *xce, xc_osdep_handle 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 Dec 17 04:22:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:22: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 1VsmBP-0003AG-Lw; Tue, 17 Dec 2013 04:22: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 1VsmBO-0003A0-GU
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:58 +0000
Received: from [85.158.139.211:37324] by server-5.bemta-5.messagelabs.com id
	21/EE-14928-1A1DFA25; Tue, 17 Dec 2013 04:22:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1387254175!4739880!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9348 invoked from network); 17 Dec 2013 04:22:56 -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;
	17 Dec 2013 04:22: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 1VsmBL-0000AT-Bp
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBK-0004ga-QR
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:55 +0000
Date: Tue, 17 Dec 2013 04:22:54 +0000
Message-Id: <E1VsmBK-0004ga-QR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Physical IRQ is not always
	equal to virtual 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 82064f033bcea2ba4a9da9bbbeb67431419a4e87
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Dec 12 18:59:02 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 15:54:10 2013 +0000

    xen/arm: Physical IRQ is not always equal to virtual IRQ
    
    When Xen needs to EOI a physical IRQ, we should use the IRQ number
    in irq_desc instead of the virtual IRQ.
    
    Remove the eoi flag in maintenance_interrupt and replace the check with
    a check on p->desc != NULL.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 43c11cb..5f7a548 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -880,7 +880,7 @@ static void gic_irq_eoi(void *info)
 
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
-    int i = 0, virq;
+    int i = 0, virq, pirq = -1;
     uint32_t lr;
     struct vcpu *v = current;
     uint64_t eisr = GICH[GICH_EISR0] | (((uint64_t) GICH[GICH_EISR1]) << 32);
@@ -888,10 +888,9 @@ 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;
+        int cpu;
 
         cpu = -1;
-        eoi = 0;
 
         spin_lock_irq(&gic.lock);
         lr = GICH[GICH_LR + i];
@@ -915,19 +914,19 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
             p->desc->status &= ~IRQ_INPROGRESS;
             /* Assume only one pcpu needs to EOI the irq */
             cpu = p->desc->arch.eoi_cpu;
-            eoi = 1;
+            pirq = p->desc->irq;
         }
         list_del_init(&p->inflight);
         spin_unlock_irq(&v->arch.vgic.lock);
 
-        if ( eoi ) {
+        if ( p->desc != NULL ) {
             /* 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*)(uintptr_t)virq);
+                gic_irq_eoi((void*)(uintptr_t)pirq);
             else
                 on_selected_cpus(cpumask_of(cpu),
-                                 gic_irq_eoi, (void*)(uintptr_t)virq, 0);
+                                 gic_irq_eoi, (void*)(uintptr_t)pirq, 0);
         }
 
         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 Dec 17 04:22:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:22: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 1VsmBP-0003AG-Lw; Tue, 17 Dec 2013 04:22: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 1VsmBO-0003A0-GU
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:58 +0000
Received: from [85.158.139.211:37324] by server-5.bemta-5.messagelabs.com id
	21/EE-14928-1A1DFA25; Tue, 17 Dec 2013 04:22:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1387254175!4739880!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9348 invoked from network); 17 Dec 2013 04:22:56 -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;
	17 Dec 2013 04:22: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 1VsmBL-0000AT-Bp
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBK-0004ga-QR
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:22:55 +0000
Date: Tue, 17 Dec 2013 04:22:54 +0000
Message-Id: <E1VsmBK-0004ga-QR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Physical IRQ is not always
	equal to virtual 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 82064f033bcea2ba4a9da9bbbeb67431419a4e87
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Dec 12 18:59:02 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 15:54:10 2013 +0000

    xen/arm: Physical IRQ is not always equal to virtual IRQ
    
    When Xen needs to EOI a physical IRQ, we should use the IRQ number
    in irq_desc instead of the virtual IRQ.
    
    Remove the eoi flag in maintenance_interrupt and replace the check with
    a check on p->desc != NULL.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 43c11cb..5f7a548 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -880,7 +880,7 @@ static void gic_irq_eoi(void *info)
 
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
-    int i = 0, virq;
+    int i = 0, virq, pirq = -1;
     uint32_t lr;
     struct vcpu *v = current;
     uint64_t eisr = GICH[GICH_EISR0] | (((uint64_t) GICH[GICH_EISR1]) << 32);
@@ -888,10 +888,9 @@ 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;
+        int cpu;
 
         cpu = -1;
-        eoi = 0;
 
         spin_lock_irq(&gic.lock);
         lr = GICH[GICH_LR + i];
@@ -915,19 +914,19 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
             p->desc->status &= ~IRQ_INPROGRESS;
             /* Assume only one pcpu needs to EOI the irq */
             cpu = p->desc->arch.eoi_cpu;
-            eoi = 1;
+            pirq = p->desc->irq;
         }
         list_del_init(&p->inflight);
         spin_unlock_irq(&v->arch.vgic.lock);
 
-        if ( eoi ) {
+        if ( p->desc != NULL ) {
             /* 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*)(uintptr_t)virq);
+                gic_irq_eoi((void*)(uintptr_t)pirq);
             else
                 on_selected_cpus(cpumask_of(cpu),
-                                 gic_irq_eoi, (void*)(uintptr_t)virq, 0);
+                                 gic_irq_eoi, (void*)(uintptr_t)pirq, 0);
         }
 
         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 Dec 17 04:23:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:23: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 1VsmBa-0003CC-PQ; Tue, 17 Dec 2013 04:23: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 1VsmBZ-0003Bv-3y
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:09 +0000
Received: from [85.158.139.211:37568] by server-6.bemta-5.messagelabs.com id
	FC/8A-16310-CA1DFA25; Tue, 17 Dec 2013 04:23:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1387254185!4739895!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.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9967 invoked from network); 17 Dec 2013 04:23: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;
	17 Dec 2013 04:23: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 1VsmBV-0000B2-Kf
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBV-0004h6-Ir
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:05 +0000
Date: Tue, 17 Dec 2013 04:23:05 +0000
Message-Id: <E1VsmBV-0004h6-Ir@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: track the state of guest 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 d16d51166b0010c39e28491ea85bc136eaf61411
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Dec 12 18:59:03 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:04:40 2013 +0000

    xen/arm: track the state of guest IRQs
    
    Introduce a status field in struct pending_irq. Valid states are
    GUEST_PENDING, GUEST_VISIBLE and GUEST_ENABLED and they are not mutually
    exclusive.  See the in-code comment for an explanation of the states and
    how they are used.
    Use atomic operations to set and clear the status bits. Note that
    setting GIC_IRQ_GUEST_VISIBLE and clearing GIC_IRQ_GUEST_PENDING can be
    done in two separate operations as the underlying pending status is
    actually only cleared on the LR after the guest ACKs the interrupts.
    Until that happens it's not possible to receive another interrupt.
    
    The main effect of this patch is that an IRQ can be set to GUEST_PENDING
    while it is being serviced by the guest. In maintenance_interrupt we
    check whether GUEST_PENDING is set and if it is we add the irq back into
    the lr_pending queue so that it's going to be reinjected one more time,
    if the interrupt is still enabled at the vgicd level.
    If it is not, it is going to be injected as soon as the guest renables
    the interrupt.
    
    One exception is evtchn_irq: in that case we don't want to
    set the GIC_IRQ_GUEST_PENDING bit if it is already GUEST_VISIBLE,
    because as part of the event handling loop, the guest would realize that
    new events are present even without a new notification.
    Also we already have a way to figure out exactly when we do need to
    inject a second notification if vgic_vcpu_inject_irq is called after the
    end of the guest event handling loop and before the guest EOIs the
    interrupt (see db453468d92369e7182663fb13e14d83ec4ce456 "arm: vgic: fix
    race between evtchn upcall and evtchnop_send").
    
    Don't call gic_inject_irq_stop from maintenance_interrupt because
    gic_inject (called by leave_hypervisor_tail) is going to call
    gic_inject_irq_start/stop appropriately later anyway.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c           |   78 +++++++++++++++++++++++++++---------------
 xen/arch/arm/vgic.c          |   17 +++++++--
 xen/include/asm-arm/domain.h |   37 ++++++++++++++++++++
 3 files changed, 101 insertions(+), 31 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 5f7a548..02f1984 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -615,6 +615,7 @@ static inline void gic_set_lr(int lr, unsigned int virtual_irq,
         unsigned int state, unsigned int priority)
 {
     int maintenance_int = GICH_LR_MAINTENANCE_IRQ;
+    struct pending_irq *p = irq_to_pending(current, virtual_irq);
 
     BUG_ON(lr >= nr_lrs);
     BUG_ON(lr < 0);
@@ -624,13 +625,34 @@ static inline void gic_set_lr(int lr, unsigned int virtual_irq,
         maintenance_int |
         ((priority >> 3) << GICH_LR_PRIORITY_SHIFT) |
         ((virtual_irq & GICH_LR_VIRTUAL_MASK) << GICH_LR_VIRTUAL_SHIFT);
+
+    set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
+    clear_bit(GIC_IRQ_GUEST_PENDING, &p->status);
+}
+
+static inline void gic_add_to_lr_pending(struct vcpu *v, unsigned int irq,
+        unsigned int priority)
+{
+    struct pending_irq *iter, *n = irq_to_pending(v, irq);
+
+    if ( !list_empty(&n->lr_queue) )
+        return;
+
+    list_for_each_entry ( iter, &v->arch.vgic.lr_pending, lr_queue )
+    {
+        if ( iter->priority > priority )
+        {
+            list_add_tail(&n->lr_queue, &iter->lr_queue);
+            return;
+        }
+    }
+    list_add_tail(&n->lr_queue, &v->arch.vgic.lr_pending);
 }
 
 void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         unsigned int state, unsigned int priority)
 {
     int i;
-    struct pending_irq *iter, *n;
     unsigned long flags;
 
     spin_lock_irqsave(&gic.lock, flags);
@@ -645,19 +667,7 @@ void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         }
     }
 
-    n = irq_to_pending(v, virtual_irq);
-    if ( !list_empty(&n->lr_queue) )
-        goto out;
-
-    list_for_each_entry ( iter, &v->arch.vgic.lr_pending, lr_queue )
-    {
-        if ( iter->priority > priority )
-        {
-            list_add_tail(&n->lr_queue, &iter->lr_queue);
-            goto out;
-        }
-    }
-    list_add_tail(&n->lr_queue, &v->arch.vgic.lr_pending);
+    gic_add_to_lr_pending(v, virtual_irq, priority);
 
 out:
     spin_unlock_irqrestore(&gic.lock, flags);
@@ -887,10 +897,12 @@ 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;
+        struct pending_irq *p, *p2;
         int cpu;
+        bool_t inflight;
 
         cpu = -1;
+        inflight = 0;
 
         spin_lock_irq(&gic.lock);
         lr = GICH[GICH_LR + i];
@@ -898,17 +910,6 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
         GICH[GICH_LR + i] = 0;
         clear_bit(i, &this_cpu(lr_mask));
 
-        if ( !list_empty(&v->arch.vgic.lr_pending) ) {
-            p = list_entry(v->arch.vgic.lr_pending.next, typeof(*p), lr_queue);
-            gic_set_lr(i, p->irq, GICH_LR_PENDING, p->priority);
-            list_del_init(&p->lr_queue);
-            set_bit(i, &this_cpu(lr_mask));
-        } else {
-            gic_inject_irq_stop();
-        }
-        spin_unlock_irq(&gic.lock);
-
-        spin_lock_irq(&v->arch.vgic.lock);
         p = irq_to_pending(v, virq);
         if ( p->desc != NULL ) {
             p->desc->status &= ~IRQ_INPROGRESS;
@@ -916,8 +917,29 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
             cpu = p->desc->arch.eoi_cpu;
             pirq = p->desc->irq;
         }
-        list_del_init(&p->inflight);
-        spin_unlock_irq(&v->arch.vgic.lock);
+        if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
+             test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
+        {
+            inflight = 1;
+            gic_add_to_lr_pending(v, virq, p->priority);
+        }
+
+        clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
+
+        if ( !list_empty(&v->arch.vgic.lr_pending) ) {
+            p2 = list_entry(v->arch.vgic.lr_pending.next, typeof(*p2), lr_queue);
+            gic_set_lr(i, p2->irq, GICH_LR_PENDING, p2->priority);
+            list_del_init(&p2->lr_queue);
+            set_bit(i, &this_cpu(lr_mask));
+        }
+        spin_unlock_irq(&gic.lock);
+
+        if ( !inflight )
+        {
+            spin_lock_irq(&v->arch.vgic.lock);
+            list_del_init(&p->inflight);
+            spin_unlock_irq(&v->arch.vgic.lock);
+        }
 
         if ( p->desc != NULL ) {
             /* this is not racy because we can't receive another irq of the
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 2e4b11f..b449f45 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -369,6 +369,7 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
     while ( (i = find_next_bit((const long unsigned int *) &r, 32, i)) < 32 ) {
         irq = i + (32 * n);
         p = irq_to_pending(v, irq);
+        set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
         if ( !list_empty(&p->inflight) )
             gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
         i++;
@@ -672,8 +673,17 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
-    /* vcpu offline or irq already pending */
-    if (test_bit(_VPF_down, &v->pause_flags) || !list_empty(&n->inflight))
+    if ( !list_empty(&n->inflight) )
+    {
+        if ( (irq != current->domain->arch.evtchn_irq) ||
+             (!test_bit(GIC_IRQ_GUEST_VISIBLE, &n->status)) )
+            set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
+        spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+        return;
+    }
+
+    /* vcpu offline */
+    if ( test_bit(_VPF_down, &v->pause_flags) )
     {
         spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
         return;
@@ -682,6 +692,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     priority = byte_read(rank->ipriority[REG_RANK_INDEX(8, idx)], 0, byte);
 
     n->irq = irq;
+    set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
     n->priority = priority;
     if (!virtual)
         n->desc = irq_to_desc(irq);
@@ -689,7 +700,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
         n->desc = NULL;
 
     /* the irq is enabled */
-    if ( rank->ienable & (1 << (irq % 32)) )
+    if ( test_bit(GIC_IRQ_GUEST_ENABLED, &n->status) )
         gic_set_guest_irq(v, irq, GICH_LR_PENDING, priority);
 
     list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, inflight )
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 8ebee3e..0733c5e 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -22,6 +22,43 @@ struct vgic_irq_rank {
 struct pending_irq
 {
     int irq;
+    /*
+     * The following two states track the lifecycle of the guest irq.
+     * However because we are not sure and we don't want to track
+     * whether an irq added to an LR register is PENDING or ACTIVE, the
+     * following states are just an approximation.
+     *
+     * GIC_IRQ_GUEST_PENDING: the irq is asserted
+     *
+     * GIC_IRQ_GUEST_VISIBLE: the irq has been added to an LR register,
+     * therefore the guest is aware of it. From the guest point of view
+     * the irq can be pending (if the guest has not acked the irq yet)
+     * or active (after acking the irq).
+     *
+     * In order for the state machine to be fully accurate, for level
+     * interrupts, we should keep the GIC_IRQ_GUEST_PENDING state until
+     * the guest deactivates the irq. However because we are not sure
+     * when that happens, we simply remove the GIC_IRQ_GUEST_PENDING
+     * state when we add the irq to an LR register. We add it back when
+     * we receive another interrupt notification.
+     * Therefore it is possible to set GIC_IRQ_GUEST_PENDING while the
+     * irq is GIC_IRQ_GUEST_VISIBLE. We could also change the state of
+     * the guest irq in the LR register from active to active and
+     * pending, but for simplicity we simply inject a second irq after
+     * the guest EOIs the first one.
+     *
+     *
+     * An additional state is used to keep track of whether the guest
+     * irq is enabled at the vgicd level:
+     *
+     * GIC_IRQ_GUEST_ENABLED: the guest IRQ is enabled at the VGICD
+     * level (GICD_ICENABLER/GICD_ISENABLER).
+     *
+     */
+#define GIC_IRQ_GUEST_PENDING  0
+#define GIC_IRQ_GUEST_VISIBLE  1
+#define GIC_IRQ_GUEST_ENABLED  2
+    unsigned long status;
     struct irq_desc *desc; /* only set it the irq corresponds to a physical irq */
     uint8_t priority;
     /* inflight is used to append instances of pending_irq to
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:23:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:23: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 1VsmBa-0003CC-PQ; Tue, 17 Dec 2013 04:23: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 1VsmBZ-0003Bv-3y
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:09 +0000
Received: from [85.158.139.211:37568] by server-6.bemta-5.messagelabs.com id
	FC/8A-16310-CA1DFA25; Tue, 17 Dec 2013 04:23:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1387254185!4739895!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.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9967 invoked from network); 17 Dec 2013 04:23: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;
	17 Dec 2013 04:23: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 1VsmBV-0000B2-Kf
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBV-0004h6-Ir
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:05 +0000
Date: Tue, 17 Dec 2013 04:23:05 +0000
Message-Id: <E1VsmBV-0004h6-Ir@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: track the state of guest 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 d16d51166b0010c39e28491ea85bc136eaf61411
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Dec 12 18:59:03 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:04:40 2013 +0000

    xen/arm: track the state of guest IRQs
    
    Introduce a status field in struct pending_irq. Valid states are
    GUEST_PENDING, GUEST_VISIBLE and GUEST_ENABLED and they are not mutually
    exclusive.  See the in-code comment for an explanation of the states and
    how they are used.
    Use atomic operations to set and clear the status bits. Note that
    setting GIC_IRQ_GUEST_VISIBLE and clearing GIC_IRQ_GUEST_PENDING can be
    done in two separate operations as the underlying pending status is
    actually only cleared on the LR after the guest ACKs the interrupts.
    Until that happens it's not possible to receive another interrupt.
    
    The main effect of this patch is that an IRQ can be set to GUEST_PENDING
    while it is being serviced by the guest. In maintenance_interrupt we
    check whether GUEST_PENDING is set and if it is we add the irq back into
    the lr_pending queue so that it's going to be reinjected one more time,
    if the interrupt is still enabled at the vgicd level.
    If it is not, it is going to be injected as soon as the guest renables
    the interrupt.
    
    One exception is evtchn_irq: in that case we don't want to
    set the GIC_IRQ_GUEST_PENDING bit if it is already GUEST_VISIBLE,
    because as part of the event handling loop, the guest would realize that
    new events are present even without a new notification.
    Also we already have a way to figure out exactly when we do need to
    inject a second notification if vgic_vcpu_inject_irq is called after the
    end of the guest event handling loop and before the guest EOIs the
    interrupt (see db453468d92369e7182663fb13e14d83ec4ce456 "arm: vgic: fix
    race between evtchn upcall and evtchnop_send").
    
    Don't call gic_inject_irq_stop from maintenance_interrupt because
    gic_inject (called by leave_hypervisor_tail) is going to call
    gic_inject_irq_start/stop appropriately later anyway.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c           |   78 +++++++++++++++++++++++++++---------------
 xen/arch/arm/vgic.c          |   17 +++++++--
 xen/include/asm-arm/domain.h |   37 ++++++++++++++++++++
 3 files changed, 101 insertions(+), 31 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 5f7a548..02f1984 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -615,6 +615,7 @@ static inline void gic_set_lr(int lr, unsigned int virtual_irq,
         unsigned int state, unsigned int priority)
 {
     int maintenance_int = GICH_LR_MAINTENANCE_IRQ;
+    struct pending_irq *p = irq_to_pending(current, virtual_irq);
 
     BUG_ON(lr >= nr_lrs);
     BUG_ON(lr < 0);
@@ -624,13 +625,34 @@ static inline void gic_set_lr(int lr, unsigned int virtual_irq,
         maintenance_int |
         ((priority >> 3) << GICH_LR_PRIORITY_SHIFT) |
         ((virtual_irq & GICH_LR_VIRTUAL_MASK) << GICH_LR_VIRTUAL_SHIFT);
+
+    set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
+    clear_bit(GIC_IRQ_GUEST_PENDING, &p->status);
+}
+
+static inline void gic_add_to_lr_pending(struct vcpu *v, unsigned int irq,
+        unsigned int priority)
+{
+    struct pending_irq *iter, *n = irq_to_pending(v, irq);
+
+    if ( !list_empty(&n->lr_queue) )
+        return;
+
+    list_for_each_entry ( iter, &v->arch.vgic.lr_pending, lr_queue )
+    {
+        if ( iter->priority > priority )
+        {
+            list_add_tail(&n->lr_queue, &iter->lr_queue);
+            return;
+        }
+    }
+    list_add_tail(&n->lr_queue, &v->arch.vgic.lr_pending);
 }
 
 void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         unsigned int state, unsigned int priority)
 {
     int i;
-    struct pending_irq *iter, *n;
     unsigned long flags;
 
     spin_lock_irqsave(&gic.lock, flags);
@@ -645,19 +667,7 @@ void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         }
     }
 
-    n = irq_to_pending(v, virtual_irq);
-    if ( !list_empty(&n->lr_queue) )
-        goto out;
-
-    list_for_each_entry ( iter, &v->arch.vgic.lr_pending, lr_queue )
-    {
-        if ( iter->priority > priority )
-        {
-            list_add_tail(&n->lr_queue, &iter->lr_queue);
-            goto out;
-        }
-    }
-    list_add_tail(&n->lr_queue, &v->arch.vgic.lr_pending);
+    gic_add_to_lr_pending(v, virtual_irq, priority);
 
 out:
     spin_unlock_irqrestore(&gic.lock, flags);
@@ -887,10 +897,12 @@ 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;
+        struct pending_irq *p, *p2;
         int cpu;
+        bool_t inflight;
 
         cpu = -1;
+        inflight = 0;
 
         spin_lock_irq(&gic.lock);
         lr = GICH[GICH_LR + i];
@@ -898,17 +910,6 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
         GICH[GICH_LR + i] = 0;
         clear_bit(i, &this_cpu(lr_mask));
 
-        if ( !list_empty(&v->arch.vgic.lr_pending) ) {
-            p = list_entry(v->arch.vgic.lr_pending.next, typeof(*p), lr_queue);
-            gic_set_lr(i, p->irq, GICH_LR_PENDING, p->priority);
-            list_del_init(&p->lr_queue);
-            set_bit(i, &this_cpu(lr_mask));
-        } else {
-            gic_inject_irq_stop();
-        }
-        spin_unlock_irq(&gic.lock);
-
-        spin_lock_irq(&v->arch.vgic.lock);
         p = irq_to_pending(v, virq);
         if ( p->desc != NULL ) {
             p->desc->status &= ~IRQ_INPROGRESS;
@@ -916,8 +917,29 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
             cpu = p->desc->arch.eoi_cpu;
             pirq = p->desc->irq;
         }
-        list_del_init(&p->inflight);
-        spin_unlock_irq(&v->arch.vgic.lock);
+        if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
+             test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
+        {
+            inflight = 1;
+            gic_add_to_lr_pending(v, virq, p->priority);
+        }
+
+        clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
+
+        if ( !list_empty(&v->arch.vgic.lr_pending) ) {
+            p2 = list_entry(v->arch.vgic.lr_pending.next, typeof(*p2), lr_queue);
+            gic_set_lr(i, p2->irq, GICH_LR_PENDING, p2->priority);
+            list_del_init(&p2->lr_queue);
+            set_bit(i, &this_cpu(lr_mask));
+        }
+        spin_unlock_irq(&gic.lock);
+
+        if ( !inflight )
+        {
+            spin_lock_irq(&v->arch.vgic.lock);
+            list_del_init(&p->inflight);
+            spin_unlock_irq(&v->arch.vgic.lock);
+        }
 
         if ( p->desc != NULL ) {
             /* this is not racy because we can't receive another irq of the
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 2e4b11f..b449f45 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -369,6 +369,7 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
     while ( (i = find_next_bit((const long unsigned int *) &r, 32, i)) < 32 ) {
         irq = i + (32 * n);
         p = irq_to_pending(v, irq);
+        set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
         if ( !list_empty(&p->inflight) )
             gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
         i++;
@@ -672,8 +673,17 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
-    /* vcpu offline or irq already pending */
-    if (test_bit(_VPF_down, &v->pause_flags) || !list_empty(&n->inflight))
+    if ( !list_empty(&n->inflight) )
+    {
+        if ( (irq != current->domain->arch.evtchn_irq) ||
+             (!test_bit(GIC_IRQ_GUEST_VISIBLE, &n->status)) )
+            set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
+        spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+        return;
+    }
+
+    /* vcpu offline */
+    if ( test_bit(_VPF_down, &v->pause_flags) )
     {
         spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
         return;
@@ -682,6 +692,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     priority = byte_read(rank->ipriority[REG_RANK_INDEX(8, idx)], 0, byte);
 
     n->irq = irq;
+    set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
     n->priority = priority;
     if (!virtual)
         n->desc = irq_to_desc(irq);
@@ -689,7 +700,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
         n->desc = NULL;
 
     /* the irq is enabled */
-    if ( rank->ienable & (1 << (irq % 32)) )
+    if ( test_bit(GIC_IRQ_GUEST_ENABLED, &n->status) )
         gic_set_guest_irq(v, irq, GICH_LR_PENDING, priority);
 
     list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, inflight )
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 8ebee3e..0733c5e 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -22,6 +22,43 @@ struct vgic_irq_rank {
 struct pending_irq
 {
     int irq;
+    /*
+     * The following two states track the lifecycle of the guest irq.
+     * However because we are not sure and we don't want to track
+     * whether an irq added to an LR register is PENDING or ACTIVE, the
+     * following states are just an approximation.
+     *
+     * GIC_IRQ_GUEST_PENDING: the irq is asserted
+     *
+     * GIC_IRQ_GUEST_VISIBLE: the irq has been added to an LR register,
+     * therefore the guest is aware of it. From the guest point of view
+     * the irq can be pending (if the guest has not acked the irq yet)
+     * or active (after acking the irq).
+     *
+     * In order for the state machine to be fully accurate, for level
+     * interrupts, we should keep the GIC_IRQ_GUEST_PENDING state until
+     * the guest deactivates the irq. However because we are not sure
+     * when that happens, we simply remove the GIC_IRQ_GUEST_PENDING
+     * state when we add the irq to an LR register. We add it back when
+     * we receive another interrupt notification.
+     * Therefore it is possible to set GIC_IRQ_GUEST_PENDING while the
+     * irq is GIC_IRQ_GUEST_VISIBLE. We could also change the state of
+     * the guest irq in the LR register from active to active and
+     * pending, but for simplicity we simply inject a second irq after
+     * the guest EOIs the first one.
+     *
+     *
+     * An additional state is used to keep track of whether the guest
+     * irq is enabled at the vgicd level:
+     *
+     * GIC_IRQ_GUEST_ENABLED: the guest IRQ is enabled at the VGICD
+     * level (GICD_ICENABLER/GICD_ISENABLER).
+     *
+     */
+#define GIC_IRQ_GUEST_PENDING  0
+#define GIC_IRQ_GUEST_VISIBLE  1
+#define GIC_IRQ_GUEST_ENABLED  2
+    unsigned long status;
     struct irq_desc *desc; /* only set it the irq corresponds to a physical irq */
     uint8_t priority;
     /* inflight is used to append instances of pending_irq to
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:23:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:23: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 1VsmBk-0003Df-AJ; Tue, 17 Dec 2013 04:23: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 1VsmBi-0003DP-Ed
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:18 +0000
Received: from [85.158.137.68:31850] by server-5.bemta-3.messagelabs.com id
	F5/2C-25188-5B1DFA25; Tue, 17 Dec 2013 04:23:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1387254196!707809!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25980 invoked from network); 17 Dec 2013 04:23:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2013 04:23: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 1VsmBf-0000B8-PH
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBf-0004hX-Oc
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:15 +0000
Date: Tue, 17 Dec 2013 04:23:15 +0000
Message-Id: <E1VsmBf-0004hX-Oc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: do not add a second irq to
	the LRs if one is already present
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1dc955639ec4bb2489ae319b43ad77ccb7a9fb19
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Dec 12 18:59:04 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:04:54 2013 +0000

    xen/arm: do not add a second irq to the LRs if one is already present
    
    When the guest re-enable IRQs, do not add guest IRQs to LRs twice.
    
    Suggested-by: Julien Grall <julien.grall@linaro.org>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index b449f45..f2f1702 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -370,7 +370,7 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
         irq = i + (32 * n);
         p = irq_to_pending(v, irq);
         set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
-        if ( !list_empty(&p->inflight) )
+        if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
             gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
         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 Dec 17 04:23:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:23: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 1VsmBk-0003Df-AJ; Tue, 17 Dec 2013 04:23: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 1VsmBi-0003DP-Ed
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:18 +0000
Received: from [85.158.137.68:31850] by server-5.bemta-3.messagelabs.com id
	F5/2C-25188-5B1DFA25; Tue, 17 Dec 2013 04:23:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1387254196!707809!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25980 invoked from network); 17 Dec 2013 04:23:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2013 04:23: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 1VsmBf-0000B8-PH
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBf-0004hX-Oc
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:15 +0000
Date: Tue, 17 Dec 2013 04:23:15 +0000
Message-Id: <E1VsmBf-0004hX-Oc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: do not add a second irq to
	the LRs if one is already present
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1dc955639ec4bb2489ae319b43ad77ccb7a9fb19
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Dec 12 18:59:04 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:04:54 2013 +0000

    xen/arm: do not add a second irq to the LRs if one is already present
    
    When the guest re-enable IRQs, do not add guest IRQs to LRs twice.
    
    Suggested-by: Julien Grall <julien.grall@linaro.org>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index b449f45..f2f1702 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -370,7 +370,7 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
         irq = i + (32 * n);
         p = irq_to_pending(v, irq);
         set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
-        if ( !list_empty(&p->inflight) )
+        if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
             gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
         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 Dec 17 04:23:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:23: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 1VsmBu-0003FO-TL; Tue, 17 Dec 2013 04:23: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 1VsmBs-0003F3-Od
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:28 +0000
Received: from [85.158.139.211:42921] by server-2.bemta-5.messagelabs.com id
	A1/F9-29392-FB1DFA25; Tue, 17 Dec 2013 04:23:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1387254206!4728786!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20217 invoked from network); 17 Dec 2013 04:23:27 -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;
	17 Dec 2013 04:23: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 1VsmBp-0000BE-W4
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBp-0004hw-U2
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:25 +0000
Date: Tue, 17 Dec 2013 04:23:25 +0000
Message-Id: <E1VsmBp-0004hw-U2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: implement gic_irq_enable and
	gic_irq_disable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a660ee3e8dd5af51656fdfbb7c571dea35c31175
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Dec 12 18:59:05 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:04:54 2013 +0000

    xen/arm: implement gic_irq_enable and gic_irq_disable
    
    Rename gic_irq_startup to gic_irq_enable.
    Rename gic_irq_shutdown to gic_irq_disable.
    
    Implement gic_irq_startup and gic_irq_shutdown calling gic_irq_enable
    and gic_irq_disable.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 02f1984..b2caced 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -129,19 +129,15 @@ void gic_restore_state(struct vcpu *v)
     gic_restore_pending_irqs(v);
 }
 
-static unsigned int gic_irq_startup(struct irq_desc *desc)
+static void gic_irq_enable(struct irq_desc *desc)
 {
-    uint32_t enabler;
     int irq = desc->irq;
 
     /* Enable routing */
-    enabler = GICD[GICD_ISENABLER + irq / 32];
-    GICD[GICD_ISENABLER + irq / 32] = enabler | (1u << (irq % 32));
-
-    return 0;
+    GICD[GICD_ISENABLER + irq / 32] = (1u << (irq % 32));
 }
 
-static void gic_irq_shutdown(struct irq_desc *desc)
+static void gic_irq_disable(struct irq_desc *desc)
 {
     int irq = desc->irq;
 
@@ -149,14 +145,15 @@ static void gic_irq_shutdown(struct irq_desc *desc)
     GICD[GICD_ICENABLER + irq / 32] = (1u << (irq % 32));
 }
 
-static void gic_irq_enable(struct irq_desc *desc)
+static unsigned int gic_irq_startup(struct irq_desc *desc)
 {
-
+    gic_irq_enable(desc);
+    return 0;
 }
 
-static void gic_irq_disable(struct irq_desc *desc)
+static void gic_irq_shutdown(struct irq_desc *desc)
 {
-
+    gic_irq_disable(desc);
 }
 
 static void gic_irq_ack(struct irq_desc *desc)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:23:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:23: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 1VsmBu-0003FO-TL; Tue, 17 Dec 2013 04:23: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 1VsmBs-0003F3-Od
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:28 +0000
Received: from [85.158.139.211:42921] by server-2.bemta-5.messagelabs.com id
	A1/F9-29392-FB1DFA25; Tue, 17 Dec 2013 04:23:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1387254206!4728786!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20217 invoked from network); 17 Dec 2013 04:23:27 -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;
	17 Dec 2013 04:23: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 1VsmBp-0000BE-W4
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmBp-0004hw-U2
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:25 +0000
Date: Tue, 17 Dec 2013 04:23:25 +0000
Message-Id: <E1VsmBp-0004hw-U2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: implement gic_irq_enable and
	gic_irq_disable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a660ee3e8dd5af51656fdfbb7c571dea35c31175
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Dec 12 18:59:05 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:04:54 2013 +0000

    xen/arm: implement gic_irq_enable and gic_irq_disable
    
    Rename gic_irq_startup to gic_irq_enable.
    Rename gic_irq_shutdown to gic_irq_disable.
    
    Implement gic_irq_startup and gic_irq_shutdown calling gic_irq_enable
    and gic_irq_disable.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 02f1984..b2caced 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -129,19 +129,15 @@ void gic_restore_state(struct vcpu *v)
     gic_restore_pending_irqs(v);
 }
 
-static unsigned int gic_irq_startup(struct irq_desc *desc)
+static void gic_irq_enable(struct irq_desc *desc)
 {
-    uint32_t enabler;
     int irq = desc->irq;
 
     /* Enable routing */
-    enabler = GICD[GICD_ISENABLER + irq / 32];
-    GICD[GICD_ISENABLER + irq / 32] = enabler | (1u << (irq % 32));
-
-    return 0;
+    GICD[GICD_ISENABLER + irq / 32] = (1u << (irq % 32));
 }
 
-static void gic_irq_shutdown(struct irq_desc *desc)
+static void gic_irq_disable(struct irq_desc *desc)
 {
     int irq = desc->irq;
 
@@ -149,14 +145,15 @@ static void gic_irq_shutdown(struct irq_desc *desc)
     GICD[GICD_ICENABLER + irq / 32] = (1u << (irq % 32));
 }
 
-static void gic_irq_enable(struct irq_desc *desc)
+static unsigned int gic_irq_startup(struct irq_desc *desc)
 {
-
+    gic_irq_enable(desc);
+    return 0;
 }
 
-static void gic_irq_disable(struct irq_desc *desc)
+static void gic_irq_shutdown(struct irq_desc *desc)
 {
-
+    gic_irq_disable(desc);
 }
 
 static void gic_irq_ack(struct irq_desc *desc)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:23:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:23: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 1VsmC4-0003Gr-1I; Tue, 17 Dec 2013 04:23: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 1VsmC2-0003Gb-Lz
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:38 +0000
Received: from [85.158.143.35:40141] by server-3.bemta-4.messagelabs.com id
	47/26-32360-AC1DFA25; Tue, 17 Dec 2013 04:23:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1387254216!5015798!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.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31231 invoked from network); 17 Dec 2013 04:23:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2013 04:23: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 1VsmC0-0000BM-5E
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmC0-0004is-3V
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:36 +0000
Date: Tue, 17 Dec 2013 04:23:36 +0000
Message-Id: <E1VsmC0-0004is-3V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Only enable physical IRQs
	when the guest asks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 132f65cb4164b54a98e150754330391fc05f8c46
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Dec 12 18:59:06 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:04:54 2013 +0000

    xen/arm: Only enable physical IRQs when the guest asks
    
    Set/Unset IRQ_DISABLED from gic_irq_enable and gic_irq_disable.
    Enable IRQs when the guest requests it, not unconditionally at boot time.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c  |   48 ++++++++++++++++++++++++++++--------------------
 xen/arch/arm/vgic.c |    6 ++----
 2 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index b2caced..ff83426 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -132,17 +132,29 @@ void gic_restore_state(struct vcpu *v)
 static void gic_irq_enable(struct irq_desc *desc)
 {
     int irq = desc->irq;
+    unsigned long flags;
 
+    spin_lock_irqsave(&desc->lock, flags);
+    spin_lock(&gic.lock);
+    desc->status &= ~IRQ_DISABLED;
+    dsb();
     /* Enable routing */
     GICD[GICD_ISENABLER + irq / 32] = (1u << (irq % 32));
+    spin_unlock(&gic.lock);
+    spin_unlock_irqrestore(&desc->lock, flags);
 }
 
 static void gic_irq_disable(struct irq_desc *desc)
 {
     int irq = desc->irq;
 
+    spin_lock(&desc->lock);
+    spin_lock(&gic.lock);
     /* Disable routing */
     GICD[GICD_ICENABLER + irq / 32] = (1u << (irq % 32));
+    desc->status |= IRQ_DISABLED;
+    spin_unlock(&gic.lock);
+    spin_unlock(&desc->lock);
 }
 
 static unsigned int gic_irq_startup(struct irq_desc *desc)
@@ -247,24 +259,20 @@ static int gic_route_irq(unsigned int irq, bool_t level,
     ASSERT(priority <= 0xff);     /* Only 8 bits of priority */
     ASSERT(irq < gic.lines);      /* Can't route interrupts that don't exist */
 
-    spin_lock_irqsave(&desc->lock, flags);
-    spin_lock(&gic.lock);
-
     if ( desc->action != NULL )
-    {
-        spin_unlock(&gic.lock);
-        spin_unlock(&desc->lock);
         return -EBUSY;
-    }
-
-    desc->handler = &gic_host_irq_type;
 
     /* Disable interrupt */
     desc->handler->shutdown(desc);
 
-    gic_set_irq_properties(irq, level, cpu_mask, priority);
+    spin_lock_irqsave(&desc->lock, flags);
+
+    desc->handler = &gic_host_irq_type;
 
+    spin_lock(&gic.lock);
+    gic_set_irq_properties(irq, level, cpu_mask, priority);
     spin_unlock(&gic.lock);
+
     spin_unlock_irqrestore(&desc->lock, flags);
     return 0;
 }
@@ -557,16 +565,13 @@ void __init release_irq(unsigned int irq)
 
     desc = irq_to_desc(irq);
 
+    desc->handler->shutdown(desc);
+
     spin_lock_irqsave(&desc->lock,flags);
     action = desc->action;
     desc->action  = NULL;
-    desc->status |= IRQ_DISABLED;
     desc->status &= ~IRQ_GUEST;
 
-    spin_lock(&gic.lock);
-    desc->handler->shutdown(desc);
-    spin_unlock(&gic.lock);
-
     spin_unlock_irqrestore(&desc->lock,flags);
 
     /* Wait to make sure it's not being used on another CPU */
@@ -583,11 +588,8 @@ static int __setup_irq(struct irq_desc *desc, unsigned int irq,
         return -EBUSY;
 
     desc->action  = new;
-    desc->status &= ~IRQ_DISABLED;
     dsb();
 
-    desc->handler->startup(desc);
-
     return 0;
 }
 
@@ -600,11 +602,12 @@ int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
     desc = irq_to_desc(irq->irq);
 
     spin_lock_irqsave(&desc->lock, flags);
-
     rc = __setup_irq(desc, irq->irq, new);
-
     spin_unlock_irqrestore(&desc->lock, flags);
 
+    desc->handler->startup(desc);
+
+
     return rc;
 }
 
@@ -745,6 +748,7 @@ int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,
     unsigned long flags;
     int retval;
     bool_t level;
+    struct pending_irq *p;
 
     action = xmalloc(struct irqaction);
     if (!action)
@@ -771,6 +775,10 @@ int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,
         goto out;
     }
 
+    /* TODO: do not assume delivery to vcpu0 */
+    p = irq_to_pending(d->vcpu[0], irq->irq);
+    p->desc = desc;
+
 out:
     spin_unlock(&gic.lock);
     spin_unlock_irqrestore(&desc->lock, flags);
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index f2f1702..ad17d1d 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -372,6 +372,8 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
         set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
         if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
             gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
+        if ( p->desc != NULL )
+            p->desc->handler->enable(p->desc);
         i++;
     }
 }
@@ -694,10 +696,6 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     n->irq = irq;
     set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
     n->priority = priority;
-    if (!virtual)
-        n->desc = irq_to_desc(irq);
-    else
-        n->desc = NULL;
 
     /* the irq is enabled */
     if ( test_bit(GIC_IRQ_GUEST_ENABLED, &n->status) )
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:23:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:23: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 1VsmC4-0003Gr-1I; Tue, 17 Dec 2013 04:23: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 1VsmC2-0003Gb-Lz
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:38 +0000
Received: from [85.158.143.35:40141] by server-3.bemta-4.messagelabs.com id
	47/26-32360-AC1DFA25; Tue, 17 Dec 2013 04:23:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1387254216!5015798!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.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31231 invoked from network); 17 Dec 2013 04:23:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2013 04:23: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 1VsmC0-0000BM-5E
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmC0-0004is-3V
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:36 +0000
Date: Tue, 17 Dec 2013 04:23:36 +0000
Message-Id: <E1VsmC0-0004is-3V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Only enable physical IRQs
	when the guest asks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 132f65cb4164b54a98e150754330391fc05f8c46
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Dec 12 18:59:06 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:04:54 2013 +0000

    xen/arm: Only enable physical IRQs when the guest asks
    
    Set/Unset IRQ_DISABLED from gic_irq_enable and gic_irq_disable.
    Enable IRQs when the guest requests it, not unconditionally at boot time.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c  |   48 ++++++++++++++++++++++++++++--------------------
 xen/arch/arm/vgic.c |    6 ++----
 2 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index b2caced..ff83426 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -132,17 +132,29 @@ void gic_restore_state(struct vcpu *v)
 static void gic_irq_enable(struct irq_desc *desc)
 {
     int irq = desc->irq;
+    unsigned long flags;
 
+    spin_lock_irqsave(&desc->lock, flags);
+    spin_lock(&gic.lock);
+    desc->status &= ~IRQ_DISABLED;
+    dsb();
     /* Enable routing */
     GICD[GICD_ISENABLER + irq / 32] = (1u << (irq % 32));
+    spin_unlock(&gic.lock);
+    spin_unlock_irqrestore(&desc->lock, flags);
 }
 
 static void gic_irq_disable(struct irq_desc *desc)
 {
     int irq = desc->irq;
 
+    spin_lock(&desc->lock);
+    spin_lock(&gic.lock);
     /* Disable routing */
     GICD[GICD_ICENABLER + irq / 32] = (1u << (irq % 32));
+    desc->status |= IRQ_DISABLED;
+    spin_unlock(&gic.lock);
+    spin_unlock(&desc->lock);
 }
 
 static unsigned int gic_irq_startup(struct irq_desc *desc)
@@ -247,24 +259,20 @@ static int gic_route_irq(unsigned int irq, bool_t level,
     ASSERT(priority <= 0xff);     /* Only 8 bits of priority */
     ASSERT(irq < gic.lines);      /* Can't route interrupts that don't exist */
 
-    spin_lock_irqsave(&desc->lock, flags);
-    spin_lock(&gic.lock);
-
     if ( desc->action != NULL )
-    {
-        spin_unlock(&gic.lock);
-        spin_unlock(&desc->lock);
         return -EBUSY;
-    }
-
-    desc->handler = &gic_host_irq_type;
 
     /* Disable interrupt */
     desc->handler->shutdown(desc);
 
-    gic_set_irq_properties(irq, level, cpu_mask, priority);
+    spin_lock_irqsave(&desc->lock, flags);
+
+    desc->handler = &gic_host_irq_type;
 
+    spin_lock(&gic.lock);
+    gic_set_irq_properties(irq, level, cpu_mask, priority);
     spin_unlock(&gic.lock);
+
     spin_unlock_irqrestore(&desc->lock, flags);
     return 0;
 }
@@ -557,16 +565,13 @@ void __init release_irq(unsigned int irq)
 
     desc = irq_to_desc(irq);
 
+    desc->handler->shutdown(desc);
+
     spin_lock_irqsave(&desc->lock,flags);
     action = desc->action;
     desc->action  = NULL;
-    desc->status |= IRQ_DISABLED;
     desc->status &= ~IRQ_GUEST;
 
-    spin_lock(&gic.lock);
-    desc->handler->shutdown(desc);
-    spin_unlock(&gic.lock);
-
     spin_unlock_irqrestore(&desc->lock,flags);
 
     /* Wait to make sure it's not being used on another CPU */
@@ -583,11 +588,8 @@ static int __setup_irq(struct irq_desc *desc, unsigned int irq,
         return -EBUSY;
 
     desc->action  = new;
-    desc->status &= ~IRQ_DISABLED;
     dsb();
 
-    desc->handler->startup(desc);
-
     return 0;
 }
 
@@ -600,11 +602,12 @@ int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
     desc = irq_to_desc(irq->irq);
 
     spin_lock_irqsave(&desc->lock, flags);
-
     rc = __setup_irq(desc, irq->irq, new);
-
     spin_unlock_irqrestore(&desc->lock, flags);
 
+    desc->handler->startup(desc);
+
+
     return rc;
 }
 
@@ -745,6 +748,7 @@ int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,
     unsigned long flags;
     int retval;
     bool_t level;
+    struct pending_irq *p;
 
     action = xmalloc(struct irqaction);
     if (!action)
@@ -771,6 +775,10 @@ int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,
         goto out;
     }
 
+    /* TODO: do not assume delivery to vcpu0 */
+    p = irq_to_pending(d->vcpu[0], irq->irq);
+    p->desc = desc;
+
 out:
     spin_unlock(&gic.lock);
     spin_unlock_irqrestore(&desc->lock, flags);
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index f2f1702..ad17d1d 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -372,6 +372,8 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
         set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
         if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
             gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
+        if ( p->desc != NULL )
+            p->desc->handler->enable(p->desc);
         i++;
     }
 }
@@ -694,10 +696,6 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     n->irq = irq;
     set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
     n->priority = priority;
-    if (!virtual)
-        n->desc = irq_to_desc(irq);
-    else
-        n->desc = NULL;
 
     /* the irq is enabled */
     if ( test_bit(GIC_IRQ_GUEST_ENABLED, &n->status) )
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:23:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:23: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 1VsmCE-0003Ix-CA; Tue, 17 Dec 2013 04:23: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 1VsmCC-0003Ih-W3
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:49 +0000
Received: from [193.109.254.147:49447] by server-4.bemta-14.messagelabs.com id
	CE/1F-03916-4D1DFA25; Tue, 17 Dec 2013 04:23:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1387254226!2207600!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16471 invoked from network); 17 Dec 2013 04:23:47 -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;
	17 Dec 2013 04:23: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 1VsmCA-0000BS-9u
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmCA-0004jE-9G
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:46 +0000
Date: Tue, 17 Dec 2013 04:23:46 +0000
Message-Id: <E1VsmCA-0004jE-9G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: disable a physical IRQ when
	the guest disables the corresponding 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 88eb95e3fba3f8d58c77ff548e26fa55f0caaef5
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Dec 12 18:59:07 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:04:54 2013 +0000

    xen/arm: disable a physical IRQ when the guest disables the corresponding IRQ
    
    In vgic_disable_irqs remove irqs from the lr_pending queue so that they
    won't get automatically injected in the guest on maintenance interrupts.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/gic.c        |   10 ++++++++++
 xen/arch/arm/vgic.c       |   19 +++++++++++++++++++
 xen/include/asm-arm/gic.h |    1 +
 3 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index ff83426..e6257a7 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -649,6 +649,16 @@ static inline void gic_add_to_lr_pending(struct vcpu *v, unsigned int irq,
     list_add_tail(&n->lr_queue, &v->arch.vgic.lr_pending);
 }
 
+void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq)
+{
+    struct pending_irq *p = irq_to_pending(v, virtual_irq);
+
+    spin_lock(&gic.lock);
+    if ( !list_empty(&p->lr_queue) )
+        list_del_init(&p->lr_queue);
+    spin_unlock(&gic.lock);
+}
+
 void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         unsigned int state, unsigned int priority)
 {
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index ad17d1d..90e9707 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -360,6 +360,23 @@ read_as_zero:
     return 1;
 }
 
+static void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n)
+{
+    struct pending_irq *p;
+    unsigned int irq;
+    int i = 0;
+
+    while ( (i = find_next_bit((const long unsigned int *) &r, 32, i)) < 32 ) {
+        irq = i + (32 * n);
+        p = irq_to_pending(v, irq);
+        clear_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
+        gic_remove_from_queues(v, irq);
+        if ( p->desc != NULL )
+            p->desc->handler->disable(p->desc);
+        i++;
+    }
+}
+
 static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
 {
     struct pending_irq *p;
@@ -490,8 +507,10 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
+        tr = rank->ienable;
         rank->ienable &= ~*r;
         vgic_unlock_rank(v, rank);
+        vgic_disable_irqs(v, (*r) & tr, gicd_reg - GICD_ICENABLER);
         return 1;
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 41f0b3b..87f4298 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -158,6 +158,7 @@ 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 void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq);
 extern int gic_route_irq_to_guest(struct domain *d,
                                   const struct dt_irq *irq,
                                   const char * devname);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:23:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:23: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 1VsmCE-0003Ix-CA; Tue, 17 Dec 2013 04:23: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 1VsmCC-0003Ih-W3
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:49 +0000
Received: from [193.109.254.147:49447] by server-4.bemta-14.messagelabs.com id
	CE/1F-03916-4D1DFA25; Tue, 17 Dec 2013 04:23:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1387254226!2207600!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16471 invoked from network); 17 Dec 2013 04:23:47 -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;
	17 Dec 2013 04:23: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 1VsmCA-0000BS-9u
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmCA-0004jE-9G
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:46 +0000
Date: Tue, 17 Dec 2013 04:23:46 +0000
Message-Id: <E1VsmCA-0004jE-9G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: disable a physical IRQ when
	the guest disables the corresponding 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 88eb95e3fba3f8d58c77ff548e26fa55f0caaef5
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Dec 12 18:59:07 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:04:54 2013 +0000

    xen/arm: disable a physical IRQ when the guest disables the corresponding IRQ
    
    In vgic_disable_irqs remove irqs from the lr_pending queue so that they
    won't get automatically injected in the guest on maintenance interrupts.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/gic.c        |   10 ++++++++++
 xen/arch/arm/vgic.c       |   19 +++++++++++++++++++
 xen/include/asm-arm/gic.h |    1 +
 3 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index ff83426..e6257a7 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -649,6 +649,16 @@ static inline void gic_add_to_lr_pending(struct vcpu *v, unsigned int irq,
     list_add_tail(&n->lr_queue, &v->arch.vgic.lr_pending);
 }
 
+void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq)
+{
+    struct pending_irq *p = irq_to_pending(v, virtual_irq);
+
+    spin_lock(&gic.lock);
+    if ( !list_empty(&p->lr_queue) )
+        list_del_init(&p->lr_queue);
+    spin_unlock(&gic.lock);
+}
+
 void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         unsigned int state, unsigned int priority)
 {
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index ad17d1d..90e9707 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -360,6 +360,23 @@ read_as_zero:
     return 1;
 }
 
+static void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n)
+{
+    struct pending_irq *p;
+    unsigned int irq;
+    int i = 0;
+
+    while ( (i = find_next_bit((const long unsigned int *) &r, 32, i)) < 32 ) {
+        irq = i + (32 * n);
+        p = irq_to_pending(v, irq);
+        clear_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
+        gic_remove_from_queues(v, irq);
+        if ( p->desc != NULL )
+            p->desc->handler->disable(p->desc);
+        i++;
+    }
+}
+
 static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
 {
     struct pending_irq *p;
@@ -490,8 +507,10 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
+        tr = rank->ienable;
         rank->ienable &= ~*r;
         vgic_unlock_rank(v, rank);
+        vgic_disable_irqs(v, (*r) & tr, gicd_reg - GICD_ICENABLER);
         return 1;
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 41f0b3b..87f4298 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -158,6 +158,7 @@ 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 void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq);
 extern int gic_route_irq_to_guest(struct domain *d,
                                   const struct dt_irq *irq,
                                   const char * devname);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:24:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:24: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 1VsmCP-0003KS-FI; Tue, 17 Dec 2013 04:24:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmCN-0003KC-Fz
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:59 +0000
Received: from [85.158.137.68:21672] by server-17.bemta-3.messagelabs.com id
	89/92-15965-ED1DFA25; Tue, 17 Dec 2013 04:23:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1387254236!4358127!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32055 invoked from network); 17 Dec 2013 04:23:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2013 04:23: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 1VsmCK-0000Bb-Ht
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmCK-0004jb-HE
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:56 +0000
Date: Tue, 17 Dec 2013 04:23:56 +0000
Message-Id: <E1VsmCK-0004jb-HE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Xend: handle died domain in
	getVCPUInfo()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5816c3e4dcb92fb444e7b8eb2004a1fb357ea733
Author:     Joe Jin <joe.jin@oracle.com>
AuthorDate: Tue Dec 10 17:04:47 2013 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:42:21 2013 +0000

    Xend: handle died domain in getVCPUInfo()
    
    When created new guest on NUMA server, xend tried to get the best node
    by calculated all vcpus info, if domain already be terminated then
    getVCPUInfo() will throw below exception and guest start failed:
    
    [2013-09-04 20:01:26 6254] ERROR (XendDomainInfo:496) VM start failed
    Traceback (most recent call last):
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 482, in start
        XendTask.log_progress(31, 60, self._initDomain)
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendTask.py", line 209, in log_progress
        retval = func(*args, **kwds)
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 2918, in _initDomain
        node = self._setCPUAffinity()
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 2835, in _setCPUAffinity
        best_node = find_relaxed_node(candidate_node_list)[0]
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 2803, in find_relaxed_node
        cpuinfo = dom.getVCPUInfo()
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 1600, in getVCPUInfo
        raise XendError(str(exn))
    XendError: (3, 'No such process')
    
    This patch will check return value of xc.vcpu_getinfo() and make sure the
    error not caused by domain died before throw the exception.
    
    Signed-off-by: Joe Jin <joe.jin@oracle.com>
    Acked-by: Matt Wilson <msw@amazon.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/python/xen/xend/XendDomainInfo.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index e9d3e7e..8d4ff5c 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -35,8 +35,10 @@ import stat
 import shutil
 import traceback
 from types import StringTypes
+import errno
 
 import xen.lowlevel.xc
+from xen.lowlevel.xc import Error as XCError
 from xen.util import asserts, auxbin, mkdir
 from xen.util.blkif import parse_uname
 import xen.util.xsm.xsm as security
@@ -1540,7 +1542,10 @@ class XendDomainInfo:
 
             return sxpr
 
-        except RuntimeError, exn:
+        except XCError, exn:
+            # Domain already died.
+            if exn.args[0] == errno.ESRCH:
+                return sxpr
             raise XendError(str(exn))
 
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 17 04:24:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Dec 2013 04:24: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 1VsmCP-0003KS-FI; Tue, 17 Dec 2013 04:24:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmCN-0003KC-Fz
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:59 +0000
Received: from [85.158.137.68:21672] by server-17.bemta-3.messagelabs.com id
	89/92-15965-ED1DFA25; Tue, 17 Dec 2013 04:23:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1387254236!4358127!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32055 invoked from network); 17 Dec 2013 04:23:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2013 04:23: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 1VsmCK-0000Bb-Ht
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VsmCK-0004jb-HE
	for xen-changelog@lists.xensource.com; Tue, 17 Dec 2013 04:23:56 +0000
Date: Tue, 17 Dec 2013 04:23:56 +0000
Message-Id: <E1VsmCK-0004jb-HE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Xend: handle died domain in
	getVCPUInfo()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5816c3e4dcb92fb444e7b8eb2004a1fb357ea733
Author:     Joe Jin <joe.jin@oracle.com>
AuthorDate: Tue Dec 10 17:04:47 2013 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Dec 16 16:42:21 2013 +0000

    Xend: handle died domain in getVCPUInfo()
    
    When created new guest on NUMA server, xend tried to get the best node
    by calculated all vcpus info, if domain already be terminated then
    getVCPUInfo() will throw below exception and guest start failed:
    
    [2013-09-04 20:01:26 6254] ERROR (XendDomainInfo:496) VM start failed
    Traceback (most recent call last):
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 482, in start
        XendTask.log_progress(31, 60, self._initDomain)
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendTask.py", line 209, in log_progress
        retval = func(*args, **kwds)
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 2918, in _initDomain
        node = self._setCPUAffinity()
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 2835, in _setCPUAffinity
        best_node = find_relaxed_node(candidate_node_list)[0]
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 2803, in find_relaxed_node
        cpuinfo = dom.getVCPUInfo()
      File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 1600, in getVCPUInfo
        raise XendError(str(exn))
    XendError: (3, 'No such process')
    
    This patch will check return value of xc.vcpu_getinfo() and make sure the
    error not caused by domain died before throw the exception.
    
    Signed-off-by: Joe Jin <joe.jin@oracle.com>
    Acked-by: Matt Wilson <msw@amazon.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/python/xen/xend/XendDomainInfo.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index e9d3e7e..8d4ff5c 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -35,8 +35,10 @@ import stat
 import shutil
 import traceback
 from types import StringTypes
+import errno
 
 import xen.lowlevel.xc
+from xen.lowlevel.xc import Error as XCError
 from xen.util import asserts, auxbin, mkdir
 from xen.util.blkif import parse_uname
 import xen.util.xsm.xsm as security
@@ -1540,7 +1542,10 @@ class XendDomainInfo:
 
             return sxpr
 
-        except RuntimeError, exn:
+        except XCError, exn:
+            # Domain already died.
+            if exn.args[0] == errno.ESRCH:
+                return sxpr
             raise XendError(str(exn))
 
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 18 07:22:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Dec 2013 07:22: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 1VtBSJ-0001Mw-D5; Wed, 18 Dec 2013 07:22: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 1VtBSH-0001Ml-Oj
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:05 +0000
Received: from [85.158.139.211:62126] by server-7.bemta-5.messagelabs.com id
	64/80-04824-D1D41B25; Wed, 18 Dec 2013 07:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1387351323!5258514!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3130 invoked from network); 18 Dec 2013 07:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2013 07:22: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 1VtBSE-0000rI-Vh
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtBSE-00084Z-Mg
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:02 +0000
Date: Wed, 18 Dec 2013 07:22:02 +0000
Message-Id: <E1VtBSE-00084Z-Mg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: Prevent leaking domain
	mappings in paging_log_dirty_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0725f326358cbb2ba7f9626976e346b963d74c37
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 17 16:38:07 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 17 16:38:07 2013 +0100

    x86/mm: Prevent leaking domain mappings in paging_log_dirty_op()
    
    Coverity ID: 1135374 1135375 1135376 1135377
    
    If {copy_to,clear}_guest_offset() fails, we would leak the domain mappings for
    l4 thru l1.
    
    Fixing this requires having conditional unmaps on the faulting path, which in
    turn requires explicitly initialising the pointers to NULL because of the
    early ENOMEM exit.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <JBeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/paging.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 4ba7669..21344e5 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -330,8 +330,8 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
 {
     int rv = 0, clean = 0, peek = 1;
     unsigned long pages = 0;
-    mfn_t *l4, *l3, *l2;
-    unsigned long *l1;
+    mfn_t *l4 = NULL, *l3 = NULL, *l2 = NULL;
+    unsigned long *l1 = NULL;
     int i4, i3, i2;
 
     domain_pause(d);
@@ -434,6 +434,16 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
  out:
     paging_unlock(d);
     domain_unpause(d);
+
+    if ( l1 )
+        unmap_domain_page(l1);
+    if ( l2 )
+        unmap_domain_page(l2);
+    if ( l3 )
+        unmap_domain_page(l3);
+    if ( l4 )
+        unmap_domain_page(l4);
+
     return rv;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 18 07:22:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Dec 2013 07:22: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 1VtBSJ-0001Mw-D5; Wed, 18 Dec 2013 07:22: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 1VtBSH-0001Ml-Oj
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:05 +0000
Received: from [85.158.139.211:62126] by server-7.bemta-5.messagelabs.com id
	64/80-04824-D1D41B25; Wed, 18 Dec 2013 07:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1387351323!5258514!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3130 invoked from network); 18 Dec 2013 07:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2013 07:22: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 1VtBSE-0000rI-Vh
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtBSE-00084Z-Mg
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:02 +0000
Date: Wed, 18 Dec 2013 07:22:02 +0000
Message-Id: <E1VtBSE-00084Z-Mg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: Prevent leaking domain
	mappings in paging_log_dirty_op()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0725f326358cbb2ba7f9626976e346b963d74c37
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 17 16:38:07 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 17 16:38:07 2013 +0100

    x86/mm: Prevent leaking domain mappings in paging_log_dirty_op()
    
    Coverity ID: 1135374 1135375 1135376 1135377
    
    If {copy_to,clear}_guest_offset() fails, we would leak the domain mappings for
    l4 thru l1.
    
    Fixing this requires having conditional unmaps on the faulting path, which in
    turn requires explicitly initialising the pointers to NULL because of the
    early ENOMEM exit.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <JBeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/paging.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 4ba7669..21344e5 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -330,8 +330,8 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
 {
     int rv = 0, clean = 0, peek = 1;
     unsigned long pages = 0;
-    mfn_t *l4, *l3, *l2;
-    unsigned long *l1;
+    mfn_t *l4 = NULL, *l3 = NULL, *l2 = NULL;
+    unsigned long *l1 = NULL;
     int i4, i3, i2;
 
     domain_pause(d);
@@ -434,6 +434,16 @@ int paging_log_dirty_op(struct domain *d, struct xen_domctl_shadow_op *sc)
  out:
     paging_unlock(d);
     domain_unpause(d);
+
+    if ( l1 )
+        unmap_domain_page(l1);
+    if ( l2 )
+        unmap_domain_page(l2);
+    if ( l3 )
+        unmap_domain_page(l3);
+    if ( l4 )
+        unmap_domain_page(l4);
+
     return rv;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 18 07:22:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Dec 2013 07:22: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 1VtBT0-0001Pb-Gy; Wed, 18 Dec 2013 07:22:50 +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 1VtBSz-0001PQ-7H
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:49 +0000
Received: from [85.158.137.68:50901] by server-15.bemta-3.messagelabs.com id
	3E/80-11556-84D41B25; Wed, 18 Dec 2013 07:22:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1387351333!4688028!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16943 invoked from network); 18 Dec 2013 07:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2013 07:22: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 1VtBSP-0000rO-Bz
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtBSP-00084x-2U
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:13 +0000
Date: Wed, 18 Dec 2013 07:22:13 +0000
Message-Id: <E1VtBSP-00084x-2U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/memshr: fix preemption in
	relinquish_shared_pages()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a0070f7a5ad8652c74c685a0ee5f10215402279d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 17 16:39:39 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 17 16:39:39 2013 +0100

    x86/memshr: fix preemption in relinquish_shared_pages()
    
    For one, should hypercall_preempt_check() return false the first time
    it gets called, it would never have got called again (because count,
    being checked for equality, didn't get reset to zero).
    
    And then, if there were a huge range of unshared pages, with count not
    getting incremented at all in that case there would also not be any
    preemption.
    
    Fix this by using a biased increment (ratio 1:16 for unshared vs shared
    pages), and flushing the count to zero in case of a "false" return from
    hypercall_preempt_check().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/mem_sharing.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index c94856b..4a5d9e8 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1290,15 +1290,21 @@ int relinquish_shared_pages(struct domain *d)
             set_rc = p2m->set_entry(p2m, gfn, _mfn(0), PAGE_ORDER_4K,
                                     p2m_invalid, p2m_access_rwx);
             ASSERT(set_rc != 0);
-            count++;
+            count += 0x10;
         }
+        else
+            ++count;
 
-        /* Preempt every 2MiB. Arbitrary */
-        if ( (count == 512) && hypercall_preempt_check() )
+        /* Preempt every 2MiB (shared) or 32MiB (unshared) - arbitrary. */
+        if ( count >= 0x2000 )
         {
-            p2m->next_shared_gfn_to_relinquish = gfn + 1;
-            rc = -EAGAIN;
-            break;
+            if ( hypercall_preempt_check() )
+            {
+                p2m->next_shared_gfn_to_relinquish = gfn + 1;
+                rc = -EAGAIN;
+                break;
+            }
+            count = 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 Dec 18 07:22:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Dec 2013 07:22: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 1VtBT0-0001Pb-Gy; Wed, 18 Dec 2013 07:22:50 +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 1VtBSz-0001PQ-7H
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:49 +0000
Received: from [85.158.137.68:50901] by server-15.bemta-3.messagelabs.com id
	3E/80-11556-84D41B25; Wed, 18 Dec 2013 07:22:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1387351333!4688028!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16943 invoked from network); 18 Dec 2013 07:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2013 07:22: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 1VtBSP-0000rO-Bz
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtBSP-00084x-2U
	for xen-changelog@lists.xensource.com; Wed, 18 Dec 2013 07:22:13 +0000
Date: Wed, 18 Dec 2013 07:22:13 +0000
Message-Id: <E1VtBSP-00084x-2U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/memshr: fix preemption in
	relinquish_shared_pages()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a0070f7a5ad8652c74c685a0ee5f10215402279d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Dec 17 16:39:39 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Dec 17 16:39:39 2013 +0100

    x86/memshr: fix preemption in relinquish_shared_pages()
    
    For one, should hypercall_preempt_check() return false the first time
    it gets called, it would never have got called again (because count,
    being checked for equality, didn't get reset to zero).
    
    And then, if there were a huge range of unshared pages, with count not
    getting incremented at all in that case there would also not be any
    preemption.
    
    Fix this by using a biased increment (ratio 1:16 for unshared vs shared
    pages), and flushing the count to zero in case of a "false" return from
    hypercall_preempt_check().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/mem_sharing.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index c94856b..4a5d9e8 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1290,15 +1290,21 @@ int relinquish_shared_pages(struct domain *d)
             set_rc = p2m->set_entry(p2m, gfn, _mfn(0), PAGE_ORDER_4K,
                                     p2m_invalid, p2m_access_rwx);
             ASSERT(set_rc != 0);
-            count++;
+            count += 0x10;
         }
+        else
+            ++count;
 
-        /* Preempt every 2MiB. Arbitrary */
-        if ( (count == 512) && hypercall_preempt_check() )
+        /* Preempt every 2MiB (shared) or 32MiB (unshared) - arbitrary. */
+        if ( count >= 0x2000 )
         {
-            p2m->next_shared_gfn_to_relinquish = gfn + 1;
-            rc = -EAGAIN;
-            break;
+            if ( hypercall_preempt_check() )
+            {
+                p2m->next_shared_gfn_to_relinquish = gfn + 1;
+                rc = -EAGAIN;
+                break;
+            }
+            count = 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 Dec 19 01:44:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 01:44: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 1VtSem-0007mH-KW; Thu, 19 Dec 2013 01:44:08 +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 1VtSel-0007m9-2G
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:07 +0000
Received: from [85.158.137.68:23664] by server-14.bemta-3.messagelabs.com id
	40/F8-06105-66F42B25; Thu, 19 Dec 2013 01:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1387417444!4897367!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26597 invoked from network); 19 Dec 2013 01:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2013 01:44: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 1VtSeh-0003iU-KC
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSeh-0006Mj-Fb
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:03 +0000
Date: Thu, 19 Dec 2013 01:44:03 +0000
Message-Id: <E1VtSeh-0006Mj-Fb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Fix CHK_ERRNO()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 54984ac03af709ce122d53c5a1936a2fecc15625
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 10 15:45:17 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 11:09:48 2013 +0000

    xl: Fix CHK_ERRNO()
    
    The macro CHK_ERRNO() was being used to check two different error schemes, and
    succeeded at neither.
    
    Split the macro into two; CHK_SYSCALL() for calls which return -1 and set
    errno on error, and CHK_ERRNOVAL() for calls which return an errno.
    
    In both cases, ensure that strerror() now gets called with the error integer.
    
    Coverity ID: 1055570 1090374 1130516
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   61 ++++++++++++++++++++++++++++-----------------
 1 files changed, 38 insertions(+), 23 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 7c5b9ec..078f7a7 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -41,11 +41,23 @@
 #include "libxlutil.h"
 #include "xl.h"
 
-#define CHK_ERRNO( call ) ({                                            \
-        int chk_errno = (call);                                         \
-        if (chk_errno < 0) {                                                \
+/* For calls which return an errno on failure */
+#define CHK_ERRNOVAL( call ) ({                                         \
+        int chk_errnoval = (call);                                      \
+        if (chk_errnoval < 0)                                           \
+            abort();                                                    \
+        else if (chk_errnoval > 0) {                                    \
             fprintf(stderr,"xl: fatal error: %s:%d: %s: %s\n",          \
-                    __FILE__,__LINE__, strerror(chk_errno), #call);     \
+                    __FILE__,__LINE__, strerror(chk_errnoval), #call);  \
+            exit(-ERROR_FAIL);                                          \
+        }                                                               \
+    })
+
+/* For calls which return -1 and set errno on failure */
+#define CHK_SYSCALL( call ) ({                                          \
+        if ((call) == -1) {                                             \
+            fprintf(stderr,"xl: fatal error: %s:%d: %s: %s\n",          \
+                    __FILE__,__LINE__, strerror(errno), #call);         \
             exit(-ERROR_FAIL);                                          \
         }                                                               \
     })
@@ -442,15 +454,15 @@ static int do_daemonize(char *name)
         exit(-1);
     }
 
-    CHK_ERRNO(logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND, 0644));
+    CHK_SYSCALL(logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND, 0644));
     free(fullname);
 
-    CHK_ERRNO(nullfd = open("/dev/null", O_RDONLY));
+    CHK_SYSCALL(nullfd = open("/dev/null", O_RDONLY));
     dup2(nullfd, 0);
     dup2(logfile, 1);
     dup2(logfile, 2);
 
-    CHK_ERRNO(daemon(0, 1));
+    CHK_SYSCALL(daemon(0, 1));
 
 out:
     return ret;
@@ -2047,8 +2059,9 @@ static uint32_t create_domain(struct domain_create *dom_info)
             if (rc) return rc;
         }
 
-        CHK_ERRNO( libxl_read_exactly(ctx, restore_fd, &hdr,
-                   sizeof(hdr), restore_source, "header") );
+        CHK_ERRNOVAL(libxl_read_exactly(
+                         ctx, restore_fd, &hdr, sizeof(hdr),
+                         restore_source, "header"));
         if (memcmp(hdr.magic, savefileheader_magic, sizeof(hdr.magic))) {
             fprintf(stderr, "File has wrong magic number -"
                     " corrupt or for a different tool?\n");
@@ -2073,8 +2086,10 @@ static uint32_t create_domain(struct domain_create *dom_info)
         }
         if (hdr.optional_data_len) {
             optdata_begin = xmalloc(hdr.optional_data_len);
-            CHK_ERRNO( libxl_read_exactly(ctx, restore_fd, optdata_begin,
-                   hdr.optional_data_len, restore_source, "optdata") );
+            CHK_ERRNOVAL(libxl_read_exactly(
+                             ctx, restore_fd, optdata_begin,
+                             hdr.optional_data_len, restore_source,
+                             "optdata"));
         }
 
 #define OPTDATA_LEFT  (hdr.optional_data_len - (optdata_here - optdata_begin))
@@ -3151,7 +3166,7 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
         rc = libxl_userdata_retrieve(ctx, info[i].domid, "xl", &data, &len);
         if (rc)
             continue;
-        CHK_ERRNO(asprintf(&config_source, "<domid %d data>", info[i].domid));
+        CHK_SYSCALL(asprintf(&config_source, "<domid %d data>", info[i].domid));
         libxl_domain_config_init(&d_config);
         parse_config_data(config_source, (char *)data, len, &d_config, NULL);
         if (default_output_format == OUTPUT_FORMAT_JSON)
@@ -3389,10 +3404,11 @@ static void save_domain_core_writeconfig(int fd, const char *source,
 
     /* that's the optional data */
 
-    CHK_ERRNO( libxl_write_exactly(ctx, fd,
-        &hdr, sizeof(hdr), source, "header") );
-    CHK_ERRNO( libxl_write_exactly(ctx, fd,
-        optdata_begin, hdr.optional_data_len, source, "header") );
+    CHK_ERRNOVAL(libxl_write_exactly(
+                     ctx, fd, &hdr, sizeof(hdr), source, "header"));
+    CHK_ERRNOVAL(libxl_write_exactly(
+                     ctx, fd, optdata_begin, hdr.optional_data_len,
+                     source, "header"));
 
     fprintf(stderr, "Saving to %s new xl format (info"
             " 0x%"PRIx32"/0x%"PRIx32"/%"PRIu32")\n",
@@ -3504,7 +3520,7 @@ static void migration_child_report(int recv_fd) {
 
     if (!xl_child_pid(child_migration)) return;
 
-    CHK_ERRNO( gettimeofday(&waituntil, 0) );
+    CHK_SYSCALL(gettimeofday(&waituntil, 0));
     waituntil.tv_sec += 2;
 
     for (;;) {
@@ -3525,7 +3541,7 @@ static void migration_child_report(int recv_fd) {
         }
         assert(child == 0);
 
-        CHK_ERRNO( gettimeofday(&now, 0) );
+        CHK_SYSCALL(gettimeofday(&now, 0));
         if (timercmp(&now, &waituntil, >)) {
             fprintf(stderr, "migration child [%ld] not exiting, no longer"
                     " waiting (exit status will be unreported)\n",
@@ -3747,11 +3763,10 @@ static void migrate_receive(int debug, int daemonize, int monitor,
 
     fprintf(stderr, "migration target: Ready to receive domain.\n");
 
-    CHK_ERRNO( libxl_write_exactly(ctx, send_fd,
-                                   migrate_receiver_banner,
-                                   sizeof(migrate_receiver_banner)-1,
-                                   "migration ack stream",
-                                   "banner") );
+    CHK_ERRNOVAL(libxl_write_exactly(
+                     ctx, send_fd, migrate_receiver_banner,
+                     sizeof(migrate_receiver_banner)-1,
+                     "migration ack stream", "banner") );
 
     memset(&dom_info, 0, sizeof(dom_info));
     dom_info.debug = debug;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 19 01:44:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 01:44: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 1VtSem-0007mH-KW; Thu, 19 Dec 2013 01:44:08 +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 1VtSel-0007m9-2G
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:07 +0000
Received: from [85.158.137.68:23664] by server-14.bemta-3.messagelabs.com id
	40/F8-06105-66F42B25; Thu, 19 Dec 2013 01:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1387417444!4897367!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26597 invoked from network); 19 Dec 2013 01:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2013 01:44: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 1VtSeh-0003iU-KC
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSeh-0006Mj-Fb
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:03 +0000
Date: Thu, 19 Dec 2013 01:44:03 +0000
Message-Id: <E1VtSeh-0006Mj-Fb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Fix CHK_ERRNO()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 54984ac03af709ce122d53c5a1936a2fecc15625
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Dec 10 15:45:17 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 11:09:48 2013 +0000

    xl: Fix CHK_ERRNO()
    
    The macro CHK_ERRNO() was being used to check two different error schemes, and
    succeeded at neither.
    
    Split the macro into two; CHK_SYSCALL() for calls which return -1 and set
    errno on error, and CHK_ERRNOVAL() for calls which return an errno.
    
    In both cases, ensure that strerror() now gets called with the error integer.
    
    Coverity ID: 1055570 1090374 1130516
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   61 ++++++++++++++++++++++++++++-----------------
 1 files changed, 38 insertions(+), 23 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 7c5b9ec..078f7a7 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -41,11 +41,23 @@
 #include "libxlutil.h"
 #include "xl.h"
 
-#define CHK_ERRNO( call ) ({                                            \
-        int chk_errno = (call);                                         \
-        if (chk_errno < 0) {                                                \
+/* For calls which return an errno on failure */
+#define CHK_ERRNOVAL( call ) ({                                         \
+        int chk_errnoval = (call);                                      \
+        if (chk_errnoval < 0)                                           \
+            abort();                                                    \
+        else if (chk_errnoval > 0) {                                    \
             fprintf(stderr,"xl: fatal error: %s:%d: %s: %s\n",          \
-                    __FILE__,__LINE__, strerror(chk_errno), #call);     \
+                    __FILE__,__LINE__, strerror(chk_errnoval), #call);  \
+            exit(-ERROR_FAIL);                                          \
+        }                                                               \
+    })
+
+/* For calls which return -1 and set errno on failure */
+#define CHK_SYSCALL( call ) ({                                          \
+        if ((call) == -1) {                                             \
+            fprintf(stderr,"xl: fatal error: %s:%d: %s: %s\n",          \
+                    __FILE__,__LINE__, strerror(errno), #call);         \
             exit(-ERROR_FAIL);                                          \
         }                                                               \
     })
@@ -442,15 +454,15 @@ static int do_daemonize(char *name)
         exit(-1);
     }
 
-    CHK_ERRNO(logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND, 0644));
+    CHK_SYSCALL(logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND, 0644));
     free(fullname);
 
-    CHK_ERRNO(nullfd = open("/dev/null", O_RDONLY));
+    CHK_SYSCALL(nullfd = open("/dev/null", O_RDONLY));
     dup2(nullfd, 0);
     dup2(logfile, 1);
     dup2(logfile, 2);
 
-    CHK_ERRNO(daemon(0, 1));
+    CHK_SYSCALL(daemon(0, 1));
 
 out:
     return ret;
@@ -2047,8 +2059,9 @@ static uint32_t create_domain(struct domain_create *dom_info)
             if (rc) return rc;
         }
 
-        CHK_ERRNO( libxl_read_exactly(ctx, restore_fd, &hdr,
-                   sizeof(hdr), restore_source, "header") );
+        CHK_ERRNOVAL(libxl_read_exactly(
+                         ctx, restore_fd, &hdr, sizeof(hdr),
+                         restore_source, "header"));
         if (memcmp(hdr.magic, savefileheader_magic, sizeof(hdr.magic))) {
             fprintf(stderr, "File has wrong magic number -"
                     " corrupt or for a different tool?\n");
@@ -2073,8 +2086,10 @@ static uint32_t create_domain(struct domain_create *dom_info)
         }
         if (hdr.optional_data_len) {
             optdata_begin = xmalloc(hdr.optional_data_len);
-            CHK_ERRNO( libxl_read_exactly(ctx, restore_fd, optdata_begin,
-                   hdr.optional_data_len, restore_source, "optdata") );
+            CHK_ERRNOVAL(libxl_read_exactly(
+                             ctx, restore_fd, optdata_begin,
+                             hdr.optional_data_len, restore_source,
+                             "optdata"));
         }
 
 #define OPTDATA_LEFT  (hdr.optional_data_len - (optdata_here - optdata_begin))
@@ -3151,7 +3166,7 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
         rc = libxl_userdata_retrieve(ctx, info[i].domid, "xl", &data, &len);
         if (rc)
             continue;
-        CHK_ERRNO(asprintf(&config_source, "<domid %d data>", info[i].domid));
+        CHK_SYSCALL(asprintf(&config_source, "<domid %d data>", info[i].domid));
         libxl_domain_config_init(&d_config);
         parse_config_data(config_source, (char *)data, len, &d_config, NULL);
         if (default_output_format == OUTPUT_FORMAT_JSON)
@@ -3389,10 +3404,11 @@ static void save_domain_core_writeconfig(int fd, const char *source,
 
     /* that's the optional data */
 
-    CHK_ERRNO( libxl_write_exactly(ctx, fd,
-        &hdr, sizeof(hdr), source, "header") );
-    CHK_ERRNO( libxl_write_exactly(ctx, fd,
-        optdata_begin, hdr.optional_data_len, source, "header") );
+    CHK_ERRNOVAL(libxl_write_exactly(
+                     ctx, fd, &hdr, sizeof(hdr), source, "header"));
+    CHK_ERRNOVAL(libxl_write_exactly(
+                     ctx, fd, optdata_begin, hdr.optional_data_len,
+                     source, "header"));
 
     fprintf(stderr, "Saving to %s new xl format (info"
             " 0x%"PRIx32"/0x%"PRIx32"/%"PRIu32")\n",
@@ -3504,7 +3520,7 @@ static void migration_child_report(int recv_fd) {
 
     if (!xl_child_pid(child_migration)) return;
 
-    CHK_ERRNO( gettimeofday(&waituntil, 0) );
+    CHK_SYSCALL(gettimeofday(&waituntil, 0));
     waituntil.tv_sec += 2;
 
     for (;;) {
@@ -3525,7 +3541,7 @@ static void migration_child_report(int recv_fd) {
         }
         assert(child == 0);
 
-        CHK_ERRNO( gettimeofday(&now, 0) );
+        CHK_SYSCALL(gettimeofday(&now, 0));
         if (timercmp(&now, &waituntil, >)) {
             fprintf(stderr, "migration child [%ld] not exiting, no longer"
                     " waiting (exit status will be unreported)\n",
@@ -3747,11 +3763,10 @@ static void migrate_receive(int debug, int daemonize, int monitor,
 
     fprintf(stderr, "migration target: Ready to receive domain.\n");
 
-    CHK_ERRNO( libxl_write_exactly(ctx, send_fd,
-                                   migrate_receiver_banner,
-                                   sizeof(migrate_receiver_banner)-1,
-                                   "migration ack stream",
-                                   "banner") );
+    CHK_ERRNOVAL(libxl_write_exactly(
+                     ctx, send_fd, migrate_receiver_banner,
+                     sizeof(migrate_receiver_banner)-1,
+                     "migration ack stream", "banner") );
 
     memset(&dom_info, 0, sizeof(dom_info));
     dom_info.debug = debug;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 19 01:44:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 01:44: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 1VtSew-0007n1-OT; Thu, 19 Dec 2013 01:44:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSeu-0007mp-RK
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:17 +0000
Received: from [193.109.254.147:10109] by server-10.bemta-14.messagelabs.com
	id E8/FA-20752-07F42B25; Thu, 19 Dec 2013 01:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1387417454!6272929!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13806 invoked from network); 19 Dec 2013 01:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2013 01:44: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 1VtSer-0003iX-Ue
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSer-0006N7-NY
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:13 +0000
Date: Thu, 19 Dec 2013 01:44:13 +0000
Message-Id: <E1VtSer-0006N7-NY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Fix error checking for
	xc_get_{cpu, node}map_size() callers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 492b0688f58c7c0150712f09677a6c140fdccd96
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Dec 11 15:47:42 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 11:09:58 2013 +0000

    tools/libxc: Fix error checking for xc_get_{cpu, node}map_size() callers
    
    c/s 2e82c18cd850592ae9a1f682eb93965a868b5f2f changed the error returns of
    xc_get_{cpu,node}map_size() to now include returning -1.  This invalidated the
    error checks from callers, which expected 0 to be the only error case.
    
    Coverity ID: 1135907 1135908 1135909 1135910 1135911 1135912 1135913 1135914
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: George Dunlap <george.dunlap@eu.citrix.com>
---
 tools/libxc/xc_cpupool.c |    4 ++--
 tools/libxc/xc_domain.c  |    8 ++++----
 tools/libxc/xc_misc.c    |    4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/xc_cpupool.c b/tools/libxc/xc_cpupool.c
index b5e0c46..c8c2a33 100644
--- a/tools/libxc/xc_cpupool.c
+++ b/tools/libxc/xc_cpupool.c
@@ -74,7 +74,7 @@ xc_cpupoolinfo_t *xc_cpupool_getinfo(xc_interface *xch,
     DECLARE_HYPERCALL_BUFFER(uint8_t, local);
 
     local_size = xc_get_cpumap_size(xch);
-    if (!local_size)
+    if (local_size <= 0)
     {
         PERROR("Could not get number of cpus");
         return NULL;
@@ -172,7 +172,7 @@ xc_cpumap_t xc_cpupool_freeinfo(xc_interface *xch)
     DECLARE_HYPERCALL_BUFFER(uint8_t, local);
 
     mapsize = xc_get_cpumap_size(xch);
-    if (mapsize == 0)
+    if (mapsize <= 0)
         return NULL;
 
     local = xc_hypercall_buffer_alloc(xch, local, mapsize);
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 1ccafc5..c2fdd74 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -122,7 +122,7 @@ int xc_domain_node_setaffinity(xc_interface *xch,
     int nodesize;
 
     nodesize = xc_get_nodemap_size(xch);
-    if (!nodesize)
+    if (nodesize <= 0)
     {
         PERROR("Could not get number of nodes");
         goto out;
@@ -160,7 +160,7 @@ int xc_domain_node_getaffinity(xc_interface *xch,
     int nodesize;
 
     nodesize = xc_get_nodemap_size(xch);
-    if (!nodesize)
+    if (nodesize <= 0)
     {
         PERROR("Could not get number of nodes");
         goto out;
@@ -200,7 +200,7 @@ int xc_vcpu_setaffinity(xc_interface *xch,
     int cpusize;
 
     cpusize = xc_get_cpumap_size(xch);
-    if (!cpusize)
+    if (cpusize <= 0)
     {
         PERROR("Could not get number of cpus");
         goto out;
@@ -243,7 +243,7 @@ int xc_vcpu_getaffinity(xc_interface *xch,
     int cpusize;
 
     cpusize = xc_get_cpumap_size(xch);
-    if (!cpusize)
+    if (cpusize <= 0)
     {
         PERROR("Could not get number of cpus");
         goto out;
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 00cd0d8..3303454 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -88,7 +88,7 @@ xc_cpumap_t xc_cpumap_alloc(xc_interface *xch)
     int sz;
 
     sz = xc_get_cpumap_size(xch);
-    if (sz == 0)
+    if (sz <= 0)
         return NULL;
     return calloc(1, sz);
 }
@@ -98,7 +98,7 @@ xc_nodemap_t xc_nodemap_alloc(xc_interface *xch)
     int sz;
 
     sz = xc_get_nodemap_size(xch);
-    if (sz == 0)
+    if (sz <= 0)
         return NULL;
     return calloc(1, sz);
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 19 01:44:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 01:44: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 1VtSew-0007n1-OT; Thu, 19 Dec 2013 01:44:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSeu-0007mp-RK
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:17 +0000
Received: from [193.109.254.147:10109] by server-10.bemta-14.messagelabs.com
	id E8/FA-20752-07F42B25; Thu, 19 Dec 2013 01:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1387417454!6272929!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13806 invoked from network); 19 Dec 2013 01:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2013 01:44: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 1VtSer-0003iX-Ue
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSer-0006N7-NY
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:13 +0000
Date: Thu, 19 Dec 2013 01:44:13 +0000
Message-Id: <E1VtSer-0006N7-NY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Fix error checking for
	xc_get_{cpu, node}map_size() callers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 492b0688f58c7c0150712f09677a6c140fdccd96
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Dec 11 15:47:42 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 11:09:58 2013 +0000

    tools/libxc: Fix error checking for xc_get_{cpu, node}map_size() callers
    
    c/s 2e82c18cd850592ae9a1f682eb93965a868b5f2f changed the error returns of
    xc_get_{cpu,node}map_size() to now include returning -1.  This invalidated the
    error checks from callers, which expected 0 to be the only error case.
    
    Coverity ID: 1135907 1135908 1135909 1135910 1135911 1135912 1135913 1135914
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    CC: George Dunlap <george.dunlap@eu.citrix.com>
---
 tools/libxc/xc_cpupool.c |    4 ++--
 tools/libxc/xc_domain.c  |    8 ++++----
 tools/libxc/xc_misc.c    |    4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/xc_cpupool.c b/tools/libxc/xc_cpupool.c
index b5e0c46..c8c2a33 100644
--- a/tools/libxc/xc_cpupool.c
+++ b/tools/libxc/xc_cpupool.c
@@ -74,7 +74,7 @@ xc_cpupoolinfo_t *xc_cpupool_getinfo(xc_interface *xch,
     DECLARE_HYPERCALL_BUFFER(uint8_t, local);
 
     local_size = xc_get_cpumap_size(xch);
-    if (!local_size)
+    if (local_size <= 0)
     {
         PERROR("Could not get number of cpus");
         return NULL;
@@ -172,7 +172,7 @@ xc_cpumap_t xc_cpupool_freeinfo(xc_interface *xch)
     DECLARE_HYPERCALL_BUFFER(uint8_t, local);
 
     mapsize = xc_get_cpumap_size(xch);
-    if (mapsize == 0)
+    if (mapsize <= 0)
         return NULL;
 
     local = xc_hypercall_buffer_alloc(xch, local, mapsize);
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 1ccafc5..c2fdd74 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -122,7 +122,7 @@ int xc_domain_node_setaffinity(xc_interface *xch,
     int nodesize;
 
     nodesize = xc_get_nodemap_size(xch);
-    if (!nodesize)
+    if (nodesize <= 0)
     {
         PERROR("Could not get number of nodes");
         goto out;
@@ -160,7 +160,7 @@ int xc_domain_node_getaffinity(xc_interface *xch,
     int nodesize;
 
     nodesize = xc_get_nodemap_size(xch);
-    if (!nodesize)
+    if (nodesize <= 0)
     {
         PERROR("Could not get number of nodes");
         goto out;
@@ -200,7 +200,7 @@ int xc_vcpu_setaffinity(xc_interface *xch,
     int cpusize;
 
     cpusize = xc_get_cpumap_size(xch);
-    if (!cpusize)
+    if (cpusize <= 0)
     {
         PERROR("Could not get number of cpus");
         goto out;
@@ -243,7 +243,7 @@ int xc_vcpu_getaffinity(xc_interface *xch,
     int cpusize;
 
     cpusize = xc_get_cpumap_size(xch);
-    if (!cpusize)
+    if (cpusize <= 0)
     {
         PERROR("Could not get number of cpus");
         goto out;
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 00cd0d8..3303454 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -88,7 +88,7 @@ xc_cpumap_t xc_cpumap_alloc(xc_interface *xch)
     int sz;
 
     sz = xc_get_cpumap_size(xch);
-    if (sz == 0)
+    if (sz <= 0)
         return NULL;
     return calloc(1, sz);
 }
@@ -98,7 +98,7 @@ xc_nodemap_t xc_nodemap_alloc(xc_interface *xch)
     int sz;
 
     sz = xc_get_nodemap_size(xch);
-    if (sz == 0)
+    if (sz <= 0)
         return NULL;
     return calloc(1, sz);
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 19 01:44:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 01:44: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 1VtSf6-0007oA-RF; Thu, 19 Dec 2013 01:44: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 1VtSf4-0007nx-Tc
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:27 +0000
Received: from [193.109.254.147:22783] by server-5.bemta-14.messagelabs.com id
	F2/6D-03510-A7F42B25; Thu, 19 Dec 2013 01:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1387417464!3960108!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22925 invoked from network); 19 Dec 2013 01:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2013 01:44: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 1VtSf2-0003ig-7h
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSf2-0006NT-2Y
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:24 +0000
Date: Thu, 19 Dec 2013 01:44:24 +0000
Message-Id: <E1VtSf2-0006NT-2Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Fix error handling in
	libxl__device_nic_from_xs_be
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 274ef72d25262f6157b49a335ef70111dc45608d
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Nov 26 12:08:09 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 11:09:58 2013 +0000

    libxl: Fix error handling in libxl__device_nic_from_xs_be
    
    Previously, this function would leak the temporary return from xs_read for
    handle and mac address.  Fix both of these and the rest of the error handling.
    
    This requires changing its return type and fixing the callers.
    
    Introduce here a READ_BACKEND macro to make the code less repetitive.
    
    Coverity ID: 1055886
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- spell out what the leaks were in the commit message ]
---
 tools/libxl/libxl.c |   62 ++++++++++++++++++++++++++++++--------------------
 1 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index e8ad610..2845ca4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2983,45 +2983,51 @@ out:
     return;
 }
 
-static void libxl__device_nic_from_xs_be(libxl__gc *gc,
-                                         const char *be_path,
-                                         libxl_device_nic *nic)
+static int libxl__device_nic_from_xs_be(libxl__gc *gc,
+                                        const char *be_path,
+                                        libxl_device_nic *nic)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int len;
-    char *tmp;
+    const char *tmp;
     int rc;
 
     libxl_device_nic_init(nic);
 
-    tmp = xs_read(ctx->xsh, XBT_NULL,
-                  libxl__sprintf(gc, "%s/handle", be_path), &len);
-    if ( tmp )
+#define READ_BACKEND(tgc, subpath) ({                                   \
+        rc = libxl__xs_read_checked(tgc, XBT_NULL,                      \
+                                    GCSPRINTF("%s/" subpath, be_path),  \
+                                    &tmp);                              \
+        if (rc) goto out;                                               \
+        (char*)tmp;                                                     \
+    });
+
+    tmp = READ_BACKEND(gc, "handle");
+    if (tmp)
         nic->devid = atoi(tmp);
     else
         nic->devid = 0;
 
     /* nic->mtu = */
 
-    tmp = xs_read(ctx->xsh, XBT_NULL,
-                  libxl__sprintf(gc, "%s/mac", be_path), &len);
-    rc = libxl__parse_mac(tmp, nic->mac);
-    if (rc)
+    tmp = READ_BACKEND(gc, "mac");
+    if (tmp) {
+        rc = libxl__parse_mac(tmp, nic->mac);
+        if (rc) goto out;
+    } else {
         memset(nic->mac, 0, sizeof(nic->mac));
+    }
 
-    nic->ip = xs_read(ctx->xsh, XBT_NULL,
-                      libxl__sprintf(gc, "%s/ip", be_path), &len);
-
-    nic->bridge = xs_read(ctx->xsh, XBT_NULL,
-                      libxl__sprintf(gc, "%s/bridge", be_path), &len);
-
-    nic->script = xs_read(ctx->xsh, XBT_NULL,
-                      libxl__sprintf(gc, "%s/script", be_path), &len);
+    nic->ip = READ_BACKEND(NOGC, "ip");
+    nic->bridge = READ_BACKEND(NOGC, "bridge");
+    nic->script = READ_BACKEND(NOGC, "script");
 
     /* vif_ioemu nics use the same xenstore entries as vif interfaces */
     nic->nictype = LIBXL_NIC_TYPE_VIF;
     nic->model = NULL; /* XXX Only for TYPE_IOEMU */
     nic->ifname = NULL; /* XXX Only for TYPE_IOEMU */
+
+    rc = 0;
+ out:
+    return rc;
 }
 
 int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
@@ -3042,7 +3048,8 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
     if (!path)
         goto out;
 
-    libxl__device_nic_from_xs_be(gc, path, nic);
+    rc = libxl__device_nic_from_xs_be(gc, path, nic);
+    if (rc) goto out;
 
     rc = 0;
 out:
@@ -3060,6 +3067,7 @@ static int libxl__append_nic_list_of_type(libxl__gc *gc,
     char **dir = NULL;
     unsigned int n = 0;
     libxl_device_nic *pnic = NULL, *pnic_end = NULL;
+    int rc;
 
     be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
@@ -3071,16 +3079,20 @@ static int libxl__append_nic_list_of_type(libxl__gc *gc,
             return ERROR_NOMEM;
         *nics = tmp;
         pnic = *nics + *nnics;
-        *nnics += n;
-        pnic_end = *nics + *nnics;
+        pnic_end = *nics + *nnics + n;
         for (; pnic < pnic_end; pnic++, dir++) {
             const char *p;
             p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
-            libxl__device_nic_from_xs_be(gc, p, pnic);
+            rc = libxl__device_nic_from_xs_be(gc, p, pnic);
+            if (rc) goto out;
             pnic->backend_domid = 0;
         }
+        *nnics += n;
     }
     return 0;
+
+ out:
+    return rc;
 }
 
 libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 19 01:44:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 01:44: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 1VtSf6-0007oA-RF; Thu, 19 Dec 2013 01:44: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 1VtSf4-0007nx-Tc
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:27 +0000
Received: from [193.109.254.147:22783] by server-5.bemta-14.messagelabs.com id
	F2/6D-03510-A7F42B25; Thu, 19 Dec 2013 01:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1387417464!3960108!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22925 invoked from network); 19 Dec 2013 01:44:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2013 01:44: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 1VtSf2-0003ig-7h
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSf2-0006NT-2Y
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:24 +0000
Date: Thu, 19 Dec 2013 01:44:24 +0000
Message-Id: <E1VtSf2-0006NT-2Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Fix error handling in
	libxl__device_nic_from_xs_be
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 274ef72d25262f6157b49a335ef70111dc45608d
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Nov 26 12:08:09 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 11:09:58 2013 +0000

    libxl: Fix error handling in libxl__device_nic_from_xs_be
    
    Previously, this function would leak the temporary return from xs_read for
    handle and mac address.  Fix both of these and the rest of the error handling.
    
    This requires changing its return type and fixing the callers.
    
    Introduce here a READ_BACKEND macro to make the code less repetitive.
    
    Coverity ID: 1055886
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- spell out what the leaks were in the commit message ]
---
 tools/libxl/libxl.c |   62 ++++++++++++++++++++++++++++++--------------------
 1 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index e8ad610..2845ca4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2983,45 +2983,51 @@ out:
     return;
 }
 
-static void libxl__device_nic_from_xs_be(libxl__gc *gc,
-                                         const char *be_path,
-                                         libxl_device_nic *nic)
+static int libxl__device_nic_from_xs_be(libxl__gc *gc,
+                                        const char *be_path,
+                                        libxl_device_nic *nic)
 {
-    libxl_ctx *ctx = libxl__gc_owner(gc);
-    unsigned int len;
-    char *tmp;
+    const char *tmp;
     int rc;
 
     libxl_device_nic_init(nic);
 
-    tmp = xs_read(ctx->xsh, XBT_NULL,
-                  libxl__sprintf(gc, "%s/handle", be_path), &len);
-    if ( tmp )
+#define READ_BACKEND(tgc, subpath) ({                                   \
+        rc = libxl__xs_read_checked(tgc, XBT_NULL,                      \
+                                    GCSPRINTF("%s/" subpath, be_path),  \
+                                    &tmp);                              \
+        if (rc) goto out;                                               \
+        (char*)tmp;                                                     \
+    });
+
+    tmp = READ_BACKEND(gc, "handle");
+    if (tmp)
         nic->devid = atoi(tmp);
     else
         nic->devid = 0;
 
     /* nic->mtu = */
 
-    tmp = xs_read(ctx->xsh, XBT_NULL,
-                  libxl__sprintf(gc, "%s/mac", be_path), &len);
-    rc = libxl__parse_mac(tmp, nic->mac);
-    if (rc)
+    tmp = READ_BACKEND(gc, "mac");
+    if (tmp) {
+        rc = libxl__parse_mac(tmp, nic->mac);
+        if (rc) goto out;
+    } else {
         memset(nic->mac, 0, sizeof(nic->mac));
+    }
 
-    nic->ip = xs_read(ctx->xsh, XBT_NULL,
-                      libxl__sprintf(gc, "%s/ip", be_path), &len);
-
-    nic->bridge = xs_read(ctx->xsh, XBT_NULL,
-                      libxl__sprintf(gc, "%s/bridge", be_path), &len);
-
-    nic->script = xs_read(ctx->xsh, XBT_NULL,
-                      libxl__sprintf(gc, "%s/script", be_path), &len);
+    nic->ip = READ_BACKEND(NOGC, "ip");
+    nic->bridge = READ_BACKEND(NOGC, "bridge");
+    nic->script = READ_BACKEND(NOGC, "script");
 
     /* vif_ioemu nics use the same xenstore entries as vif interfaces */
     nic->nictype = LIBXL_NIC_TYPE_VIF;
     nic->model = NULL; /* XXX Only for TYPE_IOEMU */
     nic->ifname = NULL; /* XXX Only for TYPE_IOEMU */
+
+    rc = 0;
+ out:
+    return rc;
 }
 
 int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
@@ -3042,7 +3048,8 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
     if (!path)
         goto out;
 
-    libxl__device_nic_from_xs_be(gc, path, nic);
+    rc = libxl__device_nic_from_xs_be(gc, path, nic);
+    if (rc) goto out;
 
     rc = 0;
 out:
@@ -3060,6 +3067,7 @@ static int libxl__append_nic_list_of_type(libxl__gc *gc,
     char **dir = NULL;
     unsigned int n = 0;
     libxl_device_nic *pnic = NULL, *pnic_end = NULL;
+    int rc;
 
     be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
@@ -3071,16 +3079,20 @@ static int libxl__append_nic_list_of_type(libxl__gc *gc,
             return ERROR_NOMEM;
         *nics = tmp;
         pnic = *nics + *nnics;
-        *nnics += n;
-        pnic_end = *nics + *nnics;
+        pnic_end = *nics + *nnics + n;
         for (; pnic < pnic_end; pnic++, dir++) {
             const char *p;
             p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
-            libxl__device_nic_from_xs_be(gc, p, pnic);
+            rc = libxl__device_nic_from_xs_be(gc, p, pnic);
+            if (rc) goto out;
             pnic->backend_domid = 0;
         }
+        *nnics += n;
     }
     return 0;
+
+ out:
+    return rc;
 }
 
 libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 19 01:44:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 01:44: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 1VtSfG-0007pO-U4; Thu, 19 Dec 2013 01:44:38 +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 1VtSfF-0007pD-6O
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:37 +0000
Received: from [85.158.137.68:34469] by server-15.bemta-3.messagelabs.com id
	DB/2F-11556-48F42B25; Thu, 19 Dec 2013 01:44:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1387417474!3741459!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13531 invoked from network); 19 Dec 2013 01:44:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2013 01:44: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 1VtSfC-0003io-DC
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSfC-0006Nu-C0
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:34 +0000
Date: Thu, 19 Dec 2013 01:44:34 +0000
Message-Id: <E1VtSfC-0006Nu-C0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: clarify cacheability
	requirements of hypercall arguments.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5d81d015539535fb7f79383c7b9d49253b5209fe
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 18 11:54:46 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 13:05:10 2013 +0000

    xen: arm: clarify cacheability requirements of hypercall arguments.
    
    Accepting hypercall arguments which are either consistently in cached or
    uncached is tricky and/or potentially slow, requiring a guest mapping lookup
    to determine whether/when to do a cache clean or invalidate.
    
    There are very few reasons, and no current use cases in practice, for a guest
    to use uncached memory for their hypercall arguments. Therefore mandate that
    all hypercall arguments must be mapped inner-cacheable.
    
    Do not place any restriction on the outer-cacheability or on the cache
    fill/flush strategy used.
    
    If use cases arise then we can consider specific exemptions to this rule.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/public/arch-arm.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 475cb4a..ef6217d 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -58,6 +58,11 @@
  * (AAPCS64). Where there is a conflict the 64-bit standard should be
  * used regardless of guest type. Structures which are passed as
  * hypercall arguments are always little endian.
+ *
+ * All hypercall arguments passed via a pointer to guest memory must
+ * reside in memory which is mapped as Normal Inner-cacheable. Any
+ * Inner cache allocation strategy (Write-Back, Write-Through etc) is
+ * acceptable. There is no restriction on the Outer-cacheability.
  */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 19 01:44:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 01:44: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 1VtSfG-0007pO-U4; Thu, 19 Dec 2013 01:44:38 +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 1VtSfF-0007pD-6O
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:37 +0000
Received: from [85.158.137.68:34469] by server-15.bemta-3.messagelabs.com id
	DB/2F-11556-48F42B25; Thu, 19 Dec 2013 01:44:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1387417474!3741459!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13531 invoked from network); 19 Dec 2013 01:44:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2013 01:44: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 1VtSfC-0003io-DC
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSfC-0006Nu-C0
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:34 +0000
Date: Thu, 19 Dec 2013 01:44:34 +0000
Message-Id: <E1VtSfC-0006Nu-C0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: clarify cacheability
	requirements of hypercall arguments.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5d81d015539535fb7f79383c7b9d49253b5209fe
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 18 11:54:46 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 13:05:10 2013 +0000

    xen: arm: clarify cacheability requirements of hypercall arguments.
    
    Accepting hypercall arguments which are either consistently in cached or
    uncached is tricky and/or potentially slow, requiring a guest mapping lookup
    to determine whether/when to do a cache clean or invalidate.
    
    There are very few reasons, and no current use cases in practice, for a guest
    to use uncached memory for their hypercall arguments. Therefore mandate that
    all hypercall arguments must be mapped inner-cacheable.
    
    Do not place any restriction on the outer-cacheability or on the cache
    fill/flush strategy used.
    
    If use cases arise then we can consider specific exemptions to this rule.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/public/arch-arm.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 475cb4a..ef6217d 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -58,6 +58,11 @@
  * (AAPCS64). Where there is a conflict the 64-bit standard should be
  * used regardless of guest type. Structures which are passed as
  * hypercall arguments are always little endian.
+ *
+ * All hypercall arguments passed via a pointer to guest memory must
+ * reside in memory which is mapped as Normal Inner-cacheable. Any
+ * Inner cache allocation strategy (Write-Back, Write-Through etc) is
+ * acceptable. There is no restriction on the Outer-cacheability.
  */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 19 01:44:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 01:44: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 1VtSfQ-0007r6-0X; Thu, 19 Dec 2013 01:44:48 +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 1VtSfP-0007qv-68
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:47 +0000
Received: from [193.109.254.147:64770] by server-1.bemta-14.messagelabs.com id
	B5/C4-15600-E8F42B25; Thu, 19 Dec 2013 01:44:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1387417484!4763461!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9458 invoked from network); 19 Dec 2013 01:44:45 -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;
	19 Dec 2013 01:44: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 1VtSfM-0003iu-Hz
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSfM-0006OG-GN
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:44 +0000
Date: Thu, 19 Dec 2013 01:44:44 +0000
Message-Id: <E1VtSfM-0006OG-GN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/efi: update .gitignore/.hgignore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29cc51db84a9c15875836121c5c60cc5eb6b613e
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Wed Dec 18 14:01:56 2013 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Wed Dec 18 14:15:12 2013 +0000

    x86/efi: update .gitignore/.hgignore
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 .gitignore |    1 +
 .hgignore  |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index ce5fd39..3504584 100644
--- a/.gitignore
+++ b/.gitignore
@@ -303,6 +303,7 @@ xen/arch/x86/boot/reloc.S
 xen/arch/x86/boot/reloc.bin
 xen/arch/x86/boot/reloc.lnk
 xen/arch/x86/efi.lds
+xen/arch/x86/efi/check.efi
 xen/arch/x86/efi/disabled
 xen/arch/x86/efi/mkreloc
 xen/ddb/*
diff --git a/.hgignore b/.hgignore
index ee5c084..9c9421e 100644
--- a/.hgignore
+++ b/.hgignore
@@ -330,6 +330,7 @@
 ^xen/arch/x86/boot/reloc\.bin$
 ^xen/arch/x86/boot/reloc\.lnk$
 ^xen/arch/x86/efi\.lds$
+^xen/arch/x86/efi/check\.efi$
 ^xen/arch/x86/efi/disabled$
 ^xen/arch/x86/efi/mkreloc$
 ^xen/ddb/.*$
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 19 01:44:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 01:44: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 1VtSfQ-0007r6-0X; Thu, 19 Dec 2013 01:44:48 +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 1VtSfP-0007qv-68
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:47 +0000
Received: from [193.109.254.147:64770] by server-1.bemta-14.messagelabs.com id
	B5/C4-15600-E8F42B25; Thu, 19 Dec 2013 01:44:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1387417484!4763461!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9458 invoked from network); 19 Dec 2013 01:44:45 -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;
	19 Dec 2013 01:44: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 1VtSfM-0003iu-Hz
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VtSfM-0006OG-GN
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 01:44:44 +0000
Date: Thu, 19 Dec 2013 01:44:44 +0000
Message-Id: <E1VtSfM-0006OG-GN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/efi: update .gitignore/.hgignore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29cc51db84a9c15875836121c5c60cc5eb6b613e
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Wed Dec 18 14:01:56 2013 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Wed Dec 18 14:15:12 2013 +0000

    x86/efi: update .gitignore/.hgignore
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 .gitignore |    1 +
 .hgignore  |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index ce5fd39..3504584 100644
--- a/.gitignore
+++ b/.gitignore
@@ -303,6 +303,7 @@ xen/arch/x86/boot/reloc.S
 xen/arch/x86/boot/reloc.bin
 xen/arch/x86/boot/reloc.lnk
 xen/arch/x86/efi.lds
+xen/arch/x86/efi/check.efi
 xen/arch/x86/efi/disabled
 xen/arch/x86/efi/mkreloc
 xen/ddb/*
diff --git a/.hgignore b/.hgignore
index ee5c084..9c9421e 100644
--- a/.hgignore
+++ b/.hgignore
@@ -330,6 +330,7 @@
 ^xen/arch/x86/boot/reloc\.bin$
 ^xen/arch/x86/boot/reloc\.lnk$
 ^xen/arch/x86/efi\.lds$
+^xen/arch/x86/efi/check\.efi$
 ^xen/arch/x86/efi/disabled$
 ^xen/arch/x86/efi/mkreloc$
 ^xen/ddb/.*$
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 19 15:44:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 15:44: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 1Vtfll-0003QT-VC; Thu, 19 Dec 2013 15:44: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 1Vtflk-0003QF-An
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 15:44:12 +0000
Received: from [85.158.139.211:15332] by server-6.bemta-5.messagelabs.com id
	8D/77-16310-B4413B25; Thu, 19 Dec 2013 15:44:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1387467848!5658673!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16874 invoked from network); 19 Dec 2013 15:44:10 -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;
	19 Dec 2013 15:44: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 1Vtfle-0005Ab-6Z
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 15:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vtfld-00058Q-Ak
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 15:44:05 +0000
Date: Thu, 19 Dec 2013 15:44:05 +0000
Message-Id: <E1Vtfld-00058Q-Ak@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-traditional: Fix build
	warnings on Wheezy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============6700646153402500154=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 7f5b3c338e0f8938ba575dec18255dcbee0c2ee2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Dec 18 15:25:14 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 15:19:49 2013 +0000

    qemu-traditional: Fix build warnings on Wheezy
    
      CC    i386-dm/eepro100.o
    hw/eepro100.c: In function â€˜eepro100_read4â€™:
    hw/eepro100.c:1232:5: warning: â€˜valâ€™ may be used uninitialized in this function [-Wmaybe-uninitialized]
    hw/eepro100.c: In function â€˜eepro100_read2â€™:
    hw/eepro100.c:1202:5: warning: â€˜valâ€™ may be used uninitialized in this function [-Wmaybe-uninitialized]
    hw/eepro100.c: In function â€˜eepro100_read1â€™:
    hw/eepro100.c:1179:5: warning: â€˜valâ€™ may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    Use ~0 to match the behaviour of real hardware.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 hw/eepro100.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/eepro100.c b/hw/eepro100.c
index bc6c3d5..d172b91 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -1136,7 +1136,7 @@ static void eepro100_write_port(EEPRO100State * s, uint32_t val)
 
 static uint8_t eepro100_read1(EEPRO100State * s, uint32_t addr)
 {
-    uint8_t val;
+    uint8_t val = ~0;
     if (addr <= sizeof(s->mem) - sizeof(val)) {
         memcpy(&val, &s->mem[addr], sizeof(val));
     }
@@ -1181,7 +1181,7 @@ static uint8_t eepro100_read1(EEPRO100State * s, uint32_t addr)
 
 static uint16_t eepro100_read2(EEPRO100State * s, uint32_t addr)
 {
-    uint16_t val;
+    uint16_t val = ~0;
     if (addr <= sizeof(s->mem) - sizeof(val)) {
         memcpy(&val, &s->mem[addr], sizeof(val));
     }
@@ -1204,7 +1204,7 @@ static uint16_t eepro100_read2(EEPRO100State * s, uint32_t addr)
 
 static uint32_t eepro100_read4(EEPRO100State * s, uint32_t addr)
 {
-    uint32_t val;
+    uint32_t val = ~0U;
     if (addr <= sizeof(s->mem) - sizeof(val)) {
         memcpy(&val, &s->mem[addr], sizeof(val));
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git


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

From xen-changelog-bounces@lists.xen.org Thu Dec 19 15:44:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 15:44: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 1Vtfll-0003QT-VC; Thu, 19 Dec 2013 15:44: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 1Vtflk-0003QF-An
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 15:44:12 +0000
Received: from [85.158.139.211:15332] by server-6.bemta-5.messagelabs.com id
	8D/77-16310-B4413B25; Thu, 19 Dec 2013 15:44:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1387467848!5658673!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16874 invoked from network); 19 Dec 2013 15:44:10 -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;
	19 Dec 2013 15:44: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 1Vtfle-0005Ab-6Z
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 15:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vtfld-00058Q-Ak
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 15:44:05 +0000
Date: Thu, 19 Dec 2013 15:44:05 +0000
Message-Id: <E1Vtfld-00058Q-Ak@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-traditional: Fix build
	warnings on Wheezy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============6700646153402500154=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 7f5b3c338e0f8938ba575dec18255dcbee0c2ee2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Dec 18 15:25:14 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 15:19:49 2013 +0000

    qemu-traditional: Fix build warnings on Wheezy
    
      CC    i386-dm/eepro100.o
    hw/eepro100.c: In function â€˜eepro100_read4â€™:
    hw/eepro100.c:1232:5: warning: â€˜valâ€™ may be used uninitialized in this function [-Wmaybe-uninitialized]
    hw/eepro100.c: In function â€˜eepro100_read2â€™:
    hw/eepro100.c:1202:5: warning: â€˜valâ€™ may be used uninitialized in this function [-Wmaybe-uninitialized]
    hw/eepro100.c: In function â€˜eepro100_read1â€™:
    hw/eepro100.c:1179:5: warning: â€˜valâ€™ may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    Use ~0 to match the behaviour of real hardware.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 hw/eepro100.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/eepro100.c b/hw/eepro100.c
index bc6c3d5..d172b91 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -1136,7 +1136,7 @@ static void eepro100_write_port(EEPRO100State * s, uint32_t val)
 
 static uint8_t eepro100_read1(EEPRO100State * s, uint32_t addr)
 {
-    uint8_t val;
+    uint8_t val = ~0;
     if (addr <= sizeof(s->mem) - sizeof(val)) {
         memcpy(&val, &s->mem[addr], sizeof(val));
     }
@@ -1181,7 +1181,7 @@ static uint8_t eepro100_read1(EEPRO100State * s, uint32_t addr)
 
 static uint16_t eepro100_read2(EEPRO100State * s, uint32_t addr)
 {
-    uint16_t val;
+    uint16_t val = ~0;
     if (addr <= sizeof(s->mem) - sizeof(val)) {
         memcpy(&val, &s->mem[addr], sizeof(val));
     }
@@ -1204,7 +1204,7 @@ static uint16_t eepro100_read2(EEPRO100State * s, uint32_t addr)
 
 static uint32_t eepro100_read4(EEPRO100State * s, uint32_t addr)
 {
-    uint32_t val;
+    uint32_t val = ~0U;
     if (addr <= sizeof(s->mem) - sizeof(val)) {
         memcpy(&val, &s->mem[addr], sizeof(val));
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git


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

From xen-changelog-bounces@lists.xen.org Thu Dec 19 16:44:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 16:44: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 1Vtghi-0008Ke-My; Thu, 19 Dec 2013 16:44: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 1Vtghh-0008KY-E2
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 16:44:05 +0000
Received: from [85.158.143.35:62934] by server-1.bemta-4.messagelabs.com id
	38/92-02132-45223B25; Thu, 19 Dec 2013 16:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1387471442!7131302!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17895 invoked from network); 19 Dec 2013 16:44:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2013 16:44:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vtghe-0006Bt-Oi
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 16:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vtghe-0006np-HC
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 16:44:02 +0000
Date: Thu, 19 Dec 2013 16:44:02 +0000
Message-Id: <E1Vtghe-0006np-HC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Update QEMU_UPSTREAM_REVISION
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d84a6e2fa077d07f91ac72c3d8334b75b45fcba2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Dec 19 16:28:29 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 16:28:29 2013 +0000

    Update QEMU_UPSTREAM_REVISION
    
    Switch to specific tag, for 4.4.0 RC1 release.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 2007b22..ba4087f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,7 +234,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 ?= 447d264115c476142f884af0be287622cd244423
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.0-rc1
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
 # Fix bug in CBFS file walking with compressed files.
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 19 16:44:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Dec 2013 16:44: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 1Vtghi-0008Ke-My; Thu, 19 Dec 2013 16:44: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 1Vtghh-0008KY-E2
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 16:44:05 +0000
Received: from [85.158.143.35:62934] by server-1.bemta-4.messagelabs.com id
	38/92-02132-45223B25; Thu, 19 Dec 2013 16:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1387471442!7131302!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17895 invoked from network); 19 Dec 2013 16:44:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2013 16:44:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vtghe-0006Bt-Oi
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 16:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vtghe-0006np-HC
	for xen-changelog@lists.xensource.com; Thu, 19 Dec 2013 16:44:02 +0000
Date: Thu, 19 Dec 2013 16:44:02 +0000
Message-Id: <E1Vtghe-0006np-HC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Update QEMU_UPSTREAM_REVISION
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d84a6e2fa077d07f91ac72c3d8334b75b45fcba2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Dec 19 16:28:29 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 16:28:29 2013 +0000

    Update QEMU_UPSTREAM_REVISION
    
    Switch to specific tag, for 4.4.0 RC1 release.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Config.mk b/Config.mk
index 2007b22..ba4087f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,7 +234,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 ?= 447d264115c476142f884af0be287622cd244423
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.0-rc1
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
 # Fix bug in CBFS file walking with compressed files.
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 14:44:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 14:44: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 1Vu1J9-0006p0-Cg; Fri, 20 Dec 2013 14:44:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu1J7-0006of-Ba
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 14:44:05 +0000
Received: from [85.158.139.211:37472] by server-10.bemta-5.messagelabs.com id
	0F/E7-01405-4B754B25; Fri, 20 Dec 2013 14:44:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1387550643!5891630!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19250 invoked from network); 20 Dec 2013 14:44:04 -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;
	20 Dec 2013 14:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu1J4-00035W-TN
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 14:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu1J4-0001YC-QN
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 14:44:02 +0000
Message-Id: <E1Vu1J4-0001YC-QN@xenbits.xen.org>
Date: Fri, 20 Dec 2013 14:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86,
	gcc-4.6: Use gcc -m options when building vdso
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User H. Peter Anvin <hpa@linux.intel.com>
# Date 1387550369 -3600
# Node ID 738b5b5d1473fa6216061e2b01a04eaf32065c2c
# Parent  c27b59a05b12679b05fef74b56a7b19ca31e791b
x86, gcc-4.6: Use gcc -m options when building vdso

The vdso Makefile passes linker-style -m options not to the linker but
to gcc.  This happens to work with earlier gcc, but fails with gcc
4.6.  Pass gcc-style -m options, instead.

Note: all currently supported versions of gcc supports -m32, so there
is no reason to conditionalize it any more.

Reported-by: H. J. Lu <hjl.tools@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>

upstream commit de2a8cf98ecdde25231d6c5e7901e2cffaf32af9
(only 32-bit part is applicable here)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r c27b59a05b12 -r 738b5b5d1473 arch/i386/kernel/Makefile
--- a/arch/i386/kernel/Makefile	Mon Dec 16 13:38:06 2013 +0100
+++ b/arch/i386/kernel/Makefile	Fri Dec 20 15:39:29 2013 +0100
@@ -54,7 +54,7 @@ targets += vsyscall-note.o vsyscall.lds
 
 # The DSO images are built using a special linker script.
 quiet_cmd_syscall = SYSCALL $@
-      cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
+      cmd_syscall = $(CC) -m32 -nostdlib $(SYSCFLAGS_$(@F)) \
 		          -Wl,-T,$(filter-out FORCE,$^) -o $@
 
 export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH)

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

From xen-changelog-bounces@lists.xen.org Fri Dec 20 14:44:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 14:44: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 1Vu1J9-0006p0-Cg; Fri, 20 Dec 2013 14:44:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu1J7-0006of-Ba
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 14:44:05 +0000
Received: from [85.158.139.211:37472] by server-10.bemta-5.messagelabs.com id
	0F/E7-01405-4B754B25; Fri, 20 Dec 2013 14:44:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1387550643!5891630!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19250 invoked from network); 20 Dec 2013 14:44:04 -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;
	20 Dec 2013 14:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu1J4-00035W-TN
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 14:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu1J4-0001YC-QN
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 14:44:02 +0000
Message-Id: <E1Vu1J4-0001YC-QN@xenbits.xen.org>
Date: Fri, 20 Dec 2013 14:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] x86,
	gcc-4.6: Use gcc -m options when building vdso
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User H. Peter Anvin <hpa@linux.intel.com>
# Date 1387550369 -3600
# Node ID 738b5b5d1473fa6216061e2b01a04eaf32065c2c
# Parent  c27b59a05b12679b05fef74b56a7b19ca31e791b
x86, gcc-4.6: Use gcc -m options when building vdso

The vdso Makefile passes linker-style -m options not to the linker but
to gcc.  This happens to work with earlier gcc, but fails with gcc
4.6.  Pass gcc-style -m options, instead.

Note: all currently supported versions of gcc supports -m32, so there
is no reason to conditionalize it any more.

Reported-by: H. J. Lu <hjl.tools@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>

upstream commit de2a8cf98ecdde25231d6c5e7901e2cffaf32af9
(only 32-bit part is applicable here)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r c27b59a05b12 -r 738b5b5d1473 arch/i386/kernel/Makefile
--- a/arch/i386/kernel/Makefile	Mon Dec 16 13:38:06 2013 +0100
+++ b/arch/i386/kernel/Makefile	Fri Dec 20 15:39:29 2013 +0100
@@ -54,7 +54,7 @@ targets += vsyscall-note.o vsyscall.lds
 
 # The DSO images are built using a special linker script.
 quiet_cmd_syscall = SYSCALL $@
-      cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
+      cmd_syscall = $(CC) -m32 -nostdlib $(SYSCFLAGS_$(@F)) \
 		          -Wl,-T,$(filter-out FORCE,$^) -o $@
 
 export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH)

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

From xen-changelog-bounces@lists.xen.org Fri Dec 20 15:44:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 15:44: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 1Vu2FD-0003v4-Ck; Fri, 20 Dec 2013 15:44:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu2FB-0003ut-Ad
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 15:44:05 +0000
Received: from [85.158.143.35:58435] by server-2.bemta-4.messagelabs.com id
	5D/E3-11386-4C564B25; Fri, 20 Dec 2013 15:44:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1387554243!7403405!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8214 invoked from network); 20 Dec 2013 15:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 15:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu2F8-0003jf-Tc
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 15:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu2F8-0003KA-Pz
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 15:44:02 +0000
Message-Id: <E1Vu2F8-0003KA-Pz@xenbits.xen.org>
Date: Fri, 20 Dec 2013 15:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] mutex: __used is needed for
	function referenced only from inline asm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5778010302681296032=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

# HG changeset patch
# User Török Edwin <edwintorok@gmail.com>
# Date 1387553825 -3600
# Node ID 777c424881e19f8f0c3106fd795873c536d93798
# Parent  738b5b5d1473fa6216061e2b01a04eaf32065c2c
mutex: __used is needed for function referenced only from inline asm

Impact: fix build failure on llvm-gcc-4.2

According to the gcc manual, the 'used' attribute should be applied to
functions referenced only from inline assembly.
This fixes a build failure with llvm-gcc-4.2, which deleted
__mutex_lock_slowpath, __mutex_unlock_slowpath.

Signed-off-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

upstream commit 7918baa555140989eeee1270f48533987d48fdba
(it's really __attribute_used__ in our old tree)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 738b5b5d1473 -r 777c424881e1 kernel/mutex.c
--- a/kernel/mutex.c	Fri Dec 20 15:39:29 2013 +0100
+++ b/kernel/mutex.c	Fri Dec 20 16:37:05 2013 +0100
@@ -57,7 +57,7 @@ EXPORT_SYMBOL(__mutex_init);
  * We also put the fastpath first in the kernel image, to make sure the
  * branch is predicted by the CPU as default-untaken.
  */
-static void fastcall noinline __sched
+static void fastcall noinline __attribute_used__ __sched
 __mutex_lock_slowpath(atomic_t *lock_count);
 
 /***
@@ -93,7 +93,7 @@ void inline fastcall __sched mutex_lock(
 
 EXPORT_SYMBOL(mutex_lock);
 
-static void fastcall noinline __sched
+static void fastcall noinline __attribute_used__ __sched
 __mutex_unlock_slowpath(atomic_t *lock_count);
 
 /***
@@ -189,7 +189,7 @@ __mutex_lock_common(struct mutex *lock, 
 	return 0;
 }
 
-static void fastcall noinline __sched
+static void fastcall noinline __attribute_used__ __sched
 __mutex_lock_slowpath(atomic_t *lock_count)
 {
 	struct mutex *lock = container_of(lock_count, struct mutex, count);
@@ -248,7 +248,7 @@ __mutex_unlock_common_slowpath(atomic_t 
 /*
  * Release the lock, slowpath:
  */
-static fastcall noinline void
+static void fastcall noinline __attribute_used__
 __mutex_unlock_slowpath(atomic_t *lock_count)
 {
 	__mutex_unlock_common_slowpath(lock_count, 1);


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

From xen-changelog-bounces@lists.xen.org Fri Dec 20 15:44:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 15:44: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 1Vu2FD-0003v4-Ck; Fri, 20 Dec 2013 15:44:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu2FB-0003ut-Ad
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 15:44:05 +0000
Received: from [85.158.143.35:58435] by server-2.bemta-4.messagelabs.com id
	5D/E3-11386-4C564B25; Fri, 20 Dec 2013 15:44:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1387554243!7403405!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8214 invoked from network); 20 Dec 2013 15:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 15:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu2F8-0003jf-Tc
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 15:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Vu2F8-0003KA-Pz
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 15:44:02 +0000
Message-Id: <E1Vu2F8-0003KA-Pz@xenbits.xen.org>
Date: Fri, 20 Dec 2013 15:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] mutex: __used is needed for
	function referenced only from inline asm
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5778010302681296032=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

# HG changeset patch
# User Török Edwin <edwintorok@gmail.com>
# Date 1387553825 -3600
# Node ID 777c424881e19f8f0c3106fd795873c536d93798
# Parent  738b5b5d1473fa6216061e2b01a04eaf32065c2c
mutex: __used is needed for function referenced only from inline asm

Impact: fix build failure on llvm-gcc-4.2

According to the gcc manual, the 'used' attribute should be applied to
functions referenced only from inline assembly.
This fixes a build failure with llvm-gcc-4.2, which deleted
__mutex_lock_slowpath, __mutex_unlock_slowpath.

Signed-off-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

upstream commit 7918baa555140989eeee1270f48533987d48fdba
(it's really __attribute_used__ in our old tree)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 738b5b5d1473 -r 777c424881e1 kernel/mutex.c
--- a/kernel/mutex.c	Fri Dec 20 15:39:29 2013 +0100
+++ b/kernel/mutex.c	Fri Dec 20 16:37:05 2013 +0100
@@ -57,7 +57,7 @@ EXPORT_SYMBOL(__mutex_init);
  * We also put the fastpath first in the kernel image, to make sure the
  * branch is predicted by the CPU as default-untaken.
  */
-static void fastcall noinline __sched
+static void fastcall noinline __attribute_used__ __sched
 __mutex_lock_slowpath(atomic_t *lock_count);
 
 /***
@@ -93,7 +93,7 @@ void inline fastcall __sched mutex_lock(
 
 EXPORT_SYMBOL(mutex_lock);
 
-static void fastcall noinline __sched
+static void fastcall noinline __attribute_used__ __sched
 __mutex_unlock_slowpath(atomic_t *lock_count);
 
 /***
@@ -189,7 +189,7 @@ __mutex_lock_common(struct mutex *lock, 
 	return 0;
 }
 
-static void fastcall noinline __sched
+static void fastcall noinline __attribute_used__ __sched
 __mutex_lock_slowpath(atomic_t *lock_count)
 {
 	struct mutex *lock = container_of(lock_count, struct mutex, count);
@@ -248,7 +248,7 @@ __mutex_unlock_common_slowpath(atomic_t 
 /*
  * Release the lock, slowpath:
  */
-static fastcall noinline void
+static void fastcall noinline __attribute_used__
 __mutex_unlock_slowpath(atomic_t *lock_count)
 {
 	__mutex_unlock_common_slowpath(lock_count, 1);


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

From xen-changelog-bounces@lists.xen.org Fri Dec 20 17:11:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3bP-0002L9-Sn; Fri, 20 Dec 2013 17: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 1Vu3bO-0002Ky-Jp
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:06 +0000
Received: from [85.158.139.211:10301] by server-13.bemta-5.messagelabs.com id
	81/77-11357-92A74B25; Fri, 20 Dec 2013 17:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1387559464!5892102!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27541 invoked from network); 20 Dec 2013 17:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17: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 1Vu3bM-00053C-0i
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3bL-0005iW-Tq
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:03 +0000
Date: Fri, 20 Dec 2013 17:11:03 +0000
Message-Id: <E1Vu3bL-0005iW-Tq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: process
	XENMEM_add_to_physmap_range forwards not backwards.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd50b8cae268fc66969e2f3858e79c244a0eea0b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 18 13:39:14 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:14:17 2013 +0000

    xen: arm: process XENMEM_add_to_physmap_range forwards not backwards.
    
    Jan points out that processing the list backwards is rather counter intuitive
    and that the effect of the hypercall can differ between forwards and backwards
    processing (e.g. in the presence of duplicate idx or gpfn, which would be
    unusual but as Jan says, users are a creative bunch)
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Cc: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 xen/arch/arm/mm.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 654281a..726adc7 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1061,21 +1061,18 @@ static int xenmem_add_to_physmap_range(struct domain *d,
 {
     int rc;
 
-    /* Process entries in reverse order to allow continuations */
     while ( xatpr->size > 0 )
     {
         xen_ulong_t idx;
         xen_pfn_t gpfn;
 
-        if ( unlikely(copy_from_guest_offset(&idx, xatpr->idxs,
-                                             xatpr->size-1, 1)) )
+        if ( unlikely(copy_from_guest_offset(&idx, xatpr->idxs, 0, 1)) )
         {
             rc = -EFAULT;
             goto out;
         }
 
-        if ( unlikely(copy_from_guest_offset(&gpfn, xatpr->gpfns,
-                                             xatpr->size-1, 1)) )
+        if ( unlikely(copy_from_guest_offset(&gpfn, xatpr->gpfns, 0, 1)) )
         {
             rc = -EFAULT;
             goto out;
@@ -1085,8 +1082,7 @@ static int xenmem_add_to_physmap_range(struct domain *d,
                                        xatpr->foreign_domid,
                                        idx, gpfn);
 
-        if ( unlikely(copy_to_guest_offset(xatpr->errs,
-                                           xatpr->size-1, &rc, 1)) )
+        if ( unlikely(copy_to_guest_offset(xatpr->errs, 0, &rc, 1)) )
         {
             rc = -EFAULT;
             goto out;
@@ -1095,6 +1091,9 @@ static int xenmem_add_to_physmap_range(struct domain *d,
         if ( rc < 0 )
             goto out;
 
+        guest_handle_add_offset(xatpr->idxs, 1);
+        guest_handle_add_offset(xatpr->gpfns, 1);
+        guest_handle_add_offset(xatpr->errs, 1);
         xatpr->size--;
 
         /* Check for continuation if it's not the last interation */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:11:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3bP-0002L9-Sn; Fri, 20 Dec 2013 17: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 1Vu3bO-0002Ky-Jp
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:06 +0000
Received: from [85.158.139.211:10301] by server-13.bemta-5.messagelabs.com id
	81/77-11357-92A74B25; Fri, 20 Dec 2013 17:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1387559464!5892102!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27541 invoked from network); 20 Dec 2013 17:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17: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 1Vu3bM-00053C-0i
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3bL-0005iW-Tq
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:03 +0000
Date: Fri, 20 Dec 2013 17:11:03 +0000
Message-Id: <E1Vu3bL-0005iW-Tq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: process
	XENMEM_add_to_physmap_range forwards not backwards.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd50b8cae268fc66969e2f3858e79c244a0eea0b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 18 13:39:14 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:14:17 2013 +0000

    xen: arm: process XENMEM_add_to_physmap_range forwards not backwards.
    
    Jan points out that processing the list backwards is rather counter intuitive
    and that the effect of the hypercall can differ between forwards and backwards
    processing (e.g. in the presence of duplicate idx or gpfn, which would be
    unusual but as Jan says, users are a creative bunch)
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Cc: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 xen/arch/arm/mm.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 654281a..726adc7 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1061,21 +1061,18 @@ static int xenmem_add_to_physmap_range(struct domain *d,
 {
     int rc;
 
-    /* Process entries in reverse order to allow continuations */
     while ( xatpr->size > 0 )
     {
         xen_ulong_t idx;
         xen_pfn_t gpfn;
 
-        if ( unlikely(copy_from_guest_offset(&idx, xatpr->idxs,
-                                             xatpr->size-1, 1)) )
+        if ( unlikely(copy_from_guest_offset(&idx, xatpr->idxs, 0, 1)) )
         {
             rc = -EFAULT;
             goto out;
         }
 
-        if ( unlikely(copy_from_guest_offset(&gpfn, xatpr->gpfns,
-                                             xatpr->size-1, 1)) )
+        if ( unlikely(copy_from_guest_offset(&gpfn, xatpr->gpfns, 0, 1)) )
         {
             rc = -EFAULT;
             goto out;
@@ -1085,8 +1082,7 @@ static int xenmem_add_to_physmap_range(struct domain *d,
                                        xatpr->foreign_domid,
                                        idx, gpfn);
 
-        if ( unlikely(copy_to_guest_offset(xatpr->errs,
-                                           xatpr->size-1, &rc, 1)) )
+        if ( unlikely(copy_to_guest_offset(xatpr->errs, 0, &rc, 1)) )
         {
             rc = -EFAULT;
             goto out;
@@ -1095,6 +1091,9 @@ static int xenmem_add_to_physmap_range(struct domain *d,
         if ( rc < 0 )
             goto out;
 
+        guest_handle_add_offset(xatpr->idxs, 1);
+        guest_handle_add_offset(xatpr->gpfns, 1);
+        guest_handle_add_offset(xatpr->errs, 1);
         xatpr->size--;
 
         /* Check for continuation if it's not the last interation */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:11:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3bZ-0002M3-VW; Fri, 20 Dec 2013 17:11:17 +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 1Vu3bZ-0002Lu-1b
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:17 +0000
Received: from [85.158.143.35:60581] by server-2.bemta-4.messagelabs.com id
	7B/35-11386-43A74B25; Fri, 20 Dec 2013 17:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1387559474!7415951!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29817 invoked from network); 20 Dec 2013 17:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:11: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 1Vu3bW-00053I-8f
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3bW-0005jd-3r
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:14 +0000
Date: Fri, 20 Dec 2013 17:11:14 +0000
Message-Id: <E1Vu3bW-0005jd-3r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce steps in
	domain_relinquish_resource
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bfa5c7fdd8e24279f3f1d28f434cfe923565bea
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:49 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:21:06 2013 +0000

    xen/arm: Introduce steps in domain_relinquish_resource
    
    In a later patch, a new step will be added. It will avoid to check every step
    when the function was preempted.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c        |   37 ++++++++++++++++++++++++++++++-------
 xen/include/asm-arm/domain.h |    8 ++++++++
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 67c65c3..1590708 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -497,6 +497,8 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
 {
     int rc;
 
+    d->arch.relmem = RELMEM_not_started;
+
     /* Idle domains do not need this setup */
     if ( is_idle_domain(d) )
         return 0;
@@ -696,15 +698,36 @@ int domain_relinquish_resources(struct domain *d)
 {
     int ret = 0;
 
-    ret = relinquish_memory(d, &d->xenpage_list);
-    if ( ret )
-        return ret;
+    switch ( d->arch.relmem )
+    {
+    case RELMEM_not_started:
+        d->arch.relmem = RELMEM_xen;
+        /* Falltrough */
 
-    ret = relinquish_memory(d, &d->page_list);
-    if ( ret )
-        return ret;
+    case RELMEM_xen:
+        ret = relinquish_memory(d, &d->xenpage_list);
+        if ( ret )
+            return ret;
 
-    return ret;
+        d->arch.relmem = RELMEM_page;
+        /* Fallthrough */
+
+    case RELMEM_page:
+        ret = relinquish_memory(d, &d->page_list);
+        if ( ret )
+            return ret;
+
+        d->arch.relmem = RELMEM_done;
+        /* Fallthrough */
+
+    case RELMEM_done:
+        break;
+
+    default:
+        BUG();
+    }
+
+    return 0;
 }
 
 void arch_dump_domain_info(struct domain *d)
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 0733c5e..53c9895 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -107,6 +107,14 @@ struct arch_domain
     struct hvm_domain hvm_domain;
     xen_pfn_t *grant_table_gpfn;
 
+    /* Continuable domain_relinquish_resources(). */
+    enum {
+        RELMEM_not_started,
+        RELMEM_xen,
+        RELMEM_page,
+        RELMEM_done,
+    } relmem;
+
     /* Virtual CPUID */
     uint32_t vpidr;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:11:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3bZ-0002M3-VW; Fri, 20 Dec 2013 17:11:17 +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 1Vu3bZ-0002Lu-1b
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:17 +0000
Received: from [85.158.143.35:60581] by server-2.bemta-4.messagelabs.com id
	7B/35-11386-43A74B25; Fri, 20 Dec 2013 17:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1387559474!7415951!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29817 invoked from network); 20 Dec 2013 17:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:11: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 1Vu3bW-00053I-8f
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3bW-0005jd-3r
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:14 +0000
Date: Fri, 20 Dec 2013 17:11:14 +0000
Message-Id: <E1Vu3bW-0005jd-3r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Introduce steps in
	domain_relinquish_resource
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bfa5c7fdd8e24279f3f1d28f434cfe923565bea
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:49 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:21:06 2013 +0000

    xen/arm: Introduce steps in domain_relinquish_resource
    
    In a later patch, a new step will be added. It will avoid to check every step
    when the function was preempted.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c        |   37 ++++++++++++++++++++++++++++++-------
 xen/include/asm-arm/domain.h |    8 ++++++++
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 67c65c3..1590708 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -497,6 +497,8 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
 {
     int rc;
 
+    d->arch.relmem = RELMEM_not_started;
+
     /* Idle domains do not need this setup */
     if ( is_idle_domain(d) )
         return 0;
@@ -696,15 +698,36 @@ int domain_relinquish_resources(struct domain *d)
 {
     int ret = 0;
 
-    ret = relinquish_memory(d, &d->xenpage_list);
-    if ( ret )
-        return ret;
+    switch ( d->arch.relmem )
+    {
+    case RELMEM_not_started:
+        d->arch.relmem = RELMEM_xen;
+        /* Falltrough */
 
-    ret = relinquish_memory(d, &d->page_list);
-    if ( ret )
-        return ret;
+    case RELMEM_xen:
+        ret = relinquish_memory(d, &d->xenpage_list);
+        if ( ret )
+            return ret;
 
-    return ret;
+        d->arch.relmem = RELMEM_page;
+        /* Fallthrough */
+
+    case RELMEM_page:
+        ret = relinquish_memory(d, &d->page_list);
+        if ( ret )
+            return ret;
+
+        d->arch.relmem = RELMEM_done;
+        /* Fallthrough */
+
+    case RELMEM_done:
+        break;
+
+    default:
+        BUG();
+    }
+
+    return 0;
 }
 
 void arch_dump_domain_info(struct domain *d)
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 0733c5e..53c9895 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -107,6 +107,14 @@ struct arch_domain
     struct hvm_domain hvm_domain;
     xen_pfn_t *grant_table_gpfn;
 
+    /* Continuable domain_relinquish_resources(). */
+    enum {
+        RELMEM_not_started,
+        RELMEM_xen,
+        RELMEM_page,
+        RELMEM_done,
+    } relmem;
+
     /* Virtual CPUID */
     uint32_t vpidr;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:11:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3bk-0002N8-26; Fri, 20 Dec 2013 17:11:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3bj-0002My-0N
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:27 +0000
Received: from [85.158.143.35:33410] by server-3.bemta-4.messagelabs.com id
	39/C7-32360-E3A74B25; Fri, 20 Dec 2013 17:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1387559484!7424267!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20415 invoked from network); 20 Dec 2013 17:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:11: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 1Vu3bg-00053O-Fa
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3bg-0005jz-C3
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:24 +0000
Date: Fri, 20 Dec 2013 17:11:24 +0000
Message-Id: <E1Vu3bg-0005jz-C3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: move mfn_to_p2m_entry in
	arch/arm/p2m.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef8f305c6b4dd9e81e4c87ce3a251d779ff2301d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:50 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:21:06 2013 +0000

    xen/arm: move mfn_to_p2m_entry in arch/arm/p2m.c
    
    The function mfn_to_p2m_entry will be extended in a following patch to handle
    p2m_type_t. It will break compilation because p2m_type_t is not defined
    (interdependence between includes).
    It's easier to move the function in arch/arm/p2m.c and it's not harmful as the
    function is only used in this file.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c         |   22 ++++++++++++++++++++++
 xen/include/asm-arm/page.h |   22 ----------------------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 083f8bf..74636df 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -128,6 +128,28 @@ int p2m_pod_decrease_reservation(struct domain *d,
     return -ENOSYS;
 }
 
+static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
+{
+    paddr_t pa = ((paddr_t) mfn) << PAGE_SHIFT;
+    lpae_t e = (lpae_t) {
+        .p2m.xn = 0,
+        .p2m.af = 1,
+        .p2m.sh = LPAE_SH_OUTER,
+        .p2m.read = 1,
+        .p2m.write = 1,
+        .p2m.mattr = mattr,
+        .p2m.table = 1,
+        .p2m.valid = 1,
+    };
+
+    ASSERT(!(pa & ~PAGE_MASK));
+    ASSERT(!(pa & ~PADDR_MASK));
+
+    e.bits |= pa;
+
+    return e;
+}
+
 /* Allocate a new page table page and hook it in via the given entry */
 static int p2m_create_table(struct domain *d,
                             lpae_t *entry)
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index d468418..0625464 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -213,28 +213,6 @@ static inline lpae_t mfn_to_xen_entry(unsigned long mfn)
     return e;
 }
 
-static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
-{
-    paddr_t pa = ((paddr_t) mfn) << PAGE_SHIFT;
-    lpae_t e = (lpae_t) {
-        .p2m.xn = 0,
-        .p2m.af = 1,
-        .p2m.sh = LPAE_SH_OUTER,
-        .p2m.write = 1,
-        .p2m.read = 1,
-        .p2m.mattr = mattr,
-        .p2m.table = 1,
-        .p2m.valid = 1,
-    };
-
-    ASSERT(!(pa & ~PAGE_MASK));
-    ASSERT(!(pa & ~PADDR_MASK));
-
-    e.bits |= pa;
-
-    return e;
-}
-
 #if defined(CONFIG_ARM_32)
 # include <asm/arm32/page.h>
 #elif defined(CONFIG_ARM_64)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:11:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3bk-0002N8-26; Fri, 20 Dec 2013 17:11:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3bj-0002My-0N
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:27 +0000
Received: from [85.158.143.35:33410] by server-3.bemta-4.messagelabs.com id
	39/C7-32360-E3A74B25; Fri, 20 Dec 2013 17:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1387559484!7424267!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20415 invoked from network); 20 Dec 2013 17:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:11: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 1Vu3bg-00053O-Fa
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3bg-0005jz-C3
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:24 +0000
Date: Fri, 20 Dec 2013 17:11:24 +0000
Message-Id: <E1Vu3bg-0005jz-C3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: move mfn_to_p2m_entry in
	arch/arm/p2m.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef8f305c6b4dd9e81e4c87ce3a251d779ff2301d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:50 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:21:06 2013 +0000

    xen/arm: move mfn_to_p2m_entry in arch/arm/p2m.c
    
    The function mfn_to_p2m_entry will be extended in a following patch to handle
    p2m_type_t. It will break compilation because p2m_type_t is not defined
    (interdependence between includes).
    It's easier to move the function in arch/arm/p2m.c and it's not harmful as the
    function is only used in this file.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c         |   22 ++++++++++++++++++++++
 xen/include/asm-arm/page.h |   22 ----------------------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 083f8bf..74636df 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -128,6 +128,28 @@ int p2m_pod_decrease_reservation(struct domain *d,
     return -ENOSYS;
 }
 
+static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
+{
+    paddr_t pa = ((paddr_t) mfn) << PAGE_SHIFT;
+    lpae_t e = (lpae_t) {
+        .p2m.xn = 0,
+        .p2m.af = 1,
+        .p2m.sh = LPAE_SH_OUTER,
+        .p2m.read = 1,
+        .p2m.write = 1,
+        .p2m.mattr = mattr,
+        .p2m.table = 1,
+        .p2m.valid = 1,
+    };
+
+    ASSERT(!(pa & ~PAGE_MASK));
+    ASSERT(!(pa & ~PADDR_MASK));
+
+    e.bits |= pa;
+
+    return e;
+}
+
 /* Allocate a new page table page and hook it in via the given entry */
 static int p2m_create_table(struct domain *d,
                             lpae_t *entry)
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index d468418..0625464 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -213,28 +213,6 @@ static inline lpae_t mfn_to_xen_entry(unsigned long mfn)
     return e;
 }
 
-static inline lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
-{
-    paddr_t pa = ((paddr_t) mfn) << PAGE_SHIFT;
-    lpae_t e = (lpae_t) {
-        .p2m.xn = 0,
-        .p2m.af = 1,
-        .p2m.sh = LPAE_SH_OUTER,
-        .p2m.write = 1,
-        .p2m.read = 1,
-        .p2m.mattr = mattr,
-        .p2m.table = 1,
-        .p2m.valid = 1,
-    };
-
-    ASSERT(!(pa & ~PAGE_MASK));
-    ASSERT(!(pa & ~PADDR_MASK));
-
-    e.bits |= pa;
-
-    return e;
-}
-
 #if defined(CONFIG_ARM_32)
 # include <asm/arm32/page.h>
 #elif defined(CONFIG_ARM_64)
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:11:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3bu-0002OW-59; Fri, 20 Dec 2013 17:11:38 +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 1Vu3bt-0002OJ-7Z
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:37 +0000
Received: from [193.109.254.147:38074] by server-9.bemta-14.messagelabs.com id
	22/44-13957-84A74B25; Fri, 20 Dec 2013 17:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1387559494!4427428!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30966 invoked from network); 20 Dec 2013 17:11:35 -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;
	20 Dec 2013 17:11: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 1Vu3bq-00053W-Jh
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3bq-0005kP-Ic
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:34 +0000
Date: Fri, 20 Dec 2013 17:11:34 +0000
Message-Id: <E1Vu3bq-0005kP-Ic@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Implement p2m_type_t as an
	enum
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 587db6905046fd55f70f0d9fbbf7ff6a8d2ef58a
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:51 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:21:06 2013 +0000

    xen/arm: Implement p2m_type_t as an enum
    
    Until now, Xen doesn't know the type of the page (ram, foreign page, mmio,...).
    Introduce p2m_type_t with basic types:
        - p2m_invalid: Nothing is mapped here
        - p2m_ram_rw: Normal read/write guest RAM
        - p2m_ram_ro: Read-only guest RAM
        - p2m_mmio_direct: Read/write mapping of device memory
        - p2m_map_foreign: RAM page from foreign guest
        - p2m_grant_map_rw: Read/write grant mapping
        - p2m_grant_map_ro: Read-only grant mapping
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c        |    2 ++
 xen/include/asm-arm/p2m.h |   20 +++++++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 74636df..691cdfa 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -142,6 +142,8 @@ static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
         .p2m.valid = 1,
     };
 
+    BUILD_BUG_ON(p2m_max_real_type > (1 << 4));
+
     ASSERT(!(pa & ~PAGE_MASK));
     ASSERT(!(pa & ~PADDR_MASK));
 
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index c660820..bc86a49 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -20,6 +20,25 @@ struct p2m_domain {
     uint8_t vmid;
 };
 
+/* List of possible type for each page in the p2m entry.
+ * The number of available bit per page in the pte for this purpose is 4 bits.
+ * So it's possible to only have 16 fields. If we run out of value in the
+ * future, it's possible to use higher value for pseudo-type and don't store
+ * them in the p2m entry.
+ */
+typedef enum {
+    p2m_invalid = 0,    /* Nothing mapped here */
+    p2m_ram_rw,         /* Normal read/write guest RAM */
+    p2m_ram_ro,         /* Read-only; writes are silently dropped */
+    p2m_mmio_direct,    /* Read/write mapping of genuine MMIO area */
+    p2m_map_foreign,    /* Ram pages from foreign domain */
+    p2m_grant_map_rw,   /* Read/write grant mapping */
+    p2m_grant_map_ro,   /* Read-only grant mapping */
+    p2m_max_real_type,  /* Types after this won't be store in the p2m */
+} p2m_type_t;
+
+#define p2m_is_foreign(_t)  ((_t) == p2m_map_foreign)
+
 /* Initialise vmid allocator */
 void p2m_vmid_allocator_init(void);
 
@@ -72,7 +91,6 @@ p2m_pod_decrease_reservation(struct domain *d,
                              unsigned int order);
 
 /* Look up a GFN and take a reference count on the backing page. */
-typedef int p2m_type_t;
 typedef unsigned int p2m_query_t;
 #define P2M_ALLOC    (1u<<0)   /* Populate PoD and paged-out entries */
 #define P2M_UNSHARE  (1u<<1)   /* Break CoW sharing */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:11:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3bu-0002OW-59; Fri, 20 Dec 2013 17:11:38 +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 1Vu3bt-0002OJ-7Z
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:37 +0000
Received: from [193.109.254.147:38074] by server-9.bemta-14.messagelabs.com id
	22/44-13957-84A74B25; Fri, 20 Dec 2013 17:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1387559494!4427428!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30966 invoked from network); 20 Dec 2013 17:11:35 -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;
	20 Dec 2013 17:11: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 1Vu3bq-00053W-Jh
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3bq-0005kP-Ic
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:34 +0000
Date: Fri, 20 Dec 2013 17:11:34 +0000
Message-Id: <E1Vu3bq-0005kP-Ic@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Implement p2m_type_t as an
	enum
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 587db6905046fd55f70f0d9fbbf7ff6a8d2ef58a
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:51 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:21:06 2013 +0000

    xen/arm: Implement p2m_type_t as an enum
    
    Until now, Xen doesn't know the type of the page (ram, foreign page, mmio,...).
    Introduce p2m_type_t with basic types:
        - p2m_invalid: Nothing is mapped here
        - p2m_ram_rw: Normal read/write guest RAM
        - p2m_ram_ro: Read-only guest RAM
        - p2m_mmio_direct: Read/write mapping of device memory
        - p2m_map_foreign: RAM page from foreign guest
        - p2m_grant_map_rw: Read/write grant mapping
        - p2m_grant_map_ro: Read-only grant mapping
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c        |    2 ++
 xen/include/asm-arm/p2m.h |   20 +++++++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 74636df..691cdfa 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -142,6 +142,8 @@ static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
         .p2m.valid = 1,
     };
 
+    BUILD_BUG_ON(p2m_max_real_type > (1 << 4));
+
     ASSERT(!(pa & ~PAGE_MASK));
     ASSERT(!(pa & ~PADDR_MASK));
 
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index c660820..bc86a49 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -20,6 +20,25 @@ struct p2m_domain {
     uint8_t vmid;
 };
 
+/* List of possible type for each page in the p2m entry.
+ * The number of available bit per page in the pte for this purpose is 4 bits.
+ * So it's possible to only have 16 fields. If we run out of value in the
+ * future, it's possible to use higher value for pseudo-type and don't store
+ * them in the p2m entry.
+ */
+typedef enum {
+    p2m_invalid = 0,    /* Nothing mapped here */
+    p2m_ram_rw,         /* Normal read/write guest RAM */
+    p2m_ram_ro,         /* Read-only; writes are silently dropped */
+    p2m_mmio_direct,    /* Read/write mapping of genuine MMIO area */
+    p2m_map_foreign,    /* Ram pages from foreign domain */
+    p2m_grant_map_rw,   /* Read/write grant mapping */
+    p2m_grant_map_ro,   /* Read-only grant mapping */
+    p2m_max_real_type,  /* Types after this won't be store in the p2m */
+} p2m_type_t;
+
+#define p2m_is_foreign(_t)  ((_t) == p2m_map_foreign)
+
 /* Initialise vmid allocator */
 void p2m_vmid_allocator_init(void);
 
@@ -72,7 +91,6 @@ p2m_pod_decrease_reservation(struct domain *d,
                              unsigned int order);
 
 /* Look up a GFN and take a reference count on the backing page. */
-typedef int p2m_type_t;
 typedef unsigned int p2m_query_t;
 #define P2M_ALLOC    (1u<<0)   /* Populate PoD and paged-out entries */
 #define P2M_UNSHARE  (1u<<1)   /* Break CoW sharing */
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:11:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3c5-0002QR-8P; Fri, 20 Dec 2013 17:11:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3c3-0002Q4-Kj
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:47 +0000
Received: from [85.158.139.211:18885] by server-11.bemta-5.messagelabs.com id
	CA/41-23268-25A74B25; Fri, 20 Dec 2013 17:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1387559504!5913949!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21174 invoked from network); 20 Dec 2013 17:11:45 -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;
	20 Dec 2013 17:11: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 1Vu3c0-00053c-Ov
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3c0-0005kl-NG
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:44 +0000
Date: Fri, 20 Dec 2013 17:11:44 +0000
Message-Id: <E1Vu3c0-0005kl-NG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Store p2m type in each page
	of the guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18651cc81bf46884cc0100574e9f41ebe91f93f8
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:52 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:40 2013 +0000

    xen/arm: Store p2m type in each page of the guest
    
    Use the field 'avail' to store the type of the page. Rename it to 'type' for
    convenience.
    The information stored in this field will be retrieved in a future patch to
    change the behaviour when the page is removed.
    
    Also introduce guest_physmap_add_entry to map and set a specific p2m type for
    a page.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c         |   68 +++++++++++++++++++++++++++++++++----------
 xen/include/asm-arm/p2m.h  |   18 +++++++++--
 xen/include/asm-arm/page.h |    2 +-
 3 files changed, 67 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 691cdfa..3dda5c2 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -128,22 +128,53 @@ int p2m_pod_decrease_reservation(struct domain *d,
     return -ENOSYS;
 }
 
-static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
+static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr,
+                               p2m_type_t t)
 {
     paddr_t pa = ((paddr_t) mfn) << PAGE_SHIFT;
+    /* xn and write bit will be defined in the switch */
     lpae_t e = (lpae_t) {
-        .p2m.xn = 0,
         .p2m.af = 1,
         .p2m.sh = LPAE_SH_OUTER,
         .p2m.read = 1,
-        .p2m.write = 1,
         .p2m.mattr = mattr,
         .p2m.table = 1,
         .p2m.valid = 1,
+        .p2m.type = t,
     };
 
     BUILD_BUG_ON(p2m_max_real_type > (1 << 4));
 
+    switch (t)
+    {
+    case p2m_ram_rw:
+        e.p2m.xn = 0;
+        e.p2m.write = 1;
+        break;
+
+    case p2m_ram_ro:
+        e.p2m.xn = 0;
+        e.p2m.write = 0;
+        break;
+
+    case p2m_map_foreign:
+    case p2m_grant_map_rw:
+    case p2m_mmio_direct:
+        e.p2m.xn = 1;
+        e.p2m.write = 1;
+        break;
+
+    case p2m_grant_map_ro:
+    case p2m_invalid:
+        e.p2m.xn = 1;
+        e.p2m.write = 0;
+        break;
+
+    case p2m_max_real_type:
+        BUG();
+        break;
+    }
+
     ASSERT(!(pa & ~PAGE_MASK));
     ASSERT(!(pa & ~PADDR_MASK));
 
@@ -173,7 +204,7 @@ static int p2m_create_table(struct domain *d,
     clear_page(p);
     unmap_domain_page(p);
 
-    pte = mfn_to_p2m_entry(page_to_mfn(page), MATTR_MEM);
+    pte = mfn_to_p2m_entry(page_to_mfn(page), MATTR_MEM, p2m_invalid);
 
     write_pte(entry, pte);
 
@@ -191,7 +222,8 @@ static int create_p2m_entries(struct domain *d,
                      paddr_t start_gpaddr,
                      paddr_t end_gpaddr,
                      paddr_t maddr,
-                     int mattr)
+                     int mattr,
+                     p2m_type_t t)
 {
     int rc, flush;
     struct p2m_domain *p2m = &d->arch.p2m;
@@ -271,14 +303,15 @@ static int create_p2m_entries(struct domain *d,
                         goto out;
                     }
 
-                    pte = mfn_to_p2m_entry(page_to_mfn(page), mattr);
+                    pte = mfn_to_p2m_entry(page_to_mfn(page), mattr, t);
 
                     write_pte(&third[third_table_offset(addr)], pte);
                 }
                 break;
             case INSERT:
                 {
-                    lpae_t pte = mfn_to_p2m_entry(maddr >> PAGE_SHIFT, mattr);
+                    lpae_t pte = mfn_to_p2m_entry(maddr >> PAGE_SHIFT,
+                                                  mattr, t);
                     write_pte(&third[third_table_offset(addr)], pte);
                     maddr += PAGE_SIZE;
                 }
@@ -313,7 +346,8 @@ int p2m_populate_ram(struct domain *d,
                      paddr_t start,
                      paddr_t end)
 {
-    return create_p2m_entries(d, ALLOCATE, start, end, 0, MATTR_MEM);
+    return create_p2m_entries(d, ALLOCATE, start, end,
+                              0, MATTR_MEM, p2m_ram_rw);
 }
 
 int map_mmio_regions(struct domain *d,
@@ -321,18 +355,20 @@ int map_mmio_regions(struct domain *d,
                      paddr_t end_gaddr,
                      paddr_t maddr)
 {
-    return create_p2m_entries(d, INSERT, start_gaddr, end_gaddr, maddr, MATTR_DEV);
+    return create_p2m_entries(d, INSERT, start_gaddr, end_gaddr,
+                              maddr, MATTR_DEV, p2m_mmio_direct);
 }
 
-int guest_physmap_add_page(struct domain *d,
-                           unsigned long gpfn,
-                           unsigned long mfn,
-                           unsigned int page_order)
+int guest_physmap_add_entry(struct domain *d,
+                            unsigned long gpfn,
+                            unsigned long mfn,
+                            unsigned long page_order,
+                            p2m_type_t t)
 {
     return create_p2m_entries(d, INSERT,
                               pfn_to_paddr(gpfn),
-                              pfn_to_paddr(gpfn + (1<<page_order)),
-                              pfn_to_paddr(mfn), MATTR_MEM);
+                              pfn_to_paddr(gpfn + (1 << page_order)),
+                              pfn_to_paddr(mfn), MATTR_MEM, t);
 }
 
 void guest_physmap_remove_page(struct domain *d,
@@ -342,7 +378,7 @@ void guest_physmap_remove_page(struct domain *d,
     create_p2m_entries(d, REMOVE,
                        pfn_to_paddr(gpfn),
                        pfn_to_paddr(gpfn + (1<<page_order)),
-                       pfn_to_paddr(mfn), MATTR_MEM);
+                       pfn_to_paddr(mfn), MATTR_MEM, p2m_invalid);
 }
 
 int p2m_alloc_table(struct domain *d)
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index bc86a49..5742bbc 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -68,11 +68,21 @@ int p2m_populate_ram(struct domain *d, paddr_t start, paddr_t end);
 int map_mmio_regions(struct domain *d, paddr_t start_gaddr,
                      paddr_t end_gaddr, paddr_t maddr);
 
+int guest_physmap_add_entry(struct domain *d,
+                            unsigned long gfn,
+                            unsigned long mfn,
+                            unsigned long page_order,
+                            p2m_type_t t);
+
 /* Untyped version for RAM only, for compatibility */
-int guest_physmap_add_page(struct domain *d,
-                           unsigned long gfn,
-                           unsigned long mfn,
-                           unsigned int page_order);
+static inline int guest_physmap_add_page(struct domain *d,
+                                         unsigned long gfn,
+                                         unsigned long mfn,
+                                         unsigned int page_order)
+{
+    return guest_physmap_add_entry(d, gfn, mfn, page_order, p2m_ram_rw);
+}
+
 void guest_physmap_remove_page(struct domain *d,
                                unsigned long gpfn,
                                unsigned long mfn, unsigned int page_order);
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 0625464..670d4e7 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -153,7 +153,7 @@ typedef struct {
     unsigned long contig:1;     /* In a block of 16 contiguous entries */
     unsigned long sbz2:1;
     unsigned long xn:1;         /* eXecute-Never */
-    unsigned long avail:4;      /* Ignored by hardware */
+    unsigned long type:4;       /* Ignore by hardware. Used to store p2m types */
 
     unsigned long sbz1:5;
 } __attribute__((__packed__)) lpae_p2m_t;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:11:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3c5-0002QR-8P; Fri, 20 Dec 2013 17:11:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3c3-0002Q4-Kj
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:47 +0000
Received: from [85.158.139.211:18885] by server-11.bemta-5.messagelabs.com id
	CA/41-23268-25A74B25; Fri, 20 Dec 2013 17:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1387559504!5913949!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21174 invoked from network); 20 Dec 2013 17:11:45 -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;
	20 Dec 2013 17:11: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 1Vu3c0-00053c-Ov
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3c0-0005kl-NG
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:44 +0000
Date: Fri, 20 Dec 2013 17:11:44 +0000
Message-Id: <E1Vu3c0-0005kl-NG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Store p2m type in each page
	of the guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18651cc81bf46884cc0100574e9f41ebe91f93f8
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:52 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:40 2013 +0000

    xen/arm: Store p2m type in each page of the guest
    
    Use the field 'avail' to store the type of the page. Rename it to 'type' for
    convenience.
    The information stored in this field will be retrieved in a future patch to
    change the behaviour when the page is removed.
    
    Also introduce guest_physmap_add_entry to map and set a specific p2m type for
    a page.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c         |   68 +++++++++++++++++++++++++++++++++----------
 xen/include/asm-arm/p2m.h  |   18 +++++++++--
 xen/include/asm-arm/page.h |    2 +-
 3 files changed, 67 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 691cdfa..3dda5c2 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -128,22 +128,53 @@ int p2m_pod_decrease_reservation(struct domain *d,
     return -ENOSYS;
 }
 
-static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr)
+static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr,
+                               p2m_type_t t)
 {
     paddr_t pa = ((paddr_t) mfn) << PAGE_SHIFT;
+    /* xn and write bit will be defined in the switch */
     lpae_t e = (lpae_t) {
-        .p2m.xn = 0,
         .p2m.af = 1,
         .p2m.sh = LPAE_SH_OUTER,
         .p2m.read = 1,
-        .p2m.write = 1,
         .p2m.mattr = mattr,
         .p2m.table = 1,
         .p2m.valid = 1,
+        .p2m.type = t,
     };
 
     BUILD_BUG_ON(p2m_max_real_type > (1 << 4));
 
+    switch (t)
+    {
+    case p2m_ram_rw:
+        e.p2m.xn = 0;
+        e.p2m.write = 1;
+        break;
+
+    case p2m_ram_ro:
+        e.p2m.xn = 0;
+        e.p2m.write = 0;
+        break;
+
+    case p2m_map_foreign:
+    case p2m_grant_map_rw:
+    case p2m_mmio_direct:
+        e.p2m.xn = 1;
+        e.p2m.write = 1;
+        break;
+
+    case p2m_grant_map_ro:
+    case p2m_invalid:
+        e.p2m.xn = 1;
+        e.p2m.write = 0;
+        break;
+
+    case p2m_max_real_type:
+        BUG();
+        break;
+    }
+
     ASSERT(!(pa & ~PAGE_MASK));
     ASSERT(!(pa & ~PADDR_MASK));
 
@@ -173,7 +204,7 @@ static int p2m_create_table(struct domain *d,
     clear_page(p);
     unmap_domain_page(p);
 
-    pte = mfn_to_p2m_entry(page_to_mfn(page), MATTR_MEM);
+    pte = mfn_to_p2m_entry(page_to_mfn(page), MATTR_MEM, p2m_invalid);
 
     write_pte(entry, pte);
 
@@ -191,7 +222,8 @@ static int create_p2m_entries(struct domain *d,
                      paddr_t start_gpaddr,
                      paddr_t end_gpaddr,
                      paddr_t maddr,
-                     int mattr)
+                     int mattr,
+                     p2m_type_t t)
 {
     int rc, flush;
     struct p2m_domain *p2m = &d->arch.p2m;
@@ -271,14 +303,15 @@ static int create_p2m_entries(struct domain *d,
                         goto out;
                     }
 
-                    pte = mfn_to_p2m_entry(page_to_mfn(page), mattr);
+                    pte = mfn_to_p2m_entry(page_to_mfn(page), mattr, t);
 
                     write_pte(&third[third_table_offset(addr)], pte);
                 }
                 break;
             case INSERT:
                 {
-                    lpae_t pte = mfn_to_p2m_entry(maddr >> PAGE_SHIFT, mattr);
+                    lpae_t pte = mfn_to_p2m_entry(maddr >> PAGE_SHIFT,
+                                                  mattr, t);
                     write_pte(&third[third_table_offset(addr)], pte);
                     maddr += PAGE_SIZE;
                 }
@@ -313,7 +346,8 @@ int p2m_populate_ram(struct domain *d,
                      paddr_t start,
                      paddr_t end)
 {
-    return create_p2m_entries(d, ALLOCATE, start, end, 0, MATTR_MEM);
+    return create_p2m_entries(d, ALLOCATE, start, end,
+                              0, MATTR_MEM, p2m_ram_rw);
 }
 
 int map_mmio_regions(struct domain *d,
@@ -321,18 +355,20 @@ int map_mmio_regions(struct domain *d,
                      paddr_t end_gaddr,
                      paddr_t maddr)
 {
-    return create_p2m_entries(d, INSERT, start_gaddr, end_gaddr, maddr, MATTR_DEV);
+    return create_p2m_entries(d, INSERT, start_gaddr, end_gaddr,
+                              maddr, MATTR_DEV, p2m_mmio_direct);
 }
 
-int guest_physmap_add_page(struct domain *d,
-                           unsigned long gpfn,
-                           unsigned long mfn,
-                           unsigned int page_order)
+int guest_physmap_add_entry(struct domain *d,
+                            unsigned long gpfn,
+                            unsigned long mfn,
+                            unsigned long page_order,
+                            p2m_type_t t)
 {
     return create_p2m_entries(d, INSERT,
                               pfn_to_paddr(gpfn),
-                              pfn_to_paddr(gpfn + (1<<page_order)),
-                              pfn_to_paddr(mfn), MATTR_MEM);
+                              pfn_to_paddr(gpfn + (1 << page_order)),
+                              pfn_to_paddr(mfn), MATTR_MEM, t);
 }
 
 void guest_physmap_remove_page(struct domain *d,
@@ -342,7 +378,7 @@ void guest_physmap_remove_page(struct domain *d,
     create_p2m_entries(d, REMOVE,
                        pfn_to_paddr(gpfn),
                        pfn_to_paddr(gpfn + (1<<page_order)),
-                       pfn_to_paddr(mfn), MATTR_MEM);
+                       pfn_to_paddr(mfn), MATTR_MEM, p2m_invalid);
 }
 
 int p2m_alloc_table(struct domain *d)
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index bc86a49..5742bbc 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -68,11 +68,21 @@ int p2m_populate_ram(struct domain *d, paddr_t start, paddr_t end);
 int map_mmio_regions(struct domain *d, paddr_t start_gaddr,
                      paddr_t end_gaddr, paddr_t maddr);
 
+int guest_physmap_add_entry(struct domain *d,
+                            unsigned long gfn,
+                            unsigned long mfn,
+                            unsigned long page_order,
+                            p2m_type_t t);
+
 /* Untyped version for RAM only, for compatibility */
-int guest_physmap_add_page(struct domain *d,
-                           unsigned long gfn,
-                           unsigned long mfn,
-                           unsigned int page_order);
+static inline int guest_physmap_add_page(struct domain *d,
+                                         unsigned long gfn,
+                                         unsigned long mfn,
+                                         unsigned int page_order)
+{
+    return guest_physmap_add_entry(d, gfn, mfn, page_order, p2m_ram_rw);
+}
+
 void guest_physmap_remove_page(struct domain *d,
                                unsigned long gpfn,
                                unsigned long mfn, unsigned int page_order);
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 0625464..670d4e7 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -153,7 +153,7 @@ typedef struct {
     unsigned long contig:1;     /* In a block of 16 contiguous entries */
     unsigned long sbz2:1;
     unsigned long xn:1;         /* eXecute-Never */
-    unsigned long avail:4;      /* Ignored by hardware */
+    unsigned long type:4;       /* Ignore by hardware. Used to store p2m types */
 
     unsigned long sbz1:5;
 } __attribute__((__packed__)) lpae_p2m_t;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:11:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3cF-0002Sp-GE; Fri, 20 Dec 2013 17:11:59 +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 1Vu3cD-0002SU-OC
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:57 +0000
Received: from [85.158.137.68:47139] by server-7.bemta-3.messagelabs.com id
	1C/12-27599-C5A74B25; Fri, 20 Dec 2013 17:11:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1387559515!4184838!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15953 invoked from network); 20 Dec 2013 17:11:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:11: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 1Vu3cA-00053l-UC
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cA-0005l7-SU
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:54 +0000
Date: Fri, 20 Dec 2013 17:11:54 +0000
Message-Id: <E1Vu3cA-0005l7-SU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: p2m: Extend p2m_lookup
	parameters to retrieve the p2m 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 10f875d7d50e113423e087e6b682f9fc14862661
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:53 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:47 2013 +0000

    xen/arm: p2m: Extend p2m_lookup parameters to retrieve the p2m type
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c         |    2 +-
 xen/arch/arm/p2m.c        |   14 ++++++++++++--
 xen/arch/arm/traps.c      |    6 +++---
 xen/include/asm-arm/p2m.h |    2 +-
 4 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 726adc7..c351b1f 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1032,7 +1032,7 @@ static int xenmem_add_to_physmap_one(
             return rc;
         }
 
-        maddr = p2m_lookup(od, pfn_to_paddr(idx));
+        maddr = p2m_lookup(od, pfn_to_paddr(idx), NULL);
         if ( maddr == INVALID_PADDR )
         {
             dump_p2m_lookup(od, pfn_to_paddr(idx));
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 3dda5c2..bc32935 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -72,11 +72,17 @@ static lpae_t *p2m_map_first(struct p2m_domain *p2m, paddr_t addr)
  * There are no processor functions to do a stage 2 only lookup therefore we
  * do a a software walk.
  */
-paddr_t p2m_lookup(struct domain *d, paddr_t paddr)
+paddr_t p2m_lookup(struct domain *d, paddr_t paddr, p2m_type_t *t)
 {
     struct p2m_domain *p2m = &d->arch.p2m;
     lpae_t pte, *first = NULL, *second = NULL, *third = NULL;
     paddr_t maddr = INVALID_PADDR;
+    p2m_type_t _t;
+
+    /* Allow t to be NULL */
+    t = t ?: &_t;
+
+    *t = p2m_invalid;
 
     spin_lock(&p2m->lock);
 
@@ -102,7 +108,11 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr)
 
 done:
     if ( pte.p2m.valid )
+    {
+        ASSERT(pte.p2m.type != p2m_invalid);
         maddr = (pte.bits & PADDR_MASK & PAGE_MASK) | (paddr & ~PAGE_MASK);
+        *t = pte.p2m.type;
+    }
 
     if (third) unmap_domain_page(third);
     if (second) unmap_domain_page(second);
@@ -521,7 +531,7 @@ err:
 
 unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
 {
-    paddr_t p = p2m_lookup(d, pfn_to_paddr(gpfn));
+    paddr_t p = p2m_lookup(d, pfn_to_paddr(gpfn), NULL);
     return p >> PAGE_SHIFT;
 }
 
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index e01045e..7c5ab19 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1421,7 +1421,7 @@ void dump_guest_s1_walk(struct domain *d, vaddr_t addr)
     printk("dom%d VA 0x%08"PRIvaddr"\n", d->domain_id, addr);
     printk("    TTBCR: 0x%08"PRIregister"\n", ttbcr);
     printk("    TTBR0: 0x%016"PRIx64" = 0x%"PRIpaddr"\n",
-           ttbr0, p2m_lookup(d, ttbr0 & PAGE_MASK));
+           ttbr0, p2m_lookup(d, ttbr0 & PAGE_MASK, NULL));
 
     if ( ttbcr & TTBCR_EAE )
     {
@@ -1434,7 +1434,7 @@ void dump_guest_s1_walk(struct domain *d, vaddr_t addr)
         return;
     }
 
-    paddr = p2m_lookup(d, ttbr0 & PAGE_MASK);
+    paddr = p2m_lookup(d, ttbr0 & PAGE_MASK, NULL);
     if ( paddr == INVALID_PADDR )
     {
         printk("Failed TTBR0 maddr lookup\n");
@@ -1449,7 +1449,7 @@ void dump_guest_s1_walk(struct domain *d, vaddr_t addr)
          !(first[offset] & 0x2) )
         goto done;
 
-    paddr = p2m_lookup(d, first[offset] & PAGE_MASK);
+    paddr = p2m_lookup(d, first[offset] & PAGE_MASK, NULL);
 
     if ( paddr == INVALID_PADDR )
     {
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 5742bbc..9d0d1e7 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -58,7 +58,7 @@ int p2m_alloc_table(struct domain *d);
 void p2m_load_VTTBR(struct domain *d);
 
 /* Look up the MFN corresponding to a domain's PFN. */
-paddr_t p2m_lookup(struct domain *d, paddr_t gpfn);
+paddr_t p2m_lookup(struct domain *d, paddr_t gpfn, p2m_type_t *t);
 
 /* Setup p2m RAM mapping for domain d from start-end. */
 int p2m_populate_ram(struct domain *d, paddr_t start, paddr_t 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 Fri Dec 20 17:11:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:11: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 1Vu3cF-0002Sp-GE; Fri, 20 Dec 2013 17:11:59 +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 1Vu3cD-0002SU-OC
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:57 +0000
Received: from [85.158.137.68:47139] by server-7.bemta-3.messagelabs.com id
	1C/12-27599-C5A74B25; Fri, 20 Dec 2013 17:11:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1387559515!4184838!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15953 invoked from network); 20 Dec 2013 17:11:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:11: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 1Vu3cA-00053l-UC
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cA-0005l7-SU
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:11:54 +0000
Date: Fri, 20 Dec 2013 17:11:54 +0000
Message-Id: <E1Vu3cA-0005l7-SU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: p2m: Extend p2m_lookup
	parameters to retrieve the p2m 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 10f875d7d50e113423e087e6b682f9fc14862661
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:53 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:47 2013 +0000

    xen/arm: p2m: Extend p2m_lookup parameters to retrieve the p2m type
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c         |    2 +-
 xen/arch/arm/p2m.c        |   14 ++++++++++++--
 xen/arch/arm/traps.c      |    6 +++---
 xen/include/asm-arm/p2m.h |    2 +-
 4 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 726adc7..c351b1f 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1032,7 +1032,7 @@ static int xenmem_add_to_physmap_one(
             return rc;
         }
 
-        maddr = p2m_lookup(od, pfn_to_paddr(idx));
+        maddr = p2m_lookup(od, pfn_to_paddr(idx), NULL);
         if ( maddr == INVALID_PADDR )
         {
             dump_p2m_lookup(od, pfn_to_paddr(idx));
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 3dda5c2..bc32935 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -72,11 +72,17 @@ static lpae_t *p2m_map_first(struct p2m_domain *p2m, paddr_t addr)
  * There are no processor functions to do a stage 2 only lookup therefore we
  * do a a software walk.
  */
-paddr_t p2m_lookup(struct domain *d, paddr_t paddr)
+paddr_t p2m_lookup(struct domain *d, paddr_t paddr, p2m_type_t *t)
 {
     struct p2m_domain *p2m = &d->arch.p2m;
     lpae_t pte, *first = NULL, *second = NULL, *third = NULL;
     paddr_t maddr = INVALID_PADDR;
+    p2m_type_t _t;
+
+    /* Allow t to be NULL */
+    t = t ?: &_t;
+
+    *t = p2m_invalid;
 
     spin_lock(&p2m->lock);
 
@@ -102,7 +108,11 @@ paddr_t p2m_lookup(struct domain *d, paddr_t paddr)
 
 done:
     if ( pte.p2m.valid )
+    {
+        ASSERT(pte.p2m.type != p2m_invalid);
         maddr = (pte.bits & PADDR_MASK & PAGE_MASK) | (paddr & ~PAGE_MASK);
+        *t = pte.p2m.type;
+    }
 
     if (third) unmap_domain_page(third);
     if (second) unmap_domain_page(second);
@@ -521,7 +531,7 @@ err:
 
 unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
 {
-    paddr_t p = p2m_lookup(d, pfn_to_paddr(gpfn));
+    paddr_t p = p2m_lookup(d, pfn_to_paddr(gpfn), NULL);
     return p >> PAGE_SHIFT;
 }
 
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index e01045e..7c5ab19 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1421,7 +1421,7 @@ void dump_guest_s1_walk(struct domain *d, vaddr_t addr)
     printk("dom%d VA 0x%08"PRIvaddr"\n", d->domain_id, addr);
     printk("    TTBCR: 0x%08"PRIregister"\n", ttbcr);
     printk("    TTBR0: 0x%016"PRIx64" = 0x%"PRIpaddr"\n",
-           ttbr0, p2m_lookup(d, ttbr0 & PAGE_MASK));
+           ttbr0, p2m_lookup(d, ttbr0 & PAGE_MASK, NULL));
 
     if ( ttbcr & TTBCR_EAE )
     {
@@ -1434,7 +1434,7 @@ void dump_guest_s1_walk(struct domain *d, vaddr_t addr)
         return;
     }
 
-    paddr = p2m_lookup(d, ttbr0 & PAGE_MASK);
+    paddr = p2m_lookup(d, ttbr0 & PAGE_MASK, NULL);
     if ( paddr == INVALID_PADDR )
     {
         printk("Failed TTBR0 maddr lookup\n");
@@ -1449,7 +1449,7 @@ void dump_guest_s1_walk(struct domain *d, vaddr_t addr)
          !(first[offset] & 0x2) )
         goto done;
 
-    paddr = p2m_lookup(d, first[offset] & PAGE_MASK);
+    paddr = p2m_lookup(d, first[offset] & PAGE_MASK, NULL);
 
     if ( paddr == INVALID_PADDR )
     {
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 5742bbc..9d0d1e7 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -58,7 +58,7 @@ int p2m_alloc_table(struct domain *d);
 void p2m_load_VTTBR(struct domain *d);
 
 /* Look up the MFN corresponding to a domain's PFN. */
-paddr_t p2m_lookup(struct domain *d, paddr_t gpfn);
+paddr_t p2m_lookup(struct domain *d, paddr_t gpfn, p2m_type_t *t);
 
 /* Setup p2m RAM mapping for domain d from start-end. */
 int p2m_populate_ram(struct domain *d, paddr_t start, paddr_t 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 Fri Dec 20 17:12:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 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 1Vu3cP-0002UU-JX; Fri, 20 Dec 2013 17:12: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 1Vu3cN-0002U0-QA
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:07 +0000
Received: from [85.158.137.68:47742] by server-7.bemta-3.messagelabs.com id
	8B/52-27599-76A74B25; Fri, 20 Dec 2013 17:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1387559525!5365688!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17886 invoked from network); 20 Dec 2013 17:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:12: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 1Vu3cL-00054K-5X
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cL-0005ld-0p
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:05 +0000
Date: Fri, 20 Dec 2013 17:12:05 +0000
Message-Id: <E1Vu3cL-0005ld-0p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Retrieve p2m type in
	get_page_from_gfn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc10bb6134e858722177ca60ea06574fa9911ab8
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:54 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:48 2013 +0000

    xen/arm: Retrieve p2m type in get_page_from_gfn
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/p2m.h |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 9d0d1e7..0eb07a8 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -109,11 +109,17 @@ static inline struct page_info *get_page_from_gfn(
     struct domain *d, unsigned long gfn, p2m_type_t *t, p2m_query_t q)
 {
     struct page_info *page;
-    unsigned long mfn = gmfn_to_mfn(d, gfn);
+    p2m_type_t p2mt;
+    paddr_t maddr = p2m_lookup(d, pfn_to_paddr(gfn), &p2mt);
+    unsigned long mfn = maddr >> PAGE_SHIFT;
 
-    ASSERT(t == NULL);
+    if (t)
+        *t = p2mt;
 
-    if (!mfn_valid(mfn))
+    if ( p2mt == p2m_invalid || p2mt == p2m_mmio_direct )
+        return NULL;
+
+    if ( !mfn_valid(mfn) )
         return NULL;
     page = mfn_to_page(mfn);
     if ( !get_page(page, 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 Fri Dec 20 17:12:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 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 1Vu3cP-0002UU-JX; Fri, 20 Dec 2013 17:12: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 1Vu3cN-0002U0-QA
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:07 +0000
Received: from [85.158.137.68:47742] by server-7.bemta-3.messagelabs.com id
	8B/52-27599-76A74B25; Fri, 20 Dec 2013 17:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1387559525!5365688!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17886 invoked from network); 20 Dec 2013 17:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:12: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 1Vu3cL-00054K-5X
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cL-0005ld-0p
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:05 +0000
Date: Fri, 20 Dec 2013 17:12:05 +0000
Message-Id: <E1Vu3cL-0005ld-0p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Retrieve p2m type in
	get_page_from_gfn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc10bb6134e858722177ca60ea06574fa9911ab8
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:54 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:48 2013 +0000

    xen/arm: Retrieve p2m type in get_page_from_gfn
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/p2m.h |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 9d0d1e7..0eb07a8 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -109,11 +109,17 @@ static inline struct page_info *get_page_from_gfn(
     struct domain *d, unsigned long gfn, p2m_type_t *t, p2m_query_t q)
 {
     struct page_info *page;
-    unsigned long mfn = gmfn_to_mfn(d, gfn);
+    p2m_type_t p2mt;
+    paddr_t maddr = p2m_lookup(d, pfn_to_paddr(gfn), &p2mt);
+    unsigned long mfn = maddr >> PAGE_SHIFT;
 
-    ASSERT(t == NULL);
+    if (t)
+        *t = p2mt;
 
-    if (!mfn_valid(mfn))
+    if ( p2mt == p2m_invalid || p2mt == p2m_mmio_direct )
+        return NULL;
+
+    if ( !mfn_valid(mfn) )
         return NULL;
     page = mfn_to_page(mfn);
     if ( !get_page(page, 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 Fri Dec 20 17:12:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:12: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 1Vu3cZ-0002WU-MM; Fri, 20 Dec 2013 17:12: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 1Vu3cX-0002WA-VW
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:18 +0000
Received: from [85.158.143.35:7247] by server-3.bemta-4.messagelabs.com id
	44/69-32360-17A74B25; Fri, 20 Dec 2013 17:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1387559535!4738666!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9938 invoked from network); 20 Dec 2013 17:12:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:12: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 1Vu3cV-00054Q-DB
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cV-0005mX-AR
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:15 +0000
Date: Fri, 20 Dec 2013 17:12:15 +0000
Message-Id: <E1Vu3cV-0005mX-AR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Handle remove foreign mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9486a8d07ba8d8385d7902fbc815f5e257da13df
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:55 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:48 2013 +0000

    xen/arm: Handle remove foreign mapping
    
    Modify get_page_from_gfn to take reference on foreign mapping. This will avoid
    specific handling in the common code.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c        |   15 +++++++++++++--
 xen/include/asm-arm/p2m.h |   12 ++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index bc32935..410acb6 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -328,10 +328,21 @@ static int create_p2m_entries(struct domain *d,
                 break;
             case REMOVE:
                 {
-                    lpae_t pte;
+                    lpae_t pte = third[third_table_offset(addr)];
+                    unsigned long mfn = pte.p2m.base;
+
+                    if ( !pte.p2m.valid )
+                        break;
+
+                    /* TODO: Handle other p2m type */
+                    if ( p2m_is_foreign(pte.p2m.type) )
+                    {
+                        ASSERT(mfn_valid(mfn));
+                        put_page(mfn_to_page(mfn));
+                    }
+
                     memset(&pte, 0x00, sizeof(pte));
                     write_pte(&third[third_table_offset(addr)], pte);
-                    maddr += PAGE_SIZE;
                 }
                 break;
         }
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 0eb07a8..5ccfa7f 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -122,6 +122,18 @@ static inline struct page_info *get_page_from_gfn(
     if ( !mfn_valid(mfn) )
         return NULL;
     page = mfn_to_page(mfn);
+
+    /* get_page won't work on foreign mapping because the page doesn't
+     * belong to the current domain.
+     */
+    if ( p2mt == p2m_map_foreign )
+    {
+        struct domain *fdom = page_get_owner_and_reference(page);
+        ASSERT(fdom != NULL);
+        ASSERT(fdom != d);
+        return page;
+    }
+
     if ( !get_page(page, d) )
         return NULL;
     return 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 Fri Dec 20 17:12:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:12: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 1Vu3cZ-0002WU-MM; Fri, 20 Dec 2013 17:12: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 1Vu3cX-0002WA-VW
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:18 +0000
Received: from [85.158.143.35:7247] by server-3.bemta-4.messagelabs.com id
	44/69-32360-17A74B25; Fri, 20 Dec 2013 17:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1387559535!4738666!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9938 invoked from network); 20 Dec 2013 17:12:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:12: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 1Vu3cV-00054Q-DB
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cV-0005mX-AR
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:15 +0000
Date: Fri, 20 Dec 2013 17:12:15 +0000
Message-Id: <E1Vu3cV-0005mX-AR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Handle remove foreign mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9486a8d07ba8d8385d7902fbc815f5e257da13df
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:55 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:48 2013 +0000

    xen/arm: Handle remove foreign mapping
    
    Modify get_page_from_gfn to take reference on foreign mapping. This will avoid
    specific handling in the common code.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c        |   15 +++++++++++++--
 xen/include/asm-arm/p2m.h |   12 ++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index bc32935..410acb6 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -328,10 +328,21 @@ static int create_p2m_entries(struct domain *d,
                 break;
             case REMOVE:
                 {
-                    lpae_t pte;
+                    lpae_t pte = third[third_table_offset(addr)];
+                    unsigned long mfn = pte.p2m.base;
+
+                    if ( !pte.p2m.valid )
+                        break;
+
+                    /* TODO: Handle other p2m type */
+                    if ( p2m_is_foreign(pte.p2m.type) )
+                    {
+                        ASSERT(mfn_valid(mfn));
+                        put_page(mfn_to_page(mfn));
+                    }
+
                     memset(&pte, 0x00, sizeof(pte));
                     write_pte(&third[third_table_offset(addr)], pte);
-                    maddr += PAGE_SIZE;
                 }
                 break;
         }
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 0eb07a8..5ccfa7f 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -122,6 +122,18 @@ static inline struct page_info *get_page_from_gfn(
     if ( !mfn_valid(mfn) )
         return NULL;
     page = mfn_to_page(mfn);
+
+    /* get_page won't work on foreign mapping because the page doesn't
+     * belong to the current domain.
+     */
+    if ( p2mt == p2m_map_foreign )
+    {
+        struct domain *fdom = page_get_owner_and_reference(page);
+        ASSERT(fdom != NULL);
+        ASSERT(fdom != d);
+        return page;
+    }
+
     if ( !get_page(page, d) )
         return NULL;
     return 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 Fri Dec 20 17:12:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 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 1Vu3cj-0002YC-P7; Fri, 20 Dec 2013 17:12:29 +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 1Vu3ci-0002Xv-6h
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:28 +0000
Received: from [193.109.254.147:41543] by server-5.bemta-14.messagelabs.com id
	DE/54-03510-B7A74B25; Fri, 20 Dec 2013 17:12:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1387559545!6738881!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28486 invoked from network); 20 Dec 2013 17:12:26 -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;
	20 Dec 2013 17:12: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 1Vu3cf-00054W-I4
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cf-0005mu-GQ
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:25 +0000
Date: Fri, 20 Dec 2013 17:12:25 +0000
Message-Id: <E1Vu3cf-0005mu-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add relinquish_p2m_mapping to
	remove reference on every mapped page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84f29a98dc31fcf4a6bbf380601f4b3651c761f8
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:56 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:48 2013 +0000

    xen/arm: Add relinquish_p2m_mapping to remove reference on every mapped page
    
    This function will be called when the domain relinquishes its memory.
    It removes refcount on every mapped page to a valid MFN.
    
    Currently, Xen doesn't take reference on every new mapping but only for foreign
    mapping. Restrict the function only on foreign mapping.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c        |    8 ++++++
 xen/arch/arm/p2m.c           |   49 +++++++++++++++++++++++++++++++++++++++++-
 xen/include/asm-arm/domain.h |    1 +
 xen/include/asm-arm/p2m.h    |   15 ++++++++++++
 4 files changed, 72 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 1590708..4099e88 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -717,6 +717,14 @@ int domain_relinquish_resources(struct domain *d)
         if ( ret )
             return ret;
 
+        d->arch.relmem = RELMEM_mapping;
+        /* Fallthrough */
+
+    case RELMEM_mapping:
+        ret = relinquish_p2m_mapping(d);
+        if ( ret )
+            return ret;
+
         d->arch.relmem = RELMEM_done;
         /* Fallthrough */
 
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 410acb6..3f4ab37 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -6,6 +6,8 @@
 #include <xen/bitops.h>
 #include <asm/flushtlb.h>
 #include <asm/gic.h>
+#include <asm/event.h>
+#include <asm/hardirq.h>
 
 /* First level P2M is 2 consecutive pages */
 #define P2M_FIRST_ORDER 1
@@ -224,7 +226,8 @@ static int p2m_create_table(struct domain *d,
 enum p2m_operation {
     INSERT,
     ALLOCATE,
-    REMOVE
+    REMOVE,
+    RELINQUISH,
 };
 
 static int create_p2m_entries(struct domain *d,
@@ -242,6 +245,7 @@ static int create_p2m_entries(struct domain *d,
     unsigned long cur_first_page = ~0,
                   cur_first_offset = ~0,
                   cur_second_offset = ~0;
+    unsigned long count = 0;
 
     spin_lock(&p2m->lock);
 
@@ -326,13 +330,19 @@ static int create_p2m_entries(struct domain *d,
                     maddr += PAGE_SIZE;
                 }
                 break;
+            case RELINQUISH:
             case REMOVE:
                 {
                     lpae_t pte = third[third_table_offset(addr)];
                     unsigned long mfn = pte.p2m.base;
 
                     if ( !pte.p2m.valid )
+                    {
+                        count++;
                         break;
+                    }
+
+                    count += 0x10;
 
                     /* TODO: Handle other p2m type */
                     if ( p2m_is_foreign(pte.p2m.type) )
@@ -343,12 +353,35 @@ static int create_p2m_entries(struct domain *d,
 
                     memset(&pte, 0x00, sizeof(pte));
                     write_pte(&third[third_table_offset(addr)], pte);
+                    count++;
                 }
                 break;
         }
 
         if ( flush )
             flush_tlb_all_local();
+
+        /* Preempt every 2MiB (mapped) or 32 MiB (unmapped) - arbitrary */
+        if ( op == RELINQUISH && count >= 0x2000 )
+        {
+            if ( hypercall_preempt_check() )
+            {
+                p2m->next_gfn_to_relinquish = maddr >> PAGE_SHIFT;
+                rc = -EAGAIN;
+                goto out;
+            }
+            count = 0;
+        }
+    }
+
+    if ( op == ALLOCATE || op == INSERT )
+    {
+        unsigned long sgfn = paddr_to_pfn(start_gpaddr);
+        unsigned long egfn = paddr_to_pfn(end_gpaddr);
+
+        p2m->max_mapped_gfn = MAX(p2m->max_mapped_gfn, egfn);
+        /* Use next_gfn_to_relinquish to store the lowest gfn mapped */
+        p2m->next_gfn_to_relinquish = MIN(p2m->next_gfn_to_relinquish, sgfn);
     }
 
     rc = 0;
@@ -534,12 +567,26 @@ int p2m_init(struct domain *d)
 
     p2m->first_level = NULL;
 
+    p2m->max_mapped_gfn = 0;
+    p2m->next_gfn_to_relinquish = ULONG_MAX;
+
 err:
     spin_unlock(&p2m->lock);
 
     return rc;
 }
 
+int relinquish_p2m_mapping(struct domain *d)
+{
+    struct p2m_domain *p2m = &d->arch.p2m;
+
+    return create_p2m_entries(d, RELINQUISH,
+                              pfn_to_paddr(p2m->next_gfn_to_relinquish),
+                              pfn_to_paddr(p2m->max_mapped_gfn),
+                              pfn_to_paddr(INVALID_MFN),
+                              MATTR_MEM, p2m_invalid);
+}
+
 unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
 {
     paddr_t p = p2m_lookup(d, pfn_to_paddr(gpfn), NULL);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 53c9895..28d39a0 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -112,6 +112,7 @@ struct arch_domain
         RELMEM_not_started,
         RELMEM_xen,
         RELMEM_page,
+        RELMEM_mapping,
         RELMEM_done,
     } relmem;
 
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 5ccfa7f..8b7b6d0 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -18,6 +18,15 @@ struct p2m_domain {
 
     /* Current VMID in use */
     uint8_t vmid;
+
+    /* Highest guest frame that's ever been mapped in the p2m
+     * Only takes into account ram and foreign mapping
+     */
+    unsigned long max_mapped_gfn;
+
+    /* When releasing mapped gfn's in a preemptible manner, recall where
+     * to resume the search */
+    unsigned long next_gfn_to_relinquish;
 };
 
 /* List of possible type for each page in the p2m entry.
@@ -48,6 +57,12 @@ int p2m_init(struct domain *d);
 /* Return all the p2m resources to Xen. */
 void p2m_teardown(struct domain *d);
 
+/* Remove mapping refcount on each mapping page in the p2m
+ *
+ * TODO: For the moment only foreign mappings are handled
+ */
+int relinquish_p2m_mapping(struct domain *d);
+
 /* Allocate a new p2m table for a domain.
  *
  * Returns 0 for success or -errno.
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:12:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 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 1Vu3cj-0002YC-P7; Fri, 20 Dec 2013 17:12:29 +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 1Vu3ci-0002Xv-6h
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:28 +0000
Received: from [193.109.254.147:41543] by server-5.bemta-14.messagelabs.com id
	DE/54-03510-B7A74B25; Fri, 20 Dec 2013 17:12:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1387559545!6738881!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28486 invoked from network); 20 Dec 2013 17:12:26 -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;
	20 Dec 2013 17:12: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 1Vu3cf-00054W-I4
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cf-0005mu-GQ
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:25 +0000
Date: Fri, 20 Dec 2013 17:12:25 +0000
Message-Id: <E1Vu3cf-0005mu-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Add relinquish_p2m_mapping to
	remove reference on every mapped page
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84f29a98dc31fcf4a6bbf380601f4b3651c761f8
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:56 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:48 2013 +0000

    xen/arm: Add relinquish_p2m_mapping to remove reference on every mapped page
    
    This function will be called when the domain relinquishes its memory.
    It removes refcount on every mapped page to a valid MFN.
    
    Currently, Xen doesn't take reference on every new mapping but only for foreign
    mapping. Restrict the function only on foreign mapping.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c        |    8 ++++++
 xen/arch/arm/p2m.c           |   49 +++++++++++++++++++++++++++++++++++++++++-
 xen/include/asm-arm/domain.h |    1 +
 xen/include/asm-arm/p2m.h    |   15 ++++++++++++
 4 files changed, 72 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 1590708..4099e88 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -717,6 +717,14 @@ int domain_relinquish_resources(struct domain *d)
         if ( ret )
             return ret;
 
+        d->arch.relmem = RELMEM_mapping;
+        /* Fallthrough */
+
+    case RELMEM_mapping:
+        ret = relinquish_p2m_mapping(d);
+        if ( ret )
+            return ret;
+
         d->arch.relmem = RELMEM_done;
         /* Fallthrough */
 
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 410acb6..3f4ab37 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -6,6 +6,8 @@
 #include <xen/bitops.h>
 #include <asm/flushtlb.h>
 #include <asm/gic.h>
+#include <asm/event.h>
+#include <asm/hardirq.h>
 
 /* First level P2M is 2 consecutive pages */
 #define P2M_FIRST_ORDER 1
@@ -224,7 +226,8 @@ static int p2m_create_table(struct domain *d,
 enum p2m_operation {
     INSERT,
     ALLOCATE,
-    REMOVE
+    REMOVE,
+    RELINQUISH,
 };
 
 static int create_p2m_entries(struct domain *d,
@@ -242,6 +245,7 @@ static int create_p2m_entries(struct domain *d,
     unsigned long cur_first_page = ~0,
                   cur_first_offset = ~0,
                   cur_second_offset = ~0;
+    unsigned long count = 0;
 
     spin_lock(&p2m->lock);
 
@@ -326,13 +330,19 @@ static int create_p2m_entries(struct domain *d,
                     maddr += PAGE_SIZE;
                 }
                 break;
+            case RELINQUISH:
             case REMOVE:
                 {
                     lpae_t pte = third[third_table_offset(addr)];
                     unsigned long mfn = pte.p2m.base;
 
                     if ( !pte.p2m.valid )
+                    {
+                        count++;
                         break;
+                    }
+
+                    count += 0x10;
 
                     /* TODO: Handle other p2m type */
                     if ( p2m_is_foreign(pte.p2m.type) )
@@ -343,12 +353,35 @@ static int create_p2m_entries(struct domain *d,
 
                     memset(&pte, 0x00, sizeof(pte));
                     write_pte(&third[third_table_offset(addr)], pte);
+                    count++;
                 }
                 break;
         }
 
         if ( flush )
             flush_tlb_all_local();
+
+        /* Preempt every 2MiB (mapped) or 32 MiB (unmapped) - arbitrary */
+        if ( op == RELINQUISH && count >= 0x2000 )
+        {
+            if ( hypercall_preempt_check() )
+            {
+                p2m->next_gfn_to_relinquish = maddr >> PAGE_SHIFT;
+                rc = -EAGAIN;
+                goto out;
+            }
+            count = 0;
+        }
+    }
+
+    if ( op == ALLOCATE || op == INSERT )
+    {
+        unsigned long sgfn = paddr_to_pfn(start_gpaddr);
+        unsigned long egfn = paddr_to_pfn(end_gpaddr);
+
+        p2m->max_mapped_gfn = MAX(p2m->max_mapped_gfn, egfn);
+        /* Use next_gfn_to_relinquish to store the lowest gfn mapped */
+        p2m->next_gfn_to_relinquish = MIN(p2m->next_gfn_to_relinquish, sgfn);
     }
 
     rc = 0;
@@ -534,12 +567,26 @@ int p2m_init(struct domain *d)
 
     p2m->first_level = NULL;
 
+    p2m->max_mapped_gfn = 0;
+    p2m->next_gfn_to_relinquish = ULONG_MAX;
+
 err:
     spin_unlock(&p2m->lock);
 
     return rc;
 }
 
+int relinquish_p2m_mapping(struct domain *d)
+{
+    struct p2m_domain *p2m = &d->arch.p2m;
+
+    return create_p2m_entries(d, RELINQUISH,
+                              pfn_to_paddr(p2m->next_gfn_to_relinquish),
+                              pfn_to_paddr(p2m->max_mapped_gfn),
+                              pfn_to_paddr(INVALID_MFN),
+                              MATTR_MEM, p2m_invalid);
+}
+
 unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
 {
     paddr_t p = p2m_lookup(d, pfn_to_paddr(gpfn), NULL);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 53c9895..28d39a0 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -112,6 +112,7 @@ struct arch_domain
         RELMEM_not_started,
         RELMEM_xen,
         RELMEM_page,
+        RELMEM_mapping,
         RELMEM_done,
     } relmem;
 
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 5ccfa7f..8b7b6d0 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -18,6 +18,15 @@ struct p2m_domain {
 
     /* Current VMID in use */
     uint8_t vmid;
+
+    /* Highest guest frame that's ever been mapped in the p2m
+     * Only takes into account ram and foreign mapping
+     */
+    unsigned long max_mapped_gfn;
+
+    /* When releasing mapped gfn's in a preemptible manner, recall where
+     * to resume the search */
+    unsigned long next_gfn_to_relinquish;
 };
 
 /* List of possible type for each page in the p2m entry.
@@ -48,6 +57,12 @@ int p2m_init(struct domain *d);
 /* Return all the p2m resources to Xen. */
 void p2m_teardown(struct domain *d);
 
+/* Remove mapping refcount on each mapping page in the p2m
+ *
+ * TODO: For the moment only foreign mappings are handled
+ */
+int relinquish_p2m_mapping(struct domain *d);
+
 /* Allocate a new p2m table for a domain.
  *
  * Returns 0 for success or -errno.
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:12:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:12: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 1Vu3ct-0002a5-S3; Fri, 20 Dec 2013 17:12: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 1Vu3cs-0002Zg-3Z
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:38 +0000
Received: from [85.158.143.35:50187] by server-3.bemta-4.messagelabs.com id
	45/0A-32360-58A74B25; Fri, 20 Dec 2013 17:12:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1387559555!7331335!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18325 invoked from network); 20 Dec 2013 17:12:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:12: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 1Vu3cp-00054e-N5
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cp-0005nK-LZ
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:35 +0000
Date: Fri, 20 Dec 2013 17:12:35 +0000
Message-Id: <E1Vu3cp-0005nK-LZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Set foreign page type to
	p2m_map_foreign
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e3079c48187aa6d04686ddb51afa10234cdbcf0
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:57 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:55 2013 +0000

    xen/arm: Set foreign page type to p2m_map_foreign
    
    Xen needs to know that the current page belongs to another domain. Also take
    a reference to this page.
    
    The current process to add a foreign page is:
       1) get the page from the foreign p2m
       2) take a reference on the page with the foreign domain in parameters
       3) add the page to the current domain p2m
    
    If the foreign domain drops the page:
        - before 2), get_page will return NULL because the page doesn't
        belong anymore to the domain
        - after 2), the current domain already have a reference. Write will
        occur to an old page which is not yet released. It can corrupt the foreign
        domain.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c         |   38 ++++++++++++++++++++++++++++++--------
 xen/include/asm-arm/p2m.h |    1 +
 2 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index c351b1f..8250e65 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -977,6 +977,7 @@ static int xenmem_add_to_physmap_one(
 {
     unsigned long mfn = 0;
     int rc;
+    p2m_type_t t;
 
     switch ( space )
     {
@@ -1009,22 +1010,33 @@ static int xenmem_add_to_physmap_one(
         
         d->arch.grant_table_gpfn[idx] = gpfn;
 
+        t = p2m_ram_rw;
+
         spin_unlock(&d->grant_table->lock);
         break;
     case XENMAPSPACE_shared_info:
-        if ( idx == 0 )
-            mfn = virt_to_mfn(d->shared_info);
-        else
+        if ( idx != 0 )
             return -EINVAL;
+
+        mfn = virt_to_mfn(d->shared_info);
+        t = p2m_ram_rw;
+
         break;
     case XENMAPSPACE_gmfn_foreign:
     {
-        paddr_t maddr;
         struct domain *od;
+        struct page_info *page;
+        p2m_type_t p2mt;
         od = rcu_lock_domain_by_any_id(foreign_domid);
         if ( od == NULL )
             return -ESRCH;
 
+        if ( od == d )
+        {
+            rcu_unlock_domain(od);
+            return -EINVAL;
+        }
+
         rc = xsm_map_gmfn_foreign(XSM_TARGET, d, od);
         if ( rc )
         {
@@ -1032,15 +1044,25 @@ static int xenmem_add_to_physmap_one(
             return rc;
         }
 
-        maddr = p2m_lookup(od, pfn_to_paddr(idx), NULL);
-        if ( maddr == INVALID_PADDR )
+        /* Take reference to the foreign domain page.
+         * Reference will be released in XENMEM_remove_from_physmap */
+        page = get_page_from_gfn(od, idx, &p2mt, P2M_ALLOC);
+        if ( !page )
         {
             dump_p2m_lookup(od, pfn_to_paddr(idx));
             rcu_unlock_domain(od);
             return -EINVAL;
         }
 
-        mfn = maddr >> PAGE_SHIFT;
+        if ( !p2m_is_ram(p2mt) )
+        {
+            put_page(page);
+            rcu_unlock_domain(od);
+            return -EINVAL;
+        }
+
+        mfn = page_to_mfn(page);
+        t = p2m_map_foreign;
 
         rcu_unlock_domain(od);
         break;
@@ -1051,7 +1073,7 @@ static int xenmem_add_to_physmap_one(
     }
 
     /* Map at new location. */
-    rc = guest_physmap_add_page(d, gpfn, mfn, 0);
+    rc = guest_physmap_add_entry(d, gpfn, mfn, 0, t);
 
     return rc;
 }
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 8b7b6d0..53b3266 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -47,6 +47,7 @@ typedef enum {
 } p2m_type_t;
 
 #define p2m_is_foreign(_t)  ((_t) == p2m_map_foreign)
+#define p2m_is_ram(_t)      ((_t) == p2m_ram_rw || (_t) == p2m_ram_ro)
 
 /* Initialise vmid allocator */
 void p2m_vmid_allocator_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 Fri Dec 20 17:12:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:12: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 1Vu3ct-0002a5-S3; Fri, 20 Dec 2013 17:12: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 1Vu3cs-0002Zg-3Z
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:38 +0000
Received: from [85.158.143.35:50187] by server-3.bemta-4.messagelabs.com id
	45/0A-32360-58A74B25; Fri, 20 Dec 2013 17:12:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1387559555!7331335!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18325 invoked from network); 20 Dec 2013 17:12:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:12: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 1Vu3cp-00054e-N5
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cp-0005nK-LZ
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:35 +0000
Date: Fri, 20 Dec 2013 17:12:35 +0000
Message-Id: <E1Vu3cp-0005nK-LZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Set foreign page type to
	p2m_map_foreign
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8e3079c48187aa6d04686ddb51afa10234cdbcf0
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:57 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:55 2013 +0000

    xen/arm: Set foreign page type to p2m_map_foreign
    
    Xen needs to know that the current page belongs to another domain. Also take
    a reference to this page.
    
    The current process to add a foreign page is:
       1) get the page from the foreign p2m
       2) take a reference on the page with the foreign domain in parameters
       3) add the page to the current domain p2m
    
    If the foreign domain drops the page:
        - before 2), get_page will return NULL because the page doesn't
        belong anymore to the domain
        - after 2), the current domain already have a reference. Write will
        occur to an old page which is not yet released. It can corrupt the foreign
        domain.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c         |   38 ++++++++++++++++++++++++++++++--------
 xen/include/asm-arm/p2m.h |    1 +
 2 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index c351b1f..8250e65 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -977,6 +977,7 @@ static int xenmem_add_to_physmap_one(
 {
     unsigned long mfn = 0;
     int rc;
+    p2m_type_t t;
 
     switch ( space )
     {
@@ -1009,22 +1010,33 @@ static int xenmem_add_to_physmap_one(
         
         d->arch.grant_table_gpfn[idx] = gpfn;
 
+        t = p2m_ram_rw;
+
         spin_unlock(&d->grant_table->lock);
         break;
     case XENMAPSPACE_shared_info:
-        if ( idx == 0 )
-            mfn = virt_to_mfn(d->shared_info);
-        else
+        if ( idx != 0 )
             return -EINVAL;
+
+        mfn = virt_to_mfn(d->shared_info);
+        t = p2m_ram_rw;
+
         break;
     case XENMAPSPACE_gmfn_foreign:
     {
-        paddr_t maddr;
         struct domain *od;
+        struct page_info *page;
+        p2m_type_t p2mt;
         od = rcu_lock_domain_by_any_id(foreign_domid);
         if ( od == NULL )
             return -ESRCH;
 
+        if ( od == d )
+        {
+            rcu_unlock_domain(od);
+            return -EINVAL;
+        }
+
         rc = xsm_map_gmfn_foreign(XSM_TARGET, d, od);
         if ( rc )
         {
@@ -1032,15 +1044,25 @@ static int xenmem_add_to_physmap_one(
             return rc;
         }
 
-        maddr = p2m_lookup(od, pfn_to_paddr(idx), NULL);
-        if ( maddr == INVALID_PADDR )
+        /* Take reference to the foreign domain page.
+         * Reference will be released in XENMEM_remove_from_physmap */
+        page = get_page_from_gfn(od, idx, &p2mt, P2M_ALLOC);
+        if ( !page )
         {
             dump_p2m_lookup(od, pfn_to_paddr(idx));
             rcu_unlock_domain(od);
             return -EINVAL;
         }
 
-        mfn = maddr >> PAGE_SHIFT;
+        if ( !p2m_is_ram(p2mt) )
+        {
+            put_page(page);
+            rcu_unlock_domain(od);
+            return -EINVAL;
+        }
+
+        mfn = page_to_mfn(page);
+        t = p2m_map_foreign;
 
         rcu_unlock_domain(od);
         break;
@@ -1051,7 +1073,7 @@ static int xenmem_add_to_physmap_one(
     }
 
     /* Map at new location. */
-    rc = guest_physmap_add_page(d, gpfn, mfn, 0);
+    rc = guest_physmap_add_entry(d, gpfn, mfn, 0, t);
 
     return rc;
 }
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 8b7b6d0..53b3266 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -47,6 +47,7 @@ typedef enum {
 } p2m_type_t;
 
 #define p2m_is_foreign(_t)  ((_t) == p2m_map_foreign)
+#define p2m_is_ram(_t)      ((_t) == p2m_ram_rw || (_t) == p2m_ram_ro)
 
 /* Initialise vmid allocator */
 void p2m_vmid_allocator_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 Fri Dec 20 17:12:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:12: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 1Vu3d3-0002bz-Uo; Fri, 20 Dec 2013 17:12:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3d2-0002bg-F5
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:48 +0000
Received: from [85.158.137.68:5264] by server-12.bemta-3.messagelabs.com id
	97/7D-20055-F8A74B25; Fri, 20 Dec 2013 17:12:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1387559566!5352693!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31706 invoked from network); 20 Dec 2013 17:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:12: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 1Vu3cz-00054k-SO
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cz-0005ng-QS
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:45 +0000
Date: Fri, 20 Dec 2013 17:12:45 +0000
Message-Id: <E1Vu3cz-0005ng-QS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: grant-table: Support
	read-only mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9383b2cc52629d77879952fda712463871ea2fe7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:58 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:55 2013 +0000

    xen/arm: grant-table: Support read-only mapping
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 8250e65..3d0b854 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1306,19 +1306,17 @@ int create_grant_host_mapping(unsigned long addr, unsigned long frame,
                               unsigned int flags, unsigned int cache_flags)
 {
     int rc;
+    p2m_type_t t = p2m_grant_map_rw;
 
     if ( cache_flags  || (flags & ~GNTMAP_readonly) != GNTMAP_host_map )
         return GNTST_general_error;
 
-    /* XXX: read only mappings */
     if ( flags & GNTMAP_readonly )
-    {
-        gdprintk(XENLOG_WARNING, "read only mappings not implemented yet\n");
-        return GNTST_general_error;
-    }
+        t = p2m_grant_map_ro;
+
+    rc = guest_physmap_add_entry(current->domain, addr >> PAGE_SHIFT,
+                                 frame, 0, t);
 
-    rc = guest_physmap_add_page(current->domain,
-                                 addr >> PAGE_SHIFT, frame, 0);
     if ( rc )
         return GNTST_general_error;
     else
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:12:49 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:12: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 1Vu3d3-0002bz-Uo; Fri, 20 Dec 2013 17:12:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3d2-0002bg-F5
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:48 +0000
Received: from [85.158.137.68:5264] by server-12.bemta-3.messagelabs.com id
	97/7D-20055-F8A74B25; Fri, 20 Dec 2013 17:12:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1387559566!5352693!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31706 invoked from network); 20 Dec 2013 17:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:12: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 1Vu3cz-00054k-SO
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3cz-0005ng-QS
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:45 +0000
Date: Fri, 20 Dec 2013 17:12:45 +0000
Message-Id: <E1Vu3cz-0005ng-QS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: grant-table: Support
	read-only mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9383b2cc52629d77879952fda712463871ea2fe7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Dec 17 16:27:58 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:32:55 2013 +0000

    xen/arm: grant-table: Support read-only mapping
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 8250e65..3d0b854 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1306,19 +1306,17 @@ int create_grant_host_mapping(unsigned long addr, unsigned long frame,
                               unsigned int flags, unsigned int cache_flags)
 {
     int rc;
+    p2m_type_t t = p2m_grant_map_rw;
 
     if ( cache_flags  || (flags & ~GNTMAP_readonly) != GNTMAP_host_map )
         return GNTST_general_error;
 
-    /* XXX: read only mappings */
     if ( flags & GNTMAP_readonly )
-    {
-        gdprintk(XENLOG_WARNING, "read only mappings not implemented yet\n");
-        return GNTST_general_error;
-    }
+        t = p2m_grant_map_ro;
+
+    rc = guest_physmap_add_entry(current->domain, addr >> PAGE_SHIFT,
+                                 frame, 0, t);
 
-    rc = guest_physmap_add_page(current->domain,
-                                 addr >> PAGE_SHIFT, frame, 0);
     if ( rc )
         return GNTST_general_error;
     else
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:13:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3dF-0002e9-3r; Fri, 20 Dec 2013 17:13:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dC-0002dk-UX
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:59 +0000
Received: from [85.158.137.68:55038] by server-7.bemta-3.messagelabs.com id
	EB/73-27599-A9A74B25; Fri, 20 Dec 2013 17:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1387559576!4185075!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20555 invoked from network); 20 Dec 2013 17:12:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:12: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 1Vu3dA-00054w-8D
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dA-0005o7-6S
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:56 +0000
Date: Fri, 20 Dec 2013 17:12:56 +0000
Message-Id: <E1Vu3dA-0005o7-6S@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 ea5647f2abad4f6b2149933cdebe6d4f7db0094d
Merge: 9383b2cc52629d77879952fda712463871ea2fe7 29cc51db84a9c15875836121c5c60cc5eb6b613e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 18 14:37:01 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:37:01 2013 +0000

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 .gitignore |    1 +
 .hgignore  |    1 +
 2 files changed, 2 insertions(+), 0 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 Dec 20 17:13:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3dF-0002e9-3r; Fri, 20 Dec 2013 17:13:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dC-0002dk-UX
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:59 +0000
Received: from [85.158.137.68:55038] by server-7.bemta-3.messagelabs.com id
	EB/73-27599-A9A74B25; Fri, 20 Dec 2013 17:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1387559576!4185075!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20555 invoked from network); 20 Dec 2013 17:12:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:12: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 1Vu3dA-00054w-8D
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dA-0005o7-6S
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:12:56 +0000
Date: Fri, 20 Dec 2013 17:12:56 +0000
Message-Id: <E1Vu3dA-0005o7-6S@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 ea5647f2abad4f6b2149933cdebe6d4f7db0094d
Merge: 9383b2cc52629d77879952fda712463871ea2fe7 29cc51db84a9c15875836121c5c60cc5eb6b613e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Dec 18 14:37:01 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 14:37:01 2013 +0000

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 .gitignore |    1 +
 .hgignore  |    1 +
 2 files changed, 2 insertions(+), 0 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 Dec 20 17:13:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3dO-0002fK-7v; Fri, 20 Dec 2013 17:13: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 1Vu3dN-0002f6-C4
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:09 +0000
Received: from [85.158.139.211:59731] by server-15.bemta-5.messagelabs.com id
	C0/46-08490-4AA74B25; Fri, 20 Dec 2013 17:13:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1387559587!5925131!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11553 invoked from network); 20 Dec 2013 17:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:13: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 1Vu3dK-00055V-PI
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dK-0005of-Ax
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:06 +0000
Date: Fri, 20 Dec 2013 17:13:06 +0000
Message-Id: <E1Vu3dK-0005of-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: p2m: Fix hypercall preemption
	when domain is relinquish memory mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3d929ba0cd0e84548f6d35fa77da08663ba4b0d0
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Dec 18 16:54:08 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 16:56:57 2013 +0000

    xen/arm: p2m: Fix hypercall preemption when domain is relinquish memory mapping
    
    The commit 84f29a9 "xen/arm: Add relinquish_p2m_mapping to remove reference on
    every mapped page" doesn't save correctly the next gfn when the hypercall
    is preempted.
    
    Instead of storing the next gfn, it store the next mfn. Fix it by using
    'addr' instead of 'maddr'.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 3f4ab37..d24a6fc 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -366,7 +366,7 @@ static int create_p2m_entries(struct domain *d,
         {
             if ( hypercall_preempt_check() )
             {
-                p2m->next_gfn_to_relinquish = maddr >> PAGE_SHIFT;
+                p2m->next_gfn_to_relinquish = addr >> PAGE_SHIFT;
                 rc = -EAGAIN;
                 goto 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 Dec 20 17:13:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3dO-0002fK-7v; Fri, 20 Dec 2013 17:13: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 1Vu3dN-0002f6-C4
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:09 +0000
Received: from [85.158.139.211:59731] by server-15.bemta-5.messagelabs.com id
	C0/46-08490-4AA74B25; Fri, 20 Dec 2013 17:13:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1387559587!5925131!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11553 invoked from network); 20 Dec 2013 17:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:13: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 1Vu3dK-00055V-PI
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dK-0005of-Ax
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:06 +0000
Date: Fri, 20 Dec 2013 17:13:06 +0000
Message-Id: <E1Vu3dK-0005of-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: p2m: Fix hypercall preemption
	when domain is relinquish memory mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3d929ba0cd0e84548f6d35fa77da08663ba4b0d0
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Dec 18 16:54:08 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Dec 18 16:56:57 2013 +0000

    xen/arm: p2m: Fix hypercall preemption when domain is relinquish memory mapping
    
    The commit 84f29a9 "xen/arm: Add relinquish_p2m_mapping to remove reference on
    every mapped page" doesn't save correctly the next gfn when the hypercall
    is preempted.
    
    Instead of storing the next gfn, it store the next mfn. Fix it by using
    'addr' instead of 'maddr'.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 3f4ab37..d24a6fc 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -366,7 +366,7 @@ static int create_p2m_entries(struct domain *d,
         {
             if ( hypercall_preempt_check() )
             {
-                p2m->next_gfn_to_relinquish = maddr >> PAGE_SHIFT;
+                p2m->next_gfn_to_relinquish = addr >> PAGE_SHIFT;
                 rc = -EAGAIN;
                 goto 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 Dec 20 17:13:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3dY-0002hM-BA; Fri, 20 Dec 2013 17:13: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 1Vu3dX-0002h1-GG
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:19 +0000
Received: from [85.158.143.35:56912] by server-3.bemta-4.messagelabs.com id
	ED/2B-32360-EAA74B25; Fri, 20 Dec 2013 17:13:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1387559597!7370461!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3565 invoked from network); 20 Dec 2013 17:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:13: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 1Vu3dV-00055b-28
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dU-0005pv-S9
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:17 +0000
Date: Fri, 20 Dec 2013 17:13:16 +0000
Message-Id: <E1Vu3dU-0005pv-S9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: further clarify the
	requirement for cached mappings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41fbf77bc87c79ae0b7dab2c47b8864c5dd34fb3
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Dec 19 10:08:39 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 19 11:28:33 2013 +0000

    xen: arm: further clarify the requirement for cached mappings
    
    We need to include all shared memory, including grant table mappings etc
    in this statement.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/public/arch-arm.h |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index ef6217d..2e7fb3e 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -59,10 +59,17 @@
  * used regardless of guest type. Structures which are passed as
  * hypercall arguments are always little endian.
  *
- * All hypercall arguments passed via a pointer to guest memory must
- * reside in memory which is mapped as Normal Inner-cacheable. Any
- * Inner cache allocation strategy (Write-Back, Write-Through etc) is
- * acceptable. There is no restriction on the Outer-cacheability.
+ * All memory which is shared with other entities in the system
+ * (including the hypervisor and other guests) must reside in memory
+ * which is mapped as Normal Inner-cacheable. This applies to:
+ *  - hypercall arguments passed via a pointer to guest memory.
+ *  - memory shared via the grant table mechanism (including PV I/O
+ *    rings etc).
+ *  - memory shared with the hypervisor (struct shared_info, struct
+ *    vcpu_info, the grant table, etc).
+ *
+ * Any Inner cache allocation strategy (Write-Back, Write-Through etc)
+ * is acceptable. There is no restriction on the Outer-cacheability.
  */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:13:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3dY-0002hM-BA; Fri, 20 Dec 2013 17:13: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 1Vu3dX-0002h1-GG
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:19 +0000
Received: from [85.158.143.35:56912] by server-3.bemta-4.messagelabs.com id
	ED/2B-32360-EAA74B25; Fri, 20 Dec 2013 17:13:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1387559597!7370461!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3565 invoked from network); 20 Dec 2013 17:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:13: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 1Vu3dV-00055b-28
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dU-0005pv-S9
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:17 +0000
Date: Fri, 20 Dec 2013 17:13:16 +0000
Message-Id: <E1Vu3dU-0005pv-S9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: further clarify the
	requirement for cached mappings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41fbf77bc87c79ae0b7dab2c47b8864c5dd34fb3
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Dec 19 10:08:39 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Dec 19 11:28:33 2013 +0000

    xen: arm: further clarify the requirement for cached mappings
    
    We need to include all shared memory, including grant table mappings etc
    in this statement.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/public/arch-arm.h |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index ef6217d..2e7fb3e 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -59,10 +59,17 @@
  * used regardless of guest type. Structures which are passed as
  * hypercall arguments are always little endian.
  *
- * All hypercall arguments passed via a pointer to guest memory must
- * reside in memory which is mapped as Normal Inner-cacheable. Any
- * Inner cache allocation strategy (Write-Back, Write-Through etc) is
- * acceptable. There is no restriction on the Outer-cacheability.
+ * All memory which is shared with other entities in the system
+ * (including the hypervisor and other guests) must reside in memory
+ * which is mapped as Normal Inner-cacheable. This applies to:
+ *  - hypercall arguments passed via a pointer to guest memory.
+ *  - memory shared via the grant table mechanism (including PV I/O
+ *    rings etc).
+ *  - memory shared with the hypervisor (struct shared_info, struct
+ *    vcpu_info, the grant table, etc).
+ *
+ * Any Inner cache allocation strategy (Write-Back, Write-Through etc)
+ * is acceptable. There is no restriction on the Outer-cacheability.
  */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 20 17:13:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3di-0002j8-E7; Fri, 20 Dec 2013 17:13: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 1Vu3dh-0002iw-Kt
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:29 +0000
Received: from [193.109.254.147:53220] by server-9.bemta-14.messagelabs.com id
	66/47-13957-8BA74B25; Fri, 20 Dec 2013 17:13:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1387559607!4485885!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5996 invoked from network); 20 Dec 2013 17:13:28 -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;
	20 Dec 2013 17:13: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 1Vu3df-00055l-7k
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3df-0005qH-4q
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:27 +0000
Date: Fri, 20 Dec 2013 17:13:27 +0000
Message-Id: <E1Vu3df-0005qH-4q@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 aeba23d8f176c4395d8da63e208ade90523f58c7
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Dec 19 15:33:17 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 15:33:17 2013 +0000

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 2007b22..84c558b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 96b58a44756a8821c108358439b0f2c06e531159
-# Wed Dec 4 15:16:18 2013 +1300
-# xen_disk: fix memory leak
+QEMU_TAG ?= 7f5b3c338e0f8938ba575dec18255dcbee0c2ee2
+# Wed Dec 18 15:25:14 2013 +0000
+# qemu-traditional: Fix build warnings on Wheezy
 
 # 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 Fri Dec 20 17:13:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3di-0002j8-E7; Fri, 20 Dec 2013 17:13: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 1Vu3dh-0002iw-Kt
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:29 +0000
Received: from [193.109.254.147:53220] by server-9.bemta-14.messagelabs.com id
	66/47-13957-8BA74B25; Fri, 20 Dec 2013 17:13:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1387559607!4485885!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5996 invoked from network); 20 Dec 2013 17:13:28 -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;
	20 Dec 2013 17:13: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 1Vu3df-00055l-7k
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3df-0005qH-4q
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:27 +0000
Date: Fri, 20 Dec 2013 17:13:27 +0000
Message-Id: <E1Vu3df-0005qH-4q@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 aeba23d8f176c4395d8da63e208ade90523f58c7
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Dec 19 15:33:17 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 15:33:17 2013 +0000

    QEMU_TAG update
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 2007b22..84c558b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -246,9 +246,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 96b58a44756a8821c108358439b0f2c06e531159
-# Wed Dec 4 15:16:18 2013 +1300
-# xen_disk: fix memory leak
+QEMU_TAG ?= 7f5b3c338e0f8938ba575dec18255dcbee0c2ee2
+# Wed Dec 18 15:25:14 2013 +0000
+# qemu-traditional: Fix build warnings on Wheezy
 
 # 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 Fri Dec 20 17:13:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3ds-0002l8-Go; Fri, 20 Dec 2013 17:13: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 1Vu3dr-0002kv-Mb
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:39 +0000
Received: from [85.158.143.35:17034] by server-2.bemta-4.messagelabs.com id
	14/69-11386-2CA74B25; Fri, 20 Dec 2013 17:13:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1387559617!7424766!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2870 invoked from network); 20 Dec 2013 17:13:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:13: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 1Vu3dp-00055t-CY
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dp-0005qi-Af
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:37 +0000
Date: Fri, 20 Dec 2013 17:13:37 +0000
Message-Id: <E1Vu3dp-0005qi-Af@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'master' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 301fc1499819a4a5e9f5a809271388bec1566872
Merge: aeba23d8f176c4395d8da63e208ade90523f58c7 d84a6e2fa077d07f91ac72c3d8334b75b45fcba2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Dec 19 16:34:56 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 16:34:56 2013 +0000

    Merge branch 'master' into staging

 Config.mk |    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 Fri Dec 20 17:13:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3ds-0002l8-Go; Fri, 20 Dec 2013 17:13: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 1Vu3dr-0002kv-Mb
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:39 +0000
Received: from [85.158.143.35:17034] by server-2.bemta-4.messagelabs.com id
	14/69-11386-2CA74B25; Fri, 20 Dec 2013 17:13:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1387559617!7424766!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2870 invoked from network); 20 Dec 2013 17:13:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:13: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 1Vu3dp-00055t-CY
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dp-0005qi-Af
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:37 +0000
Date: Fri, 20 Dec 2013 17:13:37 +0000
Message-Id: <E1Vu3dp-0005qi-Af@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'master' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 301fc1499819a4a5e9f5a809271388bec1566872
Merge: aeba23d8f176c4395d8da63e208ade90523f58c7 d84a6e2fa077d07f91ac72c3d8334b75b45fcba2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Dec 19 16:34:56 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 16:34:56 2013 +0000

    Merge branch 'master' into staging

 Config.mk |    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 Fri Dec 20 17:13:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3e4-0002mt-Jw; Fri, 20 Dec 2013 17:13: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 1Vu3e2-0002mb-IF
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:52 +0000
Received: from [85.158.137.68:2661] by server-5.bemta-3.messagelabs.com id
	35/E7-25188-DCA74B25; Fri, 20 Dec 2013 17:13:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1387559627!5296720!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26335 invoked from network); 20 Dec 2013 17:13:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:13: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 1Vu3dz-00055z-H0
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dz-0005r4-Fe
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:47 +0000
Date: Fri, 20 Dec 2013 17:13:47 +0000
Message-Id: <E1Vu3dz-0005r4-Fe@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libx: xl uptime doesn't require
	argument
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3533972f6d423e71533ffbce5cb9d84bd1a9a674
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Dec 19 16:45:03 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 17:11:52 2013 +0000

    tools/libx: xl uptime doesn't require argument
    
    The current behavior is:
    
    42sh> xl uptime
    'xl uptime' requires at least 1 argument.
    
    Usage: xl [-v] uptime [-s] [Domain]
    
    The normal behavior should list uptime for each domain when there is no
    parameters.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 078f7a7..dce2699 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -6285,7 +6285,7 @@ int main_uptime(int argc, char **argv)
     int nb_doms = 0;
     int opt;
 
-    SWITCH_FOREACH_OPT(opt, "s", NULL, "uptime", 1) {
+    SWITCH_FOREACH_OPT(opt, "s", NULL, "uptime", 0) {
     case 's':
         short_mode = 1;
         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 Dec 20 17:13:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:13: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 1Vu3e4-0002mt-Jw; Fri, 20 Dec 2013 17:13: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 1Vu3e2-0002mb-IF
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:52 +0000
Received: from [85.158.137.68:2661] by server-5.bemta-3.messagelabs.com id
	35/E7-25188-DCA74B25; Fri, 20 Dec 2013 17:13:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1387559627!5296720!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26335 invoked from network); 20 Dec 2013 17:13:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2013 17:13: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 1Vu3dz-00055z-H0
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3dz-0005r4-Fe
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:47 +0000
Date: Fri, 20 Dec 2013 17:13:47 +0000
Message-Id: <E1Vu3dz-0005r4-Fe@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libx: xl uptime doesn't require
	argument
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3533972f6d423e71533ffbce5cb9d84bd1a9a674
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Dec 19 16:45:03 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 17:11:52 2013 +0000

    tools/libx: xl uptime doesn't require argument
    
    The current behavior is:
    
    42sh> xl uptime
    'xl uptime' requires at least 1 argument.
    
    Usage: xl [-v] uptime [-s] [Domain]
    
    The normal behavior should list uptime for each domain when there is no
    parameters.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 078f7a7..dce2699 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -6285,7 +6285,7 @@ int main_uptime(int argc, char **argv)
     int nb_doms = 0;
     int opt;
 
-    SWITCH_FOREACH_OPT(opt, "s", NULL, "uptime", 1) {
+    SWITCH_FOREACH_OPT(opt, "s", NULL, "uptime", 0) {
     case 's':
         short_mode = 1;
         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 Dec 20 17:14:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:14: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 1Vu3eE-0002oV-W9; Fri, 20 Dec 2013 17:14: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 1Vu3eC-0002oF-9U
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:14:00 +0000
Received: from [85.158.139.211:25490] by server-4.bemta-5.messagelabs.com id
	E6/62-26791-7DA74B25; Fri, 20 Dec 2013 17:13:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1387559637!5929061!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5173 invoked from network); 20 Dec 2013 17:13:58 -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;
	20 Dec 2013 17:13: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 1Vu3e9-000568-MM
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3e9-0005rQ-K6
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:57 +0000
Date: Fri, 20 Dec 2013 17:13:57 +0000
Message-Id: <E1Vu3e9-0005rQ-K6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: sanity check incoming
	message body lengths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8da1ed9031341381c218b7e6eaab5b4f239a327b
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sat Nov 30 13:20:04 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 17:16:33 2013 +0000

    xenstore: sanity check incoming message body lengths
    
    This is for the client-side receiving messages from xenstored, so there
    is no security impact, unlike XSA-72.
    
    Coverity-ID: 1055449
    Coverity-ID: 1056028
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xs.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index f1f1b9d..a636498 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -1146,6 +1146,12 @@ static int read_message(struct xs_handle *h, int nonblocking)
 		goto error_freemsg;
 	}
 
+	/* Sanity check message body length. */
+	if (msg->hdr.len > XENSTORE_PAYLOAD_MAX) {
+		saved_errno = E2BIG;
+		goto error_freemsg;
+	}
+
 	/* Allocate and read the message body. */
 	body = msg->body = malloc(msg->hdr.len + 1);
 	if (body == 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 Dec 20 17:14:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Dec 2013 17:14: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 1Vu3eE-0002oV-W9; Fri, 20 Dec 2013 17:14: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 1Vu3eC-0002oF-9U
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:14:00 +0000
Received: from [85.158.139.211:25490] by server-4.bemta-5.messagelabs.com id
	E6/62-26791-7DA74B25; Fri, 20 Dec 2013 17:13:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1387559637!5929061!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5173 invoked from network); 20 Dec 2013 17:13:58 -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;
	20 Dec 2013 17:13: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 1Vu3e9-000568-MM
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Vu3e9-0005rQ-K6
	for xen-changelog@lists.xensource.com; Fri, 20 Dec 2013 17:13:57 +0000
Date: Fri, 20 Dec 2013 17:13:57 +0000
Message-Id: <E1Vu3e9-0005rQ-K6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstore: sanity check incoming
	message body lengths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8da1ed9031341381c218b7e6eaab5b4f239a327b
Author:     Matthew Daley <mattd@bugfuzz.com>
AuthorDate: Sat Nov 30 13:20:04 2013 +1300
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Dec 19 17:16:33 2013 +0000

    xenstore: sanity check incoming message body lengths
    
    This is for the client-side receiving messages from xenstored, so there
    is no security impact, unlike XSA-72.
    
    Coverity-ID: 1055449
    Coverity-ID: 1056028
    Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xenstore/xs.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index f1f1b9d..a636498 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -1146,6 +1146,12 @@ static int read_message(struct xs_handle *h, int nonblocking)
 		goto error_freemsg;
 	}
 
+	/* Sanity check message body length. */
+	if (msg->hdr.len > XENSTORE_PAYLOAD_MAX) {
+		saved_errno = E2BIG;
+		goto error_freemsg;
+	}
+
 	/* Allocate and read the message body. */
 	body = msg->body = malloc(msg->hdr.len + 1);
 	if (body == 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 Sat Dec 21 17:11:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17:11: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 1VuQ4x-000752-Cf; Sat, 21 Dec 2013 17:11: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 1VuQ4w-00074x-EK
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:06 +0000
Received: from [85.158.137.68:13868] by server-14.bemta-3.messagelabs.com id
	A0/15-06105-9ABC5B25; Sat, 21 Dec 2013 17:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1387645863!5455373!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27054 invoked from network); 21 Dec 2013 17:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2013 17:11: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 1VuQ4t-00038d-CE
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ4t-0002AP-8H
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:03 +0000
Date: Sat, 21 Dec 2013 17:11:03 +0000
Message-Id: <E1VuQ4t-0002AP-8H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: p2m: Don't create new table
	when the mapping is removed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8672aa8384d18690df62b2cff2627590e93b0359
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Dec 20 01:41:20 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 20 09:21:57 2013 +0000

    xen/arm: p2m: Don't create new table when the mapping is removed
    
    When  Xen is removing/relinquishing mapping, it will create second/third tables
    if they don't exist.
    
    Non-existent table means the address range was never mapped, so Xen can safely
    skip them.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index d24a6fc..11f4714 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -246,10 +246,12 @@ static int create_p2m_entries(struct domain *d,
                   cur_first_offset = ~0,
                   cur_second_offset = ~0;
     unsigned long count = 0;
+    bool_t populate = (op == INSERT || op == ALLOCATE);
 
     spin_lock(&p2m->lock);
 
-    for(addr = start_gpaddr; addr < end_gpaddr; addr += PAGE_SIZE)
+    addr = start_gpaddr;
+    while ( addr < end_gpaddr )
     {
         if ( cur_first_page != p2m_first_level_index(addr) )
         {
@@ -265,8 +267,15 @@ static int create_p2m_entries(struct domain *d,
 
         if ( !first[first_table_offset(addr)].p2m.valid )
         {
+            if ( !populate )
+            {
+                addr = (addr + FIRST_SIZE) & FIRST_MASK;
+                continue;
+            }
+
             rc = p2m_create_table(d, &first[first_table_offset(addr)]);
-            if ( rc < 0 ) {
+            if ( rc < 0 )
+            {
                 printk("p2m_populate_ram: L1 failed\n");
                 goto out;
             }
@@ -284,6 +293,12 @@ static int create_p2m_entries(struct domain *d,
 
         if ( !second[second_table_offset(addr)].p2m.valid )
         {
+            if ( !populate )
+            {
+                addr = (addr + SECOND_SIZE) & SECOND_MASK;
+                continue;
+            }
+
             rc = p2m_create_table(d, &second[second_table_offset(addr)]);
             if ( rc < 0 ) {
                 printk("p2m_populate_ram: L2 failed\n");
@@ -372,6 +387,9 @@ static int create_p2m_entries(struct domain *d,
             }
             count = 0;
         }
+
+        /* Got the next page */
+        addr += PAGE_SIZE;
     }
 
     if ( op == ALLOCATE || op == INSERT )
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 21 17:11:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17:11: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 1VuQ4x-000752-Cf; Sat, 21 Dec 2013 17:11: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 1VuQ4w-00074x-EK
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:06 +0000
Received: from [85.158.137.68:13868] by server-14.bemta-3.messagelabs.com id
	A0/15-06105-9ABC5B25; Sat, 21 Dec 2013 17:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1387645863!5455373!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27054 invoked from network); 21 Dec 2013 17:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2013 17:11: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 1VuQ4t-00038d-CE
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ4t-0002AP-8H
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:03 +0000
Date: Sat, 21 Dec 2013 17:11:03 +0000
Message-Id: <E1VuQ4t-0002AP-8H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: p2m: Don't create new table
	when the mapping is removed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8672aa8384d18690df62b2cff2627590e93b0359
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Dec 20 01:41:20 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 20 09:21:57 2013 +0000

    xen/arm: p2m: Don't create new table when the mapping is removed
    
    When  Xen is removing/relinquishing mapping, it will create second/third tables
    if they don't exist.
    
    Non-existent table means the address range was never mapped, so Xen can safely
    skip them.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index d24a6fc..11f4714 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -246,10 +246,12 @@ static int create_p2m_entries(struct domain *d,
                   cur_first_offset = ~0,
                   cur_second_offset = ~0;
     unsigned long count = 0;
+    bool_t populate = (op == INSERT || op == ALLOCATE);
 
     spin_lock(&p2m->lock);
 
-    for(addr = start_gpaddr; addr < end_gpaddr; addr += PAGE_SIZE)
+    addr = start_gpaddr;
+    while ( addr < end_gpaddr )
     {
         if ( cur_first_page != p2m_first_level_index(addr) )
         {
@@ -265,8 +267,15 @@ static int create_p2m_entries(struct domain *d,
 
         if ( !first[first_table_offset(addr)].p2m.valid )
         {
+            if ( !populate )
+            {
+                addr = (addr + FIRST_SIZE) & FIRST_MASK;
+                continue;
+            }
+
             rc = p2m_create_table(d, &first[first_table_offset(addr)]);
-            if ( rc < 0 ) {
+            if ( rc < 0 )
+            {
                 printk("p2m_populate_ram: L1 failed\n");
                 goto out;
             }
@@ -284,6 +293,12 @@ static int create_p2m_entries(struct domain *d,
 
         if ( !second[second_table_offset(addr)].p2m.valid )
         {
+            if ( !populate )
+            {
+                addr = (addr + SECOND_SIZE) & SECOND_MASK;
+                continue;
+            }
+
             rc = p2m_create_table(d, &second[second_table_offset(addr)]);
             if ( rc < 0 ) {
                 printk("p2m_populate_ram: L2 failed\n");
@@ -372,6 +387,9 @@ static int create_p2m_entries(struct domain *d,
             }
             count = 0;
         }
+
+        /* Got the next page */
+        addr += PAGE_SIZE;
     }
 
     if ( op == ALLOCATE || op == INSERT )
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 21 17:11:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17: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 1VuQ57-00075f-FK; Sat, 21 Dec 2013 17:11:17 +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 1VuQ56-00075T-9t
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:16 +0000
Received: from [85.158.143.35:48094] by server-2.bemta-4.messagelabs.com id
	85/3E-11386-3BBC5B25; Sat, 21 Dec 2013 17:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1387645873!7512962!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30653 invoked from network); 21 Dec 2013 17:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2013 17:11: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 1VuQ53-00038g-Hs
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ53-0002Ap-FW
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:13 +0000
Date: Sat, 21 Dec 2013 17:11:13 +0000
Message-Id: <E1VuQ53-0002Ap-FW@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 54b671170057d63a8eb508ec81ffd83e6195b99b
Merge: 8672aa8384d18690df62b2cff2627590e93b0359 8da1ed9031341381c218b7e6eaab5b4f239a327b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Dec 20 09:53:14 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 20 09:53:14 2013 +0000

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 Config.mk                |    8 ++++----
 tools/libxl/xl_cmdimpl.c |    2 +-
 tools/xenstore/xs.c      |    6 ++++++
 3 files changed, 11 insertions(+), 5 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 Sat Dec 21 17:11:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17: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 1VuQ57-00075f-FK; Sat, 21 Dec 2013 17:11:17 +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 1VuQ56-00075T-9t
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:16 +0000
Received: from [85.158.143.35:48094] by server-2.bemta-4.messagelabs.com id
	85/3E-11386-3BBC5B25; Sat, 21 Dec 2013 17:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1387645873!7512962!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30653 invoked from network); 21 Dec 2013 17:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2013 17:11: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 1VuQ53-00038g-Hs
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ53-0002Ap-FW
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:13 +0000
Date: Sat, 21 Dec 2013 17:11:13 +0000
Message-Id: <E1VuQ53-0002Ap-FW@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 54b671170057d63a8eb508ec81ffd83e6195b99b
Merge: 8672aa8384d18690df62b2cff2627590e93b0359 8da1ed9031341381c218b7e6eaab5b4f239a327b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Dec 20 09:53:14 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Dec 20 09:53:14 2013 +0000

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 Config.mk                |    8 ++++----
 tools/libxl/xl_cmdimpl.c |    2 +-
 tools/xenstore/xs.c      |    6 ++++++
 3 files changed, 11 insertions(+), 5 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 Sat Dec 21 17:11:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17:11: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 1VuQ5J-00076f-IA; Sat, 21 Dec 2013 17: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 1VuQ5H-00076Y-QP
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:27 +0000
Received: from [85.158.137.68:14327] by server-16.bemta-3.messagelabs.com id
	C2/BC-26128-FBBC5B25; Sat, 21 Dec 2013 17:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1387645884!4311311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30470 invoked from network); 21 Dec 2013 17:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2013 17:11: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 1VuQ5D-00038p-OF
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5D-0002BB-LR
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:23 +0000
Date: Sat, 21 Dec 2013 17:11:23 +0000
Message-Id: <E1VuQ5D-0002BB-LR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Nested VMX: Setup the virtual NMI
	exiting 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 136058cc5ce4f1e630d5bac199304fdc9429faa3
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Fri Dec 20 11:57:14 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 20 11:57:14 2013 +0100

    Nested VMX: Setup the virtual NMI exiting info
    
    When inject a virtual nmi exit to L1, hypervisor need to set the
    virtual vmcs with right vaule which is missing in current Xen.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 0daad79..41db52b 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1293,6 +1293,12 @@ static void sync_exception_state(struct vcpu *v)
                     nvmx->intr.error_code);
         break;
     case X86_EVENTTYPE_NMI:
+        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_REASON,
+                    EXIT_REASON_EXCEPTION_NMI);
+        __set_vvmcs(nvcpu->nv_vvmcx, EXIT_QUALIFICATION, 0);
+        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_INTR_INFO,
+                    nvmx->intr.intr_info);
+        break;
     default:
         gdprintk(XENLOG_ERR, "Exception state %lx not handled\n",
                nvmx->intr.intr_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 Dec 21 17:11:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17:11: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 1VuQ5J-00076f-IA; Sat, 21 Dec 2013 17: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 1VuQ5H-00076Y-QP
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:27 +0000
Received: from [85.158.137.68:14327] by server-16.bemta-3.messagelabs.com id
	C2/BC-26128-FBBC5B25; Sat, 21 Dec 2013 17:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1387645884!4311311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_DONG
X-StarScan-Received: 
X-StarScan-Version: 6.9.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30470 invoked from network); 21 Dec 2013 17:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2013 17:11: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 1VuQ5D-00038p-OF
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5D-0002BB-LR
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:23 +0000
Date: Sat, 21 Dec 2013 17:11:23 +0000
Message-Id: <E1VuQ5D-0002BB-LR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Nested VMX: Setup the virtual NMI
	exiting 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 136058cc5ce4f1e630d5bac199304fdc9429faa3
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Fri Dec 20 11:57:14 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 20 11:57:14 2013 +0100

    Nested VMX: Setup the virtual NMI exiting info
    
    When inject a virtual nmi exit to L1, hypervisor need to set the
    virtual vmcs with right vaule which is missing in current Xen.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Eddie Dong <eddie.dong@intel.com>
---
 xen/arch/x86/hvm/vmx/vvmx.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 0daad79..41db52b 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1293,6 +1293,12 @@ static void sync_exception_state(struct vcpu *v)
                     nvmx->intr.error_code);
         break;
     case X86_EVENTTYPE_NMI:
+        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_REASON,
+                    EXIT_REASON_EXCEPTION_NMI);
+        __set_vvmcs(nvcpu->nv_vvmcx, EXIT_QUALIFICATION, 0);
+        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_INTR_INFO,
+                    nvmx->intr.intr_info);
+        break;
     default:
         gdprintk(XENLOG_ERR, "Exception state %lx not handled\n",
                nvmx->intr.intr_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 Dec 21 17:11:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17:11: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 1VuQ5S-00077q-Ks; Sat, 21 Dec 2013 17:11:38 +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 1VuQ5R-00077c-9o
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:37 +0000
Received: from [85.158.139.211:5887] by server-8.bemta-5.messagelabs.com id
	F1/F8-29838-8CBC5B25; Sat, 21 Dec 2013 17:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1387645894!4818800!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12321 invoked from network); 21 Dec 2013 17:11:35 -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;
	21 Dec 2013 17:11: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 1VuQ5N-00038x-TY
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5N-0002Bb-Rl
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:33 +0000
Date: Sat, 21 Dec 2013 17:11:33 +0000
Message-Id: <E1VuQ5N-0002Bb-Rl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] move XENMEM_add_to_physmap handling
	framework 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 4be86bb194e25e46b6cbee900601bfee76e8090a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 20 12:00:15 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 20 12:00:15 2013 +0100

    move XENMEM_add_to_physmap handling framework to common code
    
    There's really nothing really architecture specific here; the
    architecture specific handling is limited to
    xenmem_add_to_physmap_one().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c               |   33 +----------
 xen/arch/x86/mm.c               |  127 +++++++-------------------------------
 xen/arch/x86/x86_64/compat/mm.c |   28 ---------
 xen/common/compat/memory.c      |   20 ++++++
 xen/common/memory.c             |   85 ++++++++++++++++++++++++++
 xen/include/xen/mm.h            |    4 +
 6 files changed, 134 insertions(+), 163 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 3d0b854..86015c7 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -968,7 +968,7 @@ void share_xen_page_with_privileged_guests(
     share_xen_page_with_guest(page, dom_xen, readonly);
 }
 
-static int xenmem_add_to_physmap_one(
+int xenmem_add_to_physmap_one(
     struct domain *d,
     uint16_t space,
     domid_t foreign_domid,
@@ -1139,37 +1139,6 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     switch ( op )
     {
-    case XENMEM_add_to_physmap:
-    {
-        struct xen_add_to_physmap xatp;
-        struct domain *d;
-
-        if ( copy_from_guest(&xatp, arg, 1) )
-            return -EFAULT;
-
-        /* Foreign mapping is only supported by add_to_physmap_range */
-        if ( xatp.space == XENMAPSPACE_gmfn_foreign )
-            return -EINVAL;
-
-        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 )
-        {
-            rcu_unlock_domain(d);
-            return rc;
-        }
-
-        rc = xenmem_add_to_physmap_one(d, xatp.space, DOMID_INVALID,
-                                       xatp.idx, xatp.gpfn);
-
-        rcu_unlock_domain(d);
-
-        return rc;
-    }
-
     case XENMEM_add_to_physmap_range:
     {
         struct xen_add_to_physmap_range xatpr;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index dd42bde..32c0473 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4520,20 +4520,23 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
     return 0;
 }
 
-static int xenmem_add_to_physmap_once(
+int xenmem_add_to_physmap_one(
     struct domain *d,
-    const struct xen_add_to_physmap *xatp)
+    uint16_t space,
+    domid_t foreign_domid,
+    unsigned long idx,
+    xen_pfn_t gpfn)
 {
     struct page_info *page = NULL;
     unsigned long gfn = 0; /* gcc ... */
-    unsigned long prev_mfn, mfn = 0, gpfn, idx;
+    unsigned long prev_mfn, mfn = 0, old_gpfn;
     int rc;
     p2m_type_t p2mt;
 
-    switch ( xatp->space )
+    switch ( space )
     {
         case XENMAPSPACE_shared_info:
-            if ( xatp->idx == 0 )
+            if ( idx == 0 )
                 mfn = virt_to_mfn(d->shared_info);
             break;
         case XENMAPSPACE_grant_table:
@@ -4542,9 +4545,8 @@ static int xenmem_add_to_physmap_once(
             if ( d->grant_table->gt_version == 0 )
                 d->grant_table->gt_version = 1;
 
-            idx = xatp->idx;
             if ( d->grant_table->gt_version == 2 &&
-                 (xatp->idx & XENMAPIDX_grant_table_status) )
+                 (idx & XENMAPIDX_grant_table_status) )
             {
                 idx &= ~XENMAPIDX_grant_table_status;
                 if ( idx < nr_status_frames(d->grant_table) )
@@ -4566,9 +4568,9 @@ static int xenmem_add_to_physmap_once(
         case XENMAPSPACE_gmfn:
         {
             p2m_type_t p2mt;
-            gfn = xatp->idx;
 
-            idx = mfn_x(get_gfn_unshare(d, xatp->idx, &p2mt));
+            gfn = idx;
+            idx = mfn_x(get_gfn_unshare(d, idx, &p2mt));
             /* If the page is still shared, exit early */
             if ( p2m_is_shared(p2mt) )
             {
@@ -4589,41 +4591,38 @@ static int xenmem_add_to_physmap_once(
     {
         if ( page )
             put_page(page);
-        if ( xatp->space == XENMAPSPACE_gmfn ||
-             xatp->space == XENMAPSPACE_gmfn_range )
+        if ( space == XENMAPSPACE_gmfn || space == XENMAPSPACE_gmfn_range )
             put_gfn(d, gfn);
         return -EINVAL;
     }
 
     /* Remove previously mapped page if it was present. */
-    prev_mfn = mfn_x(get_gfn(d, xatp->gpfn, &p2mt));
+    prev_mfn = mfn_x(get_gfn(d, gpfn, &p2mt));
     if ( mfn_valid(prev_mfn) )
     {
         if ( is_xen_heap_mfn(prev_mfn) )
             /* Xen heap frames are simply unhooked from this phys slot. */
-            guest_physmap_remove_page(d, xatp->gpfn, prev_mfn, PAGE_ORDER_4K);
+            guest_physmap_remove_page(d, gpfn, prev_mfn, PAGE_ORDER_4K);
         else
             /* Normal domain memory is freed, to avoid leaking memory. */
-            guest_remove_page(d, xatp->gpfn);
+            guest_remove_page(d, gpfn);
     }
     /* In the XENMAPSPACE_gmfn case we still hold a ref on the old page. */
-    put_gfn(d, xatp->gpfn);
+    put_gfn(d, gpfn);
 
     /* Unmap from old location, if any. */
-    gpfn = get_gpfn_from_mfn(mfn);
-    ASSERT( gpfn != SHARED_M2P_ENTRY );
-    if ( xatp->space == XENMAPSPACE_gmfn ||
-         xatp->space == XENMAPSPACE_gmfn_range )
-        ASSERT( gpfn == gfn );
-    if ( gpfn != INVALID_M2P_ENTRY )
-        guest_physmap_remove_page(d, gpfn, mfn, PAGE_ORDER_4K);
+    old_gpfn = get_gpfn_from_mfn(mfn);
+    ASSERT( old_gpfn != SHARED_M2P_ENTRY );
+    if ( space == XENMAPSPACE_gmfn || space == XENMAPSPACE_gmfn_range )
+        ASSERT( old_gpfn == gfn );
+    if ( old_gpfn != INVALID_M2P_ENTRY )
+        guest_physmap_remove_page(d, old_gpfn, mfn, PAGE_ORDER_4K);
 
     /* Map at new location. */
-    rc = guest_physmap_add_page(d, xatp->gpfn, mfn, PAGE_ORDER_4K);
+    rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
     /* In the XENMAPSPACE_gmfn, we took a ref of the gfn at the top */
-    if ( xatp->space == XENMAPSPACE_gmfn ||
-         xatp->space == XENMAPSPACE_gmfn_range )
+    if ( space == XENMAPSPACE_gmfn || space == XENMAPSPACE_gmfn_range )
         put_gfn(d, gfn);
 
     if ( page )
@@ -4632,90 +4631,12 @@ static int xenmem_add_to_physmap_once(
     return rc;
 }
 
-static int xenmem_add_to_physmap(struct domain *d,
-                                 struct xen_add_to_physmap *xatp)
-{
-    struct xen_add_to_physmap start_xatp;
-    int rc = 0;
-
-    if ( xatp->space == XENMAPSPACE_gmfn_range )
-    {
-        if ( need_iommu(d) )
-            this_cpu(iommu_dont_flush_iotlb) = 1;
-
-        start_xatp = *xatp;
-        while ( xatp->size > 0 )
-        {
-            rc = xenmem_add_to_physmap_once(d, xatp);
-            if ( rc < 0 )
-                break;
-
-            xatp->idx++;
-            xatp->gpfn++;
-            xatp->size--;
-
-            /* Check for continuation if it's not the last interation */
-            if ( xatp->size > 0 && hypercall_preempt_check() )
-            {
-                rc = -EAGAIN;
-                break;
-            }
-        }
-
-        if ( need_iommu(d) )
-        {
-            this_cpu(iommu_dont_flush_iotlb) = 0;
-            iommu_iotlb_flush(d, start_xatp.idx, start_xatp.size - xatp->size);
-            iommu_iotlb_flush(d, start_xatp.gpfn, start_xatp.size - xatp->size);
-        }
-
-        return rc;
-    }
-
-    return xenmem_add_to_physmap_once(d, xatp);
-}
-
 long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int rc;
 
     switch ( op )
     {
-    case XENMEM_add_to_physmap:
-    {
-        struct xen_add_to_physmap xatp;
-        struct domain *d;
-
-        if ( copy_from_guest(&xatp, arg, 1) )
-            return -EFAULT;
-
-        d = rcu_lock_domain_by_any_id(xatp.domid);
-        if ( d == NULL )
-            return -ESRCH;
-
-        if ( xsm_add_to_physmap(XSM_TARGET, current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            return -EPERM;
-        }
-
-        rc = xenmem_add_to_physmap(d, &xatp);
-
-        rcu_unlock_domain(d);
-
-        if ( xatp.space == XENMAPSPACE_gmfn_range )
-        {
-            if ( rc && __copy_to_guest(arg, &xatp, 1) )
-                rc = -EFAULT;
-
-            if ( rc == -EAGAIN )
-                rc = hypercall_create_continuation(
-                        __HYPERVISOR_memory_op, "ih", op, arg);
-        }
-
-        return rc;
-    }
-
     case XENMEM_set_memory_map:
     {
         struct xen_foreign_memory_map fmap;
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index f01f8ff..0a8408b 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -55,34 +55,6 @@ int compat_arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     switch ( op )
     {
-    case XENMEM_add_to_physmap:
-    {
-        struct compat_add_to_physmap cmp;
-        struct xen_add_to_physmap *nat = COMPAT_ARG_XLAT_VIRT_BASE;
-
-        if ( copy_from_guest(&cmp, arg, 1) )
-            return -EFAULT;
-
-        XLAT_add_to_physmap(nat, &cmp);
-        rc = arch_memory_op(op, guest_handle_from_ptr(nat, void));
-
-        if ( !rc || cmp.space != XENMAPSPACE_gmfn_range )
-            break;
-
-        XLAT_add_to_physmap(&cmp, nat);
-        if ( __copy_to_guest(arg, &cmp, 1) )
-        {
-            if ( rc == __HYPERVISOR_memory_op )
-                hypercall_cancel_continuation();
-            return -EFAULT;
-        }
-
-        if ( rc == __HYPERVISOR_memory_op )
-            hypercall_xlat_continuation(NULL, 0x2, nat, arg);
-
-        break;
-    }
-
     case XENMEM_set_memory_map:
     {
         struct compat_foreign_memory_map cmp;
diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index ba7e6eb..aeac560 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -26,11 +26,13 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             XEN_GUEST_HANDLE_PARAM(void) hnd;
             struct xen_memory_reservation *rsrv;
             struct xen_memory_exchange *xchg;
+            struct xen_add_to_physmap *atp;
             struct xen_remove_from_physmap *xrfp;
         } nat;
         union {
             struct compat_memory_reservation rsrv;
             struct compat_memory_exchange xchg;
+            struct compat_add_to_physmap atp;
         } cmp;
 
         set_xen_guest_handle(nat.hnd, COMPAT_ARG_XLAT_VIRT_BASE);
@@ -187,6 +189,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             nat.hnd = compat;
             break;
 
+        case XENMEM_add_to_physmap:
+            if ( copy_from_guest(&cmp.atp, compat, 1) )
+                return -EFAULT;
+
+            XLAT_add_to_physmap(nat.atp, &cmp.atp);
+
+            break;
+
         case XENMEM_remove_from_physmap:
         {
             struct compat_remove_from_physmap cmp;
@@ -315,6 +325,16 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
         case XENMEM_remove_from_physmap:
             break;
 
+        case XENMEM_add_to_physmap:
+            if ( !rc || cmp.atp.space != XENMAPSPACE_gmfn_range )
+                break;
+
+            XLAT_add_to_physmap(&cmp.atp, nat.atp);
+            if ( __copy_to_guest(compat, &cmp.atp, 1) )
+                rc = -EFAULT;
+
+            break;
+
         default:
             domain_crash(current->domain);
             split = 0;
diff --git a/xen/common/memory.c b/xen/common/memory.c
index eb7b72b..420a241 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -542,6 +542,53 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
     return rc;
 }
 
+static int xenmem_add_to_physmap(struct domain *d,
+                                 struct xen_add_to_physmap *xatp)
+{
+    struct xen_add_to_physmap start_xatp;
+    int rc = 0;
+
+    if ( xatp->space != XENMAPSPACE_gmfn_range )
+        return xenmem_add_to_physmap_one(d, xatp->space, DOMID_INVALID,
+                                         xatp->idx, xatp->gpfn);
+
+#ifdef HAS_PASSTHROUGH
+    if ( need_iommu(d) )
+        this_cpu(iommu_dont_flush_iotlb) = 1;
+#endif
+
+    start_xatp = *xatp;
+    while ( xatp->size > 0 )
+    {
+        rc = xenmem_add_to_physmap_one(d, xatp->space, DOMID_INVALID,
+                                       xatp->idx, xatp->gpfn);
+        if ( rc < 0 )
+            break;
+
+        xatp->idx++;
+        xatp->gpfn++;
+        xatp->size--;
+
+        /* Check for continuation if it's not the last iteration. */
+        if ( xatp->size > 0 && hypercall_preempt_check() )
+        {
+            rc = -EAGAIN;
+            break;
+        }
+    }
+
+#ifdef HAS_PASSTHROUGH
+    if ( need_iommu(d) )
+    {
+        this_cpu(iommu_dont_flush_iotlb) = 0;
+        iommu_iotlb_flush(d, start_xatp.idx, start_xatp.size - xatp->size);
+        iommu_iotlb_flush(d, start_xatp.gpfn, start_xatp.size - xatp->size);
+    }
+#endif
+
+    return rc;
+}
+
 long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d;
@@ -673,6 +720,44 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         break;
 
+    case XENMEM_add_to_physmap:
+    {
+        struct xen_add_to_physmap xatp;
+
+        if ( copy_from_guest(&xatp, arg, 1) )
+            return -EFAULT;
+
+        /* Foreign mapping is only possible via add_to_physmap_range. */
+        if ( xatp.space == XENMAPSPACE_gmfn_foreign )
+            return -ENOSYS;
+
+        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 )
+        {
+            rcu_unlock_domain(d);
+            return rc;
+        }
+
+        rc = xenmem_add_to_physmap(d, &xatp);
+
+        rcu_unlock_domain(d);
+
+        if ( xatp.space == XENMAPSPACE_gmfn_range && rc == -EAGAIN )
+        {
+            if ( !__copy_to_guest(arg, &xatp, 1) )
+                rc = hypercall_create_continuation(
+                        __HYPERVISOR_memory_op, "ih", op, arg);
+            else
+                rc = -EFAULT;
+        }
+
+        return rc;
+    }
+
     case XENMEM_remove_from_physmap:
     {
         struct xen_remove_from_physmap xrfp;
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 4f5795c..f90ed74 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -356,6 +356,10 @@ static inline unsigned int get_order_from_pages(unsigned long nr_pages)
 
 void scrub_one_page(struct page_info *);
 
+int xenmem_add_to_physmap_one(struct domain *d, uint16_t space,
+                              domid_t foreign_domid,
+                              unsigned long idx, xen_pfn_t gpfn);
+
 /* Returns 1 on success, 0 on error, negative if the ring
  * for event propagation is full in the presence of paging */
 int guest_remove_page(struct domain *d, unsigned long gmfn);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 21 17:11:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17:11: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 1VuQ5S-00077q-Ks; Sat, 21 Dec 2013 17:11:38 +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 1VuQ5R-00077c-9o
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:37 +0000
Received: from [85.158.139.211:5887] by server-8.bemta-5.messagelabs.com id
	F1/F8-29838-8CBC5B25; Sat, 21 Dec 2013 17:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1387645894!4818800!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12321 invoked from network); 21 Dec 2013 17:11:35 -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;
	21 Dec 2013 17:11: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 1VuQ5N-00038x-TY
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5N-0002Bb-Rl
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:33 +0000
Date: Sat, 21 Dec 2013 17:11:33 +0000
Message-Id: <E1VuQ5N-0002Bb-Rl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] move XENMEM_add_to_physmap handling
	framework 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 4be86bb194e25e46b6cbee900601bfee76e8090a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 20 12:00:15 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 20 12:00:15 2013 +0100

    move XENMEM_add_to_physmap handling framework to common code
    
    There's really nothing really architecture specific here; the
    architecture specific handling is limited to
    xenmem_add_to_physmap_one().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c               |   33 +----------
 xen/arch/x86/mm.c               |  127 +++++++-------------------------------
 xen/arch/x86/x86_64/compat/mm.c |   28 ---------
 xen/common/compat/memory.c      |   20 ++++++
 xen/common/memory.c             |   85 ++++++++++++++++++++++++++
 xen/include/xen/mm.h            |    4 +
 6 files changed, 134 insertions(+), 163 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 3d0b854..86015c7 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -968,7 +968,7 @@ void share_xen_page_with_privileged_guests(
     share_xen_page_with_guest(page, dom_xen, readonly);
 }
 
-static int xenmem_add_to_physmap_one(
+int xenmem_add_to_physmap_one(
     struct domain *d,
     uint16_t space,
     domid_t foreign_domid,
@@ -1139,37 +1139,6 @@ long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     switch ( op )
     {
-    case XENMEM_add_to_physmap:
-    {
-        struct xen_add_to_physmap xatp;
-        struct domain *d;
-
-        if ( copy_from_guest(&xatp, arg, 1) )
-            return -EFAULT;
-
-        /* Foreign mapping is only supported by add_to_physmap_range */
-        if ( xatp.space == XENMAPSPACE_gmfn_foreign )
-            return -EINVAL;
-
-        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 )
-        {
-            rcu_unlock_domain(d);
-            return rc;
-        }
-
-        rc = xenmem_add_to_physmap_one(d, xatp.space, DOMID_INVALID,
-                                       xatp.idx, xatp.gpfn);
-
-        rcu_unlock_domain(d);
-
-        return rc;
-    }
-
     case XENMEM_add_to_physmap_range:
     {
         struct xen_add_to_physmap_range xatpr;
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index dd42bde..32c0473 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4520,20 +4520,23 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
     return 0;
 }
 
-static int xenmem_add_to_physmap_once(
+int xenmem_add_to_physmap_one(
     struct domain *d,
-    const struct xen_add_to_physmap *xatp)
+    uint16_t space,
+    domid_t foreign_domid,
+    unsigned long idx,
+    xen_pfn_t gpfn)
 {
     struct page_info *page = NULL;
     unsigned long gfn = 0; /* gcc ... */
-    unsigned long prev_mfn, mfn = 0, gpfn, idx;
+    unsigned long prev_mfn, mfn = 0, old_gpfn;
     int rc;
     p2m_type_t p2mt;
 
-    switch ( xatp->space )
+    switch ( space )
     {
         case XENMAPSPACE_shared_info:
-            if ( xatp->idx == 0 )
+            if ( idx == 0 )
                 mfn = virt_to_mfn(d->shared_info);
             break;
         case XENMAPSPACE_grant_table:
@@ -4542,9 +4545,8 @@ static int xenmem_add_to_physmap_once(
             if ( d->grant_table->gt_version == 0 )
                 d->grant_table->gt_version = 1;
 
-            idx = xatp->idx;
             if ( d->grant_table->gt_version == 2 &&
-                 (xatp->idx & XENMAPIDX_grant_table_status) )
+                 (idx & XENMAPIDX_grant_table_status) )
             {
                 idx &= ~XENMAPIDX_grant_table_status;
                 if ( idx < nr_status_frames(d->grant_table) )
@@ -4566,9 +4568,9 @@ static int xenmem_add_to_physmap_once(
         case XENMAPSPACE_gmfn:
         {
             p2m_type_t p2mt;
-            gfn = xatp->idx;
 
-            idx = mfn_x(get_gfn_unshare(d, xatp->idx, &p2mt));
+            gfn = idx;
+            idx = mfn_x(get_gfn_unshare(d, idx, &p2mt));
             /* If the page is still shared, exit early */
             if ( p2m_is_shared(p2mt) )
             {
@@ -4589,41 +4591,38 @@ static int xenmem_add_to_physmap_once(
     {
         if ( page )
             put_page(page);
-        if ( xatp->space == XENMAPSPACE_gmfn ||
-             xatp->space == XENMAPSPACE_gmfn_range )
+        if ( space == XENMAPSPACE_gmfn || space == XENMAPSPACE_gmfn_range )
             put_gfn(d, gfn);
         return -EINVAL;
     }
 
     /* Remove previously mapped page if it was present. */
-    prev_mfn = mfn_x(get_gfn(d, xatp->gpfn, &p2mt));
+    prev_mfn = mfn_x(get_gfn(d, gpfn, &p2mt));
     if ( mfn_valid(prev_mfn) )
     {
         if ( is_xen_heap_mfn(prev_mfn) )
             /* Xen heap frames are simply unhooked from this phys slot. */
-            guest_physmap_remove_page(d, xatp->gpfn, prev_mfn, PAGE_ORDER_4K);
+            guest_physmap_remove_page(d, gpfn, prev_mfn, PAGE_ORDER_4K);
         else
             /* Normal domain memory is freed, to avoid leaking memory. */
-            guest_remove_page(d, xatp->gpfn);
+            guest_remove_page(d, gpfn);
     }
     /* In the XENMAPSPACE_gmfn case we still hold a ref on the old page. */
-    put_gfn(d, xatp->gpfn);
+    put_gfn(d, gpfn);
 
     /* Unmap from old location, if any. */
-    gpfn = get_gpfn_from_mfn(mfn);
-    ASSERT( gpfn != SHARED_M2P_ENTRY );
-    if ( xatp->space == XENMAPSPACE_gmfn ||
-         xatp->space == XENMAPSPACE_gmfn_range )
-        ASSERT( gpfn == gfn );
-    if ( gpfn != INVALID_M2P_ENTRY )
-        guest_physmap_remove_page(d, gpfn, mfn, PAGE_ORDER_4K);
+    old_gpfn = get_gpfn_from_mfn(mfn);
+    ASSERT( old_gpfn != SHARED_M2P_ENTRY );
+    if ( space == XENMAPSPACE_gmfn || space == XENMAPSPACE_gmfn_range )
+        ASSERT( old_gpfn == gfn );
+    if ( old_gpfn != INVALID_M2P_ENTRY )
+        guest_physmap_remove_page(d, old_gpfn, mfn, PAGE_ORDER_4K);
 
     /* Map at new location. */
-    rc = guest_physmap_add_page(d, xatp->gpfn, mfn, PAGE_ORDER_4K);
+    rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
     /* In the XENMAPSPACE_gmfn, we took a ref of the gfn at the top */
-    if ( xatp->space == XENMAPSPACE_gmfn ||
-         xatp->space == XENMAPSPACE_gmfn_range )
+    if ( space == XENMAPSPACE_gmfn || space == XENMAPSPACE_gmfn_range )
         put_gfn(d, gfn);
 
     if ( page )
@@ -4632,90 +4631,12 @@ static int xenmem_add_to_physmap_once(
     return rc;
 }
 
-static int xenmem_add_to_physmap(struct domain *d,
-                                 struct xen_add_to_physmap *xatp)
-{
-    struct xen_add_to_physmap start_xatp;
-    int rc = 0;
-
-    if ( xatp->space == XENMAPSPACE_gmfn_range )
-    {
-        if ( need_iommu(d) )
-            this_cpu(iommu_dont_flush_iotlb) = 1;
-
-        start_xatp = *xatp;
-        while ( xatp->size > 0 )
-        {
-            rc = xenmem_add_to_physmap_once(d, xatp);
-            if ( rc < 0 )
-                break;
-
-            xatp->idx++;
-            xatp->gpfn++;
-            xatp->size--;
-
-            /* Check for continuation if it's not the last interation */
-            if ( xatp->size > 0 && hypercall_preempt_check() )
-            {
-                rc = -EAGAIN;
-                break;
-            }
-        }
-
-        if ( need_iommu(d) )
-        {
-            this_cpu(iommu_dont_flush_iotlb) = 0;
-            iommu_iotlb_flush(d, start_xatp.idx, start_xatp.size - xatp->size);
-            iommu_iotlb_flush(d, start_xatp.gpfn, start_xatp.size - xatp->size);
-        }
-
-        return rc;
-    }
-
-    return xenmem_add_to_physmap_once(d, xatp);
-}
-
 long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     int rc;
 
     switch ( op )
     {
-    case XENMEM_add_to_physmap:
-    {
-        struct xen_add_to_physmap xatp;
-        struct domain *d;
-
-        if ( copy_from_guest(&xatp, arg, 1) )
-            return -EFAULT;
-
-        d = rcu_lock_domain_by_any_id(xatp.domid);
-        if ( d == NULL )
-            return -ESRCH;
-
-        if ( xsm_add_to_physmap(XSM_TARGET, current->domain, d) )
-        {
-            rcu_unlock_domain(d);
-            return -EPERM;
-        }
-
-        rc = xenmem_add_to_physmap(d, &xatp);
-
-        rcu_unlock_domain(d);
-
-        if ( xatp.space == XENMAPSPACE_gmfn_range )
-        {
-            if ( rc && __copy_to_guest(arg, &xatp, 1) )
-                rc = -EFAULT;
-
-            if ( rc == -EAGAIN )
-                rc = hypercall_create_continuation(
-                        __HYPERVISOR_memory_op, "ih", op, arg);
-        }
-
-        return rc;
-    }
-
     case XENMEM_set_memory_map:
     {
         struct xen_foreign_memory_map fmap;
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index f01f8ff..0a8408b 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -55,34 +55,6 @@ int compat_arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     switch ( op )
     {
-    case XENMEM_add_to_physmap:
-    {
-        struct compat_add_to_physmap cmp;
-        struct xen_add_to_physmap *nat = COMPAT_ARG_XLAT_VIRT_BASE;
-
-        if ( copy_from_guest(&cmp, arg, 1) )
-            return -EFAULT;
-
-        XLAT_add_to_physmap(nat, &cmp);
-        rc = arch_memory_op(op, guest_handle_from_ptr(nat, void));
-
-        if ( !rc || cmp.space != XENMAPSPACE_gmfn_range )
-            break;
-
-        XLAT_add_to_physmap(&cmp, nat);
-        if ( __copy_to_guest(arg, &cmp, 1) )
-        {
-            if ( rc == __HYPERVISOR_memory_op )
-                hypercall_cancel_continuation();
-            return -EFAULT;
-        }
-
-        if ( rc == __HYPERVISOR_memory_op )
-            hypercall_xlat_continuation(NULL, 0x2, nat, arg);
-
-        break;
-    }
-
     case XENMEM_set_memory_map:
     {
         struct compat_foreign_memory_map cmp;
diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index ba7e6eb..aeac560 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -26,11 +26,13 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             XEN_GUEST_HANDLE_PARAM(void) hnd;
             struct xen_memory_reservation *rsrv;
             struct xen_memory_exchange *xchg;
+            struct xen_add_to_physmap *atp;
             struct xen_remove_from_physmap *xrfp;
         } nat;
         union {
             struct compat_memory_reservation rsrv;
             struct compat_memory_exchange xchg;
+            struct compat_add_to_physmap atp;
         } cmp;
 
         set_xen_guest_handle(nat.hnd, COMPAT_ARG_XLAT_VIRT_BASE);
@@ -187,6 +189,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             nat.hnd = compat;
             break;
 
+        case XENMEM_add_to_physmap:
+            if ( copy_from_guest(&cmp.atp, compat, 1) )
+                return -EFAULT;
+
+            XLAT_add_to_physmap(nat.atp, &cmp.atp);
+
+            break;
+
         case XENMEM_remove_from_physmap:
         {
             struct compat_remove_from_physmap cmp;
@@ -315,6 +325,16 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
         case XENMEM_remove_from_physmap:
             break;
 
+        case XENMEM_add_to_physmap:
+            if ( !rc || cmp.atp.space != XENMAPSPACE_gmfn_range )
+                break;
+
+            XLAT_add_to_physmap(&cmp.atp, nat.atp);
+            if ( __copy_to_guest(compat, &cmp.atp, 1) )
+                rc = -EFAULT;
+
+            break;
+
         default:
             domain_crash(current->domain);
             split = 0;
diff --git a/xen/common/memory.c b/xen/common/memory.c
index eb7b72b..420a241 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -542,6 +542,53 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
     return rc;
 }
 
+static int xenmem_add_to_physmap(struct domain *d,
+                                 struct xen_add_to_physmap *xatp)
+{
+    struct xen_add_to_physmap start_xatp;
+    int rc = 0;
+
+    if ( xatp->space != XENMAPSPACE_gmfn_range )
+        return xenmem_add_to_physmap_one(d, xatp->space, DOMID_INVALID,
+                                         xatp->idx, xatp->gpfn);
+
+#ifdef HAS_PASSTHROUGH
+    if ( need_iommu(d) )
+        this_cpu(iommu_dont_flush_iotlb) = 1;
+#endif
+
+    start_xatp = *xatp;
+    while ( xatp->size > 0 )
+    {
+        rc = xenmem_add_to_physmap_one(d, xatp->space, DOMID_INVALID,
+                                       xatp->idx, xatp->gpfn);
+        if ( rc < 0 )
+            break;
+
+        xatp->idx++;
+        xatp->gpfn++;
+        xatp->size--;
+
+        /* Check for continuation if it's not the last iteration. */
+        if ( xatp->size > 0 && hypercall_preempt_check() )
+        {
+            rc = -EAGAIN;
+            break;
+        }
+    }
+
+#ifdef HAS_PASSTHROUGH
+    if ( need_iommu(d) )
+    {
+        this_cpu(iommu_dont_flush_iotlb) = 0;
+        iommu_iotlb_flush(d, start_xatp.idx, start_xatp.size - xatp->size);
+        iommu_iotlb_flush(d, start_xatp.gpfn, start_xatp.size - xatp->size);
+    }
+#endif
+
+    return rc;
+}
+
 long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d;
@@ -673,6 +720,44 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         break;
 
+    case XENMEM_add_to_physmap:
+    {
+        struct xen_add_to_physmap xatp;
+
+        if ( copy_from_guest(&xatp, arg, 1) )
+            return -EFAULT;
+
+        /* Foreign mapping is only possible via add_to_physmap_range. */
+        if ( xatp.space == XENMAPSPACE_gmfn_foreign )
+            return -ENOSYS;
+
+        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 )
+        {
+            rcu_unlock_domain(d);
+            return rc;
+        }
+
+        rc = xenmem_add_to_physmap(d, &xatp);
+
+        rcu_unlock_domain(d);
+
+        if ( xatp.space == XENMAPSPACE_gmfn_range && rc == -EAGAIN )
+        {
+            if ( !__copy_to_guest(arg, &xatp, 1) )
+                rc = hypercall_create_continuation(
+                        __HYPERVISOR_memory_op, "ih", op, arg);
+            else
+                rc = -EFAULT;
+        }
+
+        return rc;
+    }
+
     case XENMEM_remove_from_physmap:
     {
         struct xen_remove_from_physmap xrfp;
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 4f5795c..f90ed74 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -356,6 +356,10 @@ static inline unsigned int get_order_from_pages(unsigned long nr_pages)
 
 void scrub_one_page(struct page_info *);
 
+int xenmem_add_to_physmap_one(struct domain *d, uint16_t space,
+                              domid_t foreign_domid,
+                              unsigned long idx, xen_pfn_t gpfn);
+
 /* Returns 1 on success, 0 on error, negative if the ring
  * for event propagation is full in the presence of paging */
 int guest_remove_page(struct domain *d, unsigned long gmfn);
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 21 17:11:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17:11: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 1VuQ5c-00079J-OY; Sat, 21 Dec 2013 17:11:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5b-000794-1r
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:47 +0000
Received: from [85.158.143.35:31938] by server-3.bemta-4.messagelabs.com id
	2E/7E-32360-2DBC5B25; Sat, 21 Dec 2013 17:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1387645904!7566321!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15569 invoked from network); 21 Dec 2013 17:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2013 17:11: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 1VuQ5Y-000393-1g
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5Y-0002Bx-0l
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:44 +0000
Date: Sat, 21 Dec 2013 17:11:44 +0000
Message-Id: <E1VuQ5Y-0002Bx-0l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix XENMEM_add_to_physmap preemption
	handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ade868939fe06520bb946dad740e1f3f1c12ea82
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 20 12:01:09 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 20 12:01:09 2013 +0100

    fix XENMEM_add_to_physmap preemption handling
    
    Just like for all other hypercalls we shouldn't be modifying the input
    structure - all of the fields are, even if not explicitly documented,
    just inputs.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/compat/memory.c |   14 +++--------
 xen/common/memory.c        |   50 ++++++++++++++++++++++++-------------------
 2 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index aeac560..7692b5b 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -190,6 +190,9 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             break;
 
         case XENMEM_add_to_physmap:
+            BUILD_BUG_ON((typeof(cmp.atp.size))-1 >
+                         (UINT_MAX >> MEMOP_EXTENT_SHIFT));
+
             if ( copy_from_guest(&cmp.atp, compat, 1) )
                 return -EFAULT;
 
@@ -322,17 +325,8 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
         case XENMEM_current_reservation:
         case XENMEM_maximum_reservation:
         case XENMEM_maximum_gpfn:
-        case XENMEM_remove_from_physmap:
-            break;
-
         case XENMEM_add_to_physmap:
-            if ( !rc || cmp.atp.space != XENMAPSPACE_gmfn_range )
-                break;
-
-            XLAT_add_to_physmap(&cmp.atp, nat.atp);
-            if ( __copy_to_guest(compat, &cmp.atp, 1) )
-                rc = -EFAULT;
-
+        case XENMEM_remove_from_physmap:
             break;
 
         default:
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 420a241..12264e0 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -543,22 +543,29 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
 }
 
 static int xenmem_add_to_physmap(struct domain *d,
-                                 struct xen_add_to_physmap *xatp)
+                                 struct xen_add_to_physmap *xatp,
+                                 unsigned int start)
 {
-    struct xen_add_to_physmap start_xatp;
-    int rc = 0;
+    unsigned int done = 0;
+    long rc = 0;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
         return xenmem_add_to_physmap_one(d, xatp->space, DOMID_INVALID,
                                          xatp->idx, xatp->gpfn);
 
+    if ( xatp->size < start )
+        return -EILSEQ;
+
+    xatp->idx += start;
+    xatp->gpfn += start;
+    xatp->size -= start;
+
 #ifdef HAS_PASSTHROUGH
     if ( need_iommu(d) )
         this_cpu(iommu_dont_flush_iotlb) = 1;
 #endif
 
-    start_xatp = *xatp;
-    while ( xatp->size > 0 )
+    while ( xatp->size > done )
     {
         rc = xenmem_add_to_physmap_one(d, xatp->space, DOMID_INVALID,
                                        xatp->idx, xatp->gpfn);
@@ -567,12 +574,11 @@ static int xenmem_add_to_physmap(struct domain *d,
 
         xatp->idx++;
         xatp->gpfn++;
-        xatp->size--;
 
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > 0 && hypercall_preempt_check() )
+        if ( xatp->size > ++done && hypercall_preempt_check() )
         {
-            rc = -EAGAIN;
+            rc = start + done;
             break;
         }
     }
@@ -581,8 +587,8 @@ static int xenmem_add_to_physmap(struct domain *d,
     if ( need_iommu(d) )
     {
         this_cpu(iommu_dont_flush_iotlb) = 0;
-        iommu_iotlb_flush(d, start_xatp.idx, start_xatp.size - xatp->size);
-        iommu_iotlb_flush(d, start_xatp.gpfn, start_xatp.size - xatp->size);
+        iommu_iotlb_flush(d, xatp->idx - done, done);
+        iommu_iotlb_flush(d, xatp->gpfn - done, done);
     }
 #endif
 
@@ -594,10 +600,10 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     struct domain *d;
     long rc;
     unsigned int address_bits;
-    unsigned long start_extent;
     struct xen_memory_reservation reservation;
     struct memop_args args;
     domid_t domid;
+    unsigned long start_extent = cmd >> MEMOP_EXTENT_SHIFT;
     int op = cmd & MEMOP_CMD_MASK;
 
     switch ( op )
@@ -605,8 +611,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case XENMEM_increase_reservation:
     case XENMEM_decrease_reservation:
     case XENMEM_populate_physmap:
-        start_extent = cmd >> MEMOP_EXTENT_SHIFT;
-
         if ( copy_from_guest(&reservation, arg, 1) )
             return start_extent;
 
@@ -724,6 +728,12 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     {
         struct xen_add_to_physmap xatp;
 
+        BUILD_BUG_ON((typeof(xatp.size))-1 > (UINT_MAX >> MEMOP_EXTENT_SHIFT));
+
+        /* Check for malicious or buggy input. */
+        if ( start_extent != (typeof(xatp.size))start_extent )
+            return -EDOM;
+
         if ( copy_from_guest(&xatp, arg, 1) )
             return -EFAULT;
 
@@ -742,18 +752,14 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return rc;
         }
 
-        rc = xenmem_add_to_physmap(d, &xatp);
+        rc = xenmem_add_to_physmap(d, &xatp, start_extent);
 
         rcu_unlock_domain(d);
 
-        if ( xatp.space == XENMAPSPACE_gmfn_range && rc == -EAGAIN )
-        {
-            if ( !__copy_to_guest(arg, &xatp, 1) )
-                rc = hypercall_create_continuation(
-                        __HYPERVISOR_memory_op, "ih", op, arg);
-            else
-                rc = -EFAULT;
-        }
+        if ( xatp.space == XENMAPSPACE_gmfn_range && rc > 0 )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_memory_op, "lh",
+                     op | (rc << MEMOP_EXTENT_SHIFT), arg);
 
         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 Sat Dec 21 17:11:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17:11: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 1VuQ5c-00079J-OY; Sat, 21 Dec 2013 17:11:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5b-000794-1r
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:47 +0000
Received: from [85.158.143.35:31938] by server-3.bemta-4.messagelabs.com id
	2E/7E-32360-2DBC5B25; Sat, 21 Dec 2013 17:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1387645904!7566321!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15569 invoked from network); 21 Dec 2013 17:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2013 17:11: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 1VuQ5Y-000393-1g
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5Y-0002Bx-0l
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:44 +0000
Date: Sat, 21 Dec 2013 17:11:44 +0000
Message-Id: <E1VuQ5Y-0002Bx-0l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix XENMEM_add_to_physmap preemption
	handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ade868939fe06520bb946dad740e1f3f1c12ea82
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 20 12:01:09 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 20 12:01:09 2013 +0100

    fix XENMEM_add_to_physmap preemption handling
    
    Just like for all other hypercalls we shouldn't be modifying the input
    structure - all of the fields are, even if not explicitly documented,
    just inputs.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/compat/memory.c |   14 +++--------
 xen/common/memory.c        |   50 ++++++++++++++++++++++++-------------------
 2 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index aeac560..7692b5b 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -190,6 +190,9 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
             break;
 
         case XENMEM_add_to_physmap:
+            BUILD_BUG_ON((typeof(cmp.atp.size))-1 >
+                         (UINT_MAX >> MEMOP_EXTENT_SHIFT));
+
             if ( copy_from_guest(&cmp.atp, compat, 1) )
                 return -EFAULT;
 
@@ -322,17 +325,8 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
         case XENMEM_current_reservation:
         case XENMEM_maximum_reservation:
         case XENMEM_maximum_gpfn:
-        case XENMEM_remove_from_physmap:
-            break;
-
         case XENMEM_add_to_physmap:
-            if ( !rc || cmp.atp.space != XENMAPSPACE_gmfn_range )
-                break;
-
-            XLAT_add_to_physmap(&cmp.atp, nat.atp);
-            if ( __copy_to_guest(compat, &cmp.atp, 1) )
-                rc = -EFAULT;
-
+        case XENMEM_remove_from_physmap:
             break;
 
         default:
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 420a241..12264e0 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -543,22 +543,29 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
 }
 
 static int xenmem_add_to_physmap(struct domain *d,
-                                 struct xen_add_to_physmap *xatp)
+                                 struct xen_add_to_physmap *xatp,
+                                 unsigned int start)
 {
-    struct xen_add_to_physmap start_xatp;
-    int rc = 0;
+    unsigned int done = 0;
+    long rc = 0;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
         return xenmem_add_to_physmap_one(d, xatp->space, DOMID_INVALID,
                                          xatp->idx, xatp->gpfn);
 
+    if ( xatp->size < start )
+        return -EILSEQ;
+
+    xatp->idx += start;
+    xatp->gpfn += start;
+    xatp->size -= start;
+
 #ifdef HAS_PASSTHROUGH
     if ( need_iommu(d) )
         this_cpu(iommu_dont_flush_iotlb) = 1;
 #endif
 
-    start_xatp = *xatp;
-    while ( xatp->size > 0 )
+    while ( xatp->size > done )
     {
         rc = xenmem_add_to_physmap_one(d, xatp->space, DOMID_INVALID,
                                        xatp->idx, xatp->gpfn);
@@ -567,12 +574,11 @@ static int xenmem_add_to_physmap(struct domain *d,
 
         xatp->idx++;
         xatp->gpfn++;
-        xatp->size--;
 
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > 0 && hypercall_preempt_check() )
+        if ( xatp->size > ++done && hypercall_preempt_check() )
         {
-            rc = -EAGAIN;
+            rc = start + done;
             break;
         }
     }
@@ -581,8 +587,8 @@ static int xenmem_add_to_physmap(struct domain *d,
     if ( need_iommu(d) )
     {
         this_cpu(iommu_dont_flush_iotlb) = 0;
-        iommu_iotlb_flush(d, start_xatp.idx, start_xatp.size - xatp->size);
-        iommu_iotlb_flush(d, start_xatp.gpfn, start_xatp.size - xatp->size);
+        iommu_iotlb_flush(d, xatp->idx - done, done);
+        iommu_iotlb_flush(d, xatp->gpfn - done, done);
     }
 #endif
 
@@ -594,10 +600,10 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     struct domain *d;
     long rc;
     unsigned int address_bits;
-    unsigned long start_extent;
     struct xen_memory_reservation reservation;
     struct memop_args args;
     domid_t domid;
+    unsigned long start_extent = cmd >> MEMOP_EXTENT_SHIFT;
     int op = cmd & MEMOP_CMD_MASK;
 
     switch ( op )
@@ -605,8 +611,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case XENMEM_increase_reservation:
     case XENMEM_decrease_reservation:
     case XENMEM_populate_physmap:
-        start_extent = cmd >> MEMOP_EXTENT_SHIFT;
-
         if ( copy_from_guest(&reservation, arg, 1) )
             return start_extent;
 
@@ -724,6 +728,12 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     {
         struct xen_add_to_physmap xatp;
 
+        BUILD_BUG_ON((typeof(xatp.size))-1 > (UINT_MAX >> MEMOP_EXTENT_SHIFT));
+
+        /* Check for malicious or buggy input. */
+        if ( start_extent != (typeof(xatp.size))start_extent )
+            return -EDOM;
+
         if ( copy_from_guest(&xatp, arg, 1) )
             return -EFAULT;
 
@@ -742,18 +752,14 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return rc;
         }
 
-        rc = xenmem_add_to_physmap(d, &xatp);
+        rc = xenmem_add_to_physmap(d, &xatp, start_extent);
 
         rcu_unlock_domain(d);
 
-        if ( xatp.space == XENMAPSPACE_gmfn_range && rc == -EAGAIN )
-        {
-            if ( !__copy_to_guest(arg, &xatp, 1) )
-                rc = hypercall_create_continuation(
-                        __HYPERVISOR_memory_op, "ih", op, arg);
-            else
-                rc = -EFAULT;
-        }
+        if ( xatp.space == XENMAPSPACE_gmfn_range && rc > 0 )
+            rc = hypercall_create_continuation(
+                     __HYPERVISOR_memory_op, "lh",
+                     op | (rc << MEMOP_EXTENT_SHIFT), arg);
 
         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 Sat Dec 21 17:11:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17:11: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 1VuQ5n-0007BV-9p; Sat, 21 Dec 2013 17:11:59 +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 1VuQ5l-0007BA-L2
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:57 +0000
Received: from [85.158.137.68:14992] by server-17.bemta-3.messagelabs.com id
	2D/62-15965-CDBC5B25; Sat, 21 Dec 2013 17:11:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1387645914!5431201!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10031 invoked from network); 21 Dec 2013 17:11:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2013 17:11: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 1VuQ5i-00039C-6c
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5i-0002CJ-5Q
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:54 +0000
Date: Sat, 21 Dec 2013 17:11:54 +0000
Message-Id: <E1VuQ5i-0002CJ-5Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] move XENMEM_add_to_physmap_range
	handling framework 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 0627c56cb6ff61e197da75c6958fff3b43159237
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 20 12:01:44 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 20 12:01:44 2013 +0100

    move XENMEM_add_to_physmap_range handling framework to common code
    
    There's really nothing really architecture specific here; the
    architecture specific handling is limited to
    xenmem_add_to_physmap_one().
    
    This further eliminates the erroneous bailing from
    xenmem_add_to_physmap_range() if xenmem_add_to_physmap_one() fails.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c   |   93 ---------------------------------------------------
 xen/common/memory.c |   93 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+), 93 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 86015c7..293b6e2 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1078,103 +1078,10 @@ int xenmem_add_to_physmap_one(
     return rc;
 }
 
-static int xenmem_add_to_physmap_range(struct domain *d,
-                                       struct xen_add_to_physmap_range *xatpr)
-{
-    int rc;
-
-    while ( xatpr->size > 0 )
-    {
-        xen_ulong_t idx;
-        xen_pfn_t gpfn;
-
-        if ( unlikely(copy_from_guest_offset(&idx, xatpr->idxs, 0, 1)) )
-        {
-            rc = -EFAULT;
-            goto out;
-        }
-
-        if ( unlikely(copy_from_guest_offset(&gpfn, xatpr->gpfns, 0, 1)) )
-        {
-            rc = -EFAULT;
-            goto out;
-        }
-
-        rc = xenmem_add_to_physmap_one(d, xatpr->space,
-                                       xatpr->foreign_domid,
-                                       idx, gpfn);
-
-        if ( unlikely(copy_to_guest_offset(xatpr->errs, 0, &rc, 1)) )
-        {
-            rc = -EFAULT;
-            goto out;
-        }
-
-        if ( rc < 0 )
-            goto out;
-
-        guest_handle_add_offset(xatpr->idxs, 1);
-        guest_handle_add_offset(xatpr->gpfns, 1);
-        guest_handle_add_offset(xatpr->errs, 1);
-        xatpr->size--;
-
-        /* Check for continuation if it's not the last interation */
-        if ( xatpr->size > 0 && hypercall_preempt_check() )
-        {
-            rc = -EAGAIN;
-            goto out;
-        }
-    }
-
-    rc = 0;
-
-out:
-    return rc;
-
-}
-
 long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
-    int rc;
-
     switch ( op )
     {
-    case XENMEM_add_to_physmap_range:
-    {
-        struct xen_add_to_physmap_range xatpr;
-        struct domain *d;
-
-        if ( copy_from_guest(&xatpr, arg, 1) )
-            return -EFAULT;
-
-        /* This mapspace is redundant for this hypercall */
-        if ( xatpr.space == XENMAPSPACE_gmfn_range )
-            return -EINVAL;
-
-        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 )
-        {
-            rcu_unlock_domain(d);
-            return rc;
-        }
-
-        rc = xenmem_add_to_physmap_range(d, &xatpr);
-
-        rcu_unlock_domain(d);
-
-        if ( rc && copy_to_guest(arg, &xatpr, 1) )
-            rc = -EFAULT;
-
-        if ( rc == -EAGAIN )
-            rc = hypercall_create_continuation(
-                __HYPERVISOR_memory_op, "ih", op, arg);
-
-        return rc;
-    }
     /* XXX: memsharing not working yet */
     case XENMEM_get_sharing_shared_pages:
     case XENMEM_get_sharing_freed_pages:
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 12264e0..ae0bbb8 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -595,6 +595,57 @@ static int xenmem_add_to_physmap(struct domain *d,
     return rc;
 }
 
+static int xenmem_add_to_physmap_range(struct domain *d,
+                                       struct xen_add_to_physmap_range *xatpr)
+{
+    int rc;
+
+    while ( xatpr->size > 0 )
+    {
+        xen_ulong_t idx;
+        xen_pfn_t gpfn;
+
+        if ( unlikely(__copy_from_guest_offset(&idx, xatpr->idxs, 0, 1)) )
+        {
+            rc = -EFAULT;
+            goto out;
+        }
+
+        if ( unlikely(__copy_from_guest_offset(&gpfn, xatpr->gpfns, 0, 1)) )
+        {
+            rc = -EFAULT;
+            goto out;
+        }
+
+        rc = xenmem_add_to_physmap_one(d, xatpr->space,
+                                       xatpr->foreign_domid,
+                                       idx, gpfn);
+
+        if ( unlikely(__copy_to_guest_offset(xatpr->errs, 0, &rc, 1)) )
+        {
+            rc = -EFAULT;
+            goto out;
+        }
+
+        guest_handle_add_offset(xatpr->idxs, 1);
+        guest_handle_add_offset(xatpr->gpfns, 1);
+        guest_handle_add_offset(xatpr->errs, 1);
+        xatpr->size--;
+
+        /* Check for continuation if it's not the last iteration. */
+        if ( xatpr->size > 0 && hypercall_preempt_check() )
+        {
+            rc = -EAGAIN;
+            goto out;
+        }
+    }
+
+    rc = 0;
+
+out:
+    return rc;
+}
+
 long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d;
@@ -764,6 +815,48 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         return rc;
     }
 
+    case XENMEM_add_to_physmap_range:
+    {
+        struct xen_add_to_physmap_range xatpr;
+        struct domain *d;
+
+        if ( copy_from_guest(&xatpr, arg, 1) ||
+             !guest_handle_okay(xatpr.idxs, xatpr.size) ||
+             !guest_handle_okay(xatpr.gpfns, xatpr.size) ||
+             !guest_handle_okay(xatpr.errs, xatpr.size) )
+            return -EFAULT;
+
+        /* This mapspace is unsupported for this hypercall. */
+        if ( xatpr.space == XENMAPSPACE_gmfn_range )
+            return -EOPNOTSUPP;
+
+        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 )
+        {
+            rcu_unlock_domain(d);
+            return rc;
+        }
+
+        rc = xenmem_add_to_physmap_range(d, &xatpr);
+
+        rcu_unlock_domain(d);
+
+        if ( rc == -EAGAIN )
+        {
+            if ( !__copy_to_guest(arg, &xatpr, 1) )
+                rc = hypercall_create_continuation(
+                    __HYPERVISOR_memory_op, "ih", op, arg);
+            else
+                rc = -EFAULT;
+        }
+
+        return rc;
+    }
+
     case XENMEM_remove_from_physmap:
     {
         struct xen_remove_from_physmap xrfp;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 21 17:11:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 2013 17:11: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 1VuQ5n-0007BV-9p; Sat, 21 Dec 2013 17:11:59 +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 1VuQ5l-0007BA-L2
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:57 +0000
Received: from [85.158.137.68:14992] by server-17.bemta-3.messagelabs.com id
	2D/62-15965-CDBC5B25; Sat, 21 Dec 2013 17:11:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1387645914!5431201!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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10031 invoked from network); 21 Dec 2013 17:11:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2013 17:11: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 1VuQ5i-00039C-6c
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5i-0002CJ-5Q
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:11:54 +0000
Date: Sat, 21 Dec 2013 17:11:54 +0000
Message-Id: <E1VuQ5i-0002CJ-5Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] move XENMEM_add_to_physmap_range
	handling framework 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 0627c56cb6ff61e197da75c6958fff3b43159237
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 20 12:01:44 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 20 12:01:44 2013 +0100

    move XENMEM_add_to_physmap_range handling framework to common code
    
    There's really nothing really architecture specific here; the
    architecture specific handling is limited to
    xenmem_add_to_physmap_one().
    
    This further eliminates the erroneous bailing from
    xenmem_add_to_physmap_range() if xenmem_add_to_physmap_one() fails.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c   |   93 ---------------------------------------------------
 xen/common/memory.c |   93 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+), 93 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 86015c7..293b6e2 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1078,103 +1078,10 @@ int xenmem_add_to_physmap_one(
     return rc;
 }
 
-static int xenmem_add_to_physmap_range(struct domain *d,
-                                       struct xen_add_to_physmap_range *xatpr)
-{
-    int rc;
-
-    while ( xatpr->size > 0 )
-    {
-        xen_ulong_t idx;
-        xen_pfn_t gpfn;
-
-        if ( unlikely(copy_from_guest_offset(&idx, xatpr->idxs, 0, 1)) )
-        {
-            rc = -EFAULT;
-            goto out;
-        }
-
-        if ( unlikely(copy_from_guest_offset(&gpfn, xatpr->gpfns, 0, 1)) )
-        {
-            rc = -EFAULT;
-            goto out;
-        }
-
-        rc = xenmem_add_to_physmap_one(d, xatpr->space,
-                                       xatpr->foreign_domid,
-                                       idx, gpfn);
-
-        if ( unlikely(copy_to_guest_offset(xatpr->errs, 0, &rc, 1)) )
-        {
-            rc = -EFAULT;
-            goto out;
-        }
-
-        if ( rc < 0 )
-            goto out;
-
-        guest_handle_add_offset(xatpr->idxs, 1);
-        guest_handle_add_offset(xatpr->gpfns, 1);
-        guest_handle_add_offset(xatpr->errs, 1);
-        xatpr->size--;
-
-        /* Check for continuation if it's not the last interation */
-        if ( xatpr->size > 0 && hypercall_preempt_check() )
-        {
-            rc = -EAGAIN;
-            goto out;
-        }
-    }
-
-    rc = 0;
-
-out:
-    return rc;
-
-}
-
 long arch_memory_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
-    int rc;
-
     switch ( op )
     {
-    case XENMEM_add_to_physmap_range:
-    {
-        struct xen_add_to_physmap_range xatpr;
-        struct domain *d;
-
-        if ( copy_from_guest(&xatpr, arg, 1) )
-            return -EFAULT;
-
-        /* This mapspace is redundant for this hypercall */
-        if ( xatpr.space == XENMAPSPACE_gmfn_range )
-            return -EINVAL;
-
-        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 )
-        {
-            rcu_unlock_domain(d);
-            return rc;
-        }
-
-        rc = xenmem_add_to_physmap_range(d, &xatpr);
-
-        rcu_unlock_domain(d);
-
-        if ( rc && copy_to_guest(arg, &xatpr, 1) )
-            rc = -EFAULT;
-
-        if ( rc == -EAGAIN )
-            rc = hypercall_create_continuation(
-                __HYPERVISOR_memory_op, "ih", op, arg);
-
-        return rc;
-    }
     /* XXX: memsharing not working yet */
     case XENMEM_get_sharing_shared_pages:
     case XENMEM_get_sharing_freed_pages:
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 12264e0..ae0bbb8 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -595,6 +595,57 @@ static int xenmem_add_to_physmap(struct domain *d,
     return rc;
 }
 
+static int xenmem_add_to_physmap_range(struct domain *d,
+                                       struct xen_add_to_physmap_range *xatpr)
+{
+    int rc;
+
+    while ( xatpr->size > 0 )
+    {
+        xen_ulong_t idx;
+        xen_pfn_t gpfn;
+
+        if ( unlikely(__copy_from_guest_offset(&idx, xatpr->idxs, 0, 1)) )
+        {
+            rc = -EFAULT;
+            goto out;
+        }
+
+        if ( unlikely(__copy_from_guest_offset(&gpfn, xatpr->gpfns, 0, 1)) )
+        {
+            rc = -EFAULT;
+            goto out;
+        }
+
+        rc = xenmem_add_to_physmap_one(d, xatpr->space,
+                                       xatpr->foreign_domid,
+                                       idx, gpfn);
+
+        if ( unlikely(__copy_to_guest_offset(xatpr->errs, 0, &rc, 1)) )
+        {
+            rc = -EFAULT;
+            goto out;
+        }
+
+        guest_handle_add_offset(xatpr->idxs, 1);
+        guest_handle_add_offset(xatpr->gpfns, 1);
+        guest_handle_add_offset(xatpr->errs, 1);
+        xatpr->size--;
+
+        /* Check for continuation if it's not the last iteration. */
+        if ( xatpr->size > 0 && hypercall_preempt_check() )
+        {
+            rc = -EAGAIN;
+            goto out;
+        }
+    }
+
+    rc = 0;
+
+out:
+    return rc;
+}
+
 long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
     struct domain *d;
@@ -764,6 +815,48 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         return rc;
     }
 
+    case XENMEM_add_to_physmap_range:
+    {
+        struct xen_add_to_physmap_range xatpr;
+        struct domain *d;
+
+        if ( copy_from_guest(&xatpr, arg, 1) ||
+             !guest_handle_okay(xatpr.idxs, xatpr.size) ||
+             !guest_handle_okay(xatpr.gpfns, xatpr.size) ||
+             !guest_handle_okay(xatpr.errs, xatpr.size) )
+            return -EFAULT;
+
+        /* This mapspace is unsupported for this hypercall. */
+        if ( xatpr.space == XENMAPSPACE_gmfn_range )
+            return -EOPNOTSUPP;
+
+        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 )
+        {
+            rcu_unlock_domain(d);
+            return rc;
+        }
+
+        rc = xenmem_add_to_physmap_range(d, &xatpr);
+
+        rcu_unlock_domain(d);
+
+        if ( rc == -EAGAIN )
+        {
+            if ( !__copy_to_guest(arg, &xatpr, 1) )
+                rc = hypercall_create_continuation(
+                    __HYPERVISOR_memory_op, "ih", op, arg);
+            else
+                rc = -EFAULT;
+        }
+
+        return rc;
+    }
+
     case XENMEM_remove_from_physmap:
     {
         struct xen_remove_from_physmap xrfp;
--
generated by git-patchbot for /home/xen/git/xen.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 Dec 21 17:12:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 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 1VuQ5x-0007DT-Cu; Sat, 21 Dec 2013 17:12: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 1VuQ5v-0007Cv-3N
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:12:07 +0000
Received: from [85.158.139.211:6548] by server-5.bemta-5.messagelabs.com id
	34/60-14928-6EBC5B25; Sat, 21 Dec 2013 17:12:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1387645924!3374052!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8476 invoked from network); 21 Dec 2013 17:12:05 -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;
	21 Dec 2013 17:12: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 1VuQ5s-00039l-An
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:12:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5s-0002DL-9U
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:12:04 +0000
Date: Sat, 21 Dec 2013 17:12:04 +0000
Message-Id: <E1VuQ5s-0002DL-9U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix XENMEM_add_to_physmap_range
	preemption handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9a80d5056766535ac624774b96495f8b97b1d28b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 20 12:02:06 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 20 12:02:06 2013 +0100

    fix XENMEM_add_to_physmap_range preemption handling
    
    Just like for all other hypercalls we shouldn't be modifying the input
    structure - all of the fields are, even if not explicitly documented,
    just inputs (the one OUT one really refers to the memory pointed to by
    that handle rather than the handle itself).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/memory.c |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index ae0bbb8..d5192b8 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -596,11 +596,21 @@ static int xenmem_add_to_physmap(struct domain *d,
 }
 
 static int xenmem_add_to_physmap_range(struct domain *d,
-                                       struct xen_add_to_physmap_range *xatpr)
+                                       struct xen_add_to_physmap_range *xatpr,
+                                       unsigned int start)
 {
+    unsigned int done = 0;
     int rc;
 
-    while ( xatpr->size > 0 )
+    if ( xatpr->size < start )
+        return -EILSEQ;
+
+    guest_handle_add_offset(xatpr->idxs, start);
+    guest_handle_add_offset(xatpr->gpfns, start);
+    guest_handle_add_offset(xatpr->errs, start);
+    xatpr->size -= start;
+
+    while ( xatpr->size > done )
     {
         xen_ulong_t idx;
         xen_pfn_t gpfn;
@@ -630,12 +640,11 @@ static int xenmem_add_to_physmap_range(struct domain *d,
         guest_handle_add_offset(xatpr->idxs, 1);
         guest_handle_add_offset(xatpr->gpfns, 1);
         guest_handle_add_offset(xatpr->errs, 1);
-        xatpr->size--;
 
         /* Check for continuation if it's not the last iteration. */
-        if ( xatpr->size > 0 && hypercall_preempt_check() )
+        if ( xatpr->size > ++done && hypercall_preempt_check() )
         {
-            rc = -EAGAIN;
+            rc = start + done;
             goto out;
         }
     }
@@ -820,6 +829,13 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct xen_add_to_physmap_range xatpr;
         struct domain *d;
 
+        BUILD_BUG_ON((typeof(xatpr.size))-1 >
+                     (UINT_MAX >> MEMOP_EXTENT_SHIFT));
+
+        /* Check for malicious or buggy input. */
+        if ( start_extent != (typeof(xatpr.size))start_extent )
+            return -EDOM;
+
         if ( copy_from_guest(&xatpr, arg, 1) ||
              !guest_handle_okay(xatpr.idxs, xatpr.size) ||
              !guest_handle_okay(xatpr.gpfns, xatpr.size) ||
@@ -841,18 +857,14 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return rc;
         }
 
-        rc = xenmem_add_to_physmap_range(d, &xatpr);
+        rc = xenmem_add_to_physmap_range(d, &xatpr, start_extent);
 
         rcu_unlock_domain(d);
 
-        if ( rc == -EAGAIN )
-        {
-            if ( !__copy_to_guest(arg, &xatpr, 1) )
-                rc = hypercall_create_continuation(
-                    __HYPERVISOR_memory_op, "ih", op, arg);
-            else
-                rc = -EFAULT;
-        }
+        if ( rc > 0 )
+            rc = hypercall_create_continuation(
+                    __HYPERVISOR_memory_op, "lh",
+                    op | (rc << MEMOP_EXTENT_SHIFT), arg);
 
         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 Sat Dec 21 17:12:09 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Dec 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 1VuQ5x-0007DT-Cu; Sat, 21 Dec 2013 17:12: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 1VuQ5v-0007Cv-3N
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:12:07 +0000
Received: from [85.158.139.211:6548] by server-5.bemta-5.messagelabs.com id
	34/60-14928-6EBC5B25; Sat, 21 Dec 2013 17:12:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1387645924!3374052!1
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.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8476 invoked from network); 21 Dec 2013 17:12:05 -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;
	21 Dec 2013 17:12: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 1VuQ5s-00039l-An
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:12:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1VuQ5s-0002DL-9U
	for xen-changelog@lists.xensource.com; Sat, 21 Dec 2013 17:12:04 +0000
Date: Sat, 21 Dec 2013 17:12:04 +0000
Message-Id: <E1VuQ5s-0002DL-9U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] fix XENMEM_add_to_physmap_range
	preemption handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9a80d5056766535ac624774b96495f8b97b1d28b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Dec 20 12:02:06 2013 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Dec 20 12:02:06 2013 +0100

    fix XENMEM_add_to_physmap_range preemption handling
    
    Just like for all other hypercalls we shouldn't be modifying the input
    structure - all of the fields are, even if not explicitly documented,
    just inputs (the one OUT one really refers to the memory pointed to by
    that handle rather than the handle itself).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/memory.c |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index ae0bbb8..d5192b8 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -596,11 +596,21 @@ static int xenmem_add_to_physmap(struct domain *d,
 }
 
 static int xenmem_add_to_physmap_range(struct domain *d,
-                                       struct xen_add_to_physmap_range *xatpr)
+                                       struct xen_add_to_physmap_range *xatpr,
+                                       unsigned int start)
 {
+    unsigned int done = 0;
     int rc;
 
-    while ( xatpr->size > 0 )
+    if ( xatpr->size < start )
+        return -EILSEQ;
+
+    guest_handle_add_offset(xatpr->idxs, start);
+    guest_handle_add_offset(xatpr->gpfns, start);
+    guest_handle_add_offset(xatpr->errs, start);
+    xatpr->size -= start;
+
+    while ( xatpr->size > done )
     {
         xen_ulong_t idx;
         xen_pfn_t gpfn;
@@ -630,12 +640,11 @@ static int xenmem_add_to_physmap_range(struct domain *d,
         guest_handle_add_offset(xatpr->idxs, 1);
         guest_handle_add_offset(xatpr->gpfns, 1);
         guest_handle_add_offset(xatpr->errs, 1);
-        xatpr->size--;
 
         /* Check for continuation if it's not the last iteration. */
-        if ( xatpr->size > 0 && hypercall_preempt_check() )
+        if ( xatpr->size > ++done && hypercall_preempt_check() )
         {
-            rc = -EAGAIN;
+            rc = start + done;
             goto out;
         }
     }
@@ -820,6 +829,13 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         struct xen_add_to_physmap_range xatpr;
         struct domain *d;
 
+        BUILD_BUG_ON((typeof(xatpr.size))-1 >
+                     (UINT_MAX >> MEMOP_EXTENT_SHIFT));
+
+        /* Check for malicious or buggy input. */
+        if ( start_extent != (typeof(xatpr.size))start_extent )
+            return -EDOM;
+
         if ( copy_from_guest(&xatpr, arg, 1) ||
              !guest_handle_okay(xatpr.idxs, xatpr.size) ||
              !guest_handle_okay(xatpr.gpfns, xatpr.size) ||
@@ -841,18 +857,14 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return rc;
         }
 
-        rc = xenmem_add_to_physmap_range(d, &xatpr);
+        rc = xenmem_add_to_physmap_range(d, &xatpr, start_extent);
 
         rcu_unlock_domain(d);
 
-        if ( rc == -EAGAIN )
-        {
-            if ( !__copy_to_guest(arg, &xatpr, 1) )
-                rc = hypercall_create_continuation(
-                    __HYPERVISOR_memory_op, "ih", op, arg);
-            else
-                rc = -EFAULT;
-        }
+        if ( rc > 0 )
+            rc = hypercall_create_continuation(
+                    __HYPERVISOR_memory_op, "lh",
+                    op | (rc << MEMOP_EXTENT_SHIFT), arg);
 
         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

