From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:22:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuSO-0004UH-HR; Sun, 01 Nov 2015 15:22: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 1ZsuSN-0004U8-0u
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:07 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	9A/D9-14900-E1E26365; Sun, 01 Nov 2015 15:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446391324!5836!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29114 invoked from network); 1 Nov 2015 15:22:05 -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;
	1 Nov 2015 15:22:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSK-0001xT-Ir
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSK-0000Iu-G5
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:04 +0000
Date: Sun, 01 Nov 2015 15:22:04 +0000
Message-Id: <E1ZsuSK-0000Iu-G5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] arm: Support
	hypercall_create_continuation for multicall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 16486fc03070f678e3a5266ca53907e2862e9e6b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 14:05:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:05:07 2015 +0100

    arm: Support hypercall_create_continuation for multicall
    
    Multicall for ARM has been supported since commit f0dbdc6 "xen: arm: fully
    implement multicall interface.". Although, if an hypercall in multicall
    requires preemption, it will crash the host:
    
    (XEN) Xen BUG at domain.c:347
    (XEN) ----[ Xen-4.7-unstable  arm64  debug=y  Tainted:    C ]----
    [...]
    (XEN) Xen call trace:
    (XEN)    [<00000000002420cc>] hypercall_create_continuation+0x64/0x380 (PC)
    (XEN)    [<0000000000217274>] do_memory_op+0x1b00/0x2334 (LR)
    (XEN)    [<0000000000250d2c>] do_multicall_call+0x114/0x124
    (XEN)    [<0000000000217ff0>] do_multicall+0x17c/0x23c
    (XEN)    [<000000000024f97c>] do_trap_hypercall+0x90/0x12c
    (XEN)    [<0000000000251ca8>] do_trap_hypervisor+0xd2c/0x1ba4
    (XEN)    [<00000000002582cc>] guest_sync+0x88/0xb8
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 5:
    (XEN) Xen BUG at domain.c:347
    (XEN) ****************************************
    (XEN)
    (XEN) Manual reset required ('noreboot' specified)
    
    Looking to the code, the support of multicall looks valid to me, as we only
    need to fill call.args[...]. So drop the BUG();
    
    This is CVE-2015-7812 / XSA-145.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 29bcf64ce8bc0b1b7aacd00c8668f255c4f0686c
    master date: 2015-10-29 13:31:10 +0100
---
 xen/arch/arm/domain.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index d39669f..434e216 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -331,8 +331,6 @@ unsigned long hypercall_create_continuation(
 
     if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
     {
-        BUG(); /* XXX multicalls not implemented yet. */
-
         __set_bit(_MCSF_call_preempted, &mcs->flags);
 
         for ( i = 0; *p != '\0'; i++ )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:22:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuSO-0004UH-HR; Sun, 01 Nov 2015 15:22: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 1ZsuSN-0004U8-0u
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:07 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	9A/D9-14900-E1E26365; Sun, 01 Nov 2015 15:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446391324!5836!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29114 invoked from network); 1 Nov 2015 15:22:05 -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;
	1 Nov 2015 15:22:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSK-0001xT-Ir
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSK-0000Iu-G5
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:04 +0000
Date: Sun, 01 Nov 2015 15:22:04 +0000
Message-Id: <E1ZsuSK-0000Iu-G5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] arm: Support
	hypercall_create_continuation for multicall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 16486fc03070f678e3a5266ca53907e2862e9e6b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 14:05:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:05:07 2015 +0100

    arm: Support hypercall_create_continuation for multicall
    
    Multicall for ARM has been supported since commit f0dbdc6 "xen: arm: fully
    implement multicall interface.". Although, if an hypercall in multicall
    requires preemption, it will crash the host:
    
    (XEN) Xen BUG at domain.c:347
    (XEN) ----[ Xen-4.7-unstable  arm64  debug=y  Tainted:    C ]----
    [...]
    (XEN) Xen call trace:
    (XEN)    [<00000000002420cc>] hypercall_create_continuation+0x64/0x380 (PC)
    (XEN)    [<0000000000217274>] do_memory_op+0x1b00/0x2334 (LR)
    (XEN)    [<0000000000250d2c>] do_multicall_call+0x114/0x124
    (XEN)    [<0000000000217ff0>] do_multicall+0x17c/0x23c
    (XEN)    [<000000000024f97c>] do_trap_hypercall+0x90/0x12c
    (XEN)    [<0000000000251ca8>] do_trap_hypervisor+0xd2c/0x1ba4
    (XEN)    [<00000000002582cc>] guest_sync+0x88/0xb8
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 5:
    (XEN) Xen BUG at domain.c:347
    (XEN) ****************************************
    (XEN)
    (XEN) Manual reset required ('noreboot' specified)
    
    Looking to the code, the support of multicall looks valid to me, as we only
    need to fill call.args[...]. So drop the BUG();
    
    This is CVE-2015-7812 / XSA-145.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 29bcf64ce8bc0b1b7aacd00c8668f255c4f0686c
    master date: 2015-10-29 13:31:10 +0100
---
 xen/arch/arm/domain.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index d39669f..434e216 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -331,8 +331,6 @@ unsigned long hypercall_create_continuation(
 
     if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
     {
-        BUG(); /* XXX multicalls not implemented yet. */
-
         __set_bit(_MCSF_call_preempted, &mcs->flags);
 
         for ( i = 0; *p != '\0'; i++ )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:22:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuSY-0004VA-K0; Sun, 01 Nov 2015 15:22:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSX-0004Uz-EH
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:17 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	E6/A4-02804-82E26365; Sun, 01 Nov 2015 15:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1446391335!5798!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49699 invoked from network); 1 Nov 2015 15:22:16 -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;
	1 Nov 2015 15:22:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSU-0001xY-SE
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSU-0000JG-Pi
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:14 +0000
Date: Sun, 01 Nov 2015 15:22:14 +0000
Message-Id: <E1ZsuSU-0000JG-Pi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] arm: rate-limit logging from
	unimplemented PHYSDEVOP and HVMOP.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6e24d73697dd127a31554c88d3d66bda5c89ee6
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 14:05:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:05:25 2015 +0100

    arm: rate-limit logging from unimplemented PHYSDEVOP and HVMOP.
    
    These are guest accessible and should therefore be rate-limited.
    Moreover, include them only in debug builds.
    
    This is CVE-2015-7813 / XSA-146.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1c0e59ff15764e7b0c59282365974f5b8924ce83
    master date: 2015-10-29 13:33:38 +0100
---
 xen/arch/arm/hvm.c     |    2 +-
 xen/arch/arm/physdev.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c
index 471c4cd..5fd0753 100644
--- a/xen/arch/arm/hvm.c
+++ b/xen/arch/arm/hvm.c
@@ -57,7 +57,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     default:
     {
-        printk("%s: Bad HVM op %ld.\n", __func__, op);
+        gdprintk(XENLOG_DEBUG, "HVMOP op=%lu: not implemented\n", op);
         rc = -ENOSYS;
         break;
     }
diff --git a/xen/arch/arm/physdev.c b/xen/arch/arm/physdev.c
index 61b4a18..27bbbda 100644
--- a/xen/arch/arm/physdev.c
+++ b/xen/arch/arm/physdev.c
@@ -8,12 +8,13 @@
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
+#include <xen/sched.h>
 #include <asm/hypercall.h>
 
 
 int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
-    printk("%s %d cmd=%d: not implemented yet\n", __func__, __LINE__, cmd);
+    gdprintk(XENLOG_DEBUG, "PHYSDEVOP cmd=%d: not implemented\n", cmd);
     return -ENOSYS;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:22:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuSY-0004VA-K0; Sun, 01 Nov 2015 15:22:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSX-0004Uz-EH
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:17 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	E6/A4-02804-82E26365; Sun, 01 Nov 2015 15:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1446391335!5798!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49699 invoked from network); 1 Nov 2015 15:22:16 -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;
	1 Nov 2015 15:22:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSU-0001xY-SE
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSU-0000JG-Pi
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:14 +0000
Date: Sun, 01 Nov 2015 15:22:14 +0000
Message-Id: <E1ZsuSU-0000JG-Pi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] arm: rate-limit logging from
	unimplemented PHYSDEVOP and HVMOP.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6e24d73697dd127a31554c88d3d66bda5c89ee6
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 14:05:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:05:25 2015 +0100

    arm: rate-limit logging from unimplemented PHYSDEVOP and HVMOP.
    
    These are guest accessible and should therefore be rate-limited.
    Moreover, include them only in debug builds.
    
    This is CVE-2015-7813 / XSA-146.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1c0e59ff15764e7b0c59282365974f5b8924ce83
    master date: 2015-10-29 13:33:38 +0100
---
 xen/arch/arm/hvm.c     |    2 +-
 xen/arch/arm/physdev.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c
index 471c4cd..5fd0753 100644
--- a/xen/arch/arm/hvm.c
+++ b/xen/arch/arm/hvm.c
@@ -57,7 +57,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     default:
     {
-        printk("%s: Bad HVM op %ld.\n", __func__, op);
+        gdprintk(XENLOG_DEBUG, "HVMOP op=%lu: not implemented\n", op);
         rc = -ENOSYS;
         break;
     }
diff --git a/xen/arch/arm/physdev.c b/xen/arch/arm/physdev.c
index 61b4a18..27bbbda 100644
--- a/xen/arch/arm/physdev.c
+++ b/xen/arch/arm/physdev.c
@@ -8,12 +8,13 @@
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
+#include <xen/sched.h>
 #include <asm/hypercall.h>
 
 
 int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
-    printk("%s %d cmd=%d: not implemented yet\n", __func__, __LINE__, cmd);
+    gdprintk(XENLOG_DEBUG, "PHYSDEVOP cmd=%d: not implemented\n", cmd);
     return -ENOSYS;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:22:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuSi-0004WX-MU; Sun, 01 Nov 2015 15:22:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSh-0004WP-FF
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:27 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	8A/76-18107-23E26365; Sun, 01 Nov 2015 15:22:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1446391345!37622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21780 invoked from network); 1 Nov 2015 15:22: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;
	1 Nov 2015 15:22:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSf-0001xp-5v
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSf-0000Jc-31
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:25 +0000
Date: Sun, 01 Nov 2015 15:22:25 +0000
Message-Id: <E1ZsuSf-0000Jc-31@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] arm: handle races between
	relinquish_memory and free_domheap_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 d889704e1bc0b2d6b2b92adc2c54ac5db17f51ea
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 14:06:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:06:35 2015 +0100

    arm: handle races between relinquish_memory and free_domheap_pages
    
    Primarily this means XENMEM_decrease_reservation from a toolstack
    domain.
    
    Unlike x86 we have no requirement right now to queue such pages onto
    a separate list, if we hit this race then the other code has already
    fully accepted responsibility for freeing this page and therefore
    there is no more for relinquish_memory to do.
    
    This is CVE-2015-7814 / XSA-147.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ef01396fdff88b1c3331a09ca5c69619b90f4ea
    master date: 2015-10-29 13:34:17 +0100
---
 xen/arch/arm/domain.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 434e216..6bfea3e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -668,8 +668,15 @@ static int relinquish_memory(struct domain *d, struct page_list_head *list)
     {
         /* Grab a reference to the page so it won't disappear from under us. */
         if ( unlikely(!get_page(page, d)) )
-            /* Couldn't get a reference -- someone is freeing this page. */
-            BUG();
+            /*
+             * Couldn't get a reference -- someone is freeing this page and
+             * has already committed to doing so, so no more to do here.
+             *
+             * Note that the page must be left on the list, a list_del
+             * here will clash with the list_del done by the other
+             * party in the race and corrupt the list head.
+             */
+            continue;
 
         if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
             put_page(page);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:22:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuSi-0004WX-MU; Sun, 01 Nov 2015 15:22:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSh-0004WP-FF
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:27 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	8A/76-18107-23E26365; Sun, 01 Nov 2015 15:22:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1446391345!37622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21780 invoked from network); 1 Nov 2015 15:22: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;
	1 Nov 2015 15:22:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSf-0001xp-5v
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSf-0000Jc-31
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:25 +0000
Date: Sun, 01 Nov 2015 15:22:25 +0000
Message-Id: <E1ZsuSf-0000Jc-31@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] arm: handle races between
	relinquish_memory and free_domheap_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 d889704e1bc0b2d6b2b92adc2c54ac5db17f51ea
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 14:06:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:06:35 2015 +0100

    arm: handle races between relinquish_memory and free_domheap_pages
    
    Primarily this means XENMEM_decrease_reservation from a toolstack
    domain.
    
    Unlike x86 we have no requirement right now to queue such pages onto
    a separate list, if we hit this race then the other code has already
    fully accepted responsibility for freeing this page and therefore
    there is no more for relinquish_memory to do.
    
    This is CVE-2015-7814 / XSA-147.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ef01396fdff88b1c3331a09ca5c69619b90f4ea
    master date: 2015-10-29 13:34:17 +0100
---
 xen/arch/arm/domain.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 434e216..6bfea3e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -668,8 +668,15 @@ static int relinquish_memory(struct domain *d, struct page_list_head *list)
     {
         /* Grab a reference to the page so it won't disappear from under us. */
         if ( unlikely(!get_page(page, d)) )
-            /* Couldn't get a reference -- someone is freeing this page. */
-            BUG();
+            /*
+             * Couldn't get a reference -- someone is freeing this page and
+             * has already committed to doing so, so no more to do here.
+             *
+             * Note that the page must be left on the list, a list_del
+             * here will clash with the list_del done by the other
+             * party in the race and corrupt the list head.
+             */
+            continue;
 
         if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
             put_page(page);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:22:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15:22: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 1ZsuSt-0004YA-P1; Sun, 01 Nov 2015 15:22: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 1ZsuSs-0004Xy-4k
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:38 +0000
Content-Length: 2764
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	C2/55-28791-D3E26365; Sun, 01 Nov 2015 15:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1446391355!18463799!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23437 invoked from network); 1 Nov 2015 15:22:36 -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;
	1 Nov 2015 15:22:36 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSp-0001y2-G2
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSp-0000Jy-Dy
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:35 +0000
Date: Sun, 01 Nov 2015 15:22:35 +0000
Message-Id: <E1ZsuSp-0000Jy-Dy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: guard against undue super
	page PTE creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============1503044092978802261=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1503044092978802261==
Content-Length: 2367
Content-Transfer-Encoding: quoted-printable

commit a6646a52fd7aad00c6d50668f7ae362288ec9a98
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:07:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:07:01 2015 +0100

    x86: guard against undue super page PTE creation
    
    When optional super page support got added (commit bd1cd81d64 "x86: PV
    support for hugepages"), two adjustments were missed: mod_l2_entry()
    needs to consider the PSE and RW bits when deciding whether to use the
    fast path, and the PSE bit must not be removed from L2_DISALLOW_MASK
    unconditionally.
    
    This is CVE-2015-7835 / XSA-148.
    
    Reported-by: "=E6=A0=BE=E5=B0=9A=E8=81=AA(=E5=A5=BD=E9=A3=8E)" <shangcong.lsc@alibaba-inc.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: fe360c90ea13f309ef78810f1a2b92f2ae3b30b8
    master date: 2015-10-29 13:35:07 +0100
---
 xen/arch/x86/mm.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f4987f9..dfae2e7 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -163,7 +163,10 @@ static void put_superpage(unsigned long mfn);
 
 static uint32_t base_disallow_mask;
 #define L1_DISALLOW_MASK (base_disallow_mask | _PAGE_GNTTAB)
-#define L2_DISALLOW_MASK (base_disallow_mask & ~_PAGE_PSE)
+
+#define L2_DISALLOW_MASK (unlikely(opt_allow_superpage) \
+                          =3F base_disallow_mask & ~_PAGE_PSE \
+                          : base_disallow_mask)
 
 #define l3_disallow_mask(d) (!is_pv_32on64_domain(d) =3F  \
                              base_disallow_mask :       \
@@ -1786,7 +1789,10 @@ static int mod_l2_entry(l2_pgentry_t *pl2e,
         }
 
         /* Fast path for identical mapping and presence. */
-        if ( !l2e_has_changed(ol2e, nl2e, _PAGE_PRESENT) )
+        if ( !l2e_has_changed(ol2e, nl2e,
+                              unlikely(opt_allow_superpage)
+                              =3F _PAGE_PSE | _PAGE_RW | _PAGE_PRESENT
+                              : _PAGE_PRESENT) )
         {
             adjust_guest_l2e(nl2e, d);
             if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4


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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:22:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15:22: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 1ZsuSt-0004YA-P1; Sun, 01 Nov 2015 15:22: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 1ZsuSs-0004Xy-4k
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:38 +0000
Content-Length: 2764
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	C2/55-28791-D3E26365; Sun, 01 Nov 2015 15:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1446391355!18463799!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23437 invoked from network); 1 Nov 2015 15:22:36 -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;
	1 Nov 2015 15:22:36 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSp-0001y2-G2
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSp-0000Jy-Dy
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:35 +0000
Date: Sun, 01 Nov 2015 15:22:35 +0000
Message-Id: <E1ZsuSp-0000Jy-Dy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: guard against undue super
	page PTE creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============1503044092978802261=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1503044092978802261==
Content-Length: 2367
Content-Transfer-Encoding: quoted-printable

commit a6646a52fd7aad00c6d50668f7ae362288ec9a98
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:07:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:07:01 2015 +0100

    x86: guard against undue super page PTE creation
    
    When optional super page support got added (commit bd1cd81d64 "x86: PV
    support for hugepages"), two adjustments were missed: mod_l2_entry()
    needs to consider the PSE and RW bits when deciding whether to use the
    fast path, and the PSE bit must not be removed from L2_DISALLOW_MASK
    unconditionally.
    
    This is CVE-2015-7835 / XSA-148.
    
    Reported-by: "=E6=A0=BE=E5=B0=9A=E8=81=AA(=E5=A5=BD=E9=A3=8E)" <shangcong.lsc@alibaba-inc.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: fe360c90ea13f309ef78810f1a2b92f2ae3b30b8
    master date: 2015-10-29 13:35:07 +0100
---
 xen/arch/x86/mm.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f4987f9..dfae2e7 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -163,7 +163,10 @@ static void put_superpage(unsigned long mfn);
 
 static uint32_t base_disallow_mask;
 #define L1_DISALLOW_MASK (base_disallow_mask | _PAGE_GNTTAB)
-#define L2_DISALLOW_MASK (base_disallow_mask & ~_PAGE_PSE)
+
+#define L2_DISALLOW_MASK (unlikely(opt_allow_superpage) \
+                          =3F base_disallow_mask & ~_PAGE_PSE \
+                          : base_disallow_mask)
 
 #define l3_disallow_mask(d) (!is_pv_32on64_domain(d) =3F  \
                              base_disallow_mask :       \
@@ -1786,7 +1789,10 @@ static int mod_l2_entry(l2_pgentry_t *pl2e,
         }
 
         /* Fast path for identical mapping and presence. */
-        if ( !l2e_has_changed(ol2e, nl2e, _PAGE_PRESENT) )
+        if ( !l2e_has_changed(ol2e, nl2e,
+                              unlikely(opt_allow_superpage)
+                              =3F _PAGE_PSE | _PAGE_RW | _PAGE_PRESENT
+                              : _PAGE_PRESENT) )
         {
             adjust_guest_l2e(nl2e, d);
             if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4


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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:22:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuT3-0004Zp-RZ; Sun, 01 Nov 2015 15: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 1ZsuT2-0004ZX-2v
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:48 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	02/43-13905-74E26365; Sun, 01 Nov 2015 15:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1446391366!37606!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24735 invoked from network); 1 Nov 2015 15:22:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Nov 2015 15:22:46 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSz-0001yA-RZ
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSz-0000KK-M6
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:45 +0000
Date: Sun, 01 Nov 2015 15:22:45 +0000
Message-Id: <E1ZsuSz-0000KK-M6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: common: Use unbounded array
	for symbols_offset.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 477bc9b11964414aa6f6bf3733c6868c712fb5f1
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 14:09:45 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:09:45 2015 +0100

    xen: common: Use unbounded array for symbols_offset.
    
    Using a singleton array causes gcc5 to report:
    symbols.c: In function 'symbols_lookup':
    symbols.c:128:359: error: array subscript is above array bounds [-Werror=array-bounds]
    symbols.c:136:176: error: array subscript is above array bounds [-Werror=array-bounds]
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3f82ea62826d4eb06002d8dba475bafcc454b845
    master date: 2015-03-20 12:02:03 +0000
---
 xen/common/symbols.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/symbols.c b/xen/common/symbols.c
index 45941e1..2d7c447 100644
--- a/xen/common/symbols.c
+++ b/xen/common/symbols.c
@@ -19,7 +19,7 @@
 #include <xen/spinlock.h>
 
 #ifdef SYMBOLS_ORIGIN
-extern const unsigned int symbols_offsets[1];
+extern const unsigned int symbols_offsets[];
 #define symbols_address(n) (SYMBOLS_ORIGIN + symbols_offsets[n])
 #else
 extern const unsigned long symbols_addresses[];
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:22:49 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuT3-0004Zp-RZ; Sun, 01 Nov 2015 15: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 1ZsuT2-0004ZX-2v
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:48 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	02/43-13905-74E26365; Sun, 01 Nov 2015 15:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1446391366!37606!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24735 invoked from network); 1 Nov 2015 15:22:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Nov 2015 15:22:46 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSz-0001yA-RZ
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuSz-0000KK-M6
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:45 +0000
Date: Sun, 01 Nov 2015 15:22:45 +0000
Message-Id: <E1ZsuSz-0000KK-M6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: common: Use unbounded array
	for symbols_offset.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 477bc9b11964414aa6f6bf3733c6868c712fb5f1
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 14:09:45 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:09:45 2015 +0100

    xen: common: Use unbounded array for symbols_offset.
    
    Using a singleton array causes gcc5 to report:
    symbols.c: In function 'symbols_lookup':
    symbols.c:128:359: error: array subscript is above array bounds [-Werror=array-bounds]
    symbols.c:136:176: error: array subscript is above array bounds [-Werror=array-bounds]
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3f82ea62826d4eb06002d8dba475bafcc454b845
    master date: 2015-03-20 12:02:03 +0000
---
 xen/common/symbols.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/symbols.c b/xen/common/symbols.c
index 45941e1..2d7c447 100644
--- a/xen/common/symbols.c
+++ b/xen/common/symbols.c
@@ -19,7 +19,7 @@
 #include <xen/spinlock.h>
 
 #ifdef SYMBOLS_ORIGIN
-extern const unsigned int symbols_offsets[1];
+extern const unsigned int symbols_offsets[];
 #define symbols_address(n) (SYMBOLS_ORIGIN + symbols_offsets[n])
 #else
 extern const unsigned long symbols_addresses[];
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:23:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15:23: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 1ZsuTD-0004bK-U2; Sun, 01 Nov 2015 15:22: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 1ZsuTC-0004bB-LX
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:58 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	8F/D2-01143-15E26365; Sun, 01 Nov 2015 15:22:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1446391376!57267769!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15791 invoked from network); 1 Nov 2015 15:22:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Nov 2015 15:22:57 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTA-0001yI-7M
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTA-0000LC-3m
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:56 +0000
Date: Sun, 01 Nov 2015 15:22:56 +0000
Message-Id: <E1ZsuTA-0000LC-3m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 63c4744f4eef34af1cd77a2abb3edaf46c0d9fd1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:13:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:13:30 2015 +0100

    free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-149.
    
    Reported-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
---
 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 b6601a3..19e8470 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -744,6 +744,7 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
+    xfree(d->vcpu);
     free_domain_struct(d);
 
     send_global_virq(VIRQ_DOM_EXC);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:23:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15:23: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 1ZsuTD-0004bK-U2; Sun, 01 Nov 2015 15:22: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 1ZsuTC-0004bB-LX
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:58 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	8F/D2-01143-15E26365; Sun, 01 Nov 2015 15:22:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1446391376!57267769!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15791 invoked from network); 1 Nov 2015 15:22:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Nov 2015 15:22:57 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTA-0001yI-7M
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTA-0000LC-3m
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:22:56 +0000
Date: Sun, 01 Nov 2015 15:22:56 +0000
Message-Id: <E1ZsuTA-0000LC-3m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 63c4744f4eef34af1cd77a2abb3edaf46c0d9fd1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:13:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:13:30 2015 +0100

    free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-149.
    
    Reported-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
---
 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 b6601a3..19e8470 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -744,6 +744,7 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
+    xfree(d->vcpu);
     free_domain_struct(d);
 
     send_global_virq(VIRQ_DOM_EXC);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:23:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15:23: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 1ZsuTP-0004d0-0K; Sun, 01 Nov 2015 15:23: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 1ZsuTN-0004cm-2W
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:09 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	3A/AE-21201-C5E26365; Sun, 01 Nov 2015 15:23:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1446391386!5842!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52510 invoked from network); 1 Nov 2015 15:23:07 -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;
	1 Nov 2015 15:23:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTK-0001ys-Ho
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTK-0000Ln-FN
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:06 +0000
Date: Sun, 01 Nov 2015 15:23:06 +0000
Message-Id: <E1ZsuTK-0000Ln-FN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/PoD: Eager sweep for zeroed
	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 3638ff0e711e1a2bcb1ad8f3706d5ea079a54e79
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 29 14:14:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:14:30 2015 +0100

    x86/PoD: Eager sweep for zeroed pages
    
    Based on the contents of a guests physical address space,
    p2m_pod_emergency_sweep() could degrade into a linear memcmp() from 0 to
    max_gfn, which runs non-preemptibly.
    
    As p2m_pod_emergency_sweep() runs behind the scenes in a number of contexts,
    making it preemptible is not feasible.
    
    Instead, a different approach is taken.  Recently-populated pages are eagerly
    checked for reclaimation, which amortises the p2m_pod_emergency_sweep()
    operation across each p2m_pod_demand_populate() operation.
    
    Note that in the case that a 2M superpage can't be reclaimed as a superpage,
    it is shattered if 4K pages of zeros can be reclaimed.  This is unfortunate
    but matches the previous behaviour, and is required to avoid regressions
    (domain crash from PoD exhaustion) with VMs configured close to the limit.
    
    This is CVE-2015-7970 / XSA-150.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 101ce53266866144e724ed593173bc4098b300b9
    master date: 2015-10-29 13:36:25 +0100
---
 xen/arch/x86/mm/p2m-pod.c |   86 +++++++++++++++++++++++++++++---------------
 xen/arch/x86/mm/p2m.c     |    4 ++
 xen/include/asm-x86/p2m.h |   18 +++++++--
 3 files changed, 75 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index d14565d..d97b4a3 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -899,28 +899,6 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count)
 }
 
 #define POD_SWEEP_LIMIT 1024
-
-/* When populating a new superpage, look at recently populated superpages
- * hoping that they've been zeroed.  This will snap up zeroed pages as soon as 
- * the guest OS is done with them. */
-static void
-p2m_pod_check_last_super(struct p2m_domain *p2m, unsigned long gfn_aligned)
-{
-    unsigned long check_gfn;
-
-    ASSERT(p2m->pod.last_populated_index < POD_HISTORY_MAX);
-
-    check_gfn = p2m->pod.last_populated[p2m->pod.last_populated_index];
-
-    p2m->pod.last_populated[p2m->pod.last_populated_index] = gfn_aligned;
-
-    p2m->pod.last_populated_index =
-        ( p2m->pod.last_populated_index + 1 ) % POD_HISTORY_MAX;
-
-    p2m_pod_zero_check_superpage(p2m, check_gfn);
-}
-
-
 #define POD_SWEEP_STRIDE  16
 static void
 p2m_pod_emergency_sweep(struct p2m_domain *p2m)
@@ -961,7 +939,7 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
          * NB that this is a zero-sum game; we're increasing our cache size
          * by re-increasing our 'debt'.  Since we hold the pod lock,
          * (entry_count - count) must remain the same. */
-        if ( p2m->pod.count > 0 && i < limit )
+        if ( i < limit && (p2m->pod.count > 0 || hypercall_preempt_check()) )
             break;
     }
 
@@ -973,6 +951,58 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
 
 }
 
+static void pod_eager_reclaim(struct p2m_domain *p2m)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+    unsigned int i = 0;
+
+    /*
+     * Always check one page for reclaimation.
+     *
+     * If the PoD pool is empty, keep checking some space is found, or all
+     * entries have been exhaused.
+     */
+    do
+    {
+        unsigned int idx = (mrp->idx + i++) % ARRAY_SIZE(mrp->list);
+        unsigned long gfn = mrp->list[idx];
+
+        if ( gfn != INVALID_GFN )
+        {
+            if ( gfn & POD_LAST_SUPERPAGE )
+            {
+                gfn &= ~POD_LAST_SUPERPAGE;
+
+                if ( p2m_pod_zero_check_superpage(p2m, gfn) == 0 )
+                {
+                    unsigned int x;
+
+                    for ( x = 0; x < SUPERPAGE_PAGES; ++x, ++gfn )
+                        p2m_pod_zero_check(p2m, &gfn, 1);
+                }
+            }
+            else
+                p2m_pod_zero_check(p2m, &gfn, 1);
+
+            mrp->list[idx] = INVALID_GFN;
+        }
+
+    } while ( (p2m->pod.count == 0) && (i < ARRAY_SIZE(mrp->list)) );
+}
+
+static void pod_eager_record(struct p2m_domain *p2m,
+                             unsigned long gfn, unsigned int order)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+
+    ASSERT(mrp->list[mrp->idx] == INVALID_GFN);
+    ASSERT(gfn != INVALID_GFN);
+
+    mrp->list[mrp->idx++] =
+        gfn | (order == PAGE_ORDER_2M ? POD_LAST_SUPERPAGE : 0);
+    mrp->idx %= ARRAY_SIZE(mrp->list);
+}
+
 int
 p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
                         unsigned int order,
@@ -1013,6 +1043,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         return 0;
     }
 
+    pod_eager_reclaim(p2m);
+
     /* Only sweep if we're actually out of memory.  Doing anything else
      * causes unnecessary time and fragmentation of superpages in the p2m. */
     if ( p2m->pod.count == 0 )
@@ -1048,6 +1080,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
     p2m->pod.entry_count -= (1 << order);
     BUG_ON(p2m->pod.entry_count < 0);
 
+    pod_eager_record(p2m, gfn_aligned, order);
+
     if ( tb_init_done )
     {
         struct {
@@ -1063,12 +1097,6 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         __trace_var(TRC_MEM_POD_POPULATE, 0, sizeof(t), &t);
     }
 
-    /* Check the last guest demand-populate */
-    if ( p2m->pod.entry_count > p2m->pod.count 
-         && (order == PAGE_ORDER_2M)
-         && (q & P2M_ALLOC) )
-        p2m_pod_check_last_super(p2m, gfn_aligned);
-
     pod_unlock(p2m);
     return 0;
 out_of_memory:
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 4b4d856..f48096d 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -59,6 +59,7 @@ boolean_param("hap_2mb", opt_hap_2mb);
 /* Init the datastructures for later use by the p2m code */
 static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 {
+    unsigned int i;
     int ret = 0;
 
     mm_rwlock_init(&p2m->lock);
@@ -73,6 +74,9 @@ static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 
     p2m->np2m_base = P2M_BASE_EADDR;
 
+    for ( i = 0; i < ARRAY_SIZE(p2m->pod.mrp.list); ++i )
+        p2m->pod.mrp.list[i] = INVALID_GFN;
+
     if ( hap_enabled(d) && cpu_has_vmx )
         ret = ept_p2m_init(p2m);
     else
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index a2cb1b7..9d70d6c 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -270,10 +270,20 @@ struct p2m_domain {
                          entry_count;  /* # of pages in p2m marked pod      */
         unsigned long    reclaim_single; /* Last gpfn of a scan */
         unsigned long    max_guest;    /* gpfn of max guest demand-populate */
-#define POD_HISTORY_MAX 128
-        /* gpfn of last guest superpage demand-populated */
-        unsigned long    last_populated[POD_HISTORY_MAX]; 
-        unsigned int     last_populated_index;
+
+        /*
+         * Tracking of the most recently populated PoD pages, for eager
+         * reclamation.
+         */
+        struct pod_mrp_list {
+#define NR_POD_MRP_ENTRIES 32
+
+/* Encode ORDER_2M superpage in top bit of GFN */
+#define POD_LAST_SUPERPAGE (INVALID_GFN & ~(INVALID_GFN >> 1))
+
+            unsigned long list[NR_POD_MRP_ENTRIES];
+            unsigned int idx;
+        } mrp;
         mm_lock_t        lock;         /* Locking of private pod structs,   *
                                         * not relying on the p2m lock.      */
     } pod;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:23:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15:23: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 1ZsuTP-0004d0-0K; Sun, 01 Nov 2015 15:23: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 1ZsuTN-0004cm-2W
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:09 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	3A/AE-21201-C5E26365; Sun, 01 Nov 2015 15:23:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1446391386!5842!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52510 invoked from network); 1 Nov 2015 15:23:07 -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;
	1 Nov 2015 15:23:07 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTK-0001ys-Ho
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTK-0000Ln-FN
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:06 +0000
Date: Sun, 01 Nov 2015 15:23:06 +0000
Message-Id: <E1ZsuTK-0000Ln-FN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/PoD: Eager sweep for zeroed
	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 3638ff0e711e1a2bcb1ad8f3706d5ea079a54e79
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 29 14:14:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:14:30 2015 +0100

    x86/PoD: Eager sweep for zeroed pages
    
    Based on the contents of a guests physical address space,
    p2m_pod_emergency_sweep() could degrade into a linear memcmp() from 0 to
    max_gfn, which runs non-preemptibly.
    
    As p2m_pod_emergency_sweep() runs behind the scenes in a number of contexts,
    making it preemptible is not feasible.
    
    Instead, a different approach is taken.  Recently-populated pages are eagerly
    checked for reclaimation, which amortises the p2m_pod_emergency_sweep()
    operation across each p2m_pod_demand_populate() operation.
    
    Note that in the case that a 2M superpage can't be reclaimed as a superpage,
    it is shattered if 4K pages of zeros can be reclaimed.  This is unfortunate
    but matches the previous behaviour, and is required to avoid regressions
    (domain crash from PoD exhaustion) with VMs configured close to the limit.
    
    This is CVE-2015-7970 / XSA-150.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 101ce53266866144e724ed593173bc4098b300b9
    master date: 2015-10-29 13:36:25 +0100
---
 xen/arch/x86/mm/p2m-pod.c |   86 +++++++++++++++++++++++++++++---------------
 xen/arch/x86/mm/p2m.c     |    4 ++
 xen/include/asm-x86/p2m.h |   18 +++++++--
 3 files changed, 75 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index d14565d..d97b4a3 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -899,28 +899,6 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count)
 }
 
 #define POD_SWEEP_LIMIT 1024
-
-/* When populating a new superpage, look at recently populated superpages
- * hoping that they've been zeroed.  This will snap up zeroed pages as soon as 
- * the guest OS is done with them. */
-static void
-p2m_pod_check_last_super(struct p2m_domain *p2m, unsigned long gfn_aligned)
-{
-    unsigned long check_gfn;
-
-    ASSERT(p2m->pod.last_populated_index < POD_HISTORY_MAX);
-
-    check_gfn = p2m->pod.last_populated[p2m->pod.last_populated_index];
-
-    p2m->pod.last_populated[p2m->pod.last_populated_index] = gfn_aligned;
-
-    p2m->pod.last_populated_index =
-        ( p2m->pod.last_populated_index + 1 ) % POD_HISTORY_MAX;
-
-    p2m_pod_zero_check_superpage(p2m, check_gfn);
-}
-
-
 #define POD_SWEEP_STRIDE  16
 static void
 p2m_pod_emergency_sweep(struct p2m_domain *p2m)
@@ -961,7 +939,7 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
          * NB that this is a zero-sum game; we're increasing our cache size
          * by re-increasing our 'debt'.  Since we hold the pod lock,
          * (entry_count - count) must remain the same. */
-        if ( p2m->pod.count > 0 && i < limit )
+        if ( i < limit && (p2m->pod.count > 0 || hypercall_preempt_check()) )
             break;
     }
 
@@ -973,6 +951,58 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
 
 }
 
+static void pod_eager_reclaim(struct p2m_domain *p2m)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+    unsigned int i = 0;
+
+    /*
+     * Always check one page for reclaimation.
+     *
+     * If the PoD pool is empty, keep checking some space is found, or all
+     * entries have been exhaused.
+     */
+    do
+    {
+        unsigned int idx = (mrp->idx + i++) % ARRAY_SIZE(mrp->list);
+        unsigned long gfn = mrp->list[idx];
+
+        if ( gfn != INVALID_GFN )
+        {
+            if ( gfn & POD_LAST_SUPERPAGE )
+            {
+                gfn &= ~POD_LAST_SUPERPAGE;
+
+                if ( p2m_pod_zero_check_superpage(p2m, gfn) == 0 )
+                {
+                    unsigned int x;
+
+                    for ( x = 0; x < SUPERPAGE_PAGES; ++x, ++gfn )
+                        p2m_pod_zero_check(p2m, &gfn, 1);
+                }
+            }
+            else
+                p2m_pod_zero_check(p2m, &gfn, 1);
+
+            mrp->list[idx] = INVALID_GFN;
+        }
+
+    } while ( (p2m->pod.count == 0) && (i < ARRAY_SIZE(mrp->list)) );
+}
+
+static void pod_eager_record(struct p2m_domain *p2m,
+                             unsigned long gfn, unsigned int order)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+
+    ASSERT(mrp->list[mrp->idx] == INVALID_GFN);
+    ASSERT(gfn != INVALID_GFN);
+
+    mrp->list[mrp->idx++] =
+        gfn | (order == PAGE_ORDER_2M ? POD_LAST_SUPERPAGE : 0);
+    mrp->idx %= ARRAY_SIZE(mrp->list);
+}
+
 int
 p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
                         unsigned int order,
@@ -1013,6 +1043,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         return 0;
     }
 
+    pod_eager_reclaim(p2m);
+
     /* Only sweep if we're actually out of memory.  Doing anything else
      * causes unnecessary time and fragmentation of superpages in the p2m. */
     if ( p2m->pod.count == 0 )
@@ -1048,6 +1080,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
     p2m->pod.entry_count -= (1 << order);
     BUG_ON(p2m->pod.entry_count < 0);
 
+    pod_eager_record(p2m, gfn_aligned, order);
+
     if ( tb_init_done )
     {
         struct {
@@ -1063,12 +1097,6 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         __trace_var(TRC_MEM_POD_POPULATE, 0, sizeof(t), &t);
     }
 
-    /* Check the last guest demand-populate */
-    if ( p2m->pod.entry_count > p2m->pod.count 
-         && (order == PAGE_ORDER_2M)
-         && (q & P2M_ALLOC) )
-        p2m_pod_check_last_super(p2m, gfn_aligned);
-
     pod_unlock(p2m);
     return 0;
 out_of_memory:
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 4b4d856..f48096d 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -59,6 +59,7 @@ boolean_param("hap_2mb", opt_hap_2mb);
 /* Init the datastructures for later use by the p2m code */
 static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 {
+    unsigned int i;
     int ret = 0;
 
     mm_rwlock_init(&p2m->lock);
@@ -73,6 +74,9 @@ static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 
     p2m->np2m_base = P2M_BASE_EADDR;
 
+    for ( i = 0; i < ARRAY_SIZE(p2m->pod.mrp.list); ++i )
+        p2m->pod.mrp.list[i] = INVALID_GFN;
+
     if ( hap_enabled(d) && cpu_has_vmx )
         ret = ept_p2m_init(p2m);
     else
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index a2cb1b7..9d70d6c 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -270,10 +270,20 @@ struct p2m_domain {
                          entry_count;  /* # of pages in p2m marked pod      */
         unsigned long    reclaim_single; /* Last gpfn of a scan */
         unsigned long    max_guest;    /* gpfn of max guest demand-populate */
-#define POD_HISTORY_MAX 128
-        /* gpfn of last guest superpage demand-populated */
-        unsigned long    last_populated[POD_HISTORY_MAX]; 
-        unsigned int     last_populated_index;
+
+        /*
+         * Tracking of the most recently populated PoD pages, for eager
+         * reclamation.
+         */
+        struct pod_mrp_list {
+#define NR_POD_MRP_ENTRIES 32
+
+/* Encode ORDER_2M superpage in top bit of GFN */
+#define POD_LAST_SUPERPAGE (INVALID_GFN & ~(INVALID_GFN >> 1))
+
+            unsigned long list[NR_POD_MRP_ENTRIES];
+            unsigned int idx;
+        } mrp;
         mm_lock_t        lock;         /* Locking of private pod structs,   *
                                         * not relying on the p2m lock.      */
     } pod;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:23:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15:23: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 1ZsuTZ-0004en-52; Sun, 01 Nov 2015 15:23: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 1ZsuTX-0004eX-BI
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:19 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	0D/34-18744-66E26365; Sun, 01 Nov 2015 15:23:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1446391397!26569453!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21159 invoked from network); 1 Nov 2015 15:23:17 -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;
	1 Nov 2015 15:23:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTU-0001z0-S0
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTU-0000MC-Ot
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:16 +0000
Date: Sun, 01 Nov 2015 15:23:16 +0000
Message-Id: <E1ZsuTU-0000MC-Ot@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xenoprof: free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 76782e03f49d0ac79451db92a11877d2add8e811
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:14:55 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:14:55 2015 +0100

    xenoprof: free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-151.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 6e97c4b37386c2d09e09e9b5d5d232e37728b960
    master date: 2015-10-29 13:36:52 +0100
---
 xen/common/xenoprof.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 52ab00d..4703142 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -239,6 +239,7 @@ static int alloc_xenoprof_struct(
     d->xenoprof->rawbuf = alloc_xenheap_pages(get_order_from_pages(npages), 0);
     if ( d->xenoprof->rawbuf == NULL )
     {
+        xfree(d->xenoprof->vcpu);
         xfree(d->xenoprof);
         d->xenoprof = NULL;
         return -ENOMEM;
@@ -286,6 +287,7 @@ void free_xenoprof_pages(struct domain *d)
         free_xenheap_pages(x->rawbuf, order);
     }
 
+    xfree(x->vcpu);
     xfree(x);
     d->xenoprof = NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:23:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15:23: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 1ZsuTZ-0004en-52; Sun, 01 Nov 2015 15:23: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 1ZsuTX-0004eX-BI
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:19 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	0D/34-18744-66E26365; Sun, 01 Nov 2015 15:23:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1446391397!26569453!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21159 invoked from network); 1 Nov 2015 15:23:17 -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;
	1 Nov 2015 15:23:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTU-0001z0-S0
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTU-0000MC-Ot
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:16 +0000
Date: Sun, 01 Nov 2015 15:23:16 +0000
Message-Id: <E1ZsuTU-0000MC-Ot@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xenoprof: free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 76782e03f49d0ac79451db92a11877d2add8e811
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:14:55 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:14:55 2015 +0100

    xenoprof: free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-151.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 6e97c4b37386c2d09e09e9b5d5d232e37728b960
    master date: 2015-10-29 13:36:52 +0100
---
 xen/common/xenoprof.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 52ab00d..4703142 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -239,6 +239,7 @@ static int alloc_xenoprof_struct(
     d->xenoprof->rawbuf = alloc_xenheap_pages(get_order_from_pages(npages), 0);
     if ( d->xenoprof->rawbuf == NULL )
     {
+        xfree(d->xenoprof->vcpu);
         xfree(d->xenoprof);
         d->xenoprof = NULL;
         return -ENOMEM;
@@ -286,6 +287,7 @@ void free_xenoprof_pages(struct domain *d)
         free_xenheap_pages(x->rawbuf, order);
     }
 
+    xfree(x->vcpu);
     xfree(x);
     d->xenoprof = NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:23:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuTi-0004gC-7P; Sun, 01 Nov 2015 15:23: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 1ZsuTh-0004fx-Mq
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:29 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	7B/BE-00475-17E26365; Sun, 01 Nov 2015 15:23:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1446391407!63384671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5442 invoked from network); 1 Nov 2015 15:23:28 -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;
	1 Nov 2015 15:23:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTf-0001z8-9E
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTf-0000MY-4U
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:27 +0000
Date: Sun, 01 Nov 2015 15:23:27 +0000
Message-Id: <E1ZsuTf-0000MY-4U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: rate-limit logging in
	do_xen{oprof, pmu}_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 0613780df68c4a35a0bde1584daea0697666ef01
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:15:22 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:15:22 2015 +0100

    x86: rate-limit logging in do_xen{oprof,pmu}_op()
    
    Some of the sub-ops are acessible to all guests, and hence should be
    rate-limited. In the xenoprof case, just like for XSA-146, include them
    only in debug builds. Since the vPMU code is rather new, allow them to
    be always present, but downgrade them to (rate limited) guest messages.
    
    This is CVE-2015-7971 / XSA-152.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 95e7415843b94c346e5ba8682665f508f220e04b
    master date: 2015-10-29 13:37:19 +0100
---
 xen/common/xenoprof.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 4703142..abcb947 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -670,15 +670,13 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     
     if ( (op < 0) || (op > XENOPROF_last_op) )
     {
-        printk("xenoprof: invalid operation %d for domain %d\n",
-               op, current->domain->domain_id);
+        gdprintk(XENLOG_DEBUG, "invalid operation %d\n", op);
         return -EINVAL;
     }
 
     if ( !NONPRIV_OP(op) && (current->domain != xenoprof_primary_profiler) )
     {
-        printk("xenoprof: dom %d denied privileged operation %d\n",
-               current->domain->domain_id, op);
+        gdprintk(XENLOG_DEBUG, "denied privileged operation %d\n", op);
         return -EPERM;
     }
 
@@ -901,8 +899,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     spin_unlock(&xenoprof_lock);
 
     if ( ret < 0 )
-        printk("xenoprof: operation %d failed for dom %d (status : %d)\n",
-               op, current->domain->domain_id, ret);
+        gdprintk(XENLOG_DEBUG, "operation %d failed: %d\n", op, ret);
 
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:23:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuTi-0004gC-7P; Sun, 01 Nov 2015 15:23: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 1ZsuTh-0004fx-Mq
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:29 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	7B/BE-00475-17E26365; Sun, 01 Nov 2015 15:23:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1446391407!63384671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5442 invoked from network); 1 Nov 2015 15:23:28 -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;
	1 Nov 2015 15:23:28 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTf-0001z8-9E
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTf-0000MY-4U
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:27 +0000
Date: Sun, 01 Nov 2015 15:23:27 +0000
Message-Id: <E1ZsuTf-0000MY-4U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: rate-limit logging in
	do_xen{oprof, pmu}_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 0613780df68c4a35a0bde1584daea0697666ef01
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:15:22 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:15:22 2015 +0100

    x86: rate-limit logging in do_xen{oprof,pmu}_op()
    
    Some of the sub-ops are acessible to all guests, and hence should be
    rate-limited. In the xenoprof case, just like for XSA-146, include them
    only in debug builds. Since the vPMU code is rather new, allow them to
    be always present, but downgrade them to (rate limited) guest messages.
    
    This is CVE-2015-7971 / XSA-152.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 95e7415843b94c346e5ba8682665f508f220e04b
    master date: 2015-10-29 13:37:19 +0100
---
 xen/common/xenoprof.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 4703142..abcb947 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -670,15 +670,13 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     
     if ( (op < 0) || (op > XENOPROF_last_op) )
     {
-        printk("xenoprof: invalid operation %d for domain %d\n",
-               op, current->domain->domain_id);
+        gdprintk(XENLOG_DEBUG, "invalid operation %d\n", op);
         return -EINVAL;
     }
 
     if ( !NONPRIV_OP(op) && (current->domain != xenoprof_primary_profiler) )
     {
-        printk("xenoprof: dom %d denied privileged operation %d\n",
-               current->domain->domain_id, op);
+        gdprintk(XENLOG_DEBUG, "denied privileged operation %d\n", op);
         return -EPERM;
     }
 
@@ -901,8 +899,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     spin_unlock(&xenoprof_lock);
 
     if ( ret < 0 )
-        printk("xenoprof: operation %d failed for dom %d (status : %d)\n",
-               op, current->domain->domain_id, ret);
+        gdprintk(XENLOG_DEBUG, "operation %d failed: %d\n", op, ret);
 
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:23:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuTs-0004hj-9x; Sun, 01 Nov 2015 15:23: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 1ZsuTr-0004ha-NN
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:39 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	B6/93-13905-B7E26365; Sun, 01 Nov 2015 15:23:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446391417!37903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31121 invoked from network); 1 Nov 2015 15:23:38 -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;
	1 Nov 2015 15:23:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTp-0001zG-IN
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTp-0000Mu-Ga
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:37 +0000
Date: Sun, 01 Nov 2015 15:23:37 +0000
Message-Id: <E1ZsuTp-0000Mu-Ga@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] libxl: adjust PoD target by memory
	fudge, 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 73b70e3c5d59e63126c890068ee0cbf8a2a3b640
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 16:18:30 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:14:06 2015 +0000

    libxl: adjust PoD target by memory fudge, too
    
    PoD guests need to balloon at least as far as required by PoD, or risk
    crashing.  Currently they don't necessarily know what the right value
    is, because our memory accounting is (at the very least) confusing.
    
    Apply the memory limit fudge factor to the in-hypervisor PoD memory
    target, too.  This will increase the size of the guest's PoD cache by
    the fudge factor LIBXL_MAXMEM_CONSTANT (currently 1Mby).  This ensures
    that even with a slightly-off balloon driver, the guest will be
    stable even under memory pressure.
    
    There are two call sites of xc_domain_set_pod_target that need fixing:
    
    The one in libxl_set_memory_target is straightforward.
    
    The one in xc_hvm_build_x86.c:setup_guest is more awkward.  Simply
    setting the PoD target differently does not work because the various
    amounts of memory during domain construction no longer match up.
    Instead, we adjust the guest memory target in xenstore (but only for
    PoD guests).
    
    This introduces a 1Mby discrepancy between the balloon target of a PoD
    guest at boot, and the target set by an apparently-equivalent `xl
    mem-set' (or similar) later.  This approach is low-risk for a security
    fix but we need to fix this up properly in xen.git#staging and
    probably also in stable trees.
    
    This is XSA-153.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 56fb5fd62320eb40a7517206f9706aa9188d6f7b)
    (cherry picked from commit 423d2cd814e8460d5ea8bd191a770f3c48b3947c)
    
    Conflicts:
    	tools/libxl/libxl_dom.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c     |    2 +-
 tools/libxl/libxl_dom.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 24c3f6e..e2a5be3 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4132,7 +4132,7 @@ retry_transaction:
 
     new_target_memkb -= videoram;
     rc = xc_domain_set_pod_target(ctx->xch, domid,
-            new_target_memkb / 4, NULL, NULL, NULL);
+            (new_target_memkb + LIBXL_MAXMEM_CONSTANT) / 4, NULL, NULL, NULL);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "xc_domain_set_pod_target domid=%d, memkb=%d "
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 69e6088..52bc01a 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -270,6 +270,7 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     xs_transaction_t t;
     char **ents, **hvm_ents;
     int i, rc;
+    int64_t mem_target_fudge;
 
     rc = libxl_domain_sched_params_set(CTX, domid, &info->sched_params);
     if (rc)
@@ -286,11 +287,17 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     if (info->cpuid != NULL)
         libxl_cpuid_set(ctx, domid, info->cpuid);
 
+    mem_target_fudge =
+        (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+         info->max_memkb > info->target_memkb)
+        ? LIBXL_MAXMEM_CONSTANT : 0;
+
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
     ents[1] = GCSPRINTF("%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb);
+    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb
+                        - mem_target_fudge);
     ents[4] = "memory/videoram";
     ents[5] = GCSPRINTF("%"PRId64, info->video_memkb);
     ents[6] = "domid";
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Nov 01 15:23:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Nov 2015 15: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 1ZsuTs-0004hj-9x; Sun, 01 Nov 2015 15:23: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 1ZsuTr-0004ha-NN
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:39 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	B6/93-13905-B7E26365; Sun, 01 Nov 2015 15:23:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446391417!37903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31121 invoked from network); 1 Nov 2015 15:23:38 -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;
	1 Nov 2015 15:23:38 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTp-0001zG-IN
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZsuTp-0000Mu-Ga
	for xen-changelog@lists.xensource.com; Sun, 01 Nov 2015 15:23:37 +0000
Date: Sun, 01 Nov 2015 15:23:37 +0000
Message-Id: <E1ZsuTp-0000Mu-Ga@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] libxl: adjust PoD target by memory
	fudge, 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 73b70e3c5d59e63126c890068ee0cbf8a2a3b640
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 16:18:30 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:14:06 2015 +0000

    libxl: adjust PoD target by memory fudge, too
    
    PoD guests need to balloon at least as far as required by PoD, or risk
    crashing.  Currently they don't necessarily know what the right value
    is, because our memory accounting is (at the very least) confusing.
    
    Apply the memory limit fudge factor to the in-hypervisor PoD memory
    target, too.  This will increase the size of the guest's PoD cache by
    the fudge factor LIBXL_MAXMEM_CONSTANT (currently 1Mby).  This ensures
    that even with a slightly-off balloon driver, the guest will be
    stable even under memory pressure.
    
    There are two call sites of xc_domain_set_pod_target that need fixing:
    
    The one in libxl_set_memory_target is straightforward.
    
    The one in xc_hvm_build_x86.c:setup_guest is more awkward.  Simply
    setting the PoD target differently does not work because the various
    amounts of memory during domain construction no longer match up.
    Instead, we adjust the guest memory target in xenstore (but only for
    PoD guests).
    
    This introduces a 1Mby discrepancy between the balloon target of a PoD
    guest at boot, and the target set by an apparently-equivalent `xl
    mem-set' (or similar) later.  This approach is low-risk for a security
    fix but we need to fix this up properly in xen.git#staging and
    probably also in stable trees.
    
    This is XSA-153.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 56fb5fd62320eb40a7517206f9706aa9188d6f7b)
    (cherry picked from commit 423d2cd814e8460d5ea8bd191a770f3c48b3947c)
    
    Conflicts:
    	tools/libxl/libxl_dom.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c     |    2 +-
 tools/libxl/libxl_dom.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 24c3f6e..e2a5be3 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4132,7 +4132,7 @@ retry_transaction:
 
     new_target_memkb -= videoram;
     rc = xc_domain_set_pod_target(ctx->xch, domid,
-            new_target_memkb / 4, NULL, NULL, NULL);
+            (new_target_memkb + LIBXL_MAXMEM_CONSTANT) / 4, NULL, NULL, NULL);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "xc_domain_set_pod_target domid=%d, memkb=%d "
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 69e6088..52bc01a 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -270,6 +270,7 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     xs_transaction_t t;
     char **ents, **hvm_ents;
     int i, rc;
+    int64_t mem_target_fudge;
 
     rc = libxl_domain_sched_params_set(CTX, domid, &info->sched_params);
     if (rc)
@@ -286,11 +287,17 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     if (info->cpuid != NULL)
         libxl_cpuid_set(ctx, domid, info->cpuid);
 
+    mem_target_fudge =
+        (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+         info->max_memkb > info->target_memkb)
+        ? LIBXL_MAXMEM_CONSTANT : 0;
+
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
     ents[1] = GCSPRINTF("%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb);
+    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb
+                        - mem_target_fudge);
     ents[4] = "memory/videoram";
     ents[5] = GCSPRINTF("%"PRId64, info->video_memkb);
     ents[6] = "domid";
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 05:44:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zt7ud-0001Ng-Dk; Mon, 02 Nov 2015 05:44: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 1Zt7uc-0001Na-7J
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:10 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	00/D9-18107-928F6365; Mon, 02 Nov 2015 05:44:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1446443046!107329!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44211 invoked from network); 2 Nov 2015 05:44: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;
	2 Nov 2015 05:44:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7uX-00047n-QJ
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7uX-0002iO-MT
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:05 +0000
Date: Mon, 02 Nov 2015 05:44:05 +0000
Message-Id: <E1Zt7uX-0002iO-MT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/domain: avoid to shadow the
	variable "d" in do_vcpu_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 f6f08decb5f24ac299ab2ce23e2164ed8b13ca50
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 12:19:23 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 12:19:23 2015 +0100

    common/domain: avoid to shadow the variable "d" in do_vcpu_op
    
    The variable "d" is defined twice. However, the second one is not
    necessary as the vCPU as already been deduced from the first "d".
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/domain.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index b0378aa..b95f29a 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1329,7 +1329,6 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case VCPUOP_register_vcpu_info:
     {
-        struct domain *d = v->domain;
         struct vcpu_register_vcpu_info info;
 
         rc = -EFAULT;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:44:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zt7ud-0001Ng-Dk; Mon, 02 Nov 2015 05:44: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 1Zt7uc-0001Na-7J
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:10 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	00/D9-18107-928F6365; Mon, 02 Nov 2015 05:44:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1446443046!107329!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44211 invoked from network); 2 Nov 2015 05:44: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;
	2 Nov 2015 05:44:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7uX-00047n-QJ
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7uX-0002iO-MT
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:05 +0000
Date: Mon, 02 Nov 2015 05:44:05 +0000
Message-Id: <E1Zt7uX-0002iO-MT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/domain: avoid to shadow the
	variable "d" in do_vcpu_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 f6f08decb5f24ac299ab2ce23e2164ed8b13ca50
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 12:19:23 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 12:19:23 2015 +0100

    common/domain: avoid to shadow the variable "d" in do_vcpu_op
    
    The variable "d" is defined twice. However, the second one is not
    necessary as the vCPU as already been deduced from the first "d".
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/domain.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index b0378aa..b95f29a 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1329,7 +1329,6 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case VCPUOP_register_vcpu_info:
     {
-        struct domain *d = v->domain;
         struct vcpu_register_vcpu_info info;
 
         rc = -EFAULT;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:44:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05: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 1Zt7ul-0001OK-G3; Mon, 02 Nov 2015 05: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 1Zt7uk-0001OC-MB
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:18 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	C3/2A-09570-138F6365; Mon, 02 Nov 2015 05:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446443056!76308!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39987 invoked from network); 2 Nov 2015 05:44: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;
	2 Nov 2015 05:44:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7ui-00047r-5l
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7ui-0002iw-37
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:16 +0000
Date: Mon, 02 Nov 2015 05:44:16 +0000
Message-Id: <E1Zt7ui-0002iw-37@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] grant_table: avoid to shadow "frame"
	in __gnttab_map_grant_ref
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a722f89d30093cf5e1d2bc536fd73d6f9e5513f
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 12:20:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 12:20:38 2015 +0100

    grant_table: avoid to shadow "frame" in __gnttab_map_grant_ref
    
    The variable "frame" is declared twice within the function
    __gntab_map_grant_ref.  This makes the code quite confusing to read.
    
    The second definition is not useful as the first one is never used
    until then. So drop it.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/grant_table.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index c92abda..5d52d1e 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -826,7 +826,6 @@ __gnttab_map_grant_ref(
 
         if ( !act->pin )
         {
-            unsigned long frame;
             unsigned long gfn = rgt->gt_version == 1 ?
                                 shared_entry_v1(rgt, op->ref).frame :
                                 shared_entry_v2(rgt, op->ref).full_page.frame;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:44:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05: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 1Zt7ul-0001OK-G3; Mon, 02 Nov 2015 05: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 1Zt7uk-0001OC-MB
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:18 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	C3/2A-09570-138F6365; Mon, 02 Nov 2015 05:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446443056!76308!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39987 invoked from network); 2 Nov 2015 05:44: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;
	2 Nov 2015 05:44:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7ui-00047r-5l
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7ui-0002iw-37
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:16 +0000
Date: Mon, 02 Nov 2015 05:44:16 +0000
Message-Id: <E1Zt7ui-0002iw-37@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] grant_table: avoid to shadow "frame"
	in __gnttab_map_grant_ref
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a722f89d30093cf5e1d2bc536fd73d6f9e5513f
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 12:20:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 12:20:38 2015 +0100

    grant_table: avoid to shadow "frame" in __gnttab_map_grant_ref
    
    The variable "frame" is declared twice within the function
    __gntab_map_grant_ref.  This makes the code quite confusing to read.
    
    The second definition is not useful as the first one is never used
    until then. So drop it.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/grant_table.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index c92abda..5d52d1e 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -826,7 +826,6 @@ __gnttab_map_grant_ref(
 
         if ( !act->pin )
         {
-            unsigned long frame;
             unsigned long gfn = rgt->gt_version == 1 ?
                                 shared_entry_v1(rgt, op->ref).frame :
                                 shared_entry_v2(rgt, op->ref).full_page.frame;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:44:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:44: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 1Zt7uv-0001Po-IT; Mon, 02 Nov 2015 05:44: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 1Zt7uu-0001Pc-Oy
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:28 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	48/78-16965-C38F6365; Mon, 02 Nov 2015 05:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1446443066!76735!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57795 invoked from network); 2 Nov 2015 05:44:27 -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;
	2 Nov 2015 05:44:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7us-000483-Gt
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7us-0002jS-El
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:26 +0000
Date: Mon, 02 Nov 2015 05:44:26 +0000
Message-Id: <E1Zt7us-0002jS-El@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/memory: avoid to shadow the
	variable "d" in do_memory_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 4c09af65a9afeabd381b132a21dd8eaeee7e8437
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 12:23:34 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 12:23:34 2015 +0100

    common/memory: avoid to shadow the variable "d" in do_memory_op
    
    The variable "d" is declared multiple times within do_memory_op.
    
    The subsequent declaration are not useful because the top one is never
    used. So drop them.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/memory.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 23f90c6..a3bffb7 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -961,7 +961,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case XENMEM_add_to_physmap_batch:
     {
         struct xen_add_to_physmap_batch xatpb;
-        struct domain *d;
 
         BUILD_BUG_ON((typeof(xatpb.size))-1 >
                      (UINT_MAX >> MEMOP_EXTENT_SHIFT));
@@ -1007,7 +1006,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     {
         struct xen_remove_from_physmap xrfp;
         struct page_info *page;
-        struct domain *d;
 
         if ( unlikely(start_extent) )
             return -ENOSYS;
@@ -1076,7 +1074,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case XENMEM_get_vnumainfo:
     {
         struct xen_vnuma_topology_info topology;
-        struct domain *d;
         unsigned int dom_vnodes, dom_vranges, dom_vcpus;
         struct vnuma_info tmp;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 05:44:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:44: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 1Zt7uv-0001Po-IT; Mon, 02 Nov 2015 05:44: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 1Zt7uu-0001Pc-Oy
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:28 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	48/78-16965-C38F6365; Mon, 02 Nov 2015 05:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1446443066!76735!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57795 invoked from network); 2 Nov 2015 05:44:27 -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;
	2 Nov 2015 05:44:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7us-000483-Gt
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7us-0002jS-El
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:26 +0000
Date: Mon, 02 Nov 2015 05:44:26 +0000
Message-Id: <E1Zt7us-0002jS-El@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/memory: avoid to shadow the
	variable "d" in do_memory_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 4c09af65a9afeabd381b132a21dd8eaeee7e8437
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 12:23:34 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 12:23:34 2015 +0100

    common/memory: avoid to shadow the variable "d" in do_memory_op
    
    The variable "d" is declared multiple times within do_memory_op.
    
    The subsequent declaration are not useful because the top one is never
    used. So drop them.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/memory.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 23f90c6..a3bffb7 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -961,7 +961,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case XENMEM_add_to_physmap_batch:
     {
         struct xen_add_to_physmap_batch xatpb;
-        struct domain *d;
 
         BUILD_BUG_ON((typeof(xatpb.size))-1 >
                      (UINT_MAX >> MEMOP_EXTENT_SHIFT));
@@ -1007,7 +1006,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     {
         struct xen_remove_from_physmap xrfp;
         struct page_info *page;
-        struct domain *d;
 
         if ( unlikely(start_extent) )
             return -ENOSYS;
@@ -1076,7 +1074,6 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case XENMEM_get_vnumainfo:
     {
         struct xen_vnuma_topology_info topology;
-        struct domain *d;
         unsigned int dom_vnodes, dom_vranges, dom_vcpus;
         struct vnuma_info tmp;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 05:44:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05: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 1Zt7v5-0001RT-Kx; Mon, 02 Nov 2015 05:44: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 1Zt7v5-0001RG-3W
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:39 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	10/C8-01753-648F6365; Mon, 02 Nov 2015 05:44:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1446443077!76369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60241 invoked from network); 2 Nov 2015 05:44:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2015 05:44:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7v2-00048B-R8
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7v2-0002jz-PZ
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:36 +0000
Date: Mon, 02 Nov 2015 05:44:36 +0000
Message-Id: <E1Zt7v2-0002jz-PZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit2: avoid to shadow the variable
	"cur" in runq_tickle
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 568ff32927ecc68765973ad5b590b48e045dee4a
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 12:23:53 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 12:23:53 2015 +0100

    credit2: avoid to shadow the variable "cur" in runq_tickle
    
    The variable "cur" is declared twice within "cur". However the top
    declaration could be re-used avoiding re-declaring another time the
    variable.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/sched_credit2.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 6695729..fc51a75 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -519,8 +519,6 @@ runq_tickle(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu *
 
     for_each_cpu(i, &mask)
     {
-        struct csched2_vcpu * cur;
-
         /* Already looked at this one above */
         if ( i == cpu )
             continue;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:44:39 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05: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 1Zt7v5-0001RT-Kx; Mon, 02 Nov 2015 05:44: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 1Zt7v5-0001RG-3W
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:39 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	10/C8-01753-648F6365; Mon, 02 Nov 2015 05:44:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1446443077!76369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60241 invoked from network); 2 Nov 2015 05:44:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Nov 2015 05:44:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7v2-00048B-R8
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7v2-0002jz-PZ
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:36 +0000
Date: Mon, 02 Nov 2015 05:44:36 +0000
Message-Id: <E1Zt7v2-0002jz-PZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit2: avoid to shadow the variable
	"cur" in runq_tickle
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 568ff32927ecc68765973ad5b590b48e045dee4a
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 12:23:53 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 12:23:53 2015 +0100

    credit2: avoid to shadow the variable "cur" in runq_tickle
    
    The variable "cur" is declared twice within "cur". However the top
    declaration could be re-used avoiding re-declaring another time the
    variable.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/sched_credit2.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 6695729..fc51a75 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -519,8 +519,6 @@ runq_tickle(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu *
 
     for_each_cpu(i, &mask)
     {
-        struct csched2_vcpu * cur;
-
         /* Already looked at this one above */
         if ( i == cpu )
             continue;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:44:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:44: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 1Zt7vI-0001TX-Nc; Mon, 02 Nov 2015 05:44:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vH-0001TK-FT
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:51 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	31/A4-14422-258F6365; Mon, 02 Nov 2015 05:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1446443087!107828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58788 invoked from network); 2 Nov 2015 05:44:48 -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;
	2 Nov 2015 05:44:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vD-00048J-3k
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vD-0002kU-1r
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:47 +0000
Date: Mon, 02 Nov 2015 05:44:47 +0000
Message-Id: <E1Zt7vD-0002kU-1r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched-rt: avoid to shadow the variable
	"svc" in rt_dom_cntl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 79fbab823fde327c6b766529c1b06b509457dc92
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 12:24:13 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 12:24:13 2015 +0100

    sched-rt: avoid to shadow the variable "svc" in rt_dom_cntl
    
    The variable "svc" is declared twice within rt_dom_cntl. However, the
    top declaration could be re-used avoiding re-declaring another time the
    variable.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 xen/common/sched_rt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 6a341b1..822f23c 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -1158,7 +1158,7 @@ rt_dom_cntl(
         spin_lock_irqsave(&prv->lock, flags);
         list_for_each( iter, &sdom->vcpu )
         {
-            struct rt_vcpu * svc = list_entry(iter, struct rt_vcpu, sdom_elem);
+            svc = list_entry(iter, struct rt_vcpu, sdom_elem);
             svc->period = MICROSECS(op->u.rtds.period); /* transfer to nanosec */
             svc->budget = MICROSECS(op->u.rtds.budget);
         }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:44:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:44: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 1Zt7vI-0001TX-Nc; Mon, 02 Nov 2015 05:44:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vH-0001TK-FT
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:51 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	31/A4-14422-258F6365; Mon, 02 Nov 2015 05:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1446443087!107828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58788 invoked from network); 2 Nov 2015 05:44:48 -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;
	2 Nov 2015 05:44:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vD-00048J-3k
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vD-0002kU-1r
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:47 +0000
Date: Mon, 02 Nov 2015 05:44:47 +0000
Message-Id: <E1Zt7vD-0002kU-1r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched-rt: avoid to shadow the variable
	"svc" in rt_dom_cntl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 79fbab823fde327c6b766529c1b06b509457dc92
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 12:24:13 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 12:24:13 2015 +0100

    sched-rt: avoid to shadow the variable "svc" in rt_dom_cntl
    
    The variable "svc" is declared twice within rt_dom_cntl. However, the
    top declaration could be re-used avoiding re-declaring another time the
    variable.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 xen/common/sched_rt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 6a341b1..822f23c 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -1158,7 +1158,7 @@ rt_dom_cntl(
         spin_lock_irqsave(&prv->lock, flags);
         list_for_each( iter, &sdom->vcpu )
         {
-            struct rt_vcpu * svc = list_entry(iter, struct rt_vcpu, sdom_elem);
+            svc = list_entry(iter, struct rt_vcpu, sdom_elem);
             svc->period = MICROSECS(op->u.rtds.period); /* transfer to nanosec */
             svc->budget = MICROSECS(op->u.rtds.budget);
         }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:45:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05: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 1Zt7vQ-0001VE-S9; Mon, 02 Nov 2015 05:45: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 1Zt7vP-0001Uy-Q7
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:59 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	72/AA-09570-B58F6365; Mon, 02 Nov 2015 05:44:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1446443097!76525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46458 invoked from network); 2 Nov 2015 05:44:58 -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;
	2 Nov 2015 05:44:58 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vN-00048R-CK
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vN-0002lb-A5
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:57 +0000
Date: Mon, 02 Nov 2015 05:44:57 +0000
Message-Id: <E1Zt7vN-0002lb-A5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: Support
	hypercall_create_continuation for multicall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29bcf64ce8bc0b1b7aacd00c8668f255c4f0686c
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 13:31:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:31:10 2015 +0100

    arm: Support hypercall_create_continuation for multicall
    
    Multicall for ARM has been supported since commit f0dbdc6 "xen: arm: fully
    implement multicall interface.". Although, if an hypercall in multicall
    requires preemption, it will crash the host:
    
    (XEN) Xen BUG at domain.c:347
    (XEN) ----[ Xen-4.7-unstable  arm64  debug=y  Tainted:    C ]----
    [...]
    (XEN) Xen call trace:
    (XEN)    [<00000000002420cc>] hypercall_create_continuation+0x64/0x380 (PC)
    (XEN)    [<0000000000217274>] do_memory_op+0x1b00/0x2334 (LR)
    (XEN)    [<0000000000250d2c>] do_multicall_call+0x114/0x124
    (XEN)    [<0000000000217ff0>] do_multicall+0x17c/0x23c
    (XEN)    [<000000000024f97c>] do_trap_hypercall+0x90/0x12c
    (XEN)    [<0000000000251ca8>] do_trap_hypervisor+0xd2c/0x1ba4
    (XEN)    [<00000000002582cc>] guest_sync+0x88/0xb8
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 5:
    (XEN) Xen BUG at domain.c:347
    (XEN) ****************************************
    (XEN)
    (XEN) Manual reset required ('noreboot' specified)
    
    Looking to the code, the support of multicall looks valid to me, as we only
    need to fill call.args[...]. So drop the BUG();
    
    This is CVE-2015-7812 / XSA-145.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 4c08073..683e769 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -354,8 +354,6 @@ unsigned long hypercall_create_continuation(
 
     if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
     {
-        BUG(); /* XXX multicalls not implemented yet. */
-
         __set_bit(_MCSF_call_preempted, &mcs->flags);
 
         for ( i = 0; *p != '\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 Mon Nov 02 05:45:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05: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 1Zt7vQ-0001VE-S9; Mon, 02 Nov 2015 05:45: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 1Zt7vP-0001Uy-Q7
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:59 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	72/AA-09570-B58F6365; Mon, 02 Nov 2015 05:44:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1446443097!76525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46458 invoked from network); 2 Nov 2015 05:44:58 -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;
	2 Nov 2015 05:44:58 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vN-00048R-CK
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vN-0002lb-A5
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:44:57 +0000
Date: Mon, 02 Nov 2015 05:44:57 +0000
Message-Id: <E1Zt7vN-0002lb-A5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: Support
	hypercall_create_continuation for multicall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29bcf64ce8bc0b1b7aacd00c8668f255c4f0686c
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Oct 29 13:31:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:31:10 2015 +0100

    arm: Support hypercall_create_continuation for multicall
    
    Multicall for ARM has been supported since commit f0dbdc6 "xen: arm: fully
    implement multicall interface.". Although, if an hypercall in multicall
    requires preemption, it will crash the host:
    
    (XEN) Xen BUG at domain.c:347
    (XEN) ----[ Xen-4.7-unstable  arm64  debug=y  Tainted:    C ]----
    [...]
    (XEN) Xen call trace:
    (XEN)    [<00000000002420cc>] hypercall_create_continuation+0x64/0x380 (PC)
    (XEN)    [<0000000000217274>] do_memory_op+0x1b00/0x2334 (LR)
    (XEN)    [<0000000000250d2c>] do_multicall_call+0x114/0x124
    (XEN)    [<0000000000217ff0>] do_multicall+0x17c/0x23c
    (XEN)    [<000000000024f97c>] do_trap_hypercall+0x90/0x12c
    (XEN)    [<0000000000251ca8>] do_trap_hypervisor+0xd2c/0x1ba4
    (XEN)    [<00000000002582cc>] guest_sync+0x88/0xb8
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 5:
    (XEN) Xen BUG at domain.c:347
    (XEN) ****************************************
    (XEN)
    (XEN) Manual reset required ('noreboot' specified)
    
    Looking to the code, the support of multicall looks valid to me, as we only
    need to fill call.args[...]. So drop the BUG();
    
    This is CVE-2015-7812 / XSA-145.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 4c08073..683e769 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -354,8 +354,6 @@ unsigned long hypercall_create_continuation(
 
     if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
     {
-        BUG(); /* XXX multicalls not implemented yet. */
-
         __set_bit(_MCSF_call_preempted, &mcs->flags);
 
         for ( i = 0; *p != '\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 Mon Nov 02 05:45:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:45: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 1Zt7vg-0001XO-V2; Mon, 02 Nov 2015 05:45:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vf-0001XE-P4
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:15 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	C9/2D-26043-B68F6365; Mon, 02 Nov 2015 05:45:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1446443113!44669861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3618 invoked from network); 2 Nov 2015 05:45:14 -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;
	2 Nov 2015 05:45:14 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vZ-00049R-Vf
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vX-0002mR-H7
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:09 +0000
Date: Mon, 02 Nov 2015 05:45:07 +0000
Message-Id: <E1Zt7vX-0002mR-H7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: rate-limit logging from
	unimplemented PHYSDEVOP and HVMOP.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c0e59ff15764e7b0c59282365974f5b8924ce83
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 13:33:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:33:38 2015 +0100

    arm: rate-limit logging from unimplemented PHYSDEVOP and HVMOP.
    
    These are guest accessible and should therefore be rate-limited.
    Moreover, include them only in debug builds.
    
    This is CVE-2015-7813 / XSA-146.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/hvm.c     |    2 +-
 xen/arch/arm/physdev.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c
index 471c4cd..5fd0753 100644
--- a/xen/arch/arm/hvm.c
+++ b/xen/arch/arm/hvm.c
@@ -57,7 +57,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     default:
     {
-        printk("%s: Bad HVM op %ld.\n", __func__, op);
+        gdprintk(XENLOG_DEBUG, "HVMOP op=%lu: not implemented\n", op);
         rc = -ENOSYS;
         break;
     }
diff --git a/xen/arch/arm/physdev.c b/xen/arch/arm/physdev.c
index 61b4a18..27bbbda 100644
--- a/xen/arch/arm/physdev.c
+++ b/xen/arch/arm/physdev.c
@@ -8,12 +8,13 @@
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
+#include <xen/sched.h>
 #include <asm/hypercall.h>
 
 
 int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
-    printk("%s %d cmd=%d: not implemented yet\n", __func__, __LINE__, cmd);
+    gdprintk(XENLOG_DEBUG, "PHYSDEVOP cmd=%d: not implemented\n", cmd);
     return -ENOSYS;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:45:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:45: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 1Zt7vg-0001XO-V2; Mon, 02 Nov 2015 05:45:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vf-0001XE-P4
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:15 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	C9/2D-26043-B68F6365; Mon, 02 Nov 2015 05:45:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1446443113!44669861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3618 invoked from network); 2 Nov 2015 05:45:14 -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;
	2 Nov 2015 05:45:14 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vZ-00049R-Vf
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vX-0002mR-H7
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:09 +0000
Date: Mon, 02 Nov 2015 05:45:07 +0000
Message-Id: <E1Zt7vX-0002mR-H7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: rate-limit logging from
	unimplemented PHYSDEVOP and HVMOP.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c0e59ff15764e7b0c59282365974f5b8924ce83
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 13:33:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:33:38 2015 +0100

    arm: rate-limit logging from unimplemented PHYSDEVOP and HVMOP.
    
    These are guest accessible and should therefore be rate-limited.
    Moreover, include them only in debug builds.
    
    This is CVE-2015-7813 / XSA-146.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/hvm.c     |    2 +-
 xen/arch/arm/physdev.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c
index 471c4cd..5fd0753 100644
--- a/xen/arch/arm/hvm.c
+++ b/xen/arch/arm/hvm.c
@@ -57,7 +57,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     default:
     {
-        printk("%s: Bad HVM op %ld.\n", __func__, op);
+        gdprintk(XENLOG_DEBUG, "HVMOP op=%lu: not implemented\n", op);
         rc = -ENOSYS;
         break;
     }
diff --git a/xen/arch/arm/physdev.c b/xen/arch/arm/physdev.c
index 61b4a18..27bbbda 100644
--- a/xen/arch/arm/physdev.c
+++ b/xen/arch/arm/physdev.c
@@ -8,12 +8,13 @@
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
+#include <xen/sched.h>
 #include <asm/hypercall.h>
 
 
 int do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 {
-    printk("%s %d cmd=%d: not implemented yet\n", __func__, __LINE__, cmd);
+    gdprintk(XENLOG_DEBUG, "PHYSDEVOP cmd=%d: not implemented\n", cmd);
     return -ENOSYS;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:45:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:45: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 1Zt7vr-0001Yv-1M; Mon, 02 Nov 2015 05:45:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vp-0001Yg-Uf
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:26 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	3E/AE-01421-578F6365; Mon, 02 Nov 2015 05:45:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446443123!76420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57103 invoked from network); 2 Nov 2015 05:45:24 -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;
	2 Nov 2015 05:45:24 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vn-00049c-Oo
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vn-0002n6-Lf
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:23 +0000
Date: Mon, 02 Nov 2015 05:45:23 +0000
Message-Id: <E1Zt7vn-0002n6-Lf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: handle races between
	relinquish_memory and free_domheap_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 1ef01396fdff88b1c3331a09ca5c69619b90f4ea
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 13:34:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:34:17 2015 +0100

    arm: handle races between relinquish_memory and free_domheap_pages
    
    Primarily this means XENMEM_decrease_reservation from a toolstack
    domain.
    
    Unlike x86 we have no requirement right now to queue such pages onto
    a separate list, if we hit this race then the other code has already
    fully accepted responsibility for freeing this page and therefore
    there is no more for relinquish_memory to do.
    
    This is CVE-2015-7814 / XSA-147.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/domain.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 683e769..880d0a6 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -772,8 +772,15 @@ static int relinquish_memory(struct domain *d, struct page_list_head *list)
     {
         /* Grab a reference to the page so it won't disappear from under us. */
         if ( unlikely(!get_page(page, d)) )
-            /* Couldn't get a reference -- someone is freeing this page. */
-            BUG();
+            /*
+             * Couldn't get a reference -- someone is freeing this page and
+             * has already committed to doing so, so no more to do here.
+             *
+             * Note that the page must be left on the list, a list_del
+             * here will clash with the list_del done by the other
+             * party in the race and corrupt the list head.
+             */
+            continue;
 
         if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
             put_page(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 Mon Nov 02 05:45:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:45: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 1Zt7vr-0001Yv-1M; Mon, 02 Nov 2015 05:45:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vp-0001Yg-Uf
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:26 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	3E/AE-01421-578F6365; Mon, 02 Nov 2015 05:45:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446443123!76420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57103 invoked from network); 2 Nov 2015 05:45:24 -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;
	2 Nov 2015 05:45:24 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vn-00049c-Oo
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vn-0002n6-Lf
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:23 +0000
Date: Mon, 02 Nov 2015 05:45:23 +0000
Message-Id: <E1Zt7vn-0002n6-Lf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: handle races between
	relinquish_memory and free_domheap_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 1ef01396fdff88b1c3331a09ca5c69619b90f4ea
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 13:34:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:34:17 2015 +0100

    arm: handle races between relinquish_memory and free_domheap_pages
    
    Primarily this means XENMEM_decrease_reservation from a toolstack
    domain.
    
    Unlike x86 we have no requirement right now to queue such pages onto
    a separate list, if we hit this race then the other code has already
    fully accepted responsibility for freeing this page and therefore
    there is no more for relinquish_memory to do.
    
    This is CVE-2015-7814 / XSA-147.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/domain.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 683e769..880d0a6 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -772,8 +772,15 @@ static int relinquish_memory(struct domain *d, struct page_list_head *list)
     {
         /* Grab a reference to the page so it won't disappear from under us. */
         if ( unlikely(!get_page(page, d)) )
-            /* Couldn't get a reference -- someone is freeing this page. */
-            BUG();
+            /*
+             * Couldn't get a reference -- someone is freeing this page and
+             * has already committed to doing so, so no more to do here.
+             *
+             * Note that the page must be left on the list, a list_del
+             * here will clash with the list_del done by the other
+             * party in the race and corrupt the list head.
+             */
+            continue;
 
         if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
             put_page(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 Mon Nov 02 05:45:38 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:45: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 1Zt7w2-0001ac-3v; Mon, 02 Nov 2015 05:45: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 1Zt7w0-0001aQ-KE
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:36 +0000
Content-Length: 2755
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	07/74-14900-F78F6365; Mon, 02 Nov 2015 05:45:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1446443134!76395!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48837 invoked from network); 2 Nov 2015 05:45: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;
	2 Nov 2015 05:45:35 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vy-00049k-3m
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vx-0002ne-VR
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:34 +0000
Date: Mon, 02 Nov 2015 05:45:33 +0000
Message-Id: <E1Zt7vx-0002ne-VR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: guard against undue super page
	PTE creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5647798850868282492=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5647798850868282492==
Content-Length: 2356
Content-Transfer-Encoding: quoted-printable

commit fe360c90ea13f309ef78810f1a2b92f2ae3b30b8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:35:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:35:07 2015 +0100

    x86: guard against undue super page PTE creation
    
    When optional super page support got added (commit bd1cd81d64 "x86: PV
    support for hugepages"), two adjustments were missed: mod_l2_entry()
    needs to consider the PSE and RW bits when deciding whether to use the
    fast path, and the PSE bit must not be removed from L2_DISALLOW_MASK
    unconditionally.
    
    This is CVE-2015-7835 / XSA-148.
    
    Reported-by: "=E6=A0=BE=E5=B0=9A=E8=81=AA(=E5=A5=BD=E9=A3=8E)" <shangcong.lsc@alibaba-inc.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8763414..b65c3a5 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -160,7 +160,10 @@ static void put_superpage(unsigned long mfn);
 static uint32_t base_disallow_mask;
 /* Global bit is allowed to be set on L1 PTEs. Intended for user mappings. */
 #define L1_DISALLOW_MASK ((base_disallow_mask | _PAGE_GNTTAB) & ~_PAGE_GLOBAL)
-#define L2_DISALLOW_MASK (base_disallow_mask & ~_PAGE_PSE)
+
+#define L2_DISALLOW_MASK (unlikely(opt_allow_superpage) \
+                          =3F base_disallow_mask & ~_PAGE_PSE \
+                          : base_disallow_mask)
 
 #define l3_disallow_mask(d) (!is_pv_32bit_domain(d) =3F \
                              base_disallow_mask : 0xFFFFF198U)
@@ -1839,7 +1842,10 @@ static int mod_l2_entry(l2_pgentry_t *pl2e,
         }
 
         /* Fast path for identical mapping and presence. */
-        if ( !l2e_has_changed(ol2e, nl2e, _PAGE_PRESENT) )
+        if ( !l2e_has_changed(ol2e, nl2e,
+                              unlikely(opt_allow_superpage)
+                              =3F _PAGE_PSE | _PAGE_RW | _PAGE_PRESENT
+                              : _PAGE_PRESENT) )
         {
             adjust_guest_l2e(nl2e, d);
             if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 05:45:38 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:45: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 1Zt7w2-0001ac-3v; Mon, 02 Nov 2015 05:45: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 1Zt7w0-0001aQ-KE
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:36 +0000
Content-Length: 2755
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	07/74-14900-F78F6365; Mon, 02 Nov 2015 05:45:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1446443134!76395!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48837 invoked from network); 2 Nov 2015 05:45: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;
	2 Nov 2015 05:45:35 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vy-00049k-3m
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7vx-0002ne-VR
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:34 +0000
Date: Mon, 02 Nov 2015 05:45:33 +0000
Message-Id: <E1Zt7vx-0002ne-VR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: guard against undue super page
	PTE creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5647798850868282492=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5647798850868282492==
Content-Length: 2356
Content-Transfer-Encoding: quoted-printable

commit fe360c90ea13f309ef78810f1a2b92f2ae3b30b8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:35:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:35:07 2015 +0100

    x86: guard against undue super page PTE creation
    
    When optional super page support got added (commit bd1cd81d64 "x86: PV
    support for hugepages"), two adjustments were missed: mod_l2_entry()
    needs to consider the PSE and RW bits when deciding whether to use the
    fast path, and the PSE bit must not be removed from L2_DISALLOW_MASK
    unconditionally.
    
    This is CVE-2015-7835 / XSA-148.
    
    Reported-by: "=E6=A0=BE=E5=B0=9A=E8=81=AA(=E5=A5=BD=E9=A3=8E)" <shangcong.lsc@alibaba-inc.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8763414..b65c3a5 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -160,7 +160,10 @@ static void put_superpage(unsigned long mfn);
 static uint32_t base_disallow_mask;
 /* Global bit is allowed to be set on L1 PTEs. Intended for user mappings. */
 #define L1_DISALLOW_MASK ((base_disallow_mask | _PAGE_GNTTAB) & ~_PAGE_GLOBAL)
-#define L2_DISALLOW_MASK (base_disallow_mask & ~_PAGE_PSE)
+
+#define L2_DISALLOW_MASK (unlikely(opt_allow_superpage) \
+                          =3F base_disallow_mask & ~_PAGE_PSE \
+                          : base_disallow_mask)
 
 #define l3_disallow_mask(d) (!is_pv_32bit_domain(d) =3F \
                              base_disallow_mask : 0xFFFFF198U)
@@ -1839,7 +1842,10 @@ static int mod_l2_entry(l2_pgentry_t *pl2e,
         }
 
         /* Fast path for identical mapping and presence. */
-        if ( !l2e_has_changed(ol2e, nl2e, _PAGE_PRESENT) )
+        if ( !l2e_has_changed(ol2e, nl2e,
+                              unlikely(opt_allow_superpage)
+                              =3F _PAGE_PSE | _PAGE_RW | _PAGE_PRESENT
+                              : _PAGE_PRESENT) )
         {
             adjust_guest_l2e(nl2e, d);
             if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 05:45:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05: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 1Zt7wE-0001cJ-6h; Mon, 02 Nov 2015 05:45: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 1Zt7wC-0001c3-NR
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:48 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	A2/01-29649-C88F6365; Mon, 02 Nov 2015 05:45:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446443144!73747!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32263 invoked from network); 2 Nov 2015 05:45:45 -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;
	2 Nov 2015 05:45:45 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7w8-00049s-F7
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7w8-0002oB-BN
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:44 +0000
Date: Mon, 02 Nov 2015 05:45:44 +0000
Message-Id: <E1Zt7w8-0002oB-BN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d46896ebbb23f3a9fef2eb6066ae614fd1acfd96
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:35:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:35:40 2015 +0100

    free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-149.
    
    Reported-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
---
 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 b95f29a..f56b7ff 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -841,6 +841,7 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
+    xfree(d->vcpu);
     free_domain_struct(d);
 
     send_global_virq(VIRQ_DOM_EXC);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:45:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05: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 1Zt7wE-0001cJ-6h; Mon, 02 Nov 2015 05:45: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 1Zt7wC-0001c3-NR
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:48 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	A2/01-29649-C88F6365; Mon, 02 Nov 2015 05:45:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446443144!73747!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32263 invoked from network); 2 Nov 2015 05:45:45 -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;
	2 Nov 2015 05:45:45 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7w8-00049s-F7
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7w8-0002oB-BN
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:44 +0000
Date: Mon, 02 Nov 2015 05:45:44 +0000
Message-Id: <E1Zt7w8-0002oB-BN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d46896ebbb23f3a9fef2eb6066ae614fd1acfd96
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:35:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:35:40 2015 +0100

    free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-149.
    
    Reported-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
---
 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 b95f29a..f56b7ff 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -841,6 +841,7 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
+    xfree(d->vcpu);
     free_domain_struct(d);
 
     send_global_virq(VIRQ_DOM_EXC);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:45:58 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:45: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 1Zt7wM-0001de-9D; Mon, 02 Nov 2015 05:45:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wL-0001dR-AJ
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:57 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	74/22-10678-498F6365; Mon, 02 Nov 2015 05:45:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1446443154!76589!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57890 invoked from network); 2 Nov 2015 05:45:55 -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;
	2 Nov 2015 05:45:55 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wI-0004A0-PF
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wI-0002pW-M6
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:54 +0000
Date: Mon, 02 Nov 2015 05:45:54 +0000
Message-Id: <E1Zt7wI-0002pW-M6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PoD: Eager sweep for zeroed 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 101ce53266866144e724ed593173bc4098b300b9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 29 13:36:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:36:25 2015 +0100

    x86/PoD: Eager sweep for zeroed pages
    
    Based on the contents of a guests physical address space,
    p2m_pod_emergency_sweep() could degrade into a linear memcmp() from 0 to
    max_gfn, which runs non-preemptibly.
    
    As p2m_pod_emergency_sweep() runs behind the scenes in a number of contexts,
    making it preemptible is not feasible.
    
    Instead, a different approach is taken.  Recently-populated pages are eagerly
    checked for reclaimation, which amortises the p2m_pod_emergency_sweep()
    operation across each p2m_pod_demand_populate() operation.
    
    Note that in the case that a 2M superpage can't be reclaimed as a superpage,
    it is shattered if 4K pages of zeros can be reclaimed.  This is unfortunate
    but matches the previous behaviour, and is required to avoid regressions
    (domain crash from PoD exhaustion) with VMs configured close to the limit.
    
    This is CVE-2015-7970 / XSA-150.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |   86 +++++++++++++++++++++++++++++---------------
 xen/arch/x86/mm/p2m.c     |    4 ++
 xen/include/asm-x86/p2m.h |   18 +++++++--
 3 files changed, 75 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index acd85ea..2a6f125 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -921,28 +921,6 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count)
 }
 
 #define POD_SWEEP_LIMIT 1024
-
-/* When populating a new superpage, look at recently populated superpages
- * hoping that they've been zeroed.  This will snap up zeroed pages as soon as 
- * the guest OS is done with them. */
-static void
-p2m_pod_check_last_super(struct p2m_domain *p2m, unsigned long gfn_aligned)
-{
-    unsigned long check_gfn;
-
-    ASSERT(p2m->pod.last_populated_index < POD_HISTORY_MAX);
-
-    check_gfn = p2m->pod.last_populated[p2m->pod.last_populated_index];
-
-    p2m->pod.last_populated[p2m->pod.last_populated_index] = gfn_aligned;
-
-    p2m->pod.last_populated_index =
-        ( p2m->pod.last_populated_index + 1 ) % POD_HISTORY_MAX;
-
-    p2m_pod_zero_check_superpage(p2m, check_gfn);
-}
-
-
 #define POD_SWEEP_STRIDE  16
 static void
 p2m_pod_emergency_sweep(struct p2m_domain *p2m)
@@ -983,7 +961,7 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
          * NB that this is a zero-sum game; we're increasing our cache size
          * by re-increasing our 'debt'.  Since we hold the pod lock,
          * (entry_count - count) must remain the same. */
-        if ( p2m->pod.count > 0 && i < limit )
+        if ( i < limit && (p2m->pod.count > 0 || hypercall_preempt_check()) )
             break;
     }
 
@@ -995,6 +973,58 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
 
 }
 
+static void pod_eager_reclaim(struct p2m_domain *p2m)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+    unsigned int i = 0;
+
+    /*
+     * Always check one page for reclaimation.
+     *
+     * If the PoD pool is empty, keep checking some space is found, or all
+     * entries have been exhaused.
+     */
+    do
+    {
+        unsigned int idx = (mrp->idx + i++) % ARRAY_SIZE(mrp->list);
+        unsigned long gfn = mrp->list[idx];
+
+        if ( gfn != INVALID_GFN )
+        {
+            if ( gfn & POD_LAST_SUPERPAGE )
+            {
+                gfn &= ~POD_LAST_SUPERPAGE;
+
+                if ( p2m_pod_zero_check_superpage(p2m, gfn) == 0 )
+                {
+                    unsigned int x;
+
+                    for ( x = 0; x < SUPERPAGE_PAGES; ++x, ++gfn )
+                        p2m_pod_zero_check(p2m, &gfn, 1);
+                }
+            }
+            else
+                p2m_pod_zero_check(p2m, &gfn, 1);
+
+            mrp->list[idx] = INVALID_GFN;
+        }
+
+    } while ( (p2m->pod.count == 0) && (i < ARRAY_SIZE(mrp->list)) );
+}
+
+static void pod_eager_record(struct p2m_domain *p2m,
+                             unsigned long gfn, unsigned int order)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+
+    ASSERT(mrp->list[mrp->idx] == INVALID_GFN);
+    ASSERT(gfn != INVALID_GFN);
+
+    mrp->list[mrp->idx++] =
+        gfn | (order == PAGE_ORDER_2M ? POD_LAST_SUPERPAGE : 0);
+    mrp->idx %= ARRAY_SIZE(mrp->list);
+}
+
 int
 p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
                         unsigned int order,
@@ -1035,6 +1065,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         return 0;
     }
 
+    pod_eager_reclaim(p2m);
+
     /* Only sweep if we're actually out of memory.  Doing anything else
      * causes unnecessary time and fragmentation of superpages in the p2m. */
     if ( p2m->pod.count == 0 )
@@ -1071,6 +1103,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
     p2m->pod.entry_count -= (1 << order);
     BUG_ON(p2m->pod.entry_count < 0);
 
+    pod_eager_record(p2m, gfn_aligned, order);
+
     if ( tb_init_done )
     {
         struct {
@@ -1086,12 +1120,6 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         __trace_var(TRC_MEM_POD_POPULATE, 0, sizeof(t), &t);
     }
 
-    /* Check the last guest demand-populate */
-    if ( p2m->pod.entry_count > p2m->pod.count 
-         && (order == PAGE_ORDER_2M)
-         && (q & P2M_ALLOC) )
-        p2m_pod_check_last_super(p2m, gfn_aligned);
-
     pod_unlock(p2m);
     return 0;
 out_of_memory:
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 006be64..ed0bbd7 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -58,6 +58,7 @@ boolean_param("hap_2mb", opt_hap_2mb);
 /* Init the datastructures for later use by the p2m code */
 static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 {
+    unsigned int i;
     int ret = 0;
 
     mm_rwlock_init(&p2m->lock);
@@ -73,6 +74,9 @@ static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 
     p2m->np2m_base = P2M_BASE_EADDR;
 
+    for ( i = 0; i < ARRAY_SIZE(p2m->pod.mrp.list); ++i )
+        p2m->pod.mrp.list[i] = INVALID_GFN;
+
     if ( hap_enabled(d) && cpu_has_vmx )
         ret = ept_p2m_init(p2m);
     else
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 2fc8667..b710b2c 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -292,10 +292,20 @@ struct p2m_domain {
                          entry_count;  /* # of pages in p2m marked pod      */
         unsigned long    reclaim_single; /* Last gpfn of a scan */
         unsigned long    max_guest;    /* gpfn of max guest demand-populate */
-#define POD_HISTORY_MAX 128
-        /* gpfn of last guest superpage demand-populated */
-        unsigned long    last_populated[POD_HISTORY_MAX]; 
-        unsigned int     last_populated_index;
+
+        /*
+         * Tracking of the most recently populated PoD pages, for eager
+         * reclamation.
+         */
+        struct pod_mrp_list {
+#define NR_POD_MRP_ENTRIES 32
+
+/* Encode ORDER_2M superpage in top bit of GFN */
+#define POD_LAST_SUPERPAGE (INVALID_GFN & ~(INVALID_GFN >> 1))
+
+            unsigned long list[NR_POD_MRP_ENTRIES];
+            unsigned int idx;
+        } mrp;
         mm_lock_t        lock;         /* Locking of private pod structs,   *
                                         * not relying on the p2m lock.      */
     } pod;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:45:58 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:45: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 1Zt7wM-0001de-9D; Mon, 02 Nov 2015 05:45:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wL-0001dR-AJ
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:57 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	74/22-10678-498F6365; Mon, 02 Nov 2015 05:45:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1446443154!76589!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57890 invoked from network); 2 Nov 2015 05:45:55 -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;
	2 Nov 2015 05:45:55 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wI-0004A0-PF
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wI-0002pW-M6
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:45:54 +0000
Date: Mon, 02 Nov 2015 05:45:54 +0000
Message-Id: <E1Zt7wI-0002pW-M6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PoD: Eager sweep for zeroed 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 101ce53266866144e724ed593173bc4098b300b9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 29 13:36:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:36:25 2015 +0100

    x86/PoD: Eager sweep for zeroed pages
    
    Based on the contents of a guests physical address space,
    p2m_pod_emergency_sweep() could degrade into a linear memcmp() from 0 to
    max_gfn, which runs non-preemptibly.
    
    As p2m_pod_emergency_sweep() runs behind the scenes in a number of contexts,
    making it preemptible is not feasible.
    
    Instead, a different approach is taken.  Recently-populated pages are eagerly
    checked for reclaimation, which amortises the p2m_pod_emergency_sweep()
    operation across each p2m_pod_demand_populate() operation.
    
    Note that in the case that a 2M superpage can't be reclaimed as a superpage,
    it is shattered if 4K pages of zeros can be reclaimed.  This is unfortunate
    but matches the previous behaviour, and is required to avoid regressions
    (domain crash from PoD exhaustion) with VMs configured close to the limit.
    
    This is CVE-2015-7970 / XSA-150.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |   86 +++++++++++++++++++++++++++++---------------
 xen/arch/x86/mm/p2m.c     |    4 ++
 xen/include/asm-x86/p2m.h |   18 +++++++--
 3 files changed, 75 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index acd85ea..2a6f125 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -921,28 +921,6 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count)
 }
 
 #define POD_SWEEP_LIMIT 1024
-
-/* When populating a new superpage, look at recently populated superpages
- * hoping that they've been zeroed.  This will snap up zeroed pages as soon as 
- * the guest OS is done with them. */
-static void
-p2m_pod_check_last_super(struct p2m_domain *p2m, unsigned long gfn_aligned)
-{
-    unsigned long check_gfn;
-
-    ASSERT(p2m->pod.last_populated_index < POD_HISTORY_MAX);
-
-    check_gfn = p2m->pod.last_populated[p2m->pod.last_populated_index];
-
-    p2m->pod.last_populated[p2m->pod.last_populated_index] = gfn_aligned;
-
-    p2m->pod.last_populated_index =
-        ( p2m->pod.last_populated_index + 1 ) % POD_HISTORY_MAX;
-
-    p2m_pod_zero_check_superpage(p2m, check_gfn);
-}
-
-
 #define POD_SWEEP_STRIDE  16
 static void
 p2m_pod_emergency_sweep(struct p2m_domain *p2m)
@@ -983,7 +961,7 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
          * NB that this is a zero-sum game; we're increasing our cache size
          * by re-increasing our 'debt'.  Since we hold the pod lock,
          * (entry_count - count) must remain the same. */
-        if ( p2m->pod.count > 0 && i < limit )
+        if ( i < limit && (p2m->pod.count > 0 || hypercall_preempt_check()) )
             break;
     }
 
@@ -995,6 +973,58 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
 
 }
 
+static void pod_eager_reclaim(struct p2m_domain *p2m)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+    unsigned int i = 0;
+
+    /*
+     * Always check one page for reclaimation.
+     *
+     * If the PoD pool is empty, keep checking some space is found, or all
+     * entries have been exhaused.
+     */
+    do
+    {
+        unsigned int idx = (mrp->idx + i++) % ARRAY_SIZE(mrp->list);
+        unsigned long gfn = mrp->list[idx];
+
+        if ( gfn != INVALID_GFN )
+        {
+            if ( gfn & POD_LAST_SUPERPAGE )
+            {
+                gfn &= ~POD_LAST_SUPERPAGE;
+
+                if ( p2m_pod_zero_check_superpage(p2m, gfn) == 0 )
+                {
+                    unsigned int x;
+
+                    for ( x = 0; x < SUPERPAGE_PAGES; ++x, ++gfn )
+                        p2m_pod_zero_check(p2m, &gfn, 1);
+                }
+            }
+            else
+                p2m_pod_zero_check(p2m, &gfn, 1);
+
+            mrp->list[idx] = INVALID_GFN;
+        }
+
+    } while ( (p2m->pod.count == 0) && (i < ARRAY_SIZE(mrp->list)) );
+}
+
+static void pod_eager_record(struct p2m_domain *p2m,
+                             unsigned long gfn, unsigned int order)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+
+    ASSERT(mrp->list[mrp->idx] == INVALID_GFN);
+    ASSERT(gfn != INVALID_GFN);
+
+    mrp->list[mrp->idx++] =
+        gfn | (order == PAGE_ORDER_2M ? POD_LAST_SUPERPAGE : 0);
+    mrp->idx %= ARRAY_SIZE(mrp->list);
+}
+
 int
 p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
                         unsigned int order,
@@ -1035,6 +1065,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         return 0;
     }
 
+    pod_eager_reclaim(p2m);
+
     /* Only sweep if we're actually out of memory.  Doing anything else
      * causes unnecessary time and fragmentation of superpages in the p2m. */
     if ( p2m->pod.count == 0 )
@@ -1071,6 +1103,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
     p2m->pod.entry_count -= (1 << order);
     BUG_ON(p2m->pod.entry_count < 0);
 
+    pod_eager_record(p2m, gfn_aligned, order);
+
     if ( tb_init_done )
     {
         struct {
@@ -1086,12 +1120,6 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         __trace_var(TRC_MEM_POD_POPULATE, 0, sizeof(t), &t);
     }
 
-    /* Check the last guest demand-populate */
-    if ( p2m->pod.entry_count > p2m->pod.count 
-         && (order == PAGE_ORDER_2M)
-         && (q & P2M_ALLOC) )
-        p2m_pod_check_last_super(p2m, gfn_aligned);
-
     pod_unlock(p2m);
     return 0;
 out_of_memory:
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 006be64..ed0bbd7 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -58,6 +58,7 @@ boolean_param("hap_2mb", opt_hap_2mb);
 /* Init the datastructures for later use by the p2m code */
 static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 {
+    unsigned int i;
     int ret = 0;
 
     mm_rwlock_init(&p2m->lock);
@@ -73,6 +74,9 @@ static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 
     p2m->np2m_base = P2M_BASE_EADDR;
 
+    for ( i = 0; i < ARRAY_SIZE(p2m->pod.mrp.list); ++i )
+        p2m->pod.mrp.list[i] = INVALID_GFN;
+
     if ( hap_enabled(d) && cpu_has_vmx )
         ret = ept_p2m_init(p2m);
     else
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 2fc8667..b710b2c 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -292,10 +292,20 @@ struct p2m_domain {
                          entry_count;  /* # of pages in p2m marked pod      */
         unsigned long    reclaim_single; /* Last gpfn of a scan */
         unsigned long    max_guest;    /* gpfn of max guest demand-populate */
-#define POD_HISTORY_MAX 128
-        /* gpfn of last guest superpage demand-populated */
-        unsigned long    last_populated[POD_HISTORY_MAX]; 
-        unsigned int     last_populated_index;
+
+        /*
+         * Tracking of the most recently populated PoD pages, for eager
+         * reclamation.
+         */
+        struct pod_mrp_list {
+#define NR_POD_MRP_ENTRIES 32
+
+/* Encode ORDER_2M superpage in top bit of GFN */
+#define POD_LAST_SUPERPAGE (INVALID_GFN & ~(INVALID_GFN >> 1))
+
+            unsigned long list[NR_POD_MRP_ENTRIES];
+            unsigned int idx;
+        } mrp;
         mm_lock_t        lock;         /* Locking of private pod structs,   *
                                         * not relying on the p2m lock.      */
     } pod;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 02 05:46:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:46: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 1Zt7wY-0001fS-Bv; Mon, 02 Nov 2015 05:46: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 1Zt7wX-0001fJ-E2
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:09 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	03/4B-18107-0A8F6365; Mon, 02 Nov 2015 05:46:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1446443165!108736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53859 invoked from network); 2 Nov 2015 05:46:06 -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;
	2 Nov 2015 05:46:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wT-0004Ag-83
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wS-0002qJ-Vg
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:05 +0000
Date: Mon, 02 Nov 2015 05:46:04 +0000
Message-Id: <E1Zt7wS-0002qJ-Vg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenoprof: free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6e97c4b37386c2d09e09e9b5d5d232e37728b960
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:36:52 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:36:52 2015 +0100

    xenoprof: free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-151.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/xenoprof.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 1061323..53a803a 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -239,6 +239,7 @@ static int alloc_xenoprof_struct(
     d->xenoprof->rawbuf = alloc_xenheap_pages(get_order_from_pages(npages), 0);
     if ( d->xenoprof->rawbuf == NULL )
     {
+        xfree(d->xenoprof->vcpu);
         xfree(d->xenoprof);
         d->xenoprof = NULL;
         return -ENOMEM;
@@ -286,6 +287,7 @@ void free_xenoprof_pages(struct domain *d)
         free_xenheap_pages(x->rawbuf, order);
     }
 
+    xfree(x->vcpu);
     xfree(x);
     d->xenoprof = 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 Mon Nov 02 05:46:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:46: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 1Zt7wY-0001fS-Bv; Mon, 02 Nov 2015 05:46: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 1Zt7wX-0001fJ-E2
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:09 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	03/4B-18107-0A8F6365; Mon, 02 Nov 2015 05:46:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1446443165!108736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53859 invoked from network); 2 Nov 2015 05:46:06 -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;
	2 Nov 2015 05:46:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wT-0004Ag-83
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wS-0002qJ-Vg
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:05 +0000
Date: Mon, 02 Nov 2015 05:46:04 +0000
Message-Id: <E1Zt7wS-0002qJ-Vg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenoprof: free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6e97c4b37386c2d09e09e9b5d5d232e37728b960
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:36:52 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:36:52 2015 +0100

    xenoprof: free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-151.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/xenoprof.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 1061323..53a803a 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -239,6 +239,7 @@ static int alloc_xenoprof_struct(
     d->xenoprof->rawbuf = alloc_xenheap_pages(get_order_from_pages(npages), 0);
     if ( d->xenoprof->rawbuf == NULL )
     {
+        xfree(d->xenoprof->vcpu);
         xfree(d->xenoprof);
         d->xenoprof = NULL;
         return -ENOMEM;
@@ -286,6 +287,7 @@ void free_xenoprof_pages(struct domain *d)
         free_xenheap_pages(x->rawbuf, order);
     }
 
+    xfree(x->vcpu);
     xfree(x);
     d->xenoprof = 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 Mon Nov 02 05:46:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:46: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 1Zt7wh-0001hA-GL; Mon, 02 Nov 2015 05:46:19 +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 1Zt7wf-0001gy-TR
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:18 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	7E/79-00475-9A8F6365; Mon, 02 Nov 2015 05:46:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1446443175!44669977!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.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20107 invoked from network); 2 Nov 2015 05:46:16 -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;
	2 Nov 2015 05:46:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wd-0004Ao-G4
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wd-0002qv-EA
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:15 +0000
Date: Mon, 02 Nov 2015 05:46:15 +0000
Message-Id: <E1Zt7wd-0002qv-EA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: rate-limit logging in
	do_xen{oprof, pmu}_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 95e7415843b94c346e5ba8682665f508f220e04b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:37:19 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:37:19 2015 +0100

    x86: rate-limit logging in do_xen{oprof,pmu}_op()
    
    Some of the sub-ops are acessible to all guests, and hence should be
    rate-limited. In the xenoprof case, just like for XSA-146, include them
    only in debug builds. Since the vPMU code is rather new, allow them to
    be always present, but downgrade them to (rate limited) guest messages.
    
    This is CVE-2015-7971 / XSA-152.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/cpu/vpmu.c |    8 ++++----
 xen/common/xenoprof.c   |    9 +++------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 8af3df1..2f5156a 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -682,8 +682,8 @@ long do_xenpmu_op(unsigned int op, XEN_GUEST_HANDLE_PARAM(xen_pmu_params_t) arg)
             vpmu_mode = pmu_params.val;
         else if ( vpmu_mode != pmu_params.val )
         {
-            printk(XENLOG_WARNING
-                   "VPMU: Cannot change mode while active VPMUs exist\n");
+            gprintk(XENLOG_WARNING,
+                    "VPMU: Cannot change mode while active VPMUs exist\n");
             ret = -EBUSY;
         }
 
@@ -714,8 +714,8 @@ long do_xenpmu_op(unsigned int op, XEN_GUEST_HANDLE_PARAM(xen_pmu_params_t) arg)
             vpmu_features = pmu_params.val;
         else
         {
-            printk(XENLOG_WARNING "VPMU: Cannot change features while"
-                                  " active VPMUs exist\n");
+            gprintk(XENLOG_WARNING,
+                    "VPMU: Cannot change features while active VPMUs exist\n");
             ret = -EBUSY;
         }
 
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 53a803a..19b4605 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -676,15 +676,13 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     
     if ( (op < 0) || (op > XENOPROF_last_op) )
     {
-        printk("xenoprof: invalid operation %d for domain %d\n",
-               op, current->domain->domain_id);
+        gdprintk(XENLOG_DEBUG, "invalid operation %d\n", op);
         return -EINVAL;
     }
 
     if ( !NONPRIV_OP(op) && (current->domain != xenoprof_primary_profiler) )
     {
-        printk("xenoprof: dom %d denied privileged operation %d\n",
-               current->domain->domain_id, op);
+        gdprintk(XENLOG_DEBUG, "denied privileged operation %d\n", op);
         return -EPERM;
     }
 
@@ -907,8 +905,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     spin_unlock(&xenoprof_lock);
 
     if ( ret < 0 )
-        printk("xenoprof: operation %d failed for dom %d (status : %d)\n",
-               op, current->domain->domain_id, ret);
+        gdprintk(XENLOG_DEBUG, "operation %d failed: %d\n", op, ret);
 
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 05:46:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:46: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 1Zt7wh-0001hA-GL; Mon, 02 Nov 2015 05:46:19 +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 1Zt7wf-0001gy-TR
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:18 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	7E/79-00475-9A8F6365; Mon, 02 Nov 2015 05:46:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1446443175!44669977!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.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20107 invoked from network); 2 Nov 2015 05:46:16 -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;
	2 Nov 2015 05:46:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wd-0004Ao-G4
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wd-0002qv-EA
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:15 +0000
Date: Mon, 02 Nov 2015 05:46:15 +0000
Message-Id: <E1Zt7wd-0002qv-EA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: rate-limit logging in
	do_xen{oprof, pmu}_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 95e7415843b94c346e5ba8682665f508f220e04b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 13:37:19 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 13:37:19 2015 +0100

    x86: rate-limit logging in do_xen{oprof,pmu}_op()
    
    Some of the sub-ops are acessible to all guests, and hence should be
    rate-limited. In the xenoprof case, just like for XSA-146, include them
    only in debug builds. Since the vPMU code is rather new, allow them to
    be always present, but downgrade them to (rate limited) guest messages.
    
    This is CVE-2015-7971 / XSA-152.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/cpu/vpmu.c |    8 ++++----
 xen/common/xenoprof.c   |    9 +++------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 8af3df1..2f5156a 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -682,8 +682,8 @@ long do_xenpmu_op(unsigned int op, XEN_GUEST_HANDLE_PARAM(xen_pmu_params_t) arg)
             vpmu_mode = pmu_params.val;
         else if ( vpmu_mode != pmu_params.val )
         {
-            printk(XENLOG_WARNING
-                   "VPMU: Cannot change mode while active VPMUs exist\n");
+            gprintk(XENLOG_WARNING,
+                    "VPMU: Cannot change mode while active VPMUs exist\n");
             ret = -EBUSY;
         }
 
@@ -714,8 +714,8 @@ long do_xenpmu_op(unsigned int op, XEN_GUEST_HANDLE_PARAM(xen_pmu_params_t) arg)
             vpmu_features = pmu_params.val;
         else
         {
-            printk(XENLOG_WARNING "VPMU: Cannot change features while"
-                                  " active VPMUs exist\n");
+            gprintk(XENLOG_WARNING,
+                    "VPMU: Cannot change features while active VPMUs exist\n");
             ret = -EBUSY;
         }
 
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 53a803a..19b4605 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -676,15 +676,13 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     
     if ( (op < 0) || (op > XENOPROF_last_op) )
     {
-        printk("xenoprof: invalid operation %d for domain %d\n",
-               op, current->domain->domain_id);
+        gdprintk(XENLOG_DEBUG, "invalid operation %d\n", op);
         return -EINVAL;
     }
 
     if ( !NONPRIV_OP(op) && (current->domain != xenoprof_primary_profiler) )
     {
-        printk("xenoprof: dom %d denied privileged operation %d\n",
-               current->domain->domain_id, op);
+        gdprintk(XENLOG_DEBUG, "denied privileged operation %d\n", op);
         return -EPERM;
     }
 
@@ -907,8 +905,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     spin_unlock(&xenoprof_lock);
 
     if ( ret < 0 )
-        printk("xenoprof: operation %d failed for dom %d (status : %d)\n",
-               op, current->domain->domain_id, ret);
+        gdprintk(XENLOG_DEBUG, "operation %d failed: %d\n", op, ret);
 
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 05:46:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:46: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 1Zt7wt-0001ie-Iv; Mon, 02 Nov 2015 05:46: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 1Zt7ws-0001iT-Gn
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:30 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	58/27-12889-5B8F6365; Mon, 02 Nov 2015 05:46:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1446443185!44669992!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23508 invoked from network); 2 Nov 2015 05:46:26 -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;
	2 Nov 2015 05:46:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wn-0004Aw-Nb
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wn-0002rV-Lz
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:25 +0000
Date: Mon, 02 Nov 2015 05:46:25 +0000
Message-Id: <E1Zt7wn-0002rV-Lz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: adjust PoD target by memory
	fudge, 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 e294a0c3af9f4443dc692b180fb1771b1cb075e8
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 16:18:30 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:11:51 2015 +0000

    libxl: adjust PoD target by memory fudge, too
    
    PoD guests need to balloon at least as far as required by PoD, or risk
    crashing.  Currently they don't necessarily know what the right value
    is, because our memory accounting is (at the very least) confusing.
    
    Apply the memory limit fudge factor to the in-hypervisor PoD memory
    target, too.  This will increase the size of the guest's PoD cache by
    the fudge factor LIBXL_MAXMEM_CONSTANT (currently 1Mby).  This ensures
    that even with a slightly-off balloon driver, the guest will be
    stable even under memory pressure.
    
    There are two call sites of xc_domain_set_pod_target that need fixing:
    
    The one in libxl_set_memory_target is straightforward.
    
    The one in xc_hvm_build_x86.c:setup_guest is more awkward.  Simply
    setting the PoD target differently does not work because the various
    amounts of memory during domain construction no longer match up.
    Instead, we adjust the guest memory target in xenstore (but only for
    PoD guests).
    
    This introduces a 1Mby discrepancy between the balloon target of a PoD
    guest at boot, and the target set by an apparently-equivalent `xl
    mem-set' (or similar) later.  This approach is low-risk for a security
    fix but we need to fix this up properly in xen.git#staging and
    probably also in stable trees.
    
    This is XSA-153.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 56fb5fd62320eb40a7517206f9706aa9188d6f7b)
---
 tools/libxl/libxl.c     |    2 +-
 tools/libxl/libxl_dom.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 22bbc29..854e957 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4834,7 +4834,7 @@ retry_transaction:
     }
 
     rc = xc_domain_set_pod_target(ctx->xch, domid,
-            new_target_memkb / 4, NULL, NULL, NULL);
+            (new_target_memkb + LIBXL_MAXMEM_CONSTANT) / 4, NULL, NULL, NULL);
     if (rc != 0) {
         LOGE(ERROR,
              "xc_domain_set_pod_target domid=%d, memkb=%d ""failed rc=%d\n",
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 43e527a..44d481b 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -484,6 +484,7 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     xs_transaction_t t;
     char **ents;
     int i, rc;
+    int64_t mem_target_fudge;
 
     if (info->num_vnuma_nodes && !info->num_vcpu_soft_affinity) {
         rc = set_vnuma_affinity(gc, domid, info);
@@ -516,11 +517,17 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
         }
     }
 
+    mem_target_fudge =
+        (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+         info->max_memkb > info->target_memkb)
+        ? LIBXL_MAXMEM_CONSTANT : 0;
+
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
     ents[1] = GCSPRINTF("%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb);
+    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb
+                        - mem_target_fudge);
     ents[4] = "memory/videoram";
     ents[5] = GCSPRINTF("%"PRId64, info->video_memkb);
     ents[6] = "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 Mon Nov 02 05:46:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 05:46: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 1Zt7wt-0001ie-Iv; Mon, 02 Nov 2015 05:46: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 1Zt7ws-0001iT-Gn
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:30 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	58/27-12889-5B8F6365; Mon, 02 Nov 2015 05:46:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1446443185!44669992!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23508 invoked from network); 2 Nov 2015 05:46:26 -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;
	2 Nov 2015 05:46:26 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wn-0004Aw-Nb
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zt7wn-0002rV-Lz
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 05:46:25 +0000
Date: Mon, 02 Nov 2015 05:46:25 +0000
Message-Id: <E1Zt7wn-0002rV-Lz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: adjust PoD target by memory
	fudge, 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 e294a0c3af9f4443dc692b180fb1771b1cb075e8
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 16:18:30 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:11:51 2015 +0000

    libxl: adjust PoD target by memory fudge, too
    
    PoD guests need to balloon at least as far as required by PoD, or risk
    crashing.  Currently they don't necessarily know what the right value
    is, because our memory accounting is (at the very least) confusing.
    
    Apply the memory limit fudge factor to the in-hypervisor PoD memory
    target, too.  This will increase the size of the guest's PoD cache by
    the fudge factor LIBXL_MAXMEM_CONSTANT (currently 1Mby).  This ensures
    that even with a slightly-off balloon driver, the guest will be
    stable even under memory pressure.
    
    There are two call sites of xc_domain_set_pod_target that need fixing:
    
    The one in libxl_set_memory_target is straightforward.
    
    The one in xc_hvm_build_x86.c:setup_guest is more awkward.  Simply
    setting the PoD target differently does not work because the various
    amounts of memory during domain construction no longer match up.
    Instead, we adjust the guest memory target in xenstore (but only for
    PoD guests).
    
    This introduces a 1Mby discrepancy between the balloon target of a PoD
    guest at boot, and the target set by an apparently-equivalent `xl
    mem-set' (or similar) later.  This approach is low-risk for a security
    fix but we need to fix this up properly in xen.git#staging and
    probably also in stable trees.
    
    This is XSA-153.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 56fb5fd62320eb40a7517206f9706aa9188d6f7b)
---
 tools/libxl/libxl.c     |    2 +-
 tools/libxl/libxl_dom.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 22bbc29..854e957 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4834,7 +4834,7 @@ retry_transaction:
     }
 
     rc = xc_domain_set_pod_target(ctx->xch, domid,
-            new_target_memkb / 4, NULL, NULL, NULL);
+            (new_target_memkb + LIBXL_MAXMEM_CONSTANT) / 4, NULL, NULL, NULL);
     if (rc != 0) {
         LOGE(ERROR,
              "xc_domain_set_pod_target domid=%d, memkb=%d ""failed rc=%d\n",
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 43e527a..44d481b 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -484,6 +484,7 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     xs_transaction_t t;
     char **ents;
     int i, rc;
+    int64_t mem_target_fudge;
 
     if (info->num_vnuma_nodes && !info->num_vcpu_soft_affinity) {
         rc = set_vnuma_affinity(gc, domid, info);
@@ -516,11 +517,17 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
         }
     }
 
+    mem_target_fudge =
+        (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+         info->max_memkb > info->target_memkb)
+        ? LIBXL_MAXMEM_CONSTANT : 0;
+
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
     ents[1] = GCSPRINTF("%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb);
+    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb
+                        - mem_target_fudge);
     ents[4] = "memory/videoram";
     ents[5] = GCSPRINTF("%"PRId64, info->video_memkb);
     ents[6] = "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 Mon Nov 02 17:55:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 17:55:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZtJK0-0003i1-8A; Mon, 02 Nov 2015 17:55: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 1ZtJJz-0003hw-7r
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 17:55:07 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	AA/1B-12889-A73A7365; Mon, 02 Nov 2015 17:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446486904!63650071!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20164 invoked from network); 2 Nov 2015 17:55:05 -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;
	2 Nov 2015 17:55:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtJJw-00043U-IA
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 17:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtJJv-00019M-5f
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 17:55:03 +0000
Date: Mon, 02 Nov 2015 17:55:03 +0000
Message-Id: <E1ZtJJv-00019M-5f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] libxl: adjust PoD target by memory
	fudge, 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 423d2cd814e8460d5ea8bd191a770f3c48b3947c
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 16:18:30 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:12:04 2015 +0000

    libxl: adjust PoD target by memory fudge, too
    
    PoD guests need to balloon at least as far as required by PoD, or risk
    crashing.  Currently they don't necessarily know what the right value
    is, because our memory accounting is (at the very least) confusing.
    
    Apply the memory limit fudge factor to the in-hypervisor PoD memory
    target, too.  This will increase the size of the guest's PoD cache by
    the fudge factor LIBXL_MAXMEM_CONSTANT (currently 1Mby).  This ensures
    that even with a slightly-off balloon driver, the guest will be
    stable even under memory pressure.
    
    There are two call sites of xc_domain_set_pod_target that need fixing:
    
    The one in libxl_set_memory_target is straightforward.
    
    The one in xc_hvm_build_x86.c:setup_guest is more awkward.  Simply
    setting the PoD target differently does not work because the various
    amounts of memory during domain construction no longer match up.
    Instead, we adjust the guest memory target in xenstore (but only for
    PoD guests).
    
    This introduces a 1Mby discrepancy between the balloon target of a PoD
    guest at boot, and the target set by an apparently-equivalent `xl
    mem-set' (or similar) later.  This approach is low-risk for a security
    fix but we need to fix this up properly in xen.git#staging and
    probably also in stable trees.
    
    This is XSA-153.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 56fb5fd62320eb40a7517206f9706aa9188d6f7b)
---
 tools/libxl/libxl.c     |    2 +-
 tools/libxl/libxl_dom.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 3536b5d..312a371 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4859,7 +4859,7 @@ retry_transaction:
 
     new_target_memkb -= videoram;
     rc = xc_domain_set_pod_target(ctx->xch, domid,
-            new_target_memkb / 4, NULL, NULL, NULL);
+            (new_target_memkb + LIBXL_MAXMEM_CONSTANT) / 4, NULL, NULL, NULL);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "xc_domain_set_pod_target domid=%d, memkb=%d "
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 1d33a18..4ee3248 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -446,6 +446,7 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     xs_transaction_t t;
     char **ents;
     int i, rc;
+    int64_t mem_target_fudge;
 
     rc = libxl_domain_sched_params_set(CTX, domid, &info->sched_params);
     if (rc)
@@ -472,11 +473,17 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
         }
     }
 
+    mem_target_fudge =
+        (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+         info->max_memkb > info->target_memkb)
+        ? LIBXL_MAXMEM_CONSTANT : 0;
+
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
     ents[1] = GCSPRINTF("%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb);
+    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb
+                        - mem_target_fudge);
     ents[4] = "memory/videoram";
     ents[5] = GCSPRINTF("%"PRId64, info->video_memkb);
     ents[6] = "domid";
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 17:55:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 17:55:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZtJK0-0003i1-8A; Mon, 02 Nov 2015 17:55: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 1ZtJJz-0003hw-7r
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 17:55:07 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	AA/1B-12889-A73A7365; Mon, 02 Nov 2015 17:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1446486904!63650071!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20164 invoked from network); 2 Nov 2015 17:55:05 -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;
	2 Nov 2015 17:55:05 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtJJw-00043U-IA
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 17:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtJJv-00019M-5f
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 17:55:03 +0000
Date: Mon, 02 Nov 2015 17:55:03 +0000
Message-Id: <E1ZtJJv-00019M-5f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] libxl: adjust PoD target by memory
	fudge, 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 423d2cd814e8460d5ea8bd191a770f3c48b3947c
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 16:18:30 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:12:04 2015 +0000

    libxl: adjust PoD target by memory fudge, too
    
    PoD guests need to balloon at least as far as required by PoD, or risk
    crashing.  Currently they don't necessarily know what the right value
    is, because our memory accounting is (at the very least) confusing.
    
    Apply the memory limit fudge factor to the in-hypervisor PoD memory
    target, too.  This will increase the size of the guest's PoD cache by
    the fudge factor LIBXL_MAXMEM_CONSTANT (currently 1Mby).  This ensures
    that even with a slightly-off balloon driver, the guest will be
    stable even under memory pressure.
    
    There are two call sites of xc_domain_set_pod_target that need fixing:
    
    The one in libxl_set_memory_target is straightforward.
    
    The one in xc_hvm_build_x86.c:setup_guest is more awkward.  Simply
    setting the PoD target differently does not work because the various
    amounts of memory during domain construction no longer match up.
    Instead, we adjust the guest memory target in xenstore (but only for
    PoD guests).
    
    This introduces a 1Mby discrepancy between the balloon target of a PoD
    guest at boot, and the target set by an apparently-equivalent `xl
    mem-set' (or similar) later.  This approach is low-risk for a security
    fix but we need to fix this up properly in xen.git#staging and
    probably also in stable trees.
    
    This is XSA-153.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 56fb5fd62320eb40a7517206f9706aa9188d6f7b)
---
 tools/libxl/libxl.c     |    2 +-
 tools/libxl/libxl_dom.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 3536b5d..312a371 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4859,7 +4859,7 @@ retry_transaction:
 
     new_target_memkb -= videoram;
     rc = xc_domain_set_pod_target(ctx->xch, domid,
-            new_target_memkb / 4, NULL, NULL, NULL);
+            (new_target_memkb + LIBXL_MAXMEM_CONSTANT) / 4, NULL, NULL, NULL);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "xc_domain_set_pod_target domid=%d, memkb=%d "
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 1d33a18..4ee3248 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -446,6 +446,7 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     xs_transaction_t t;
     char **ents;
     int i, rc;
+    int64_t mem_target_fudge;
 
     rc = libxl_domain_sched_params_set(CTX, domid, &info->sched_params);
     if (rc)
@@ -472,11 +473,17 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
         }
     }
 
+    mem_target_fudge =
+        (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+         info->max_memkb > info->target_memkb)
+        ? LIBXL_MAXMEM_CONSTANT : 0;
+
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
     ents[1] = GCSPRINTF("%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb);
+    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb
+                        - mem_target_fudge);
     ents[4] = "memory/videoram";
     ents[5] = GCSPRINTF("%"PRId64, info->video_memkb);
     ents[6] = "domid";
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 19:44:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 19: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 1ZtL1T-0006ks-GZ; Mon, 02 Nov 2015 19:44:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtL1S-0006kn-9A
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:06 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	AA/04-04752-50DB7365; Mon, 02 Nov 2015 19:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1446493443!18813559!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15761 invoked from network); 2 Nov 2015 19:44:04 -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;
	2 Nov 2015 19:44:04 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtL1P-0005Ab-Iz
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtL1P-0005X6-8P
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:03 +0000
Date: Mon, 02 Nov 2015 19:44:03 +0000
Message-Id: <E1ZtL1P-0005X6-8P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] libxl: adjust PoD target by memory
	fudge, 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 56fb5fd62320eb40a7517206f9706aa9188d6f7b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 16:18:30 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:11:15 2015 +0000

    libxl: adjust PoD target by memory fudge, too
    
    PoD guests need to balloon at least as far as required by PoD, or risk
    crashing.  Currently they don't necessarily know what the right value
    is, because our memory accounting is (at the very least) confusing.
    
    Apply the memory limit fudge factor to the in-hypervisor PoD memory
    target, too.  This will increase the size of the guest's PoD cache by
    the fudge factor LIBXL_MAXMEM_CONSTANT (currently 1Mby).  This ensures
    that even with a slightly-off balloon driver, the guest will be
    stable even under memory pressure.
    
    There are two call sites of xc_domain_set_pod_target that need fixing:
    
    The one in libxl_set_memory_target is straightforward.
    
    The one in xc_hvm_build_x86.c:setup_guest is more awkward.  Simply
    setting the PoD target differently does not work because the various
    amounts of memory during domain construction no longer match up.
    Instead, we adjust the guest memory target in xenstore (but only for
    PoD guests).
    
    This introduces a 1Mby discrepancy between the balloon target of a PoD
    guest at boot, and the target set by an apparently-equivalent `xl
    mem-set' (or similar) later.  This approach is low-risk for a security
    fix but we need to fix this up properly in xen.git#staging and
    probably also in stable trees.
    
    This is XSA-153.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl.c     |    2 +-
 tools/libxl/libxl_dom.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index d38d0c7..1366177 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4815,7 +4815,7 @@ retry_transaction:
     }
 
     rc = xc_domain_set_pod_target(ctx->xch, domid,
-            new_target_memkb / 4, NULL, NULL, NULL);
+            (new_target_memkb + LIBXL_MAXMEM_CONSTANT) / 4, NULL, NULL, NULL);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "xc_domain_set_pod_target domid=%d, memkb=%d "
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index b514377..8019f4e 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -486,6 +486,7 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     xs_transaction_t t;
     char **ents;
     int i, rc;
+    int64_t mem_target_fudge;
 
     if (info->num_vnuma_nodes && !info->num_vcpu_soft_affinity) {
         rc = set_vnuma_affinity(gc, domid, info);
@@ -518,11 +519,17 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
         }
     }
 
+    mem_target_fudge =
+        (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+         info->max_memkb > info->target_memkb)
+        ? LIBXL_MAXMEM_CONSTANT : 0;
+
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
     ents[1] = GCSPRINTF("%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb);
+    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb
+                        - mem_target_fudge);
     ents[4] = "memory/videoram";
     ents[5] = GCSPRINTF("%"PRId64, info->video_memkb);
     ents[6] = "domid";
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 19:44:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 19: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 1ZtL1T-0006ks-GZ; Mon, 02 Nov 2015 19:44:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtL1S-0006kn-9A
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:06 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	AA/04-04752-50DB7365; Mon, 02 Nov 2015 19:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1446493443!18813559!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15761 invoked from network); 2 Nov 2015 19:44:04 -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;
	2 Nov 2015 19:44:04 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtL1P-0005Ab-Iz
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtL1P-0005X6-8P
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:03 +0000
Date: Mon, 02 Nov 2015 19:44:03 +0000
Message-Id: <E1ZtL1P-0005X6-8P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] libxl: adjust PoD target by memory
	fudge, 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 56fb5fd62320eb40a7517206f9706aa9188d6f7b
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 16:18:30 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:11:15 2015 +0000

    libxl: adjust PoD target by memory fudge, too
    
    PoD guests need to balloon at least as far as required by PoD, or risk
    crashing.  Currently they don't necessarily know what the right value
    is, because our memory accounting is (at the very least) confusing.
    
    Apply the memory limit fudge factor to the in-hypervisor PoD memory
    target, too.  This will increase the size of the guest's PoD cache by
    the fudge factor LIBXL_MAXMEM_CONSTANT (currently 1Mby).  This ensures
    that even with a slightly-off balloon driver, the guest will be
    stable even under memory pressure.
    
    There are two call sites of xc_domain_set_pod_target that need fixing:
    
    The one in libxl_set_memory_target is straightforward.
    
    The one in xc_hvm_build_x86.c:setup_guest is more awkward.  Simply
    setting the PoD target differently does not work because the various
    amounts of memory during domain construction no longer match up.
    Instead, we adjust the guest memory target in xenstore (but only for
    PoD guests).
    
    This introduces a 1Mby discrepancy between the balloon target of a PoD
    guest at boot, and the target set by an apparently-equivalent `xl
    mem-set' (or similar) later.  This approach is low-risk for a security
    fix but we need to fix this up properly in xen.git#staging and
    probably also in stable trees.
    
    This is XSA-153.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl.c     |    2 +-
 tools/libxl/libxl_dom.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index d38d0c7..1366177 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4815,7 +4815,7 @@ retry_transaction:
     }
 
     rc = xc_domain_set_pod_target(ctx->xch, domid,
-            new_target_memkb / 4, NULL, NULL, NULL);
+            (new_target_memkb + LIBXL_MAXMEM_CONSTANT) / 4, NULL, NULL, NULL);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "xc_domain_set_pod_target domid=%d, memkb=%d "
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index b514377..8019f4e 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -486,6 +486,7 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     xs_transaction_t t;
     char **ents;
     int i, rc;
+    int64_t mem_target_fudge;
 
     if (info->num_vnuma_nodes && !info->num_vcpu_soft_affinity) {
         rc = set_vnuma_affinity(gc, domid, info);
@@ -518,11 +519,17 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
         }
     }
 
+    mem_target_fudge =
+        (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+         info->max_memkb > info->target_memkb)
+        ? LIBXL_MAXMEM_CONSTANT : 0;
+
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
     ents[1] = GCSPRINTF("%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb);
+    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb
+                        - mem_target_fudge);
     ents[4] = "memory/videoram";
     ents[5] = GCSPRINTF("%"PRId64, info->video_memkb);
     ents[6] = "domid";
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 19:44:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 19: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 1ZtL1f-0006lZ-J4; Mon, 02 Nov 2015 19:44:19 +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 1ZtL1d-0006lQ-G6
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:17 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	2F/D2-12889-01DB7365; Mon, 02 Nov 2015 19:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1446493455!31382622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25620 invoked from network); 2 Nov 2015 19:44:15 -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;
	2 Nov 2015 19:44:15 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtL1a-0005Ag-RQ
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtL1Z-0005Xd-Qq
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:13 +0000
Date: Mon, 02 Nov 2015 19:44:13 +0000
Message-Id: <E1ZtL1Z-0005Xd-Qq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] 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 40d7a7454835c2f7c639c78f6c09e7b6f0e4a4e2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 29 15:22:50 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:22:50 2015 +0000

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

diff --git a/Config.mk b/Config.mk
index 54fbb9d..659d94d 100644
--- a/Config.mk
+++ b/Config.mk
@@ -266,9 +266,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= xen-4.6.0
-# Tue Sep 8 15:41:20 2015 +0100
-# Fix build after "ui/vnc: limit client_cut_text msg payload size"
+QEMU_TRADITIONAL_REVISION ?= bc00cad75d8bcc3ba696992bec219c21db8406aa
+# Tue Mar 11 10:19:23 2014 +0000
+# block-vvfat: fix resource leaks in read_directory()
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Mon Nov 02 19:44:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Nov 2015 19: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 1ZtL1f-0006lZ-J4; Mon, 02 Nov 2015 19:44:19 +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 1ZtL1d-0006lQ-G6
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:17 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	2F/D2-12889-01DB7365; Mon, 02 Nov 2015 19:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1446493455!31382622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.13.16; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25620 invoked from network); 2 Nov 2015 19:44:15 -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;
	2 Nov 2015 19:44:15 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtL1a-0005Ag-RQ
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZtL1Z-0005Xd-Qq
	for xen-changelog@lists.xensource.com; Mon, 02 Nov 2015 19:44:13 +0000
Date: Mon, 02 Nov 2015 19:44:13 +0000
Message-Id: <E1ZtL1Z-0005Xd-Qq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.6] 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 40d7a7454835c2f7c639c78f6c09e7b6f0e4a4e2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Oct 29 15:22:50 2015 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:22:50 2015 +0000

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

diff --git a/Config.mk b/Config.mk
index 54fbb9d..659d94d 100644
--- a/Config.mk
+++ b/Config.mk
@@ -266,9 +266,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= xen-4.6.0
-# Tue Sep 8 15:41:20 2015 +0100
-# Fix build after "ui/vnc: limit client_cut_text msg payload size"
+QEMU_TRADITIONAL_REVISION ?= bc00cad75d8bcc3ba696992bec219c21db8406aa
+# Tue Mar 11 10:19:23 2014 +0000
+# block-vvfat: fix resource leaks in read_directory()
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

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

From xen-changelog-bounces@lists.xen.org Wed Nov 04 16:22:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2015 16:22: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 1Zu0p6-0008JL-LO; Wed, 04 Nov 2015 16:22: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 1Zu0p5-0008JG-K1
	for xen-changelog@lists.xensource.com; Wed, 04 Nov 2015 16:22:07 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	AF/BC-01753-EA03A365; Wed, 04 Nov 2015 16:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446654125!969562!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62308 invoked from network); 4 Nov 2015 16:22:06 -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;
	4 Nov 2015 16:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zu0p0-0007X8-T3
	for xen-changelog@lists.xensource.com; Wed, 04 Nov 2015 16:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zu0p0-0006wA-Eb
	for xen-changelog@lists.xensource.com; Wed, 04 Nov 2015 16:22:02 +0000
Date: Wed, 04 Nov 2015 16:22:02 +0000
Message-Id: <E1Zu0p0-0006wA-Eb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] update Xen version to 4.5.2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e0a36c028bd6d9f50982bc2eaacadc0036267e27
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 10:11:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 10:11:18 2015 +0100

    update Xen version to 4.5.2
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index ea44f65..c1795e6 100644
--- a/Config.mk
+++ b/Config.mk
@@ -252,7 +252,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-4.5-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.5.1
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.5.2
 SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 # Thu May 22 16:59:16 2014 -0400
 # python3 fixes for vgabios and csm builds.
@@ -260,7 +260,7 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= dfe880e8d5fdc863ce6bbcdcaebaf918f8689cc0
+QEMU_TRADITIONAL_REVISION ?= xen-4.5.2
 # Mon Jun 30 10:07:54 2014 +0200
 # vnc: limit client_cut_text msg payload size
 
diff --git a/xen/Makefile b/xen/Makefile
index ee0bcfc..5161fdc 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 5
-export XEN_EXTRAVERSION ?= .2-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Wed Nov 04 16:22:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Nov 2015 16:22: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 1Zu0p6-0008JL-LO; Wed, 04 Nov 2015 16:22: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 1Zu0p5-0008JG-K1
	for xen-changelog@lists.xensource.com; Wed, 04 Nov 2015 16:22:07 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	AF/BC-01753-EA03A365; Wed, 04 Nov 2015 16:22:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1446654125!969562!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62308 invoked from network); 4 Nov 2015 16:22:06 -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;
	4 Nov 2015 16:22:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zu0p0-0007X8-T3
	for xen-changelog@lists.xensource.com; Wed, 04 Nov 2015 16:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zu0p0-0006wA-Eb
	for xen-changelog@lists.xensource.com; Wed, 04 Nov 2015 16:22:02 +0000
Date: Wed, 04 Nov 2015 16:22:02 +0000
Message-Id: <E1Zu0p0-0006wA-Eb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] update Xen version to 4.5.2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e0a36c028bd6d9f50982bc2eaacadc0036267e27
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 10:11:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 10:11:18 2015 +0100

    update Xen version to 4.5.2
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index ea44f65..c1795e6 100644
--- a/Config.mk
+++ b/Config.mk
@@ -252,7 +252,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-4.5-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.5.1
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.5.2
 SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 # Thu May 22 16:59:16 2014 -0400
 # python3 fixes for vgabios and csm builds.
@@ -260,7 +260,7 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= dfe880e8d5fdc863ce6bbcdcaebaf918f8689cc0
+QEMU_TRADITIONAL_REVISION ?= xen-4.5.2
 # Mon Jun 30 10:07:54 2014 +0200
 # vnc: limit client_cut_text msg payload size
 
diff --git a/xen/Makefile b/xen/Makefile
index ee0bcfc..5161fdc 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 5
-export XEN_EXTRAVERSION ?= .2-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:00:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:00: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 1Zugci-0003Ns-U1; Fri, 06 Nov 2015 13:00: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 1Zugch-0003NS-W3
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:08 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	5F/2B-31450-754AC365; Fri, 06 Nov 2015 13:00:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1446814805!1587761!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26628 invoked from network); 6 Nov 2015 13:00:06 -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;
	6 Nov 2015 13:00:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugcf-0000o4-H2
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugce-00047r-Kf
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:04 +0000
Date: Fri, 06 Nov 2015 13:00:04 +0000
Message-Id: <E1Zugce-00047r-Kf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] drop get_xen_guest_handle()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83a20172cc70cc579afb8a9e539a0408a533c31d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 2 15:26:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:26:40 2015 +0100

    drop get_xen_guest_handle()
    
    Its use in the tools (and its apparent abuse in the hypervisor) are
    long gone.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/sysctl.c             |    2 --
 xen/arch/x86/x86_64/cpu_idle.c    |    3 ---
 xen/include/public/arch-arm.h     |    3 ---
 xen/include/public/arch-x86/xen.h |    3 ---
 4 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 34ee240..58cbd70 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -31,8 +31,6 @@
 #include <xsm/xsm.h>
 #include <asm/psr.h>
 
-#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
-
 struct l3_cache_info {
     int ret;
     unsigned long size;
diff --git a/xen/arch/x86/x86_64/cpu_idle.c b/xen/arch/x86/x86_64/cpu_idle.c
index 0fbd10a..f991fd9 100644
--- a/xen/arch/x86/x86_64/cpu_idle.c
+++ b/xen/arch/x86/x86_64/cpu_idle.c
@@ -21,9 +21,6 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
-#define __XEN_TOOLS__ /* for using get_xen_guest_handle macro */
-
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 #include <xen/guest_access.h>
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 3c365f3..6322548 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -195,9 +195,6 @@
         _sxghr_tmp->q = 0;                                  \
         _sxghr_tmp->p = val;                                \
     } while ( 0 )
-#ifdef __XEN_TOOLS__
-#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
-#endif
 #define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
 
 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 2ecc9c9..5187560 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -54,9 +54,6 @@
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
 #define XEN_GUEST_HANDLE_PARAM(name)    XEN_GUEST_HANDLE(name)
 #define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
-#ifdef __XEN_TOOLS__
-#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
-#endif
 #define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
 
 #if defined(__i386__)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:00:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:00: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 1Zugci-0003Ns-U1; Fri, 06 Nov 2015 13:00: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 1Zugch-0003NS-W3
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:08 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	5F/2B-31450-754AC365; Fri, 06 Nov 2015 13:00:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1446814805!1587761!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26628 invoked from network); 6 Nov 2015 13:00:06 -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;
	6 Nov 2015 13:00:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugcf-0000o4-H2
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugce-00047r-Kf
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:04 +0000
Date: Fri, 06 Nov 2015 13:00:04 +0000
Message-Id: <E1Zugce-00047r-Kf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] drop get_xen_guest_handle()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83a20172cc70cc579afb8a9e539a0408a533c31d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 2 15:26:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:26:40 2015 +0100

    drop get_xen_guest_handle()
    
    Its use in the tools (and its apparent abuse in the hypervisor) are
    long gone.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/x86/sysctl.c             |    2 --
 xen/arch/x86/x86_64/cpu_idle.c    |    3 ---
 xen/include/public/arch-arm.h     |    3 ---
 xen/include/public/arch-x86/xen.h |    3 ---
 4 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 34ee240..58cbd70 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -31,8 +31,6 @@
 #include <xsm/xsm.h>
 #include <asm/psr.h>
 
-#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
-
 struct l3_cache_info {
     int ret;
     unsigned long size;
diff --git a/xen/arch/x86/x86_64/cpu_idle.c b/xen/arch/x86/x86_64/cpu_idle.c
index 0fbd10a..f991fd9 100644
--- a/xen/arch/x86/x86_64/cpu_idle.c
+++ b/xen/arch/x86/x86_64/cpu_idle.c
@@ -21,9 +21,6 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
-#define __XEN_TOOLS__ /* for using get_xen_guest_handle macro */
-
-#include <xen/config.h>
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 #include <xen/guest_access.h>
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 3c365f3..6322548 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -195,9 +195,6 @@
         _sxghr_tmp->q = 0;                                  \
         _sxghr_tmp->p = val;                                \
     } while ( 0 )
-#ifdef __XEN_TOOLS__
-#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
-#endif
 #define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
 
 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 2ecc9c9..5187560 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -54,9 +54,6 @@
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
 #define XEN_GUEST_HANDLE_PARAM(name)    XEN_GUEST_HANDLE(name)
 #define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
-#ifdef __XEN_TOOLS__
-#define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
-#endif
 #define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
 
 #if defined(__i386__)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:00:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:00: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 1Zugcu-0003RB-1o; Fri, 06 Nov 2015 13:00: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 1Zugcs-0003Pd-LA
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:18 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	DF/CF-00536-164AC365; Fri, 06 Nov 2015 13:00:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1446814816!1549386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62236 invoked from network); 6 Nov 2015 13:00:17 -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;
	6 Nov 2015 13:00:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugcq-0000o8-0y
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugcp-000494-NW
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:15 +0000
Date: Fri, 06 Nov 2015 13:00:15 +0000
Message-Id: <E1Zugcp-000494-NW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxlu: avoid linker warnings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a647406c0fe1d3ed801019b7bde0be32effaea9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 2 15:28:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:28:33 2015 +0100

    libxlu: avoid linker warnings
    
    Recent ld warns about libxenlight.so's dependency libraries not being
    available, which can be easily avoided by not just passing the raw
    library name on ld's command line.
    
    In the course of checking how things fit together (I originally
    suspected the warning to come from the linking of xl) I also noticed a
    stray L in SHLIB_libxenguest, which gets removed at once.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Rules.mk       |    2 +-
 tools/libxl/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 2c422bd..ffa5fd3 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -40,7 +40,7 @@ SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
 
 CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenguest = $(XEN_LIBXC)/libxenguest$(libextension)
-SHLIB_libxenguest  = -Wl,-rpath-link=L$(XEN_LIBXC)
+SHLIB_libxenguest  = -Wl,-rpath-link=$(XEN_LIBXC)
 
 CFLAGS_libxenstore = -I$(XEN_XENSTORE)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore$(libextension)
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index c5ecec1..6ff5bee 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -41,7 +41,7 @@ LDFLAGS += $(PTHREAD_LDFLAGS)
 LIBXL_LIBS += $(PTHREAD_LIBS)
 LIBXL_LIBS += $(LIBXL_LIBS-y)
 
-LIBXLU_LIBS = libxenlight.so
+LIBXLU_LIBS = $(LDLIBS_libxenlight)
 
 LIBXL_OBJS-y = osdeps.o libxl_paths.o libxl_bootloader.o flexarray.o
 ifeq ($(LIBXL_BLKTAP),y)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:00:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:00: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 1Zugcu-0003RB-1o; Fri, 06 Nov 2015 13:00: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 1Zugcs-0003Pd-LA
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:18 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	DF/CF-00536-164AC365; Fri, 06 Nov 2015 13:00:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1446814816!1549386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62236 invoked from network); 6 Nov 2015 13:00:17 -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;
	6 Nov 2015 13:00:17 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugcq-0000o8-0y
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugcp-000494-NW
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:15 +0000
Date: Fri, 06 Nov 2015 13:00:15 +0000
Message-Id: <E1Zugcp-000494-NW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxlu: avoid linker warnings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a647406c0fe1d3ed801019b7bde0be32effaea9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 2 15:28:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:28:33 2015 +0100

    libxlu: avoid linker warnings
    
    Recent ld warns about libxenlight.so's dependency libraries not being
    available, which can be easily avoided by not just passing the raw
    library name on ld's command line.
    
    In the course of checking how things fit together (I originally
    suspected the warning to come from the linking of xl) I also noticed a
    stray L in SHLIB_libxenguest, which gets removed at once.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Rules.mk       |    2 +-
 tools/libxl/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 2c422bd..ffa5fd3 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -40,7 +40,7 @@ SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
 
 CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenguest = $(XEN_LIBXC)/libxenguest$(libextension)
-SHLIB_libxenguest  = -Wl,-rpath-link=L$(XEN_LIBXC)
+SHLIB_libxenguest  = -Wl,-rpath-link=$(XEN_LIBXC)
 
 CFLAGS_libxenstore = -I$(XEN_XENSTORE)/include $(CFLAGS_xeninclude)
 LDLIBS_libxenstore = $(XEN_XENSTORE)/libxenstore$(libextension)
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index c5ecec1..6ff5bee 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -41,7 +41,7 @@ LDFLAGS += $(PTHREAD_LDFLAGS)
 LIBXL_LIBS += $(PTHREAD_LIBS)
 LIBXL_LIBS += $(LIBXL_LIBS-y)
 
-LIBXLU_LIBS = libxenlight.so
+LIBXLU_LIBS = $(LDLIBS_libxenlight)
 
 LIBXL_OBJS-y = osdeps.o libxl_paths.o libxl_bootloader.o flexarray.o
 ifeq ($(LIBXL_BLKTAP),y)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:00:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:00: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 1Zugd5-0003Tw-57; Fri, 06 Nov 2015 13:00: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 1Zugd3-0003Tb-0k
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:29 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	72/D7-01753-C64AC365; Fri, 06 Nov 2015 13:00:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446814826!1554810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47578 invoked from network); 6 Nov 2015 13:00:27 -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;
	6 Nov 2015 13:00:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugd0-0000oT-C8
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugd0-0004AV-8a
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:26 +0000
Date: Fri, 06 Nov 2015 13:00:26 +0000
Message-Id: <E1Zugd0-0004AV-8a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make compat_iret() domain crash
	cases distinguishable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 957af2e22c7f68462cdfc531f505a0688c70941a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 2 15:32:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:32:48 2015 +0100

    x86: make compat_iret() domain crash cases distinguishable
    
    Rather than issuing a (mostly) useless separate message, rely on
    domain_crash() providing enough data, and leverage the line number
    information it prints.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_64/compat/traps.c |   47 +++++++++++++++++++++++-------------
 1 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/traps.c b/xen/arch/x86/x86_64/compat/traps.c
index 2dae0c7..bbf18e4 100644
--- a/xen/arch/x86/x86_64/compat/traps.c
+++ b/xen/arch/x86/x86_64/compat/traps.c
@@ -77,19 +77,28 @@ unsigned int compat_iret(void)
 
     /* Restore EAX (clobbered by hypercall). */
     if ( unlikely(__get_user(regs->_eax, (u32 *)regs->rsp)) )
-        goto exit_and_crash;
+    {
+        domain_crash(v->domain);
+        return 0;
+    }
 
     /* Restore CS and EIP. */
     if ( unlikely(__get_user(regs->_eip, (u32 *)regs->rsp + 1)) ||
         unlikely(__get_user(regs->cs, (u32 *)regs->rsp + 2)) )
-        goto exit_and_crash;
+    {
+        domain_crash(v->domain);
+        return 0;
+    }
 
     /*
      * Fix up and restore EFLAGS. We fix up in a local staging area
      * to avoid firing the BUG_ON(IOPL) check in arch_get_info_guest.
      */
     if ( unlikely(__get_user(eflags, (u32 *)regs->rsp + 3)) )
-        goto exit_and_crash;
+    {
+        domain_crash(v->domain);
+        return 0;
+    }
     regs->_eflags = (eflags & ~X86_EFLAGS_IOPL) | X86_EFLAGS_IF;
 
     if ( unlikely(eflags & X86_EFLAGS_VM) )
@@ -126,7 +135,10 @@ unsigned int compat_iret(void)
             }
         }
         if ( rc )
-            goto exit_and_crash;
+        {
+            domain_crash(v->domain);
+            return 0;
+        }
         regs->_esp = ksp;
         regs->ss = v->arch.pv_vcpu.kernel_ss;
 
@@ -136,21 +148,27 @@ unsigned int compat_iret(void)
         regs->_eflags &= ~(X86_EFLAGS_VM|X86_EFLAGS_RF|
                            X86_EFLAGS_NT|X86_EFLAGS_TF);
         if ( unlikely(__put_user(0, (u32 *)regs->rsp)) )
-            goto exit_and_crash;
+        {
+            domain_crash(v->domain);
+            return 0;
+        }
         regs->_eip = ti->address;
         regs->cs = ti->cs;
     }
     else if ( unlikely(ring_0(regs)) )
-        goto exit_and_crash;
-    else if ( !ring_1(regs) )
     {
-        /* Return to ring 2/3: restore ESP and SS. */
-        if ( __get_user(regs->ss, (u32 *)regs->rsp + 5)
-            || __get_user(regs->_esp, (u32 *)regs->rsp + 4))
-            goto exit_and_crash;
+        domain_crash(v->domain);
+        return 0;
     }
-    else
+    else if ( ring_1(regs) )
         regs->_esp += 16;
+    /* Return to ring 2/3: restore ESP and SS. */
+    else if ( __get_user(regs->ss, (u32 *)regs->rsp + 5) ||
+              __get_user(regs->_esp, (u32 *)regs->rsp + 4) )
+    {
+        domain_crash(v->domain);
+        return 0;
+    }
 
     /* Restore upcall mask from supplied EFLAGS.IF. */
     vcpu_info(v, evtchn_upcall_mask) = !(eflags & X86_EFLAGS_IF);
@@ -162,11 +180,6 @@ unsigned int compat_iret(void)
      * value.
      */
     return regs->_eax;
-
- exit_and_crash:
-    gprintk(XENLOG_ERR, "Fatal IRET error\n");
-    domain_crash(v->domain);
-    return 0;
 }
 
 static long compat_register_guest_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 Nov 06 13:00:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:00: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 1Zugd5-0003Tw-57; Fri, 06 Nov 2015 13:00: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 1Zugd3-0003Tb-0k
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:29 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	72/D7-01753-C64AC365; Fri, 06 Nov 2015 13:00:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446814826!1554810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47578 invoked from network); 6 Nov 2015 13:00:27 -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;
	6 Nov 2015 13:00:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugd0-0000oT-C8
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugd0-0004AV-8a
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:26 +0000
Date: Fri, 06 Nov 2015 13:00:26 +0000
Message-Id: <E1Zugd0-0004AV-8a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make compat_iret() domain crash
	cases distinguishable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 957af2e22c7f68462cdfc531f505a0688c70941a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 2 15:32:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:32:48 2015 +0100

    x86: make compat_iret() domain crash cases distinguishable
    
    Rather than issuing a (mostly) useless separate message, rely on
    domain_crash() providing enough data, and leverage the line number
    information it prints.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_64/compat/traps.c |   47 +++++++++++++++++++++++-------------
 1 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/traps.c b/xen/arch/x86/x86_64/compat/traps.c
index 2dae0c7..bbf18e4 100644
--- a/xen/arch/x86/x86_64/compat/traps.c
+++ b/xen/arch/x86/x86_64/compat/traps.c
@@ -77,19 +77,28 @@ unsigned int compat_iret(void)
 
     /* Restore EAX (clobbered by hypercall). */
     if ( unlikely(__get_user(regs->_eax, (u32 *)regs->rsp)) )
-        goto exit_and_crash;
+    {
+        domain_crash(v->domain);
+        return 0;
+    }
 
     /* Restore CS and EIP. */
     if ( unlikely(__get_user(regs->_eip, (u32 *)regs->rsp + 1)) ||
         unlikely(__get_user(regs->cs, (u32 *)regs->rsp + 2)) )
-        goto exit_and_crash;
+    {
+        domain_crash(v->domain);
+        return 0;
+    }
 
     /*
      * Fix up and restore EFLAGS. We fix up in a local staging area
      * to avoid firing the BUG_ON(IOPL) check in arch_get_info_guest.
      */
     if ( unlikely(__get_user(eflags, (u32 *)regs->rsp + 3)) )
-        goto exit_and_crash;
+    {
+        domain_crash(v->domain);
+        return 0;
+    }
     regs->_eflags = (eflags & ~X86_EFLAGS_IOPL) | X86_EFLAGS_IF;
 
     if ( unlikely(eflags & X86_EFLAGS_VM) )
@@ -126,7 +135,10 @@ unsigned int compat_iret(void)
             }
         }
         if ( rc )
-            goto exit_and_crash;
+        {
+            domain_crash(v->domain);
+            return 0;
+        }
         regs->_esp = ksp;
         regs->ss = v->arch.pv_vcpu.kernel_ss;
 
@@ -136,21 +148,27 @@ unsigned int compat_iret(void)
         regs->_eflags &= ~(X86_EFLAGS_VM|X86_EFLAGS_RF|
                            X86_EFLAGS_NT|X86_EFLAGS_TF);
         if ( unlikely(__put_user(0, (u32 *)regs->rsp)) )
-            goto exit_and_crash;
+        {
+            domain_crash(v->domain);
+            return 0;
+        }
         regs->_eip = ti->address;
         regs->cs = ti->cs;
     }
     else if ( unlikely(ring_0(regs)) )
-        goto exit_and_crash;
-    else if ( !ring_1(regs) )
     {
-        /* Return to ring 2/3: restore ESP and SS. */
-        if ( __get_user(regs->ss, (u32 *)regs->rsp + 5)
-            || __get_user(regs->_esp, (u32 *)regs->rsp + 4))
-            goto exit_and_crash;
+        domain_crash(v->domain);
+        return 0;
     }
-    else
+    else if ( ring_1(regs) )
         regs->_esp += 16;
+    /* Return to ring 2/3: restore ESP and SS. */
+    else if ( __get_user(regs->ss, (u32 *)regs->rsp + 5) ||
+              __get_user(regs->_esp, (u32 *)regs->rsp + 4) )
+    {
+        domain_crash(v->domain);
+        return 0;
+    }
 
     /* Restore upcall mask from supplied EFLAGS.IF. */
     vcpu_info(v, evtchn_upcall_mask) = !(eflags & X86_EFLAGS_IF);
@@ -162,11 +180,6 @@ unsigned int compat_iret(void)
      * value.
      */
     return regs->_eax;
-
- exit_and_crash:
-    gprintk(XENLOG_ERR, "Fatal IRET error\n");
-    domain_crash(v->domain);
-    return 0;
 }
 
 static long compat_register_guest_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 Nov 06 13:00:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:00: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 1ZugdF-0003YC-9O; Fri, 06 Nov 2015 13:00: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 1ZugdD-0003WW-7K
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:40 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	45/F4-03763-674AC365; Fri, 06 Nov 2015 13:00:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446814836!1636284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5330 invoked from network); 6 Nov 2015 13:00:37 -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 Nov 2015 13:00:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdA-0000oY-MV
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdA-0004Bv-Jo
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:36 +0000
Date: Fri, 06 Nov 2015 13:00:36 +0000
Message-Id: <E1ZugdA-0004Bv-Jo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit1: on vCPU wakeup,
	kick away current only if makes sense
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f02a5760c75c8ce17c930e7c9068eb64997418d0
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Nov 2 15:33:19 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:33:19 2015 +0100

    credit1: on vCPU wakeup, kick away current only if makes sense
    
    In fact, when waking up a vCPU, __runq_tickle() is called
    to allow the new vCPU to run on a pCPU (which one, depends
    on the relationship between the priority of the new vCPU,
    and the ones of the vCPUs that are already running).
    
    If there is no idle processor on which the new vCPU can
    run (e.g., because of pinning/affinity), we try to migrate
    away the vCPU that is currently running on the new vCPU's
    processor (i.e., the processor on which the vCPU is waking
    up).
    
    Now, trying to migrate a vCPU has the effect of pushing it
    through a
    
     running --> offline --> runnable
    
    transition, which, in turn, has the following negative
    effects:
    
     1) Credit1 counts that as a wakeup, and it BOOSTs the
        vCPU, even if it is a CPU-bound one, which wouldn't
        normally have deserved boosting. This can prevent
        legit IO-bound vCPUs to get ahold of the processor
        until such spurious boosting expires, hurting the
        performance!
    
     2) since the vCPU is fails the vcpu_runnable() test
        (within the call to csched_schedule() that follows
        the wakeup, as a consequence of tickling) the
        scheduling rate-limiting mechanism is also fooled,
        i.e., the context switch happens even if less than
        the minimum execution amount of time passed.
    
    In particular, 1) has been reported to cause the following
    issue:
    
     * VM-IO: 1-vCPU pinned to a pCPU, running netperf
     * VM-CPU: 1-vCPU pinned the the same pCPU, running a busy
               CPU loop
     ==> Only VM-I/O: throughput is 806.64 Mbps
     ==> VM-I/O + VM-CPU: throughput is 166.50 Mbps
    
    This patch solves (for the above scenario) the problem
    by checking whether or not it makes sense to try to
    migrate away the vCPU currently running on the processor.
    In fact, if there aren't idle processors where such a vCPU
    can execute. attempting the migration is just futile
    (harmful, actually!).
    
    With this patch, in the above configuration, results are:
    
     ==> Only VM-I/O: throughput is 807.18 Mbps
     ==> VM-I/O + VM-CPU: throughput is 731.66 Mbps
    
    Reported-by: Kun Suo <ksuo@uccs.edu>
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Tested-by: Kun Suo <ksuo@uccs.edu>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index b8f28fe..1b30e67 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -426,9 +426,10 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 
             /*
              * If there are no suitable idlers for new, and it's higher
-             * priority than cur, ask the scheduler to migrate cur away.
-             * We have to act like this (instead of just waking some of
-             * the idlers suitable for cur) because cur is running.
+             * priority than cur, check whether we can migrate cur away.
+             * (We have to do it indirectly, via _VPF_migrating, instead
+             * of just tickling any idler suitable for cur) because cur
+             * is running.)
              *
              * If there are suitable idlers for new, no matter priorities,
              * leave cur alone (as it is running and is, likely, cache-hot)
@@ -437,11 +438,18 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
              */
             if ( new_idlers_empty && new->pri > cur->pri )
             {
+                csched_balance_cpumask(cur->vcpu, balance_step,
+                                       csched_balance_mask(cpu));
+                if ( cpumask_intersects(csched_balance_mask(cpu),
+                                        &idle_mask) )
+                {
+                    SCHED_VCPU_STAT_CRANK(cur, kicked_away);
+                    SCHED_VCPU_STAT_CRANK(cur, migrate_r);
+                    SCHED_STAT_CRANK(migrate_kicked_away);
+                    set_bit(_VPF_migrating, &cur->vcpu->pause_flags);
+                }
+                /* Tickle cpu anyway, to let new preempt cur. */
                 SCHED_STAT_CRANK(tickle_idlers_none);
-                SCHED_VCPU_STAT_CRANK(cur, kicked_away);
-                SCHED_VCPU_STAT_CRANK(cur, migrate_r);
-                SCHED_STAT_CRANK(migrate_kicked_away);
-                set_bit(_VPF_migrating, &cur->vcpu->pause_flags);
                 __cpumask_set_cpu(cpu, &mask);
             }
             else if ( !new_idlers_empty )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:00:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:00: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 1ZugdF-0003YC-9O; Fri, 06 Nov 2015 13:00: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 1ZugdD-0003WW-7K
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:40 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	45/F4-03763-674AC365; Fri, 06 Nov 2015 13:00:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446814836!1636284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5330 invoked from network); 6 Nov 2015 13:00:37 -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 Nov 2015 13:00:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdA-0000oY-MV
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdA-0004Bv-Jo
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:36 +0000
Date: Fri, 06 Nov 2015 13:00:36 +0000
Message-Id: <E1ZugdA-0004Bv-Jo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit1: on vCPU wakeup,
	kick away current only if makes sense
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f02a5760c75c8ce17c930e7c9068eb64997418d0
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Nov 2 15:33:19 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:33:19 2015 +0100

    credit1: on vCPU wakeup, kick away current only if makes sense
    
    In fact, when waking up a vCPU, __runq_tickle() is called
    to allow the new vCPU to run on a pCPU (which one, depends
    on the relationship between the priority of the new vCPU,
    and the ones of the vCPUs that are already running).
    
    If there is no idle processor on which the new vCPU can
    run (e.g., because of pinning/affinity), we try to migrate
    away the vCPU that is currently running on the new vCPU's
    processor (i.e., the processor on which the vCPU is waking
    up).
    
    Now, trying to migrate a vCPU has the effect of pushing it
    through a
    
     running --> offline --> runnable
    
    transition, which, in turn, has the following negative
    effects:
    
     1) Credit1 counts that as a wakeup, and it BOOSTs the
        vCPU, even if it is a CPU-bound one, which wouldn't
        normally have deserved boosting. This can prevent
        legit IO-bound vCPUs to get ahold of the processor
        until such spurious boosting expires, hurting the
        performance!
    
     2) since the vCPU is fails the vcpu_runnable() test
        (within the call to csched_schedule() that follows
        the wakeup, as a consequence of tickling) the
        scheduling rate-limiting mechanism is also fooled,
        i.e., the context switch happens even if less than
        the minimum execution amount of time passed.
    
    In particular, 1) has been reported to cause the following
    issue:
    
     * VM-IO: 1-vCPU pinned to a pCPU, running netperf
     * VM-CPU: 1-vCPU pinned the the same pCPU, running a busy
               CPU loop
     ==> Only VM-I/O: throughput is 806.64 Mbps
     ==> VM-I/O + VM-CPU: throughput is 166.50 Mbps
    
    This patch solves (for the above scenario) the problem
    by checking whether or not it makes sense to try to
    migrate away the vCPU currently running on the processor.
    In fact, if there aren't idle processors where such a vCPU
    can execute. attempting the migration is just futile
    (harmful, actually!).
    
    With this patch, in the above configuration, results are:
    
     ==> Only VM-I/O: throughput is 807.18 Mbps
     ==> VM-I/O + VM-CPU: throughput is 731.66 Mbps
    
    Reported-by: Kun Suo <ksuo@uccs.edu>
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Tested-by: Kun Suo <ksuo@uccs.edu>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index b8f28fe..1b30e67 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -426,9 +426,10 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 
             /*
              * If there are no suitable idlers for new, and it's higher
-             * priority than cur, ask the scheduler to migrate cur away.
-             * We have to act like this (instead of just waking some of
-             * the idlers suitable for cur) because cur is running.
+             * priority than cur, check whether we can migrate cur away.
+             * (We have to do it indirectly, via _VPF_migrating, instead
+             * of just tickling any idler suitable for cur) because cur
+             * is running.)
              *
              * If there are suitable idlers for new, no matter priorities,
              * leave cur alone (as it is running and is, likely, cache-hot)
@@ -437,11 +438,18 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
              */
             if ( new_idlers_empty && new->pri > cur->pri )
             {
+                csched_balance_cpumask(cur->vcpu, balance_step,
+                                       csched_balance_mask(cpu));
+                if ( cpumask_intersects(csched_balance_mask(cpu),
+                                        &idle_mask) )
+                {
+                    SCHED_VCPU_STAT_CRANK(cur, kicked_away);
+                    SCHED_VCPU_STAT_CRANK(cur, migrate_r);
+                    SCHED_STAT_CRANK(migrate_kicked_away);
+                    set_bit(_VPF_migrating, &cur->vcpu->pause_flags);
+                }
+                /* Tickle cpu anyway, to let new preempt cur. */
                 SCHED_STAT_CRANK(tickle_idlers_none);
-                SCHED_VCPU_STAT_CRANK(cur, kicked_away);
-                SCHED_VCPU_STAT_CRANK(cur, migrate_r);
-                SCHED_STAT_CRANK(migrate_kicked_away);
-                set_bit(_VPF_migrating, &cur->vcpu->pause_flags);
                 __cpumask_set_cpu(cpu, &mask);
             }
             else if ( !new_idlers_empty )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:00:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:00: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 1ZugdS-0003Zx-O6; Fri, 06 Nov 2015 13:00:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdO-0003Ze-BH
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:50 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	C7/00-18886-184AC365; Fri, 06 Nov 2015 13:00:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1446814848!1074045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51396 invoked from network); 6 Nov 2015 13:00:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Nov 2015 13:00:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdL-0000og-QM
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdK-0004DO-Ut
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:46 +0000
Date: Fri, 06 Nov 2015 13:00:46 +0000
Message-Id: <E1ZugdK-0004DO-Ut@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PoD: Make p2m_pod_empty_cache()
	restartable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 59a5061723ba47c0028cf48487e5de551c42a378
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 2 15:33:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:33:38 2015 +0100

    x86/PoD: Make p2m_pod_empty_cache() restartable
    
    This avoids a long running operation when destroying a domain with a
    large PoD cache.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |   16 +++++++++++-----
 xen/arch/x86/mm/paging.c  |    2 +-
 xen/include/asm-x86/p2m.h |    2 +-
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 2a6f125..be15cf3 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -374,11 +374,11 @@ out:
     return ret;
 }
 
-void
-p2m_pod_empty_cache(struct domain *d)
+int p2m_pod_empty_cache(struct domain *d)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     struct page_info *page;
+    unsigned int i;
 
     /* After this barrier no new PoD activities can happen. */
     BUG_ON(!d->is_dying);
@@ -388,8 +388,6 @@ p2m_pod_empty_cache(struct domain *d)
 
     while ( (page = page_list_remove_head(&p2m->pod.super)) )
     {
-        int i;
-            
         for ( i = 0 ; i < SUPERPAGE_PAGES ; i++ )
         {
             BUG_ON(page_get_owner(page + i) != d);
@@ -397,19 +395,27 @@ p2m_pod_empty_cache(struct domain *d)
         }
 
         p2m->pod.count -= SUPERPAGE_PAGES;
+
+        if ( hypercall_preempt_check() )
+            goto out;
     }
 
-    while ( (page = page_list_remove_head(&p2m->pod.single)) )
+    for ( i = 0; (page = page_list_remove_head(&p2m->pod.single)); ++i )
     {
         BUG_ON(page_get_owner(page) != d);
         page_list_add_tail(page, &d->page_list);
 
         p2m->pod.count -= 1;
+
+        if ( i && !(i & 511) && hypercall_preempt_check() )
+            goto out;
     }
 
     BUG_ON(p2m->pod.count != 0);
 
+ out:
     unlock_page_alloc(p2m);
+    return p2m->pod.count ? -ERESTART : 0;
 }
 
 int
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 0bfb2be..c7d1943 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -824,7 +824,7 @@ int paging_teardown(struct domain *d)
         return rc;
 
     /* Move populate-on-demand cache back to domain_list for destruction */
-    p2m_pod_empty_cache(d);
+    rc = p2m_pod_empty_cache(d);
 
     return rc;
 }
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index b710b2c..d748557 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -588,7 +588,7 @@ void p2m_pod_dump_data(struct domain *d);
 
 /* Move all pages from the populate-on-demand cache to the domain page_list
  * (usually in preparation for domain destruction) */
-void p2m_pod_empty_cache(struct domain *d);
+int p2m_pod_empty_cache(struct domain *d);
 
 /* Set populate-on-demand cache size so that the total memory allocated to a
  * domain matches target */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:00:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:00: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 1ZugdS-0003Zx-O6; Fri, 06 Nov 2015 13:00:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdO-0003Ze-BH
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:50 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	C7/00-18886-184AC365; Fri, 06 Nov 2015 13:00:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1446814848!1074045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51396 invoked from network); 6 Nov 2015 13:00:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Nov 2015 13:00:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdL-0000og-QM
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdK-0004DO-Ut
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:46 +0000
Date: Fri, 06 Nov 2015 13:00:46 +0000
Message-Id: <E1ZugdK-0004DO-Ut@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PoD: Make p2m_pod_empty_cache()
	restartable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 59a5061723ba47c0028cf48487e5de551c42a378
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 2 15:33:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:33:38 2015 +0100

    x86/PoD: Make p2m_pod_empty_cache() restartable
    
    This avoids a long running operation when destroying a domain with a
    large PoD cache.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |   16 +++++++++++-----
 xen/arch/x86/mm/paging.c  |    2 +-
 xen/include/asm-x86/p2m.h |    2 +-
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 2a6f125..be15cf3 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -374,11 +374,11 @@ out:
     return ret;
 }
 
-void
-p2m_pod_empty_cache(struct domain *d)
+int p2m_pod_empty_cache(struct domain *d)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     struct page_info *page;
+    unsigned int i;
 
     /* After this barrier no new PoD activities can happen. */
     BUG_ON(!d->is_dying);
@@ -388,8 +388,6 @@ p2m_pod_empty_cache(struct domain *d)
 
     while ( (page = page_list_remove_head(&p2m->pod.super)) )
     {
-        int i;
-            
         for ( i = 0 ; i < SUPERPAGE_PAGES ; i++ )
         {
             BUG_ON(page_get_owner(page + i) != d);
@@ -397,19 +395,27 @@ p2m_pod_empty_cache(struct domain *d)
         }
 
         p2m->pod.count -= SUPERPAGE_PAGES;
+
+        if ( hypercall_preempt_check() )
+            goto out;
     }
 
-    while ( (page = page_list_remove_head(&p2m->pod.single)) )
+    for ( i = 0; (page = page_list_remove_head(&p2m->pod.single)); ++i )
     {
         BUG_ON(page_get_owner(page) != d);
         page_list_add_tail(page, &d->page_list);
 
         p2m->pod.count -= 1;
+
+        if ( i && !(i & 511) && hypercall_preempt_check() )
+            goto out;
     }
 
     BUG_ON(p2m->pod.count != 0);
 
+ out:
     unlock_page_alloc(p2m);
+    return p2m->pod.count ? -ERESTART : 0;
 }
 
 int
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 0bfb2be..c7d1943 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -824,7 +824,7 @@ int paging_teardown(struct domain *d)
         return rc;
 
     /* Move populate-on-demand cache back to domain_list for destruction */
-    p2m_pod_empty_cache(d);
+    rc = p2m_pod_empty_cache(d);
 
     return rc;
 }
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index b710b2c..d748557 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -588,7 +588,7 @@ void p2m_pod_dump_data(struct domain *d);
 
 /* Move all pages from the populate-on-demand cache to the domain page_list
  * (usually in preparation for domain destruction) */
-void p2m_pod_empty_cache(struct domain *d);
+int p2m_pod_empty_cache(struct domain *d);
 
 /* Set populate-on-demand cache size so that the total memory allocated to a
  * domain matches target */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:01:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:01:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zugda-0003d8-EN; Fri, 06 Nov 2015 13:01: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 1ZugdY-0003cC-Ss
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:01 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	B1/8E-32615-C84AC365; Fri, 06 Nov 2015 13:01:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1446814858!1582186!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25369 invoked from network); 6 Nov 2015 13:00:59 -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;
	6 Nov 2015 13:00:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdW-0000os-QG
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdW-0004Du-0y
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:58 +0000
Date: Fri, 06 Nov 2015 13:00:58 +0000
Message-Id: <E1ZugdW-0004Du-0y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: return -ESRCH for an invalid
	foreign domid
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 990ea04ebedf543156dc2afa980061eb6645c390
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 2 15:34:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:34:01 2015 +0100

    x86/mm: return -ESRCH for an invalid foreign domid
    
    For consistency with all other invalid domid handling.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b65c3a5..92df36f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3544,7 +3544,7 @@ long do_mmu_update(
     {
         /* Pagetables belong to a foreign domain (PFD). */
         if ( (pt_owner = rcu_lock_domain_by_id(pt_dom - 1)) == NULL )
-            return -EINVAL;
+            return -ESRCH;
 
         if ( pt_owner == d )
             rcu_unlock_domain(pt_owner);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:01:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:01:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zugda-0003d8-EN; Fri, 06 Nov 2015 13:01: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 1ZugdY-0003cC-Ss
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:01 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	B1/8E-32615-C84AC365; Fri, 06 Nov 2015 13:01:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1446814858!1582186!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25369 invoked from network); 6 Nov 2015 13:00:59 -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;
	6 Nov 2015 13:00:59 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdW-0000os-QG
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugdW-0004Du-0y
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:00:58 +0000
Date: Fri, 06 Nov 2015 13:00:58 +0000
Message-Id: <E1ZugdW-0004Du-0y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm: return -ESRCH for an invalid
	foreign domid
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 990ea04ebedf543156dc2afa980061eb6645c390
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Nov 2 15:34:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 2 15:34:01 2015 +0100

    x86/mm: return -ESRCH for an invalid foreign domid
    
    For consistency with all other invalid domid handling.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b65c3a5..92df36f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3544,7 +3544,7 @@ long do_mmu_update(
     {
         /* Pagetables belong to a foreign domain (PFD). */
         if ( (pt_owner = rcu_lock_domain_by_id(pt_dom - 1)) == NULL )
-            return -EINVAL;
+            return -ESRCH;
 
         if ( pt_owner == d )
             rcu_unlock_domain(pt_owner);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:01:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:01:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zugdk-0003gJ-OJ; Fri, 06 Nov 2015 13:01: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 1Zugdj-0003fu-Ky
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:11 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	6A/03-13905-694AC365; Fri, 06 Nov 2015 13:01:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446814869!1584181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63333 invoked from network); 6 Nov 2015 13:01:10 -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;
	6 Nov 2015 13:01:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugdh-0000pY-Bu
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugdh-0004Ea-8s
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:09 +0000
Date: Fri, 06 Nov 2015 13:01:09 +0000
Message-Id: <E1Zugdh-0004Ea-8s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Die on unknown options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ce89a914e832160e28ef9c312f7ffc105d43967
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 23 16:44:11 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 16:30:57 2015 +0000

    xl: Die on unknown options
    
    def_getopt would print a message to stderr, but blunder on anyway.
    
    Sadly this is probably not a backport candidate.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 646b281..be40818 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3179,6 +3179,7 @@ static int def_getopt(int argc, char * const argv[],
             exit(0);
         }
         fprintf(stderr, "option `%c' not supported.\n", optopt);
+        exit(2);
     }
     if (opt == 'h') {
         help(helpstr);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:01:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:01:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zugdk-0003gJ-OJ; Fri, 06 Nov 2015 13:01: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 1Zugdj-0003fu-Ky
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:11 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	6A/03-13905-694AC365; Fri, 06 Nov 2015 13:01:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446814869!1584181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 63333 invoked from network); 6 Nov 2015 13:01:10 -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;
	6 Nov 2015 13:01:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugdh-0000pY-Bu
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugdh-0004Ea-8s
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:09 +0000
Date: Fri, 06 Nov 2015 13:01:09 +0000
Message-Id: <E1Zugdh-0004Ea-8s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Die on unknown options
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ce89a914e832160e28ef9c312f7ffc105d43967
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Fri Oct 23 16:44:11 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 16:30:57 2015 +0000

    xl: Die on unknown options
    
    def_getopt would print a message to stderr, but blunder on anyway.
    
    Sadly this is probably not a backport candidate.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 646b281..be40818 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3179,6 +3179,7 @@ static int def_getopt(int argc, char * const argv[],
             exit(0);
         }
         fprintf(stderr, "option `%c' not supported.\n", optopt);
+        exit(2);
     }
     if (opt == 'h') {
         help(helpstr);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:01:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:01: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 1Zugdv-0003kc-SG; Fri, 06 Nov 2015 13:01: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 1Zugdu-0003kC-2g
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:22 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	39/08-10715-1A4AC365; Fri, 06 Nov 2015 13:01:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1446814879!1076475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19103 invoked from network); 6 Nov 2015 13:01:20 -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;
	6 Nov 2015 13:01:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugdr-0000pj-LY
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugdr-0004FA-IP
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:19 +0000
Date: Fri, 06 Nov 2015 13:01:19 +0000
Message-Id: <E1Zugdr-0004FA-IP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: create XEN_DUMP_DIR with mode
	0700
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8931a72ea22ae754bef348f43905d94ebad58359
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 21 15:15:56 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 16:31:28 2015 +0000

    tools: create XEN_DUMP_DIR with mode 0700
    
    That directory is used to store guest memory dump which contains
    sensitive information.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 2618559..820ca40 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -58,7 +58,7 @@ build all: subdirs-all
 
 .PHONY: install
 install: subdirs-install
-	$(INSTALL_DIR) $(DESTDIR)$(XEN_DUMP_DIR)
+	$(INSTALL_DIR) -m 700 $(DESTDIR)$(XEN_DUMP_DIR)
 	$(INSTALL_DIR) $(DESTDIR)/var/log/xen
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:01:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:01: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 1Zugdv-0003kc-SG; Fri, 06 Nov 2015 13:01: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 1Zugdu-0003kC-2g
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:22 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	39/08-10715-1A4AC365; Fri, 06 Nov 2015 13:01:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1446814879!1076475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19103 invoked from network); 6 Nov 2015 13:01:20 -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;
	6 Nov 2015 13:01:20 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugdr-0000pj-LY
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugdr-0004FA-IP
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:19 +0000
Date: Fri, 06 Nov 2015 13:01:19 +0000
Message-Id: <E1Zugdr-0004FA-IP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: create XEN_DUMP_DIR with mode
	0700
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8931a72ea22ae754bef348f43905d94ebad58359
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Oct 21 15:15:56 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 16:31:28 2015 +0000

    tools: create XEN_DUMP_DIR with mode 0700
    
    That directory is used to store guest memory dump which contains
    sensitive information.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 2618559..820ca40 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -58,7 +58,7 @@ build all: subdirs-all
 
 .PHONY: install
 install: subdirs-install
-	$(INSTALL_DIR) $(DESTDIR)$(XEN_DUMP_DIR)
+	$(INSTALL_DIR) -m 700 $(DESTDIR)$(XEN_DUMP_DIR)
 	$(INSTALL_DIR) $(DESTDIR)/var/log/xen
 	$(INSTALL_DIR) $(DESTDIR)/var/lib/xen
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:01:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:01: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 1Zuge6-0003me-3i; Fri, 06 Nov 2015 13:01:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuge4-0003mH-2D
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:32 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	EF/54-06179-BA4AC365; Fri, 06 Nov 2015 13:01:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1446814890!1584831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47917 invoked from network); 6 Nov 2015 13:01:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Nov 2015 13:01:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuge1-0000pr-Uu
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuge1-0004GS-Sa
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:29 +0000
Date: Fri, 06 Nov 2015 13:01:29 +0000
Message-Id: <E1Zuge1-0004GS-Sa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: domain_build: Avoid to shadow
	the variable "mod" in write_properties
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb7886ea0f3e0635c1ae2a0d61de3330c9870ea6
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Oct 27 15:39:14 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 16:32:22 2015 +0000

    xen/arm: domain_build: Avoid to shadow the variable "mod" in write_properties
    
    The variable "mod" is defined twice with different value. This make the
    code confusing to read.
    
    Rename the 2 "mod" in something more meaningful.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    
    --
    
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 0c3441a..0f0f53e 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -407,10 +407,10 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
     int res = 0;
     int had_dom0_bootargs = 0;
 
-    const struct bootmodule *mod = kinfo->kernel_bootmodule;
+    const struct bootmodule *kernel = kinfo->kernel_bootmodule;
 
-    if ( mod && mod->cmdline[0] )
-        bootargs = &mod->cmdline[0];
+    if ( kernel && kernel->cmdline[0] )
+        bootargs = &kernel->cmdline[0];
 
     dt_for_each_property_node (node, prop)
     {
@@ -489,7 +489,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
 
     if ( dt_node_path_is_equal(node, "/chosen") )
     {
-        const struct bootmodule *mod = kinfo->initrd_bootmodule;
+        const struct bootmodule *initrd = kinfo->initrd_bootmodule;
 
         if ( bootargs )
         {
@@ -503,7 +503,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
          * If the bootloader provides an initrd, we must create a placeholder
          * for the initrd properties. The values will be replaced later.
          */
-        if ( mod && mod->size )
+        if ( initrd && initrd->size )
         {
             u64 a = 0;
             res = fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(a));
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:01:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:01: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 1Zuge6-0003me-3i; Fri, 06 Nov 2015 13:01:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuge4-0003mH-2D
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:32 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	EF/54-06179-BA4AC365; Fri, 06 Nov 2015 13:01:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1446814890!1584831!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47917 invoked from network); 6 Nov 2015 13:01:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Nov 2015 13:01:30 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuge1-0000pr-Uu
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuge1-0004GS-Sa
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:29 +0000
Date: Fri, 06 Nov 2015 13:01:29 +0000
Message-Id: <E1Zuge1-0004GS-Sa@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: domain_build: Avoid to shadow
	the variable "mod" in write_properties
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb7886ea0f3e0635c1ae2a0d61de3330c9870ea6
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Tue Oct 27 15:39:14 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 16:32:22 2015 +0000

    xen/arm: domain_build: Avoid to shadow the variable "mod" in write_properties
    
    The variable "mod" is defined twice with different value. This make the
    code confusing to read.
    
    Rename the 2 "mod" in something more meaningful.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    
    --
    
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 0c3441a..0f0f53e 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -407,10 +407,10 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
     int res = 0;
     int had_dom0_bootargs = 0;
 
-    const struct bootmodule *mod = kinfo->kernel_bootmodule;
+    const struct bootmodule *kernel = kinfo->kernel_bootmodule;
 
-    if ( mod && mod->cmdline[0] )
-        bootargs = &mod->cmdline[0];
+    if ( kernel && kernel->cmdline[0] )
+        bootargs = &kernel->cmdline[0];
 
     dt_for_each_property_node (node, prop)
     {
@@ -489,7 +489,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
 
     if ( dt_node_path_is_equal(node, "/chosen") )
     {
-        const struct bootmodule *mod = kinfo->initrd_bootmodule;
+        const struct bootmodule *initrd = kinfo->initrd_bootmodule;
 
         if ( bootargs )
         {
@@ -503,7 +503,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
          * If the bootloader provides an initrd, we must create a placeholder
          * for the initrd properties. The values will be replaced later.
          */
-        if ( mod && mod->size )
+        if ( initrd && initrd->size )
         {
             u64 a = 0;
             res = fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(a));
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:01:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13: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 1ZugeJ-0003pF-9F; Fri, 06 Nov 2015 13: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 1ZugeH-0003ov-Fy
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:45 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	98/F6-18107-8B4AC365; Fri, 06 Nov 2015 13:01:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446814900!1584400!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3877 invoked from network); 6 Nov 2015 13:01:41 -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;
	6 Nov 2015 13:01:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeC-0000pz-6g
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeC-0004HR-4k
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:40 +0000
Date: Fri, 06 Nov 2015 13:01:40 +0000
Message-Id: <E1ZugeC-0004HR-4k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: xendomains.service
	conflicts with libvirt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b38a310f9f21d95f98d3cce915787c34cb5f727c
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Oct 29 11:02:54 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 16:37:05 2015 +0000

    tools/hotplug: xendomains.service conflicts with libvirt
    
    xendomains will manage guests behind libvirts back:
    - libvirt starts a guest
    - that guest can be "managed" by libvirt and xl at the same time
    - when xendomains runs on shutdown it will save the guest using xl
      libvirt does not know about this
    - when xendomains runs on boot it will restore the saved guest using xl
      libvirt does not know about this, it will just fail to manage the
      restored guest
    
    To prevent xendomains from interfering with libvirt add a Conflicts= to
    xendomains.service. It will cause libvirt to be stopped if xendomains is
    started manually with 'systemctl start'.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/hotplug/Linux/systemd/xendomains.service.in |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index 66e2065..c7bfb61 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -5,6 +5,7 @@ After=proc-xen.mount xenstored.service xenconsoled.service xen-init-dom0.service
 After=network-online.target
 After=remote-fs.target
 ConditionPathExists=/proc/xen/capabilities
+Conflicts=libvirtd.service
 
 [Service]
 Type=oneshot
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:01:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13: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 1ZugeJ-0003pF-9F; Fri, 06 Nov 2015 13: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 1ZugeH-0003ov-Fy
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:45 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	98/F6-18107-8B4AC365; Fri, 06 Nov 2015 13:01:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446814900!1584400!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3877 invoked from network); 6 Nov 2015 13:01:41 -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;
	6 Nov 2015 13:01:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeC-0000pz-6g
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeC-0004HR-4k
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:40 +0000
Date: Fri, 06 Nov 2015 13:01:40 +0000
Message-Id: <E1ZugeC-0004HR-4k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: xendomains.service
	conflicts with libvirt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b38a310f9f21d95f98d3cce915787c34cb5f727c
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Oct 29 11:02:54 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 16:37:05 2015 +0000

    tools/hotplug: xendomains.service conflicts with libvirt
    
    xendomains will manage guests behind libvirts back:
    - libvirt starts a guest
    - that guest can be "managed" by libvirt and xl at the same time
    - when xendomains runs on shutdown it will save the guest using xl
      libvirt does not know about this
    - when xendomains runs on boot it will restore the saved guest using xl
      libvirt does not know about this, it will just fail to manage the
      restored guest
    
    To prevent xendomains from interfering with libvirt add a Conflicts= to
    xendomains.service. It will cause libvirt to be stopped if xendomains is
    started manually with 'systemctl start'.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/hotplug/Linux/systemd/xendomains.service.in |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index 66e2065..c7bfb61 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -5,6 +5,7 @@ After=proc-xen.mount xenstored.service xenconsoled.service xen-init-dom0.service
 After=network-online.target
 After=remote-fs.target
 ConditionPathExists=/proc/xen/capabilities
+Conflicts=libvirtd.service
 
 [Service]
 Type=oneshot
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:01:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:01:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZugeS-0003qn-2P; Fri, 06 Nov 2015 13:01:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeP-0003qU-1S
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:53 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	42/35-06179-0C4AC365; Fri, 06 Nov 2015 13:01:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1446814910!1584519!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58485 invoked from network); 6 Nov 2015 13:01:51 -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;
	6 Nov 2015 13:01:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeM-0000q3-IE
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeM-0004IK-EF
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:50 +0000
Date: Fri, 06 Nov 2015 13:01:50 +0000
Message-Id: <E1ZugeM-0004IK-EF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: adding myself as
	co-maintainer of vTPM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1dbe5d9ed6d698b0a24ada014d6747fb984dc13d
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Sun Oct 11 00:26:07 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 16:37:54 2015 +0000

    MAINTAINERS: adding myself as co-maintainer of vTPM
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index fbfd57a..759de1b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -346,6 +346,7 @@ F:	drivers/xen/usb*/
 
 VTPM
 M:	Daniel De Graaf <dgdegra@tycho.nsa.gov>
+M:	Quan Xu <quan.xu@intel.com>
 S:	Supported
 F:	extras/mini-os/tpm*
 F:	extras/mini-os/include/tpm*
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:01:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:01:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZugeS-0003qn-2P; Fri, 06 Nov 2015 13:01:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeP-0003qU-1S
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:53 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	42/35-06179-0C4AC365; Fri, 06 Nov 2015 13:01:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1446814910!1584519!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58485 invoked from network); 6 Nov 2015 13:01:51 -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;
	6 Nov 2015 13:01:51 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeM-0000q3-IE
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeM-0004IK-EF
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:01:50 +0000
Date: Fri, 06 Nov 2015 13:01:50 +0000
Message-Id: <E1ZugeM-0004IK-EF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: adding myself as
	co-maintainer of vTPM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1dbe5d9ed6d698b0a24ada014d6747fb984dc13d
Author:     Quan Xu <quan.xu@intel.com>
AuthorDate: Sun Oct 11 00:26:07 2015 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 16:37:54 2015 +0000

    MAINTAINERS: adding myself as co-maintainer of vTPM
    
    Signed-off-by: Quan Xu <quan.xu@intel.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index fbfd57a..759de1b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -346,6 +346,7 @@ F:	drivers/xen/usb*/
 
 VTPM
 M:	Daniel De Graaf <dgdegra@tycho.nsa.gov>
+M:	Quan Xu <quan.xu@intel.com>
 S:	Supported
 F:	extras/mini-os/tpm*
 F:	extras/mini-os/include/tpm*
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:02:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02: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 1Zugec-0003sQ-ML; Fri, 06 Nov 2015 13:02: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 1ZugeZ-0003s1-9u
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:03 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	01/61-16618-AC4AC365; Fri, 06 Nov 2015 13:02:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1446814921!1076227!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21245 invoked from network); 6 Nov 2015 13:02:01 -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;
	6 Nov 2015 13:02:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeW-0000qF-Sv
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeW-0004J7-Pc
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:00 +0000
Date: Fri, 06 Nov 2015 13:02:00 +0000
Message-Id: <E1ZugeW-0004J7-Pc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: convert main() exit codes to
	EXIT_[SUCCESS|FAILURE]
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 00e110e44a0eb268fb7705a3f333f10f01f33eca
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Oct 28 07:56:20 2015 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 17:03:03 2015 +0000

    xl: convert main() exit codes to EXIT_[SUCCESS|FAILURE]
    
    Turning main() function exit codes towards using the EXIT_[SUCCESS|FAILURE]
    constants, instead of instead of arbitrary numbers or libxl return codes.
    
    Also includes a document comment in xl.h stating xl process should always
    return EXIT_FOO and main_* can be treated as main() as if they are returning
    a process exit status and not a function return value)
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl.c |   12 ++++++------
 tools/libxl/xl.h |    7 +++++++
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 5316ad9..dfae84a 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -318,7 +318,7 @@ int main(int argc, char **argv)
             break;
         default:
             fprintf(stderr, "unknown global option\n");
-            exit(2);
+            exit(EXIT_FAILURE);
         }
     }
 
@@ -326,13 +326,13 @@ int main(int argc, char **argv)
 
     if (!cmd) {
         help(NULL);
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     opterr = 0;
 
     logger = xtl_createlogger_stdiostream(stderr, minmsglevel,
         (progress_use_cr ? XTL_STDIOSTREAM_PROGRESS_USE_CR : 0));
-    if (!logger) exit(1);
+    if (!logger) exit(EXIT_FAILURE);
 
     atexit(xl_ctx_free);
 
@@ -355,16 +355,16 @@ int main(int argc, char **argv)
     if (cspec) {
         if (dryrun_only && !cspec->can_dryrun) {
             fprintf(stderr, "command does not implement -N (dryrun) option\n");
-            ret = 1;
+            ret = EXIT_FAILURE;
             goto xit;
         }
         ret = cspec->cmd_impl(argc, argv);
     } else if (!strcmp(cmd, "help")) {
         help(argv[1]);
-        ret = 0;
+        ret = EXIT_SUCCESS;
     } else {
         fprintf(stderr, "command not implemented\n");
-        ret = 1;
+        ret = EXIT_FAILURE;
     }
 
  xit:
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 0021112..bdab125 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -30,6 +30,13 @@ struct cmd_spec {
     char *cmd_option;
 };
 
+/*
+ * The xl process should always return either EXIT_SUCCESS or
+ * EXIT_FAILURE. main_* functions, implementing the various xl
+ * commands, can be treated as main() as if they are returning
+ * a process exit status and not a function return value.
+ */
+
 int main_vcpulist(int argc, char **argv);
 int main_info(int argc, char **argv);
 int main_sharing(int argc, char **argv);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:02:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02: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 1Zugec-0003sQ-ML; Fri, 06 Nov 2015 13:02: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 1ZugeZ-0003s1-9u
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:03 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	01/61-16618-AC4AC365; Fri, 06 Nov 2015 13:02:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1446814921!1076227!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21245 invoked from network); 6 Nov 2015 13:02:01 -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;
	6 Nov 2015 13:02:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeW-0000qF-Sv
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugeW-0004J7-Pc
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:00 +0000
Date: Fri, 06 Nov 2015 13:02:00 +0000
Message-Id: <E1ZugeW-0004J7-Pc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: convert main() exit codes to
	EXIT_[SUCCESS|FAILURE]
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 00e110e44a0eb268fb7705a3f333f10f01f33eca
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Oct 28 07:56:20 2015 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 17:03:03 2015 +0000

    xl: convert main() exit codes to EXIT_[SUCCESS|FAILURE]
    
    Turning main() function exit codes towards using the EXIT_[SUCCESS|FAILURE]
    constants, instead of instead of arbitrary numbers or libxl return codes.
    
    Also includes a document comment in xl.h stating xl process should always
    return EXIT_FOO and main_* can be treated as main() as if they are returning
    a process exit status and not a function return value)
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl.c |   12 ++++++------
 tools/libxl/xl.h |    7 +++++++
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 5316ad9..dfae84a 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -318,7 +318,7 @@ int main(int argc, char **argv)
             break;
         default:
             fprintf(stderr, "unknown global option\n");
-            exit(2);
+            exit(EXIT_FAILURE);
         }
     }
 
@@ -326,13 +326,13 @@ int main(int argc, char **argv)
 
     if (!cmd) {
         help(NULL);
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     opterr = 0;
 
     logger = xtl_createlogger_stdiostream(stderr, minmsglevel,
         (progress_use_cr ? XTL_STDIOSTREAM_PROGRESS_USE_CR : 0));
-    if (!logger) exit(1);
+    if (!logger) exit(EXIT_FAILURE);
 
     atexit(xl_ctx_free);
 
@@ -355,16 +355,16 @@ int main(int argc, char **argv)
     if (cspec) {
         if (dryrun_only && !cspec->can_dryrun) {
             fprintf(stderr, "command does not implement -N (dryrun) option\n");
-            ret = 1;
+            ret = EXIT_FAILURE;
             goto xit;
         }
         ret = cspec->cmd_impl(argc, argv);
     } else if (!strcmp(cmd, "help")) {
         help(argv[1]);
-        ret = 0;
+        ret = EXIT_SUCCESS;
     } else {
         fprintf(stderr, "command not implemented\n");
-        ret = 1;
+        ret = EXIT_FAILURE;
     }
 
  xit:
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 0021112..bdab125 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -30,6 +30,13 @@ struct cmd_spec {
     char *cmd_option;
 };
 
+/*
+ * The xl process should always return either EXIT_SUCCESS or
+ * EXIT_FAILURE. main_* functions, implementing the various xl
+ * commands, can be treated as main() as if they are returning
+ * a process exit status and not a function return value.
+ */
+
 int main_vcpulist(int argc, char **argv);
 int main_info(int argc, char **argv);
 int main_sharing(int argc, char **argv);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:02:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02: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 1Zugem-0003uN-DJ; Fri, 06 Nov 2015 13:02:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugek-0003uA-An
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:14 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	2C/15-21201-5D4AC365; Fri, 06 Nov 2015 13:02:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1446814931!1062297!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53792 invoked from network); 6 Nov 2015 13:02:12 -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;
	6 Nov 2015 13:02:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugeh-0000qq-AS
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugeh-0004Jf-82
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:11 +0000
Date: Fri, 06 Nov 2015 13:02:11 +0000
Message-Id: <E1Zugeh-0004Jf-82@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: improve return and exit codes of
	scheduling related functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fbb7b8386ef827ef3d3329af986643cf36c727c
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Oct 28 07:56:21 2015 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 17:03:04 2015 +0000

    xl: improve return and exit codes of scheduling related functions
    
    Turning scheduling related functions exit codes towards using the
    EXIT_[SUCCESS|FAILURE] constants, instead of instead of arbitrary numbers
    or libxl return codes.
            - for main_*: arbitrary -> EXIT_SUCCESS|EXIT_FAILURE.
            - for internal fucntion: arbitrary -> 0/1.
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |  151 ++++++++++++++++++++++------------------------
 1 files changed, 73 insertions(+), 78 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index be40818..db2d44d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5794,18 +5794,15 @@ int main_sharing(int argc, char **argv)
 static int sched_domain_get(libxl_scheduler sched, int domid,
                             libxl_domain_sched_params *scinfo)
 {
-    int rc;
-
-    rc = libxl_domain_sched_params_get(ctx, domid, scinfo);
-    if (rc) {
+    if (libxl_domain_sched_params_get(ctx, domid, scinfo)) {
         fprintf(stderr, "libxl_domain_sched_params_get failed.\n");
-        return rc;
+        return 1;
     }
     if (scinfo->sched != sched) {
         fprintf(stderr, "libxl_domain_sched_params_get returned %s not %s.\n",
                 libxl_scheduler_to_string(scinfo->sched),
                 libxl_scheduler_to_string(sched));
-        return ERROR_INVAL;
+        return 1;
     }
 
     return 0;
@@ -5813,42 +5810,38 @@ static int sched_domain_get(libxl_scheduler sched, int domid,
 
 static int sched_domain_set(int domid, const libxl_domain_sched_params *scinfo)
 {
-    int rc;
-
-    rc = libxl_domain_sched_params_set(ctx, domid, scinfo);
-    if (rc)
+    if (libxl_domain_sched_params_set(ctx, domid, scinfo)) {
         fprintf(stderr, "libxl_domain_sched_params_set failed.\n");
+        return 1;
+    }
 
-    return rc;
+    return 0;
 }
 
 static int sched_credit_params_set(int poolid, libxl_sched_credit_params *scinfo)
 {
-    int rc;
-
-    rc = libxl_sched_credit_params_set(ctx, poolid, scinfo);
-    if (rc)
+    if (libxl_sched_credit_params_set(ctx, poolid, scinfo)) {
         fprintf(stderr, "libxl_sched_credit_params_set failed.\n");
+        return 1;
+    }
 
-    return rc;
+    return 0;
 }
 
 static int sched_credit_params_get(int poolid, libxl_sched_credit_params *scinfo)
 {
-    int rc;
-
-    rc = libxl_sched_credit_params_get(ctx, poolid, scinfo);
-    if (rc)
+    if (libxl_sched_credit_params_get(ctx, poolid, scinfo)) {
         fprintf(stderr, "libxl_sched_credit_params_get failed.\n");
+        return 1;
+    }
 
-    return rc;
+    return 0;
 }
 
 static int sched_credit_domain_output(int domid)
 {
     char *domname;
     libxl_domain_sched_params scinfo;
-    int rc;
 
     if (domid < 0) {
         printf("%-33s %4s %6s %4s\n", "Name", "ID", "Weight", "Cap");
@@ -5856,9 +5849,10 @@ static int sched_credit_domain_output(int domid)
     }
 
     libxl_domain_sched_params_init(&scinfo);
-    rc = sched_domain_get(LIBXL_SCHEDULER_CREDIT, domid, &scinfo);
-    if (rc)
-        return rc;
+    if (sched_domain_get(LIBXL_SCHEDULER_CREDIT, domid, &scinfo)) {
+        libxl_domain_sched_params_dispose(&scinfo);
+        return 1;
+    }
     domname = libxl_domid_to_name(ctx, domid);
     printf("%-33s %4d %6d %4d\n",
         domname,
@@ -5874,11 +5868,9 @@ static int sched_credit_pool_output(uint32_t poolid)
 {
     libxl_sched_credit_params scparam;
     char *poolname;
-    int rc;
 
     poolname = libxl_cpupoolid_to_name(ctx, poolid);
-    rc = sched_credit_params_get(poolid, &scparam);
-    if (rc) {
+    if (sched_credit_params_get(poolid, &scparam)) {
         printf("Cpupool %s: [sched params unavailable]\n",
                poolname);
     } else {
@@ -5896,7 +5888,6 @@ static int sched_credit2_domain_output(
 {
     char *domname;
     libxl_domain_sched_params scinfo;
-    int rc;
 
     if (domid < 0) {
         printf("%-33s %4s %6s\n", "Name", "ID", "Weight");
@@ -5904,9 +5895,10 @@ static int sched_credit2_domain_output(
     }
 
     libxl_domain_sched_params_init(&scinfo);
-    rc = sched_domain_get(LIBXL_SCHEDULER_CREDIT2, domid, &scinfo);
-    if (rc)
-        return rc;
+    if (sched_domain_get(LIBXL_SCHEDULER_CREDIT2, domid, &scinfo)) {
+        libxl_domain_sched_params_dispose(&scinfo);
+        return 1;
+    }
     domname = libxl_domid_to_name(ctx, domid);
     printf("%-33s %4d %6d\n",
         domname,
@@ -5922,7 +5914,6 @@ static int sched_rtds_domain_output(
 {
     char *domname;
     libxl_domain_sched_params scinfo;
-    int rc = 0;
 
     if (domid < 0) {
         printf("%-33s %4s %9s %9s\n", "Name", "ID", "Period", "Budget");
@@ -5930,9 +5921,10 @@ static int sched_rtds_domain_output(
     }
 
     libxl_domain_sched_params_init(&scinfo);
-    rc = sched_domain_get(LIBXL_SCHEDULER_RTDS, domid, &scinfo);
-    if (rc)
-        goto out;
+    if (sched_domain_get(LIBXL_SCHEDULER_RTDS, domid, &scinfo)) {
+        libxl_domain_sched_params_dispose(&scinfo);
+        return 1;
+    }
 
     domname = libxl_domid_to_name(ctx, domid);
     printf("%-33s %4d %9d %9d\n",
@@ -5941,10 +5933,8 @@ static int sched_rtds_domain_output(
         scinfo.period,
         scinfo.budget);
     free(domname);
-
-out:
     libxl_domain_sched_params_dispose(&scinfo);
-    return rc;
+    return 0;
 }
 
 static int sched_rtds_pool_output(uint32_t poolid)
@@ -5982,7 +5972,7 @@ static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
         if (libxl_cpupool_qualifier_to_cpupoolid(ctx, cpupool, &poolid, NULL) ||
             !libxl_cpupoolid_is_valid(ctx, poolid)) {
             fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
-            return -ERROR_FAIL;
+            return 1;
         }
     }
 
@@ -5995,7 +5985,7 @@ static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
     if (!poolinfo) {
         fprintf(stderr, "error getting cpupool info\n");
         libxl_dominfo_list_free(info, nb_domain);
-        return -ERROR_NOMEM;
+        return 1;
     }
 
     for (p = 0; !rc && (p < n_pools); p++) {
@@ -6081,16 +6071,16 @@ int main_sched_credit(int argc, char **argv)
     if ((cpupool || opt_s) && (dom || opt_w || opt_c)) {
         fprintf(stderr, "Specifying a cpupool or schedparam is not "
                 "allowed with domain options.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     if (!dom && (opt_w || opt_c)) {
         fprintf(stderr, "Must specify a domain.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     if (!opt_s && (opt_t || opt_r)) {
         fprintf(stderr, "Must specify schedparam to set schedule "
                 "parameter values.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (opt_s) {
@@ -6102,16 +6092,16 @@ int main_sched_credit(int argc, char **argv)
                                                      &poolid, NULL) ||
                 !libxl_cpupoolid_is_valid(ctx, poolid)) {
                 fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
-                return -ERROR_FAIL;
+                return EXIT_FAILURE;
             }
         }
 
         if (!opt_t && !opt_r) { /* Output scheduling parameters */
-            return -sched_credit_pool_output(poolid);
+            if (sched_credit_pool_output(poolid))
+                return EXIT_FAILURE;
         } else { /* Set scheduling parameters*/
-            rc = sched_credit_params_get(poolid, &scparam);
-            if (rc)
-                return -rc;
+            if (sched_credit_params_get(poolid, &scparam))
+                return EXIT_FAILURE;
 
             if (opt_t)
                 scparam.tslice_ms = tslice;
@@ -6119,21 +6109,22 @@ int main_sched_credit(int argc, char **argv)
             if (opt_r)
                 scparam.ratelimit_us = ratelimit;
 
-            rc = sched_credit_params_set(poolid, &scparam);
-            if (rc)
-                return -rc;
+            if (sched_credit_params_set(poolid, &scparam))
+                return EXIT_FAILURE;
         }
     } else if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT,
-                                    sched_credit_domain_output,
-                                    sched_credit_pool_output,
-                                    cpupool);
+        if (sched_domain_output(LIBXL_SCHEDULER_CREDIT,
+                                sched_credit_domain_output,
+                                sched_credit_pool_output,
+                                cpupool))
+            return EXIT_FAILURE;
     } else {
         uint32_t domid = find_domain(dom);
 
         if (!opt_w && !opt_c) { /* output credit scheduler info */
             sched_credit_domain_output(-1);
-            return -sched_credit_domain_output(domid);
+            if (sched_credit_domain_output(domid))
+                return EXIT_FAILURE;
         } else { /* set credit scheduler paramaters */
             libxl_domain_sched_params scinfo;
             libxl_domain_sched_params_init(&scinfo);
@@ -6145,11 +6136,11 @@ int main_sched_credit(int argc, char **argv)
             rc = sched_domain_set(domid, &scinfo);
             libxl_domain_sched_params_dispose(&scinfo);
             if (rc)
-                return -rc;
+                return EXIT_FAILURE;
         }
     }
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_sched_credit2(int argc, char **argv)
@@ -6181,24 +6172,26 @@ int main_sched_credit2(int argc, char **argv)
     if (cpupool && (dom || opt_w)) {
         fprintf(stderr, "Specifying a cpupool is not allowed with other "
                 "options.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     if (!dom && opt_w) {
         fprintf(stderr, "Must specify a domain.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT2,
-                                    sched_credit2_domain_output,
-                                    sched_default_pool_output,
-                                    cpupool);
+        if (sched_domain_output(LIBXL_SCHEDULER_CREDIT2,
+                                sched_credit2_domain_output,
+                                sched_default_pool_output,
+                                cpupool))
+            return EXIT_FAILURE;
     } else {
         uint32_t domid = find_domain(dom);
 
         if (!opt_w) { /* output credit2 scheduler info */
             sched_credit2_domain_output(-1);
-            return -sched_credit2_domain_output(domid);
+            if (sched_credit2_domain_output(domid))
+                return EXIT_FAILURE;
         } else { /* set credit2 scheduler paramaters */
             libxl_domain_sched_params scinfo;
             libxl_domain_sched_params_init(&scinfo);
@@ -6208,11 +6201,11 @@ int main_sched_credit2(int argc, char **argv)
             rc = sched_domain_set(domid, &scinfo);
             libxl_domain_sched_params_dispose(&scinfo);
             if (rc)
-                return -rc;
+                return EXIT_FAILURE;
         }
     }
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 /*
@@ -6257,27 +6250,29 @@ int main_sched_rtds(int argc, char **argv)
     if (cpupool && (dom || opt_p || opt_b)) {
         fprintf(stderr, "Specifying a cpupool is not allowed with "
                 "other options.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     if (!dom && (opt_p || opt_b)) {
         fprintf(stderr, "Must specify a domain.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     if (opt_p != opt_b) {
         fprintf(stderr, "Must specify period and budget\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (!dom) { /* list all domain's rt scheduler info */
-        return -sched_domain_output(LIBXL_SCHEDULER_RTDS,
-                                    sched_rtds_domain_output,
-                                    sched_rtds_pool_output,
-                                    cpupool);
+        if (sched_domain_output(LIBXL_SCHEDULER_RTDS,
+                                sched_rtds_domain_output,
+                                sched_rtds_pool_output,
+                                cpupool))
+            return EXIT_FAILURE;
     } else {
         uint32_t domid = find_domain(dom);
         if (!opt_p && !opt_b) { /* output rt scheduler info */
             sched_rtds_domain_output(-1);
-            return -sched_rtds_domain_output(domid);
+            if (sched_rtds_domain_output(domid))
+                return EXIT_FAILURE;
         } else { /* set rt scheduler paramaters */
             libxl_domain_sched_params scinfo;
             libxl_domain_sched_params_init(&scinfo);
@@ -6288,11 +6283,11 @@ int main_sched_rtds(int argc, char **argv)
             rc = sched_domain_set(domid, &scinfo);
             libxl_domain_sched_params_dispose(&scinfo);
             if (rc)
-                return -rc;
+                return EXIT_FAILURE;
         }
     }
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_domid(int argc, char **argv)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:02:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02: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 1Zugem-0003uN-DJ; Fri, 06 Nov 2015 13:02:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugek-0003uA-An
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:14 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	2C/15-21201-5D4AC365; Fri, 06 Nov 2015 13:02:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1446814931!1062297!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53792 invoked from network); 6 Nov 2015 13:02:12 -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;
	6 Nov 2015 13:02:12 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugeh-0000qq-AS
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugeh-0004Jf-82
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:11 +0000
Date: Fri, 06 Nov 2015 13:02:11 +0000
Message-Id: <E1Zugeh-0004Jf-82@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: improve return and exit codes of
	scheduling related functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9fbb7b8386ef827ef3d3329af986643cf36c727c
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Oct 28 07:56:21 2015 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 17:03:04 2015 +0000

    xl: improve return and exit codes of scheduling related functions
    
    Turning scheduling related functions exit codes towards using the
    EXIT_[SUCCESS|FAILURE] constants, instead of instead of arbitrary numbers
    or libxl return codes.
            - for main_*: arbitrary -> EXIT_SUCCESS|EXIT_FAILURE.
            - for internal fucntion: arbitrary -> 0/1.
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |  151 ++++++++++++++++++++++------------------------
 1 files changed, 73 insertions(+), 78 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index be40818..db2d44d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5794,18 +5794,15 @@ int main_sharing(int argc, char **argv)
 static int sched_domain_get(libxl_scheduler sched, int domid,
                             libxl_domain_sched_params *scinfo)
 {
-    int rc;
-
-    rc = libxl_domain_sched_params_get(ctx, domid, scinfo);
-    if (rc) {
+    if (libxl_domain_sched_params_get(ctx, domid, scinfo)) {
         fprintf(stderr, "libxl_domain_sched_params_get failed.\n");
-        return rc;
+        return 1;
     }
     if (scinfo->sched != sched) {
         fprintf(stderr, "libxl_domain_sched_params_get returned %s not %s.\n",
                 libxl_scheduler_to_string(scinfo->sched),
                 libxl_scheduler_to_string(sched));
-        return ERROR_INVAL;
+        return 1;
     }
 
     return 0;
@@ -5813,42 +5810,38 @@ static int sched_domain_get(libxl_scheduler sched, int domid,
 
 static int sched_domain_set(int domid, const libxl_domain_sched_params *scinfo)
 {
-    int rc;
-
-    rc = libxl_domain_sched_params_set(ctx, domid, scinfo);
-    if (rc)
+    if (libxl_domain_sched_params_set(ctx, domid, scinfo)) {
         fprintf(stderr, "libxl_domain_sched_params_set failed.\n");
+        return 1;
+    }
 
-    return rc;
+    return 0;
 }
 
 static int sched_credit_params_set(int poolid, libxl_sched_credit_params *scinfo)
 {
-    int rc;
-
-    rc = libxl_sched_credit_params_set(ctx, poolid, scinfo);
-    if (rc)
+    if (libxl_sched_credit_params_set(ctx, poolid, scinfo)) {
         fprintf(stderr, "libxl_sched_credit_params_set failed.\n");
+        return 1;
+    }
 
-    return rc;
+    return 0;
 }
 
 static int sched_credit_params_get(int poolid, libxl_sched_credit_params *scinfo)
 {
-    int rc;
-
-    rc = libxl_sched_credit_params_get(ctx, poolid, scinfo);
-    if (rc)
+    if (libxl_sched_credit_params_get(ctx, poolid, scinfo)) {
         fprintf(stderr, "libxl_sched_credit_params_get failed.\n");
+        return 1;
+    }
 
-    return rc;
+    return 0;
 }
 
 static int sched_credit_domain_output(int domid)
 {
     char *domname;
     libxl_domain_sched_params scinfo;
-    int rc;
 
     if (domid < 0) {
         printf("%-33s %4s %6s %4s\n", "Name", "ID", "Weight", "Cap");
@@ -5856,9 +5849,10 @@ static int sched_credit_domain_output(int domid)
     }
 
     libxl_domain_sched_params_init(&scinfo);
-    rc = sched_domain_get(LIBXL_SCHEDULER_CREDIT, domid, &scinfo);
-    if (rc)
-        return rc;
+    if (sched_domain_get(LIBXL_SCHEDULER_CREDIT, domid, &scinfo)) {
+        libxl_domain_sched_params_dispose(&scinfo);
+        return 1;
+    }
     domname = libxl_domid_to_name(ctx, domid);
     printf("%-33s %4d %6d %4d\n",
         domname,
@@ -5874,11 +5868,9 @@ static int sched_credit_pool_output(uint32_t poolid)
 {
     libxl_sched_credit_params scparam;
     char *poolname;
-    int rc;
 
     poolname = libxl_cpupoolid_to_name(ctx, poolid);
-    rc = sched_credit_params_get(poolid, &scparam);
-    if (rc) {
+    if (sched_credit_params_get(poolid, &scparam)) {
         printf("Cpupool %s: [sched params unavailable]\n",
                poolname);
     } else {
@@ -5896,7 +5888,6 @@ static int sched_credit2_domain_output(
 {
     char *domname;
     libxl_domain_sched_params scinfo;
-    int rc;
 
     if (domid < 0) {
         printf("%-33s %4s %6s\n", "Name", "ID", "Weight");
@@ -5904,9 +5895,10 @@ static int sched_credit2_domain_output(
     }
 
     libxl_domain_sched_params_init(&scinfo);
-    rc = sched_domain_get(LIBXL_SCHEDULER_CREDIT2, domid, &scinfo);
-    if (rc)
-        return rc;
+    if (sched_domain_get(LIBXL_SCHEDULER_CREDIT2, domid, &scinfo)) {
+        libxl_domain_sched_params_dispose(&scinfo);
+        return 1;
+    }
     domname = libxl_domid_to_name(ctx, domid);
     printf("%-33s %4d %6d\n",
         domname,
@@ -5922,7 +5914,6 @@ static int sched_rtds_domain_output(
 {
     char *domname;
     libxl_domain_sched_params scinfo;
-    int rc = 0;
 
     if (domid < 0) {
         printf("%-33s %4s %9s %9s\n", "Name", "ID", "Period", "Budget");
@@ -5930,9 +5921,10 @@ static int sched_rtds_domain_output(
     }
 
     libxl_domain_sched_params_init(&scinfo);
-    rc = sched_domain_get(LIBXL_SCHEDULER_RTDS, domid, &scinfo);
-    if (rc)
-        goto out;
+    if (sched_domain_get(LIBXL_SCHEDULER_RTDS, domid, &scinfo)) {
+        libxl_domain_sched_params_dispose(&scinfo);
+        return 1;
+    }
 
     domname = libxl_domid_to_name(ctx, domid);
     printf("%-33s %4d %9d %9d\n",
@@ -5941,10 +5933,8 @@ static int sched_rtds_domain_output(
         scinfo.period,
         scinfo.budget);
     free(domname);
-
-out:
     libxl_domain_sched_params_dispose(&scinfo);
-    return rc;
+    return 0;
 }
 
 static int sched_rtds_pool_output(uint32_t poolid)
@@ -5982,7 +5972,7 @@ static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
         if (libxl_cpupool_qualifier_to_cpupoolid(ctx, cpupool, &poolid, NULL) ||
             !libxl_cpupoolid_is_valid(ctx, poolid)) {
             fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
-            return -ERROR_FAIL;
+            return 1;
         }
     }
 
@@ -5995,7 +5985,7 @@ static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
     if (!poolinfo) {
         fprintf(stderr, "error getting cpupool info\n");
         libxl_dominfo_list_free(info, nb_domain);
-        return -ERROR_NOMEM;
+        return 1;
     }
 
     for (p = 0; !rc && (p < n_pools); p++) {
@@ -6081,16 +6071,16 @@ int main_sched_credit(int argc, char **argv)
     if ((cpupool || opt_s) && (dom || opt_w || opt_c)) {
         fprintf(stderr, "Specifying a cpupool or schedparam is not "
                 "allowed with domain options.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     if (!dom && (opt_w || opt_c)) {
         fprintf(stderr, "Must specify a domain.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     if (!opt_s && (opt_t || opt_r)) {
         fprintf(stderr, "Must specify schedparam to set schedule "
                 "parameter values.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (opt_s) {
@@ -6102,16 +6092,16 @@ int main_sched_credit(int argc, char **argv)
                                                      &poolid, NULL) ||
                 !libxl_cpupoolid_is_valid(ctx, poolid)) {
                 fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
-                return -ERROR_FAIL;
+                return EXIT_FAILURE;
             }
         }
 
         if (!opt_t && !opt_r) { /* Output scheduling parameters */
-            return -sched_credit_pool_output(poolid);
+            if (sched_credit_pool_output(poolid))
+                return EXIT_FAILURE;
         } else { /* Set scheduling parameters*/
-            rc = sched_credit_params_get(poolid, &scparam);
-            if (rc)
-                return -rc;
+            if (sched_credit_params_get(poolid, &scparam))
+                return EXIT_FAILURE;
 
             if (opt_t)
                 scparam.tslice_ms = tslice;
@@ -6119,21 +6109,22 @@ int main_sched_credit(int argc, char **argv)
             if (opt_r)
                 scparam.ratelimit_us = ratelimit;
 
-            rc = sched_credit_params_set(poolid, &scparam);
-            if (rc)
-                return -rc;
+            if (sched_credit_params_set(poolid, &scparam))
+                return EXIT_FAILURE;
         }
     } else if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT,
-                                    sched_credit_domain_output,
-                                    sched_credit_pool_output,
-                                    cpupool);
+        if (sched_domain_output(LIBXL_SCHEDULER_CREDIT,
+                                sched_credit_domain_output,
+                                sched_credit_pool_output,
+                                cpupool))
+            return EXIT_FAILURE;
     } else {
         uint32_t domid = find_domain(dom);
 
         if (!opt_w && !opt_c) { /* output credit scheduler info */
             sched_credit_domain_output(-1);
-            return -sched_credit_domain_output(domid);
+            if (sched_credit_domain_output(domid))
+                return EXIT_FAILURE;
         } else { /* set credit scheduler paramaters */
             libxl_domain_sched_params scinfo;
             libxl_domain_sched_params_init(&scinfo);
@@ -6145,11 +6136,11 @@ int main_sched_credit(int argc, char **argv)
             rc = sched_domain_set(domid, &scinfo);
             libxl_domain_sched_params_dispose(&scinfo);
             if (rc)
-                return -rc;
+                return EXIT_FAILURE;
         }
     }
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_sched_credit2(int argc, char **argv)
@@ -6181,24 +6172,26 @@ int main_sched_credit2(int argc, char **argv)
     if (cpupool && (dom || opt_w)) {
         fprintf(stderr, "Specifying a cpupool is not allowed with other "
                 "options.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     if (!dom && opt_w) {
         fprintf(stderr, "Must specify a domain.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT2,
-                                    sched_credit2_domain_output,
-                                    sched_default_pool_output,
-                                    cpupool);
+        if (sched_domain_output(LIBXL_SCHEDULER_CREDIT2,
+                                sched_credit2_domain_output,
+                                sched_default_pool_output,
+                                cpupool))
+            return EXIT_FAILURE;
     } else {
         uint32_t domid = find_domain(dom);
 
         if (!opt_w) { /* output credit2 scheduler info */
             sched_credit2_domain_output(-1);
-            return -sched_credit2_domain_output(domid);
+            if (sched_credit2_domain_output(domid))
+                return EXIT_FAILURE;
         } else { /* set credit2 scheduler paramaters */
             libxl_domain_sched_params scinfo;
             libxl_domain_sched_params_init(&scinfo);
@@ -6208,11 +6201,11 @@ int main_sched_credit2(int argc, char **argv)
             rc = sched_domain_set(domid, &scinfo);
             libxl_domain_sched_params_dispose(&scinfo);
             if (rc)
-                return -rc;
+                return EXIT_FAILURE;
         }
     }
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 /*
@@ -6257,27 +6250,29 @@ int main_sched_rtds(int argc, char **argv)
     if (cpupool && (dom || opt_p || opt_b)) {
         fprintf(stderr, "Specifying a cpupool is not allowed with "
                 "other options.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     if (!dom && (opt_p || opt_b)) {
         fprintf(stderr, "Must specify a domain.\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     if (opt_p != opt_b) {
         fprintf(stderr, "Must specify period and budget\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (!dom) { /* list all domain's rt scheduler info */
-        return -sched_domain_output(LIBXL_SCHEDULER_RTDS,
-                                    sched_rtds_domain_output,
-                                    sched_rtds_pool_output,
-                                    cpupool);
+        if (sched_domain_output(LIBXL_SCHEDULER_RTDS,
+                                sched_rtds_domain_output,
+                                sched_rtds_pool_output,
+                                cpupool))
+            return EXIT_FAILURE;
     } else {
         uint32_t domid = find_domain(dom);
         if (!opt_p && !opt_b) { /* output rt scheduler info */
             sched_rtds_domain_output(-1);
-            return -sched_rtds_domain_output(domid);
+            if (sched_rtds_domain_output(domid))
+                return EXIT_FAILURE;
         } else { /* set rt scheduler paramaters */
             libxl_domain_sched_params scinfo;
             libxl_domain_sched_params_init(&scinfo);
@@ -6288,11 +6283,11 @@ int main_sched_rtds(int argc, char **argv)
             rc = sched_domain_set(domid, &scinfo);
             libxl_domain_sched_params_dispose(&scinfo);
             if (rc)
-                return -rc;
+                return EXIT_FAILURE;
         }
     }
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_domid(int argc, char **argv)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:02:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02: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 1Zugex-0003wV-2f; Fri, 06 Nov 2015 13:02:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugeu-0003w4-9R
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:24 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	17/6F-25435-FD4AC365; Fri, 06 Nov 2015 13:02:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1446814941!1074678!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24277 invoked from network); 6 Nov 2015 13:02:22 -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;
	6 Nov 2015 13:02:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuger-0000qy-Lu
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuger-0004Kq-Iv
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:21 +0000
Date: Fri, 06 Nov 2015 13:02:21 +0000
Message-Id: <E1Zuger-0004Kq-Iv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: improve return and exit codes of
	vcpu related functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5b725e56d684ca6a437c9679d53314e9ce9f20d7
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Oct 28 07:56:22 2015 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 17:03:04 2015 +0000

    xl: improve return and exit codes of vcpu related functions
    
    Turning vcpu manipulation functions exit codes toward using the
    EXIT_[SUCCESS|FAILURE] constants, instead of instead of arbitrary numbers
    or libxl return codes.
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index db2d44d..943e45f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5317,7 +5317,7 @@ int main_vcpulist(int argc, char **argv)
     }
 
     vcpulist(argc - optind, argv + optind);
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_vcpupin(int argc, char **argv)
@@ -5333,7 +5333,7 @@ int main_vcpupin(int argc, char **argv)
     long vcpuid;
     const char *vcpu, *hard_str, *soft_str;
     char *endptr;
-    int opt, nb_cpu, nb_vcpu, rc = -1;
+    int opt, nb_cpu, nb_vcpu, rc = EXIT_FAILURE;
 
     libxl_bitmap_init(&cpumap_hard);
     libxl_bitmap_init(&cpumap_soft);
@@ -5408,10 +5408,10 @@ int main_vcpupin(int argc, char **argv)
 
         if (ferror(stdout) || fflush(stdout)) {
             perror("stdout");
-            exit(-1);
+            exit(EXIT_FAILURE);
         }
 
-        rc = 0;
+        rc = EXIT_SUCCESS;
         goto out;
     }
 
@@ -5431,7 +5431,7 @@ int main_vcpupin(int argc, char **argv)
         libxl_vcpuinfo_list_free(vcpuinfo, nb_vcpu);
     }
 
-    rc = 0;
+    rc = EXIT_SUCCESS;
  out:
     libxl_bitmap_dispose(&cpumap_soft);
     libxl_bitmap_dispose(&cpumap_hard);
@@ -5460,8 +5460,7 @@ static int vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
         unsigned int host_cpu = libxl_get_max_cpus(ctx);
         libxl_dominfo dominfo;
 
-        rc = libxl_domain_info(ctx, &dominfo, domid);
-        if (rc)
+        if (libxl_domain_info(ctx, &dominfo, domid))
             return 1;
 
         if (max_vcpus > dominfo.vcpu_online && max_vcpus > host_cpu) {
@@ -5474,8 +5473,7 @@ static int vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
         if (rc)
             return 1;
     }
-    rc = libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus);
-    if (rc) {
+    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus)) {
         fprintf(stderr, "libxl_cpu_bitmap_alloc failed, rc: %d\n", rc);
         return 1;
     }
@@ -5509,7 +5507,10 @@ int main_vcpuset(int argc, char **argv)
         break;
     }
 
-    return vcpuset(find_domain(argv[optind]), argv[optind + 1], check_host);
+    if (vcpuset(find_domain(argv[optind]), argv[optind + 1], check_host))
+        return EXIT_FAILURE;
+
+    return EXIT_SUCCESS;
 }
 
 static void output_xeninfo(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 Nov 06 13:02:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02: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 1Zugex-0003wV-2f; Fri, 06 Nov 2015 13:02:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugeu-0003w4-9R
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:24 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	17/6F-25435-FD4AC365; Fri, 06 Nov 2015 13:02:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1446814941!1074678!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24277 invoked from network); 6 Nov 2015 13:02:22 -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;
	6 Nov 2015 13:02:22 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuger-0000qy-Lu
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuger-0004Kq-Iv
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:21 +0000
Date: Fri, 06 Nov 2015 13:02:21 +0000
Message-Id: <E1Zuger-0004Kq-Iv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: improve return and exit codes of
	vcpu related functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5b725e56d684ca6a437c9679d53314e9ce9f20d7
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Oct 28 07:56:22 2015 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 17:03:04 2015 +0000

    xl: improve return and exit codes of vcpu related functions
    
    Turning vcpu manipulation functions exit codes toward using the
    EXIT_[SUCCESS|FAILURE] constants, instead of instead of arbitrary numbers
    or libxl return codes.
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index db2d44d..943e45f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5317,7 +5317,7 @@ int main_vcpulist(int argc, char **argv)
     }
 
     vcpulist(argc - optind, argv + optind);
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_vcpupin(int argc, char **argv)
@@ -5333,7 +5333,7 @@ int main_vcpupin(int argc, char **argv)
     long vcpuid;
     const char *vcpu, *hard_str, *soft_str;
     char *endptr;
-    int opt, nb_cpu, nb_vcpu, rc = -1;
+    int opt, nb_cpu, nb_vcpu, rc = EXIT_FAILURE;
 
     libxl_bitmap_init(&cpumap_hard);
     libxl_bitmap_init(&cpumap_soft);
@@ -5408,10 +5408,10 @@ int main_vcpupin(int argc, char **argv)
 
         if (ferror(stdout) || fflush(stdout)) {
             perror("stdout");
-            exit(-1);
+            exit(EXIT_FAILURE);
         }
 
-        rc = 0;
+        rc = EXIT_SUCCESS;
         goto out;
     }
 
@@ -5431,7 +5431,7 @@ int main_vcpupin(int argc, char **argv)
         libxl_vcpuinfo_list_free(vcpuinfo, nb_vcpu);
     }
 
-    rc = 0;
+    rc = EXIT_SUCCESS;
  out:
     libxl_bitmap_dispose(&cpumap_soft);
     libxl_bitmap_dispose(&cpumap_hard);
@@ -5460,8 +5460,7 @@ static int vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
         unsigned int host_cpu = libxl_get_max_cpus(ctx);
         libxl_dominfo dominfo;
 
-        rc = libxl_domain_info(ctx, &dominfo, domid);
-        if (rc)
+        if (libxl_domain_info(ctx, &dominfo, domid))
             return 1;
 
         if (max_vcpus > dominfo.vcpu_online && max_vcpus > host_cpu) {
@@ -5474,8 +5473,7 @@ static int vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
         if (rc)
             return 1;
     }
-    rc = libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus);
-    if (rc) {
+    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus)) {
         fprintf(stderr, "libxl_cpu_bitmap_alloc failed, rc: %d\n", rc);
         return 1;
     }
@@ -5509,7 +5507,10 @@ int main_vcpuset(int argc, char **argv)
         break;
     }
 
-    return vcpuset(find_domain(argv[optind]), argv[optind + 1], check_host);
+    if (vcpuset(find_domain(argv[optind]), argv[optind + 1], check_host))
+        return EXIT_FAILURE;
+
+    return EXIT_SUCCESS;
 }
 
 static void output_xeninfo(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 Nov 06 13:02:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02: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 1Zugf6-0003yM-Ac; Fri, 06 Nov 2015 13:02:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugf5-0003y1-0q
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:35 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	C7/A8-16965-AE4AC365; Fri, 06 Nov 2015 13:02:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1446814952!1062431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57452 invoked from network); 6 Nov 2015 13:02:33 -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;
	6 Nov 2015 13:02:33 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugf2-0000r6-0k
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugf1-0004LI-U1
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:31 +0000
Date: Fri, 06 Nov 2015 13:02:31 +0000
Message-Id: <E1Zugf1-0004LI-U1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: improve return and exit codes of
	parse related functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1365cdb6debc842be503d990c2c182056edcc57b
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Oct 28 07:56:23 2015 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 17:03:04 2015 +0000

    xl: improve return and exit codes of parse related functions
    
    Turning  cpupools related functions exit codes towards using the
    EXIT_[SUCCESS|FAILURE] constants, instead of instead of arbitrary numbers
    or libxl return codes.
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   52 +++++++++++++++++++++++-----------------------
 1 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 943e45f..d7ab04b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7315,7 +7315,7 @@ int main_cpupoolcreate(int argc, char **argv)
     libxl_bitmap cpumap;
     libxl_uuid uuid;
     libxl_cputopology *topology;
-    int rc = 1;
+    int rc = EXIT_FAILURE;
 
     SWITCH_FOREACH_OPT(opt, "nf:", opts, "cpupool-create", 0) {
     case 'f':
@@ -7485,7 +7485,7 @@ int main_cpupoolcreate(int argc, char **argv)
         }
     }
     /* We made it! */
-    rc = 0;
+    rc = EXIT_SUCCESS;
    
 out_cfg:
     xlu_cfg_destroy(config);
@@ -7522,14 +7522,14 @@ int main_cpupoollist(int argc, char **argv)
         pool = argv[optind];
         if (libxl_name_to_cpupoolid(ctx, pool, &poolid)) {
             fprintf(stderr, "Pool \'%s\' does not exist\n", pool);
-            return 1;
+            return EXIT_FAILURE;
         }
     }
 
     poolinfo = libxl_list_cpupool(ctx, &n_pools);
     if (!poolinfo) {
         fprintf(stderr, "error getting cpupool info\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     printf("%-19s", "Name");
@@ -7560,7 +7560,7 @@ int main_cpupoollist(int argc, char **argv)
 
     libxl_cpupoolinfo_list_free(poolinfo, n_pools);
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_cpupooldestroy(int argc, char **argv)
@@ -7578,13 +7578,13 @@ int main_cpupooldestroy(int argc, char **argv)
     if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool '%s'\n", pool);
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (libxl_cpupool_destroy(ctx, poolid))
-        return 1;
+        return EXIT_FAILURE;
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_cpupoolrename(int argc, char **argv)
@@ -7603,17 +7603,17 @@ int main_cpupoolrename(int argc, char **argv)
     if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool '%s'\n", pool);
-        return 1;
+        return EXIT_FAILURE;
     }
 
     new_name = argv[optind];
 
     if (libxl_cpupool_rename(ctx, new_name, poolid)) {
         fprintf(stderr, "Can't rename cpupool '%s'\n", pool);
-        return 1;
+        return EXIT_FAILURE;
     }
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_cpupoolcpuadd(int argc, char **argv)
@@ -7622,7 +7622,7 @@ int main_cpupoolcpuadd(int argc, char **argv)
     const char *pool;
     uint32_t poolid;
     libxl_bitmap cpumap;
-    int rc = 1;
+    int rc = EXIT_FAILURE;
 
     SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-cpu-add", 2) {
         /* No options */
@@ -7631,7 +7631,7 @@ int main_cpupoolcpuadd(int argc, char **argv)
     libxl_bitmap_init(&cpumap);
     if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
         fprintf(stderr, "Unable to allocate cpumap");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     pool = argv[optind++];
@@ -7647,7 +7647,7 @@ int main_cpupoolcpuadd(int argc, char **argv)
     if (libxl_cpupool_cpuadd_cpumap(ctx, poolid, &cpumap))
         fprintf(stderr, "some cpus may not have been added to %s\n", pool);
 
-    rc = 0;
+    rc = EXIT_SUCCESS;
 
 out:
     libxl_bitmap_dispose(&cpumap);
@@ -7660,12 +7660,12 @@ int main_cpupoolcpuremove(int argc, char **argv)
     const char *pool;
     uint32_t poolid;
     libxl_bitmap cpumap;
-    int rc = 1;
+    int rc = EXIT_FAILURE;
 
     libxl_bitmap_init(&cpumap);
     if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
         fprintf(stderr, "Unable to allocate cpumap");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-cpu-remove", 2) {
@@ -7685,7 +7685,7 @@ int main_cpupoolcpuremove(int argc, char **argv)
     if (libxl_cpupool_cpuremove_cpumap(ctx, poolid, &cpumap))
         fprintf(stderr, "some cpus may not have been removed from %s\n", pool);
 
-    rc = 0;
+    rc = EXIT_SUCCESS;
 
 out:
     libxl_bitmap_dispose(&cpumap);
@@ -7710,19 +7710,19 @@ int main_cpupoolmigrate(int argc, char **argv)
     if (libxl_domain_qualifier_to_domid(ctx, dom, &domid) ||
         !libxl_domid_to_name(ctx, domid)) {
         fprintf(stderr, "unknown domain '%s'\n", dom);
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool '%s'\n", pool);
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (libxl_cpupool_movedomain(ctx, poolid, domid))
-        return 1;
+        return EXIT_FAILURE;
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_cpupoolnumasplit(int argc, char **argv)
@@ -7750,13 +7750,13 @@ int main_cpupoolnumasplit(int argc, char **argv)
 
     libxl_dominfo_init(&info);
 
-    rc = 1;
+    rc = EXIT_FAILURE;
 
     libxl_bitmap_init(&cpumap);
     poolinfo = libxl_list_cpupool(ctx, &n_pools);
     if (!poolinfo) {
         fprintf(stderr, "error getting cpupool info\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     poolid = poolinfo[0].poolid;
     sched = poolinfo[0].sched;
@@ -7764,13 +7764,13 @@ int main_cpupoolnumasplit(int argc, char **argv)
 
     if (n_pools > 1) {
         fprintf(stderr, "splitting not possible, already cpupools in use\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     topology = libxl_get_cpu_topology(ctx, &n_cpus);
     if (topology == NULL) {
         fprintf(stderr, "libxl_get_topologyinfo failed\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
@@ -7859,7 +7859,7 @@ int main_cpupoolnumasplit(int argc, char **argv)
         }
     }
 
-    rc = 0;
+    rc = EXIT_SUCCESS;
 
 out:
     libxl_cputopology_list_free(topology, n_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 Fri Nov 06 13:02:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02: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 1Zugf6-0003yM-Ac; Fri, 06 Nov 2015 13:02:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugf5-0003y1-0q
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:35 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	C7/A8-16965-AE4AC365; Fri, 06 Nov 2015 13:02:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1446814952!1062431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57452 invoked from network); 6 Nov 2015 13:02:33 -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;
	6 Nov 2015 13:02:33 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugf2-0000r6-0k
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugf1-0004LI-U1
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:31 +0000
Date: Fri, 06 Nov 2015 13:02:31 +0000
Message-Id: <E1Zugf1-0004LI-U1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: improve return and exit codes of
	parse related functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1365cdb6debc842be503d990c2c182056edcc57b
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Oct 28 07:56:23 2015 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 17:03:04 2015 +0000

    xl: improve return and exit codes of parse related functions
    
    Turning  cpupools related functions exit codes towards using the
    EXIT_[SUCCESS|FAILURE] constants, instead of instead of arbitrary numbers
    or libxl return codes.
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   52 +++++++++++++++++++++++-----------------------
 1 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 943e45f..d7ab04b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7315,7 +7315,7 @@ int main_cpupoolcreate(int argc, char **argv)
     libxl_bitmap cpumap;
     libxl_uuid uuid;
     libxl_cputopology *topology;
-    int rc = 1;
+    int rc = EXIT_FAILURE;
 
     SWITCH_FOREACH_OPT(opt, "nf:", opts, "cpupool-create", 0) {
     case 'f':
@@ -7485,7 +7485,7 @@ int main_cpupoolcreate(int argc, char **argv)
         }
     }
     /* We made it! */
-    rc = 0;
+    rc = EXIT_SUCCESS;
    
 out_cfg:
     xlu_cfg_destroy(config);
@@ -7522,14 +7522,14 @@ int main_cpupoollist(int argc, char **argv)
         pool = argv[optind];
         if (libxl_name_to_cpupoolid(ctx, pool, &poolid)) {
             fprintf(stderr, "Pool \'%s\' does not exist\n", pool);
-            return 1;
+            return EXIT_FAILURE;
         }
     }
 
     poolinfo = libxl_list_cpupool(ctx, &n_pools);
     if (!poolinfo) {
         fprintf(stderr, "error getting cpupool info\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     printf("%-19s", "Name");
@@ -7560,7 +7560,7 @@ int main_cpupoollist(int argc, char **argv)
 
     libxl_cpupoolinfo_list_free(poolinfo, n_pools);
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_cpupooldestroy(int argc, char **argv)
@@ -7578,13 +7578,13 @@ int main_cpupooldestroy(int argc, char **argv)
     if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool '%s'\n", pool);
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (libxl_cpupool_destroy(ctx, poolid))
-        return 1;
+        return EXIT_FAILURE;
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_cpupoolrename(int argc, char **argv)
@@ -7603,17 +7603,17 @@ int main_cpupoolrename(int argc, char **argv)
     if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool '%s'\n", pool);
-        return 1;
+        return EXIT_FAILURE;
     }
 
     new_name = argv[optind];
 
     if (libxl_cpupool_rename(ctx, new_name, poolid)) {
         fprintf(stderr, "Can't rename cpupool '%s'\n", pool);
-        return 1;
+        return EXIT_FAILURE;
     }
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_cpupoolcpuadd(int argc, char **argv)
@@ -7622,7 +7622,7 @@ int main_cpupoolcpuadd(int argc, char **argv)
     const char *pool;
     uint32_t poolid;
     libxl_bitmap cpumap;
-    int rc = 1;
+    int rc = EXIT_FAILURE;
 
     SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-cpu-add", 2) {
         /* No options */
@@ -7631,7 +7631,7 @@ int main_cpupoolcpuadd(int argc, char **argv)
     libxl_bitmap_init(&cpumap);
     if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
         fprintf(stderr, "Unable to allocate cpumap");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     pool = argv[optind++];
@@ -7647,7 +7647,7 @@ int main_cpupoolcpuadd(int argc, char **argv)
     if (libxl_cpupool_cpuadd_cpumap(ctx, poolid, &cpumap))
         fprintf(stderr, "some cpus may not have been added to %s\n", pool);
 
-    rc = 0;
+    rc = EXIT_SUCCESS;
 
 out:
     libxl_bitmap_dispose(&cpumap);
@@ -7660,12 +7660,12 @@ int main_cpupoolcpuremove(int argc, char **argv)
     const char *pool;
     uint32_t poolid;
     libxl_bitmap cpumap;
-    int rc = 1;
+    int rc = EXIT_FAILURE;
 
     libxl_bitmap_init(&cpumap);
     if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
         fprintf(stderr, "Unable to allocate cpumap");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     SWITCH_FOREACH_OPT(opt, "", NULL, "cpupool-cpu-remove", 2) {
@@ -7685,7 +7685,7 @@ int main_cpupoolcpuremove(int argc, char **argv)
     if (libxl_cpupool_cpuremove_cpumap(ctx, poolid, &cpumap))
         fprintf(stderr, "some cpus may not have been removed from %s\n", pool);
 
-    rc = 0;
+    rc = EXIT_SUCCESS;
 
 out:
     libxl_bitmap_dispose(&cpumap);
@@ -7710,19 +7710,19 @@ int main_cpupoolmigrate(int argc, char **argv)
     if (libxl_domain_qualifier_to_domid(ctx, dom, &domid) ||
         !libxl_domid_to_name(ctx, domid)) {
         fprintf(stderr, "unknown domain '%s'\n", dom);
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool '%s'\n", pool);
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (libxl_cpupool_movedomain(ctx, poolid, domid))
-        return 1;
+        return EXIT_FAILURE;
 
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 int main_cpupoolnumasplit(int argc, char **argv)
@@ -7750,13 +7750,13 @@ int main_cpupoolnumasplit(int argc, char **argv)
 
     libxl_dominfo_init(&info);
 
-    rc = 1;
+    rc = EXIT_FAILURE;
 
     libxl_bitmap_init(&cpumap);
     poolinfo = libxl_list_cpupool(ctx, &n_pools);
     if (!poolinfo) {
         fprintf(stderr, "error getting cpupool info\n");
-        return 1;
+        return EXIT_FAILURE;
     }
     poolid = poolinfo[0].poolid;
     sched = poolinfo[0].sched;
@@ -7764,13 +7764,13 @@ int main_cpupoolnumasplit(int argc, char **argv)
 
     if (n_pools > 1) {
         fprintf(stderr, "splitting not possible, already cpupools in use\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     topology = libxl_get_cpu_topology(ctx, &n_cpus);
     if (topology == NULL) {
         fprintf(stderr, "libxl_get_topologyinfo failed\n");
-        return 1;
+        return EXIT_FAILURE;
     }
 
     if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
@@ -7859,7 +7859,7 @@ int main_cpupoolnumasplit(int argc, char **argv)
         }
     }
 
-    rc = 0;
+    rc = EXIT_SUCCESS;
 
 out:
     libxl_cputopology_list_free(topology, n_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 Fri Nov 06 13:02:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZugfG-00040J-Gm; Fri, 06 Nov 2015 13:02:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfF-0003zz-1Q
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:45 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	46/FE-14900-4F4AC365; Fri, 06 Nov 2015 13:02:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1446814962!1673388!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7858 invoked from network); 6 Nov 2015 13:02:43 -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;
	6 Nov 2015 13:02:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfC-0000rE-Am
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfC-0004Lk-75
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:42 +0000
Date: Fri, 06 Nov 2015 13:02:42 +0000
Message-Id: <E1ZugfC-0004Lk-75@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: improve return and exit codes of
	parse related functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d05834df2612b8dfce93a0afd7425971c30143b
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Oct 28 07:56:24 2015 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 17:03:04 2015 +0000

    xl: improve return and exit codes of parse related functions
    
    Turning  parsing related functions exit codes towards using the
    EXIT_[SUCCESS|FAILURE] constants, instead of instead of arbitrary numbers
    or libxl return codes.
            - for main_*: arbitrary -> EXIT_SUCCESS|EXIT_FAILURE.
            - for internal fucntion: arbitrary -> 0/1.
    
    Don't touch parse_config_data() which is big enough to deserve its own patch.
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index d7ab04b..2756d2f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -578,10 +578,10 @@ static void parse_disk_config_multistring(XLU_Config **config,
     }
 
     e = xlu_disk_parse(*config, nspecs, specs, disk);
-    if (e == EINVAL) exit(-1);
+    if (e == EINVAL) exit(EXIT_FAILURE);
     if (e) {
         fprintf(stderr,"xlu_disk_parse failed: %s\n",strerror(errno));
-        exit(-1);
+        exit(EXIT_FAILURE);
     }
 }
 
@@ -597,10 +597,10 @@ static void parse_vif_rate(XLU_Config **config, const char *rate,
     int e;
 
     e = xlu_vif_parse_rate(*config, rate, nic);
-    if (e == EINVAL || e == EOVERFLOW) exit(-1);
+    if (e == EINVAL || e == EOVERFLOW) exit(EXIT_FAILURE);
     if (e) {
         fprintf(stderr,"xlu_vif_parse_rate failed: %s\n",strerror(errno));
-        exit(-1);
+        exit(EXIT_FAILURE);
     }
 }
 
@@ -741,19 +741,19 @@ static int parse_range(const char *str, unsigned long *a, unsigned long *b)
 
     *a = *b = strtoul(str, &endptr, 10);
     if (endptr == str || *a == ULONG_MAX)
-        return ERROR_INVAL;
+        return 1;
 
     if (*endptr == '-') {
         nstr = endptr + 1;
 
         *b = strtoul(nstr, &endptr, 10);
         if (endptr == nstr || *b == ULONG_MAX || *b < *a)
-            return ERROR_INVAL;
+            return 1;
     }
 
     /* Valid value or range so far, but we also don't want junk after that */
     if (*endptr != '\0')
-        return ERROR_INVAL;
+        return 1;
 
     return 0;
 }
@@ -902,7 +902,7 @@ static char *parse_cmdline(XLU_Config *config)
 
     if ((buf || root || extra) && !cmdline) {
         fprintf(stderr, "Failed to allocate memory for cmdline\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     return cmdline;
@@ -946,11 +946,11 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info,
             libxl_bitmap_init(&vcpu_affinity_array[j]);
             if (libxl_cpu_bitmap_alloc(ctx, &vcpu_affinity_array[j], 0)) {
                 fprintf(stderr, "Unable to allocate cpumap for vcpu %d\n", j);
-                exit(1);
+                exit(EXIT_FAILURE);
             }
 
             if (cpurange_parse(buf, &vcpu_affinity_array[j]))
-                exit(1);
+                exit(EXIT_FAILURE);
 
             j++;
         }
@@ -963,17 +963,17 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info,
         libxl_bitmap_init(&vcpu_affinity_array[0]);
         if (libxl_cpu_bitmap_alloc(ctx, &vcpu_affinity_array[0], 0)) {
             fprintf(stderr, "Unable to allocate cpumap for vcpu 0\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
 
         if (cpurange_parse(buf, &vcpu_affinity_array[0]))
-            exit(1);
+            exit(EXIT_FAILURE);
 
         for (i = 1; i < b_info->max_vcpus; i++) {
             libxl_bitmap_init(&vcpu_affinity_array[i]);
             if (libxl_cpu_bitmap_alloc(ctx, &vcpu_affinity_array[i], 0)) {
                 fprintf(stderr, "Unable to allocate cpumap for vcpu %d\n", i);
-                exit(1);
+                exit(EXIT_FAILURE);
             }
             libxl_bitmap_copy(ctx, &vcpu_affinity_array[i],
                               &vcpu_affinity_array[0]);
@@ -1064,7 +1064,7 @@ static unsigned long parse_ulong(const char *str)
     val = strtoul(str, &endptr, 10);
     if (endptr == str || val == ULONG_MAX) {
         fprintf(stderr, "xl: failed to convert \"%s\" to number\n", str);
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     return val;
 }
@@ -1086,7 +1086,7 @@ static void parse_vnuma_config(const XLU_Config *config,
     if (libxl_get_physinfo(ctx, &physinfo) != 0) {
         libxl_physinfo_dispose(&physinfo);
         fprintf(stderr, "libxl_get_physinfo failed\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     nr_nodes = physinfo.nr_nodes;
@@ -1105,7 +1105,7 @@ static void parse_vnuma_config(const XLU_Config *config,
         libxl_bitmap_init(&vcpu_parsed[i]);
         if (libxl_cpu_bitmap_alloc(ctx, &vcpu_parsed[i], b_info->max_vcpus)) {
             fprintf(stderr, "libxl_node_bitmap_alloc failed.\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
     }
 
@@ -1130,7 +1130,7 @@ static void parse_vnuma_config(const XLU_Config *config,
         xlu_cfg_value_get_list(config, vnode_spec, &vnode_config_list, 0);
         if (!vnode_config_list) {
             fprintf(stderr, "xl: cannot get vnode config option list\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
 
         for (conf_count = 0;
@@ -1152,7 +1152,7 @@ static void parse_vnuma_config(const XLU_Config *config,
                                            &value_untrimmed)) {
                     fprintf(stderr, "xl: failed to split \"%s\" into pair\n",
                             buf);
-                    exit(1);
+                    exit(EXIT_FAILURE);
                 }
                 trim(isspace, option_untrimmed, &option);
                 trim(isspace, value_untrimmed, &value);
@@ -1162,7 +1162,7 @@ static void parse_vnuma_config(const XLU_Config *config,
                     if (val >= nr_nodes) {
                         fprintf(stderr,
                                 "xl: invalid pnode number: %lu\n", val);
-                        exit(1);
+                        exit(EXIT_FAILURE);
                     }
                     p->pnode = val;
                     libxl_defbool_set(&b_info->numa_placement, false);
@@ -1218,20 +1218,20 @@ static void parse_vnuma_config(const XLU_Config *config,
     if (b_info->max_vcpus != 0) {
         if (b_info->max_vcpus != max_vcpus) {
             fprintf(stderr, "xl: vnuma vcpus and maxvcpus= mismatch\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
     } else {
         int host_cpus = libxl_get_online_cpus(ctx);
 
         if (host_cpus < 0) {
             fprintf(stderr, "Failed to get online cpus\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
 
         if (host_cpus < max_vcpus) {
             fprintf(stderr, "xl: vnuma specifies more vcpus than pcpus, "\
                     "use maxvcpus= to override this check.\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
 
         b_info->max_vcpus = max_vcpus;
@@ -1241,7 +1241,7 @@ static void parse_vnuma_config(const XLU_Config *config,
     if (b_info->max_memkb != LIBXL_MEMKB_DEFAULT &&
         b_info->max_memkb != max_memkb) {
         fprintf(stderr, "xl: maxmem and vnuma memory size mismatch\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     } else
         b_info->max_memkb = max_memkb;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:02:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZugfG-00040J-Gm; Fri, 06 Nov 2015 13:02:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfF-0003zz-1Q
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:45 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	46/FE-14900-4F4AC365; Fri, 06 Nov 2015 13:02:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1446814962!1673388!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7858 invoked from network); 6 Nov 2015 13:02:43 -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;
	6 Nov 2015 13:02:43 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfC-0000rE-Am
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfC-0004Lk-75
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:42 +0000
Date: Fri, 06 Nov 2015 13:02:42 +0000
Message-Id: <E1ZugfC-0004Lk-75@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: improve return and exit codes of
	parse related functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d05834df2612b8dfce93a0afd7425971c30143b
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Oct 28 07:56:24 2015 +0530
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 3 17:03:04 2015 +0000

    xl: improve return and exit codes of parse related functions
    
    Turning  parsing related functions exit codes towards using the
    EXIT_[SUCCESS|FAILURE] constants, instead of instead of arbitrary numbers
    or libxl return codes.
            - for main_*: arbitrary -> EXIT_SUCCESS|EXIT_FAILURE.
            - for internal fucntion: arbitrary -> 0/1.
    
    Don't touch parse_config_data() which is big enough to deserve its own patch.
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index d7ab04b..2756d2f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -578,10 +578,10 @@ static void parse_disk_config_multistring(XLU_Config **config,
     }
 
     e = xlu_disk_parse(*config, nspecs, specs, disk);
-    if (e == EINVAL) exit(-1);
+    if (e == EINVAL) exit(EXIT_FAILURE);
     if (e) {
         fprintf(stderr,"xlu_disk_parse failed: %s\n",strerror(errno));
-        exit(-1);
+        exit(EXIT_FAILURE);
     }
 }
 
@@ -597,10 +597,10 @@ static void parse_vif_rate(XLU_Config **config, const char *rate,
     int e;
 
     e = xlu_vif_parse_rate(*config, rate, nic);
-    if (e == EINVAL || e == EOVERFLOW) exit(-1);
+    if (e == EINVAL || e == EOVERFLOW) exit(EXIT_FAILURE);
     if (e) {
         fprintf(stderr,"xlu_vif_parse_rate failed: %s\n",strerror(errno));
-        exit(-1);
+        exit(EXIT_FAILURE);
     }
 }
 
@@ -741,19 +741,19 @@ static int parse_range(const char *str, unsigned long *a, unsigned long *b)
 
     *a = *b = strtoul(str, &endptr, 10);
     if (endptr == str || *a == ULONG_MAX)
-        return ERROR_INVAL;
+        return 1;
 
     if (*endptr == '-') {
         nstr = endptr + 1;
 
         *b = strtoul(nstr, &endptr, 10);
         if (endptr == nstr || *b == ULONG_MAX || *b < *a)
-            return ERROR_INVAL;
+            return 1;
     }
 
     /* Valid value or range so far, but we also don't want junk after that */
     if (*endptr != '\0')
-        return ERROR_INVAL;
+        return 1;
 
     return 0;
 }
@@ -902,7 +902,7 @@ static char *parse_cmdline(XLU_Config *config)
 
     if ((buf || root || extra) && !cmdline) {
         fprintf(stderr, "Failed to allocate memory for cmdline\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     return cmdline;
@@ -946,11 +946,11 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info,
             libxl_bitmap_init(&vcpu_affinity_array[j]);
             if (libxl_cpu_bitmap_alloc(ctx, &vcpu_affinity_array[j], 0)) {
                 fprintf(stderr, "Unable to allocate cpumap for vcpu %d\n", j);
-                exit(1);
+                exit(EXIT_FAILURE);
             }
 
             if (cpurange_parse(buf, &vcpu_affinity_array[j]))
-                exit(1);
+                exit(EXIT_FAILURE);
 
             j++;
         }
@@ -963,17 +963,17 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info,
         libxl_bitmap_init(&vcpu_affinity_array[0]);
         if (libxl_cpu_bitmap_alloc(ctx, &vcpu_affinity_array[0], 0)) {
             fprintf(stderr, "Unable to allocate cpumap for vcpu 0\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
 
         if (cpurange_parse(buf, &vcpu_affinity_array[0]))
-            exit(1);
+            exit(EXIT_FAILURE);
 
         for (i = 1; i < b_info->max_vcpus; i++) {
             libxl_bitmap_init(&vcpu_affinity_array[i]);
             if (libxl_cpu_bitmap_alloc(ctx, &vcpu_affinity_array[i], 0)) {
                 fprintf(stderr, "Unable to allocate cpumap for vcpu %d\n", i);
-                exit(1);
+                exit(EXIT_FAILURE);
             }
             libxl_bitmap_copy(ctx, &vcpu_affinity_array[i],
                               &vcpu_affinity_array[0]);
@@ -1064,7 +1064,7 @@ static unsigned long parse_ulong(const char *str)
     val = strtoul(str, &endptr, 10);
     if (endptr == str || val == ULONG_MAX) {
         fprintf(stderr, "xl: failed to convert \"%s\" to number\n", str);
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     return val;
 }
@@ -1086,7 +1086,7 @@ static void parse_vnuma_config(const XLU_Config *config,
     if (libxl_get_physinfo(ctx, &physinfo) != 0) {
         libxl_physinfo_dispose(&physinfo);
         fprintf(stderr, "libxl_get_physinfo failed\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     nr_nodes = physinfo.nr_nodes;
@@ -1105,7 +1105,7 @@ static void parse_vnuma_config(const XLU_Config *config,
         libxl_bitmap_init(&vcpu_parsed[i]);
         if (libxl_cpu_bitmap_alloc(ctx, &vcpu_parsed[i], b_info->max_vcpus)) {
             fprintf(stderr, "libxl_node_bitmap_alloc failed.\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
     }
 
@@ -1130,7 +1130,7 @@ static void parse_vnuma_config(const XLU_Config *config,
         xlu_cfg_value_get_list(config, vnode_spec, &vnode_config_list, 0);
         if (!vnode_config_list) {
             fprintf(stderr, "xl: cannot get vnode config option list\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
 
         for (conf_count = 0;
@@ -1152,7 +1152,7 @@ static void parse_vnuma_config(const XLU_Config *config,
                                            &value_untrimmed)) {
                     fprintf(stderr, "xl: failed to split \"%s\" into pair\n",
                             buf);
-                    exit(1);
+                    exit(EXIT_FAILURE);
                 }
                 trim(isspace, option_untrimmed, &option);
                 trim(isspace, value_untrimmed, &value);
@@ -1162,7 +1162,7 @@ static void parse_vnuma_config(const XLU_Config *config,
                     if (val >= nr_nodes) {
                         fprintf(stderr,
                                 "xl: invalid pnode number: %lu\n", val);
-                        exit(1);
+                        exit(EXIT_FAILURE);
                     }
                     p->pnode = val;
                     libxl_defbool_set(&b_info->numa_placement, false);
@@ -1218,20 +1218,20 @@ static void parse_vnuma_config(const XLU_Config *config,
     if (b_info->max_vcpus != 0) {
         if (b_info->max_vcpus != max_vcpus) {
             fprintf(stderr, "xl: vnuma vcpus and maxvcpus= mismatch\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
     } else {
         int host_cpus = libxl_get_online_cpus(ctx);
 
         if (host_cpus < 0) {
             fprintf(stderr, "Failed to get online cpus\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
 
         if (host_cpus < max_vcpus) {
             fprintf(stderr, "xl: vnuma specifies more vcpus than pcpus, "\
                     "use maxvcpus= to override this check.\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
 
         b_info->max_vcpus = max_vcpus;
@@ -1241,7 +1241,7 @@ static void parse_vnuma_config(const XLU_Config *config,
     if (b_info->max_memkb != LIBXL_MEMKB_DEFAULT &&
         b_info->max_memkb != max_memkb) {
         fprintf(stderr, "xl: maxmem and vnuma memory size mismatch\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     } else
         b_info->max_memkb = max_memkb;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:02:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02: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 1ZugfT-00042O-5r; Fri, 06 Nov 2015 13:02: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 1ZugfQ-00042A-S3
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:57 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	49/F8-29649-FF4AC365; Fri, 06 Nov 2015 13:02:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1446814974!1062556!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60326 invoked from network); 6 Nov 2015 13:02:55 -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;
	6 Nov 2015 13:02:55 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfN-0000rM-Q1
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfN-0004NP-Dv
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:53 +0000
Date: Fri, 06 Nov 2015 13:02:53 +0000
Message-Id: <E1ZugfN-0004NP-Dv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] symbols: prefix static symbols with
	their source file names
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d37d63d4b548b5fc214c71b2987a86ac0bbf4965
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 18:05:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:05:35 2015 +0100

    symbols: prefix static symbols with their source file names
    
    This requires adjustments to the tool generating the symbol table and
    its as well as nm's invocation.
    
    Note: Not warning about duplicate symbols in the EFI case for now, as
    a binutils bug causes misnamed file name entries to appear in EFI
    binaries' symbol tables when the file name is longer than 18 chars.
    (Not doing so also avoids other duplicates getting printed twice.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile |    6 ++-
 xen/arch/x86/Makefile |   12 +++--
 xen/tools/symbols.c   |  129 ++++++++++++++++++++++++++++++++++++++++++++-----
 3 files changed, 128 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 1ef39f7..e47dd4c 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -80,11 +80,13 @@ $(BASEDIR)/common/symbols-dummy.o:
 $(TARGET)-syms: prelink.o xen.lds $(BASEDIR)/common/symbols-dummy.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
-	$(NM) -n $(@D)/.$(@F).0 | $(BASEDIR)/tools/symbols >$(@D)/.$(@F).0.S
+	$(NM) -pa --format=sysv $(@D)/.$(@F).0 \
+		| $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).0.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1
-	$(NM) -n $(@D)/.$(@F).1 | $(BASEDIR)/tools/symbols >$(@D)/.$(@F).1.S
+	$(NM) -pa --format=sysv $(@D)/.$(@F).1 \
+		| $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).1.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(@D)/.$(@F).1.o -o $@
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 39a8059..8c1a890 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -106,11 +106,13 @@ $(BASEDIR)/common/symbols-dummy.o:
 $(TARGET)-syms: prelink.o xen.lds $(BASEDIR)/common/symbols-dummy.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
-	$(NM) -n $(@D)/.$(@F).0 | $(BASEDIR)/tools/symbols >$(@D)/.$(@F).0.S
+	$(NM) -pa --format=sysv $(@D)/.$(@F).0 \
+		| $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).0.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1
-	$(NM) -n $(@D)/.$(@F).1 | $(BASEDIR)/tools/symbols >$(@D)/.$(@F).1.S
+	$(NM) -pa --format=sysv $(@D)/.$(@F).1 \
+		| $(BASEDIR)/tools/symbols --sysv --sort --warn-dup >$(@D)/.$(@F).1.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(@D)/.$(@F).1.o -o $@
@@ -133,13 +135,15 @@ $(TARGET).efi: prelink-efi.o efi.lds efi/relocs-dummy.o $(BASEDIR)/common/symbol
 	          $(guard) $(LD) $(call EFI_LDFLAGS,$(base)) -T efi.lds -N $< efi/relocs-dummy.o \
 	                $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).$(base).0 &&) :
 	$(guard) efi/mkreloc $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(@D)/.$(@F).$(base).0) >$(@D)/.$(@F).0r.S
-	$(guard) $(NM) -n $(@D)/.$(@F).$(VIRT_BASE).0 | $(guard) $(BASEDIR)/tools/symbols >$(@D)/.$(@F).0s.S
+	$(guard) $(NM) -pa --format=sysv $(@D)/.$(@F).$(VIRT_BASE).0 \
+		| $(guard) $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).0s.S
 	$(guard) $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0r.o $(@D)/.$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
 	          $(guard) $(LD) $(call EFI_LDFLAGS,$(base)) -T efi.lds -N $< \
 	                $(@D)/.$(@F).0r.o $(@D)/.$(@F).0s.o -o $(@D)/.$(@F).$(base).1 &&) :
 	$(guard) efi/mkreloc $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(@D)/.$(@F).$(base).1) >$(@D)/.$(@F).1r.S
-	$(guard) $(NM) -n $(@D)/.$(@F).$(VIRT_BASE).1 | $(guard) $(BASEDIR)/tools/symbols >$(@D)/.$(@F).1s.S
+	$(guard) $(NM) -pa --format=sysv $(@D)/.$(@F).$(VIRT_BASE).1 \
+		| $(guard) $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).1s.S
 	$(guard) $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o
 	$(guard) $(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T efi.lds -N $< \
 	                $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o -o $@
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index f39c906..dbf6a1a 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdint.h>
+#include <stdbool.h>
 #include <ctype.h>
 
 #define KSYM_NAME_LEN		127
@@ -40,13 +41,14 @@ struct sym_entry {
 	unsigned int len;
 	unsigned char *sym;
 };
-
+#define SYMBOL_NAME(s) ((char *)(s)->sym + 1)
 
 static struct sym_entry *table;
 static unsigned int table_size, table_cnt;
 static unsigned long long _stext, _etext, _sinittext, _einittext, _sextratext, _eextratext;
 static int all_symbols = 0;
 static char symbol_prefix_char = '\0';
+static enum { fmt_bsd, fmt_sysv } input_format;
 
 int token_profit[0x10000];
 
@@ -73,11 +75,25 @@ static inline int is_arm_mapping_symbol(const char *str)
 
 static int read_symbol(FILE *in, struct sym_entry *s)
 {
-	char str[500];
+	char str[500], type[20] = "";
 	char *sym, stype;
-	int rc;
-
-	rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str);
+	static enum { symbol, single_source, multi_source } last;
+	static char *filename;
+	int rc = -1;
+
+	switch (input_format) {
+	case fmt_bsd:
+		rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str);
+		break;
+	case fmt_sysv:
+		while (fscanf(in, "\n") == 1)
+			/* nothing */;
+		rc = fscanf(in, "%499[^ |] |%llx | %c |",
+			    str, &s->addr, &stype);
+		if (rc == 3 && fscanf(in, " %19[^ |] |", type) != 1)
+			*type = '\0';
+		break;
+	}
 	if (rc != 3) {
 		if (rc != EOF) {
 			/* skip line */
@@ -87,6 +103,31 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 		return -1;
 	}
 
+	sym = strrchr(str, '.');
+	if (strcasecmp(type, "FILE") == 0 ||
+	    (/* GNU nm prior to XXX doesn't produce a type for EFI binaries. */
+	     input_format == fmt_sysv && !*type && stype == '?' && sym &&
+	     sym[1] && strchr("cSsoh", sym[1]) && !sym[2])) {
+		/*
+		 * gas prior to XXX outputs symbol table entries resulting
+		 * from .file in reverse order. If we get two consecutive file
+		 * symbols, prefer the first one if that names an object file
+		 * or has a directory component (to cover multiply compiled
+		 * files).
+		 */
+		bool multi = strchr(str, '/') || (sym && sym[1] == 'o');
+
+		if (multi || last != multi_source) {
+			free(filename);
+			filename = *str ? strdup(str) : NULL;
+		}
+		last = multi ? multi_source : single_source;
+		goto skip_tail;
+	}
+
+	last = symbol;
+	rc = -1;
+
 	sym = str;
 	/* skip prefix char */
 	if (symbol_prefix_char && str[0] == symbol_prefix_char)
@@ -109,24 +150,37 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 	{
 		/* Keep these useful absolute symbols */
 		if (strcmp(sym, "__gp"))
-			return -1;
-
+			goto skip_tail;
 	}
 	else if (toupper((uint8_t)stype) == 'U' ||
+		 toupper((uint8_t)stype) == 'N' ||
 		 is_arm_mapping_symbol(sym))
-		return -1;
+		goto skip_tail;
 	/* exclude also MIPS ELF local symbols ($L123 instead of .L123) */
 	else if (str[0] == '$')
-		return -1;
+		goto skip_tail;
 
 	/* include the type field in the symbol name, so that it gets
 	 * compressed together */
 	s->len = strlen(str) + 1;
+	if (islower(stype) && filename)
+		s->len += strlen(filename) + 1;
 	s->sym = malloc(s->len + 1);
-	strcpy((char *)s->sym + 1, str);
+	sym = SYMBOL_NAME(s);
+	if (islower(stype) && filename) {
+		sym = stpcpy(sym, filename);
+		*sym++ = '#';
+	}
+	strcpy(sym, str);
 	s->sym[0] = stype;
 
-	return 0;
+	rc = 0;
+
+ skip_tail:
+	if (input_format == fmt_sysv)
+		fgets(str, 500, in); /* discard rest of line */
+
+	return rc;
 }
 
 static int symbol_valid(struct sym_entry *s)
@@ -460,11 +514,37 @@ static void optimize_token_table(void)
 	optimize_result();
 }
 
+static int compare_value(const void *p1, const void *p2)
+{
+	const struct sym_entry *sym1 = p1;
+	const struct sym_entry *sym2 = p2;
+
+	if (sym1->addr < sym2->addr)
+		return -1;
+	if (sym1->addr > sym2->addr)
+		return +1;
+	/* Prefer global symbols. */
+	if (isupper(*sym1->sym))
+		return -1;
+	if (isupper(*sym2->sym))
+		return +1;
+	return 0;
+}
+
+static int compare_name(const void *p1, const void *p2)
+{
+	const struct sym_entry *sym1 = p1;
+	const struct sym_entry *sym2 = p2;
+
+	return strcmp(SYMBOL_NAME(sym1), SYMBOL_NAME(sym2));
+}
 
 int main(int argc, char **argv)
 {
+	unsigned int i;
+	bool unsorted = false, warn_dup = false;
+
 	if (argc >= 2) {
-		int i;
 		for (i = 1; i < argc; i++) {
 			if(strcmp(argv[i], "--all-symbols") == 0)
 				all_symbols = 1;
@@ -474,13 +554,36 @@ int main(int argc, char **argv)
 				if ((*p == '"' && *(p+2) == '"') || (*p == '\'' && *(p+2) == '\''))
 					p++;
 				symbol_prefix_char = *p;
-			} else
+			} else if (strcmp(argv[i], "--sysv") == 0)
+				input_format = fmt_sysv;
+			else if (strcmp(argv[i], "--sort") == 0)
+				unsorted = true;
+			else if (strcmp(argv[i], "--warn-dup") == 0)
+				warn_dup = true;
+			else
 				usage();
 		}
 	} else if (argc != 1)
 		usage();
 
 	read_map(stdin);
+
+	if (warn_dup) {
+		qsort(table, table_cnt, sizeof(*table), compare_name);
+		for (i = 1; i < table_cnt; ++i)
+			if (strcmp(SYMBOL_NAME(table + i - 1),
+				   SYMBOL_NAME(table + i)) == 0 &&
+			    table[i - 1].addr != table[i].addr)
+				fprintf(stderr,
+					"Duplicate symbol '%s' (%llx != %llx)\n",
+					SYMBOL_NAME(table + i),
+					table[i].addr, table[i - 1].addr);
+		unsorted = true;
+	}
+
+	if (unsorted)
+		qsort(table, table_cnt, sizeof(*table), compare_value);
+
 	optimize_token_table();
 	write_src();
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:02:59 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:02: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 1ZugfT-00042O-5r; Fri, 06 Nov 2015 13:02: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 1ZugfQ-00042A-S3
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:57 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	49/F8-29649-FF4AC365; Fri, 06 Nov 2015 13:02:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1446814974!1062556!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60326 invoked from network); 6 Nov 2015 13:02:55 -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;
	6 Nov 2015 13:02:55 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfN-0000rM-Q1
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfN-0004NP-Dv
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:02:53 +0000
Date: Fri, 06 Nov 2015 13:02:53 +0000
Message-Id: <E1ZugfN-0004NP-Dv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] symbols: prefix static symbols with
	their source file names
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d37d63d4b548b5fc214c71b2987a86ac0bbf4965
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 18:05:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:05:35 2015 +0100

    symbols: prefix static symbols with their source file names
    
    This requires adjustments to the tool generating the symbol table and
    its as well as nm's invocation.
    
    Note: Not warning about duplicate symbols in the EFI case for now, as
    a binutils bug causes misnamed file name entries to appear in EFI
    binaries' symbol tables when the file name is longer than 18 chars.
    (Not doing so also avoids other duplicates getting printed twice.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/Makefile |    6 ++-
 xen/arch/x86/Makefile |   12 +++--
 xen/tools/symbols.c   |  129 ++++++++++++++++++++++++++++++++++++++++++++-----
 3 files changed, 128 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 1ef39f7..e47dd4c 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -80,11 +80,13 @@ $(BASEDIR)/common/symbols-dummy.o:
 $(TARGET)-syms: prelink.o xen.lds $(BASEDIR)/common/symbols-dummy.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
-	$(NM) -n $(@D)/.$(@F).0 | $(BASEDIR)/tools/symbols >$(@D)/.$(@F).0.S
+	$(NM) -pa --format=sysv $(@D)/.$(@F).0 \
+		| $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).0.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1
-	$(NM) -n $(@D)/.$(@F).1 | $(BASEDIR)/tools/symbols >$(@D)/.$(@F).1.S
+	$(NM) -pa --format=sysv $(@D)/.$(@F).1 \
+		| $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).1.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(@D)/.$(@F).1.o -o $@
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 39a8059..8c1a890 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -106,11 +106,13 @@ $(BASEDIR)/common/symbols-dummy.o:
 $(TARGET)-syms: prelink.o xen.lds $(BASEDIR)/common/symbols-dummy.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
-	$(NM) -n $(@D)/.$(@F).0 | $(BASEDIR)/tools/symbols >$(@D)/.$(@F).0.S
+	$(NM) -pa --format=sysv $(@D)/.$(@F).0 \
+		| $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).0.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1
-	$(NM) -n $(@D)/.$(@F).1 | $(BASEDIR)/tools/symbols >$(@D)/.$(@F).1.S
+	$(NM) -pa --format=sysv $(@D)/.$(@F).1 \
+		| $(BASEDIR)/tools/symbols --sysv --sort --warn-dup >$(@D)/.$(@F).1.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o \
 	    $(@D)/.$(@F).1.o -o $@
@@ -133,13 +135,15 @@ $(TARGET).efi: prelink-efi.o efi.lds efi/relocs-dummy.o $(BASEDIR)/common/symbol
 	          $(guard) $(LD) $(call EFI_LDFLAGS,$(base)) -T efi.lds -N $< efi/relocs-dummy.o \
 	                $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).$(base).0 &&) :
 	$(guard) efi/mkreloc $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(@D)/.$(@F).$(base).0) >$(@D)/.$(@F).0r.S
-	$(guard) $(NM) -n $(@D)/.$(@F).$(VIRT_BASE).0 | $(guard) $(BASEDIR)/tools/symbols >$(@D)/.$(@F).0s.S
+	$(guard) $(NM) -pa --format=sysv $(@D)/.$(@F).$(VIRT_BASE).0 \
+		| $(guard) $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).0s.S
 	$(guard) $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0r.o $(@D)/.$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
 	          $(guard) $(LD) $(call EFI_LDFLAGS,$(base)) -T efi.lds -N $< \
 	                $(@D)/.$(@F).0r.o $(@D)/.$(@F).0s.o -o $(@D)/.$(@F).$(base).1 &&) :
 	$(guard) efi/mkreloc $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(@D)/.$(@F).$(base).1) >$(@D)/.$(@F).1r.S
-	$(guard) $(NM) -n $(@D)/.$(@F).$(VIRT_BASE).1 | $(guard) $(BASEDIR)/tools/symbols >$(@D)/.$(@F).1s.S
+	$(guard) $(NM) -pa --format=sysv $(@D)/.$(@F).$(VIRT_BASE).1 \
+		| $(guard) $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).1s.S
 	$(guard) $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o
 	$(guard) $(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T efi.lds -N $< \
 	                $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o -o $@
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index f39c906..dbf6a1a 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdint.h>
+#include <stdbool.h>
 #include <ctype.h>
 
 #define KSYM_NAME_LEN		127
@@ -40,13 +41,14 @@ struct sym_entry {
 	unsigned int len;
 	unsigned char *sym;
 };
-
+#define SYMBOL_NAME(s) ((char *)(s)->sym + 1)
 
 static struct sym_entry *table;
 static unsigned int table_size, table_cnt;
 static unsigned long long _stext, _etext, _sinittext, _einittext, _sextratext, _eextratext;
 static int all_symbols = 0;
 static char symbol_prefix_char = '\0';
+static enum { fmt_bsd, fmt_sysv } input_format;
 
 int token_profit[0x10000];
 
@@ -73,11 +75,25 @@ static inline int is_arm_mapping_symbol(const char *str)
 
 static int read_symbol(FILE *in, struct sym_entry *s)
 {
-	char str[500];
+	char str[500], type[20] = "";
 	char *sym, stype;
-	int rc;
-
-	rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str);
+	static enum { symbol, single_source, multi_source } last;
+	static char *filename;
+	int rc = -1;
+
+	switch (input_format) {
+	case fmt_bsd:
+		rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str);
+		break;
+	case fmt_sysv:
+		while (fscanf(in, "\n") == 1)
+			/* nothing */;
+		rc = fscanf(in, "%499[^ |] |%llx | %c |",
+			    str, &s->addr, &stype);
+		if (rc == 3 && fscanf(in, " %19[^ |] |", type) != 1)
+			*type = '\0';
+		break;
+	}
 	if (rc != 3) {
 		if (rc != EOF) {
 			/* skip line */
@@ -87,6 +103,31 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 		return -1;
 	}
 
+	sym = strrchr(str, '.');
+	if (strcasecmp(type, "FILE") == 0 ||
+	    (/* GNU nm prior to XXX doesn't produce a type for EFI binaries. */
+	     input_format == fmt_sysv && !*type && stype == '?' && sym &&
+	     sym[1] && strchr("cSsoh", sym[1]) && !sym[2])) {
+		/*
+		 * gas prior to XXX outputs symbol table entries resulting
+		 * from .file in reverse order. If we get two consecutive file
+		 * symbols, prefer the first one if that names an object file
+		 * or has a directory component (to cover multiply compiled
+		 * files).
+		 */
+		bool multi = strchr(str, '/') || (sym && sym[1] == 'o');
+
+		if (multi || last != multi_source) {
+			free(filename);
+			filename = *str ? strdup(str) : NULL;
+		}
+		last = multi ? multi_source : single_source;
+		goto skip_tail;
+	}
+
+	last = symbol;
+	rc = -1;
+
 	sym = str;
 	/* skip prefix char */
 	if (symbol_prefix_char && str[0] == symbol_prefix_char)
@@ -109,24 +150,37 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 	{
 		/* Keep these useful absolute symbols */
 		if (strcmp(sym, "__gp"))
-			return -1;
-
+			goto skip_tail;
 	}
 	else if (toupper((uint8_t)stype) == 'U' ||
+		 toupper((uint8_t)stype) == 'N' ||
 		 is_arm_mapping_symbol(sym))
-		return -1;
+		goto skip_tail;
 	/* exclude also MIPS ELF local symbols ($L123 instead of .L123) */
 	else if (str[0] == '$')
-		return -1;
+		goto skip_tail;
 
 	/* include the type field in the symbol name, so that it gets
 	 * compressed together */
 	s->len = strlen(str) + 1;
+	if (islower(stype) && filename)
+		s->len += strlen(filename) + 1;
 	s->sym = malloc(s->len + 1);
-	strcpy((char *)s->sym + 1, str);
+	sym = SYMBOL_NAME(s);
+	if (islower(stype) && filename) {
+		sym = stpcpy(sym, filename);
+		*sym++ = '#';
+	}
+	strcpy(sym, str);
 	s->sym[0] = stype;
 
-	return 0;
+	rc = 0;
+
+ skip_tail:
+	if (input_format == fmt_sysv)
+		fgets(str, 500, in); /* discard rest of line */
+
+	return rc;
 }
 
 static int symbol_valid(struct sym_entry *s)
@@ -460,11 +514,37 @@ static void optimize_token_table(void)
 	optimize_result();
 }
 
+static int compare_value(const void *p1, const void *p2)
+{
+	const struct sym_entry *sym1 = p1;
+	const struct sym_entry *sym2 = p2;
+
+	if (sym1->addr < sym2->addr)
+		return -1;
+	if (sym1->addr > sym2->addr)
+		return +1;
+	/* Prefer global symbols. */
+	if (isupper(*sym1->sym))
+		return -1;
+	if (isupper(*sym2->sym))
+		return +1;
+	return 0;
+}
+
+static int compare_name(const void *p1, const void *p2)
+{
+	const struct sym_entry *sym1 = p1;
+	const struct sym_entry *sym2 = p2;
+
+	return strcmp(SYMBOL_NAME(sym1), SYMBOL_NAME(sym2));
+}
 
 int main(int argc, char **argv)
 {
+	unsigned int i;
+	bool unsorted = false, warn_dup = false;
+
 	if (argc >= 2) {
-		int i;
 		for (i = 1; i < argc; i++) {
 			if(strcmp(argv[i], "--all-symbols") == 0)
 				all_symbols = 1;
@@ -474,13 +554,36 @@ int main(int argc, char **argv)
 				if ((*p == '"' && *(p+2) == '"') || (*p == '\'' && *(p+2) == '\''))
 					p++;
 				symbol_prefix_char = *p;
-			} else
+			} else if (strcmp(argv[i], "--sysv") == 0)
+				input_format = fmt_sysv;
+			else if (strcmp(argv[i], "--sort") == 0)
+				unsorted = true;
+			else if (strcmp(argv[i], "--warn-dup") == 0)
+				warn_dup = true;
+			else
 				usage();
 		}
 	} else if (argc != 1)
 		usage();
 
 	read_map(stdin);
+
+	if (warn_dup) {
+		qsort(table, table_cnt, sizeof(*table), compare_name);
+		for (i = 1; i < table_cnt; ++i)
+			if (strcmp(SYMBOL_NAME(table + i - 1),
+				   SYMBOL_NAME(table + i)) == 0 &&
+			    table[i - 1].addr != table[i].addr)
+				fprintf(stderr,
+					"Duplicate symbol '%s' (%llx != %llx)\n",
+					SYMBOL_NAME(table + i),
+					table[i].addr, table[i - 1].addr);
+		unsorted = true;
+	}
+
+	if (unsorted)
+		qsort(table, table_cnt, sizeof(*table), compare_value);
+
 	optimize_token_table();
 	write_src();
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:03:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:03: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 1Zugfd-00044R-JP; Fri, 06 Nov 2015 13:03: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 1Zugfc-00044D-86
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:08 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	E6/59-29649-B05AC365; Fri, 06 Nov 2015 13:03:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1446814985!1011633!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37810 invoked from network); 6 Nov 2015 13:03: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;
	6 Nov 2015 13:03:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfZ-0000ry-BE
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfY-0004OF-0U
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:04 +0000
Date: Fri, 06 Nov 2015 13:03:04 +0000
Message-Id: <E1ZugfY-0004OF-0U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] compat: enforce distinguishable file
	names in symbol table
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b6ef9c152edceabecc7f90c811cd538a7b7a110
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 18:07:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:07:20 2015 +0100

    compat: enforce distinguishable file names in symbol table
    
    To make it possible to tell apart the static symbols in files built a
    second time for compat guest support, arrange for their source file
    names to be prefixed by a suitable path. We can't do this without
    explicit .file directives, since gcc has always been stripping paths
    from file names handed to the internally generated .file directive.
    However, we can leverage __FILE__ if we make sure the second instance
    gets compiled out of other than the very directory the wrapper sits in.
    
    Where suitable, remove the long redundant explicit inclusions of
    xen/config.h at once.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/Rules.mk                             |   11 +++++++++--
 xen/arch/x86/Makefile                    |    8 ++++----
 xen/arch/x86/x86_64/Makefile             |    4 ----
 xen/arch/x86/x86_64/compat.c             |    3 ++-
 xen/arch/x86/x86_64/mm.c                 |    3 ++-
 xen/arch/x86/x86_64/physdev.c            |    3 ++-
 xen/arch/x86/x86_64/platform_hypercall.c |    3 ++-
 xen/common/Makefile                      |    2 +-
 xen/common/compat/Makefile               |    6 ------
 xen/common/compat/domain.c               |    3 ++-
 xen/common/compat/kernel.c               |    3 ++-
 xen/common/compat/memory.c               |    3 ++-
 xen/common/compat/multicall.c            |    3 ++-
 xen/include/Makefile                     |    2 +-
 14 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 433dad3..e9d03b9 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -86,8 +86,7 @@ AFLAGS-$(clang)         += -no-integrated-as
 ALL_OBJS := $(ALL_OBJS-y)
 
 # Get gcc to generate the dependencies for us.
-CFLAGS-y += -MMD -MF .$(@F).d
-DEPS = .*.d
+CFLAGS-y += -MMD -MF $(@D)/.$(@F).d
 
 CFLAGS += $(CFLAGS-y)
 
@@ -103,6 +102,14 @@ LDFLAGS += $(LDFLAGS-y)
 
 include Makefile
 
+DEPS = .*.d
+define gendep
+    ifneq ($(1),$(subst /,:,$(1)))
+        DEPS += $(dir $(1)).$(basename $(notdir $(1))).d
+    endif
+endef
+$(foreach o,$(filter-out %/,$(obj-y)),$(eval $(call gendep,$(o))))
+
 # Ensure each subdirectory has exactly one trailing slash.
 subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n) $(subdir-)))
 subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 8c1a890..d4e507a 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -13,7 +13,7 @@ obj-y += bitops.o
 obj-bin-y += bzimage.init.o
 obj-bin-y += clear_page.o
 obj-bin-y += copy_page.o
-obj-y += compat.o
+obj-y += compat.o x86_64/compat.o
 obj-$(CONFIG_KEXEC) += crash.o
 obj-y += debug.o
 obj-y += delay.o
@@ -25,7 +25,6 @@ obj-y += domain_page.o
 obj-y += e820.o
 obj-y += extable.o
 obj-y += flushtlb.o
-obj-y += platform_hypercall.o
 obj-y += i387.o
 obj-y += i8259.o
 obj-y += io_apic.o
@@ -37,14 +36,15 @@ obj-y += microcode_amd.o
 obj-y += microcode_intel.o
 # This must come after the vendor specific files.
 obj-y += microcode.o
-obj-y += mm.o
+obj-y += mm.o x86_64/mm.o
 obj-y += monitor.o
 obj-y += mpparse.o
 obj-y += nmi.o
 obj-y += numa.o
 obj-y += pci.o
 obj-y += percpu.o
-obj-y += physdev.o
+obj-y += physdev.o x86_64/physdev.o
+obj-y += platform_hypercall.o x86_64/platform_hypercall.o
 obj-y += psr.o
 obj-y += setup.o
 obj-y += shutdown.o
diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile
index 7f8fb3d..d5af722 100644
--- a/xen/arch/x86/x86_64/Makefile
+++ b/xen/arch/x86/x86_64/Makefile
@@ -2,7 +2,6 @@ subdir-y += compat
 
 obj-bin-y += entry.o
 obj-bin-y += gpr_switch.o
-obj-y += mm.o
 obj-y += traps.o
 obj-y += machine_kexec.o
 obj-y += pci.o
@@ -10,10 +9,7 @@ obj-y += acpi_mmcfg.o
 obj-y += mmconf-fam10h.o
 obj-y += mmconfig_64.o
 obj-y += mmconfig-shared.o
-obj-y += compat.o
 obj-y += domain.o
-obj-y += physdev.o
-obj-y += platform_hypercall.o
 obj-y += cpu_idle.o
 obj-y += cpufreq.o
 obj-bin-y += kexec_reloc.o
diff --git a/xen/arch/x86/x86_64/compat.c b/xen/arch/x86/x86_64/compat.c
index 69b9aa0..f8f633b 100644
--- a/xen/arch/x86/x86_64/compat.c
+++ b/xen/arch/x86/x86_64/compat.c
@@ -2,7 +2,8 @@
  * compat.c
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/hypercall.h>
 #include <compat/xen.h>
 #include <compat/physdev.h>
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index d918002..bbbf8e3 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -16,7 +16,8 @@
  * with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/lib.h>
 #include <xen/init.h>
 #include <xen/mm.h>
diff --git a/xen/arch/x86/x86_64/physdev.c b/xen/arch/x86/x86_64/physdev.c
index d376cd0..c5a00ea 100644
--- a/xen/arch/x86/x86_64/physdev.c
+++ b/xen/arch/x86/x86_64/physdev.c
@@ -2,7 +2,8 @@
  * physdev.c
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/types.h>
 #include <xen/guest_access.h>
 #include <compat/xen.h>
diff --git a/xen/arch/x86/x86_64/platform_hypercall.c b/xen/arch/x86/x86_64/platform_hypercall.c
index ccfd30d..8fa2543 100644
--- a/xen/arch/x86/x86_64/platform_hypercall.c
+++ b/xen/arch/x86/x86_64/platform_hypercall.c
@@ -2,7 +2,8 @@
  * platform_hypercall.c
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/lib.h>
 #include <compat/platform.h>
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index a7829db..3547c8e 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -63,7 +63,7 @@ obj-$(perfc)       += perfc.o
 obj-$(crash_debug) += gdbstub.o
 obj-$(xenoprof)    += xenoprof.o
 
-subdir-$(CONFIG_COMPAT) += compat
+obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o tmem_xen.o xlat.o)
 
 subdir-$(x86_64) += hvm
 
diff --git a/xen/common/compat/Makefile b/xen/common/compat/Makefile
deleted file mode 100644
index 1cf289a..0000000
--- a/xen/common/compat/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-obj-y += domain.o
-obj-y += kernel.o
-obj-y += memory.o
-obj-y += multicall.o
-obj-y += xlat.o
-obj-y += tmem_xen.o
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 157570a..c60d824 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -3,7 +3,8 @@
  *
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/domain.h>
diff --git a/xen/common/compat/kernel.c b/xen/common/compat/kernel.c
index 65cc25b..df93fdd 100644
--- a/xen/common/compat/kernel.c
+++ b/xen/common/compat/kernel.c
@@ -2,7 +2,8 @@
  * kernel.c
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 002948b..bb10993 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -1,4 +1,5 @@
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/types.h>
 #include <xen/hypercall.h>
 #include <xen/guest_access.h>
diff --git a/xen/common/compat/multicall.c b/xen/common/compat/multicall.c
index 2af8aef..43d2d81 100644
--- a/xen/common/compat/multicall.c
+++ b/xen/common/compat/multicall.c
@@ -2,7 +2,8 @@
  * multicall.c
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/types.h>
 #include <xen/multicall.h>
 #include <xen/trace.h>
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 6664107..c674f7f 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -58,7 +58,7 @@ compat/%.h: compat/%.i Makefile $(BASEDIR)/tools/compat-build-header.py
 	mv -f $@.new $@
 
 compat/%.i: compat/%.c Makefile
-	$(CPP) $(filter-out -M% .%.d -include %/include/xen/config.h,$(CFLAGS)) $(cppflags-y) -o $@ $<
+	$(CPP) $(filter-out -M% %.d -include %/include/xen/config.h,$(CFLAGS)) $(cppflags-y) -o $@ $<
 
 compat/%.c: public/%.h xlat.lst Makefile $(BASEDIR)/tools/compat-build-source.py
 	mkdir -p $(@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 Nov 06 13:03:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:03: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 1Zugfd-00044R-JP; Fri, 06 Nov 2015 13:03: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 1Zugfc-00044D-86
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:08 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	E6/59-29649-B05AC365; Fri, 06 Nov 2015 13:03:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1446814985!1011633!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37810 invoked from network); 6 Nov 2015 13:03: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;
	6 Nov 2015 13:03:06 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfZ-0000ry-BE
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugfY-0004OF-0U
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:04 +0000
Date: Fri, 06 Nov 2015 13:03:04 +0000
Message-Id: <E1ZugfY-0004OF-0U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] compat: enforce distinguishable file
	names in symbol table
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b6ef9c152edceabecc7f90c811cd538a7b7a110
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 18:07:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:07:20 2015 +0100

    compat: enforce distinguishable file names in symbol table
    
    To make it possible to tell apart the static symbols in files built a
    second time for compat guest support, arrange for their source file
    names to be prefixed by a suitable path. We can't do this without
    explicit .file directives, since gcc has always been stripping paths
    from file names handed to the internally generated .file directive.
    However, we can leverage __FILE__ if we make sure the second instance
    gets compiled out of other than the very directory the wrapper sits in.
    
    Where suitable, remove the long redundant explicit inclusions of
    xen/config.h at once.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/Rules.mk                             |   11 +++++++++--
 xen/arch/x86/Makefile                    |    8 ++++----
 xen/arch/x86/x86_64/Makefile             |    4 ----
 xen/arch/x86/x86_64/compat.c             |    3 ++-
 xen/arch/x86/x86_64/mm.c                 |    3 ++-
 xen/arch/x86/x86_64/physdev.c            |    3 ++-
 xen/arch/x86/x86_64/platform_hypercall.c |    3 ++-
 xen/common/Makefile                      |    2 +-
 xen/common/compat/Makefile               |    6 ------
 xen/common/compat/domain.c               |    3 ++-
 xen/common/compat/kernel.c               |    3 ++-
 xen/common/compat/memory.c               |    3 ++-
 xen/common/compat/multicall.c            |    3 ++-
 xen/include/Makefile                     |    2 +-
 14 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 433dad3..e9d03b9 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -86,8 +86,7 @@ AFLAGS-$(clang)         += -no-integrated-as
 ALL_OBJS := $(ALL_OBJS-y)
 
 # Get gcc to generate the dependencies for us.
-CFLAGS-y += -MMD -MF .$(@F).d
-DEPS = .*.d
+CFLAGS-y += -MMD -MF $(@D)/.$(@F).d
 
 CFLAGS += $(CFLAGS-y)
 
@@ -103,6 +102,14 @@ LDFLAGS += $(LDFLAGS-y)
 
 include Makefile
 
+DEPS = .*.d
+define gendep
+    ifneq ($(1),$(subst /,:,$(1)))
+        DEPS += $(dir $(1)).$(basename $(notdir $(1))).d
+    endif
+endef
+$(foreach o,$(filter-out %/,$(obj-y)),$(eval $(call gendep,$(o))))
+
 # Ensure each subdirectory has exactly one trailing slash.
 subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n) $(subdir-)))
 subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 8c1a890..d4e507a 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -13,7 +13,7 @@ obj-y += bitops.o
 obj-bin-y += bzimage.init.o
 obj-bin-y += clear_page.o
 obj-bin-y += copy_page.o
-obj-y += compat.o
+obj-y += compat.o x86_64/compat.o
 obj-$(CONFIG_KEXEC) += crash.o
 obj-y += debug.o
 obj-y += delay.o
@@ -25,7 +25,6 @@ obj-y += domain_page.o
 obj-y += e820.o
 obj-y += extable.o
 obj-y += flushtlb.o
-obj-y += platform_hypercall.o
 obj-y += i387.o
 obj-y += i8259.o
 obj-y += io_apic.o
@@ -37,14 +36,15 @@ obj-y += microcode_amd.o
 obj-y += microcode_intel.o
 # This must come after the vendor specific files.
 obj-y += microcode.o
-obj-y += mm.o
+obj-y += mm.o x86_64/mm.o
 obj-y += monitor.o
 obj-y += mpparse.o
 obj-y += nmi.o
 obj-y += numa.o
 obj-y += pci.o
 obj-y += percpu.o
-obj-y += physdev.o
+obj-y += physdev.o x86_64/physdev.o
+obj-y += platform_hypercall.o x86_64/platform_hypercall.o
 obj-y += psr.o
 obj-y += setup.o
 obj-y += shutdown.o
diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile
index 7f8fb3d..d5af722 100644
--- a/xen/arch/x86/x86_64/Makefile
+++ b/xen/arch/x86/x86_64/Makefile
@@ -2,7 +2,6 @@ subdir-y += compat
 
 obj-bin-y += entry.o
 obj-bin-y += gpr_switch.o
-obj-y += mm.o
 obj-y += traps.o
 obj-y += machine_kexec.o
 obj-y += pci.o
@@ -10,10 +9,7 @@ obj-y += acpi_mmcfg.o
 obj-y += mmconf-fam10h.o
 obj-y += mmconfig_64.o
 obj-y += mmconfig-shared.o
-obj-y += compat.o
 obj-y += domain.o
-obj-y += physdev.o
-obj-y += platform_hypercall.o
 obj-y += cpu_idle.o
 obj-y += cpufreq.o
 obj-bin-y += kexec_reloc.o
diff --git a/xen/arch/x86/x86_64/compat.c b/xen/arch/x86/x86_64/compat.c
index 69b9aa0..f8f633b 100644
--- a/xen/arch/x86/x86_64/compat.c
+++ b/xen/arch/x86/x86_64/compat.c
@@ -2,7 +2,8 @@
  * compat.c
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/hypercall.h>
 #include <compat/xen.h>
 #include <compat/physdev.h>
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index d918002..bbbf8e3 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -16,7 +16,8 @@
  * with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/lib.h>
 #include <xen/init.h>
 #include <xen/mm.h>
diff --git a/xen/arch/x86/x86_64/physdev.c b/xen/arch/x86/x86_64/physdev.c
index d376cd0..c5a00ea 100644
--- a/xen/arch/x86/x86_64/physdev.c
+++ b/xen/arch/x86/x86_64/physdev.c
@@ -2,7 +2,8 @@
  * physdev.c
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/types.h>
 #include <xen/guest_access.h>
 #include <compat/xen.h>
diff --git a/xen/arch/x86/x86_64/platform_hypercall.c b/xen/arch/x86/x86_64/platform_hypercall.c
index ccfd30d..8fa2543 100644
--- a/xen/arch/x86/x86_64/platform_hypercall.c
+++ b/xen/arch/x86/x86_64/platform_hypercall.c
@@ -2,7 +2,8 @@
  * platform_hypercall.c
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/lib.h>
 #include <compat/platform.h>
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index a7829db..3547c8e 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -63,7 +63,7 @@ obj-$(perfc)       += perfc.o
 obj-$(crash_debug) += gdbstub.o
 obj-$(xenoprof)    += xenoprof.o
 
-subdir-$(CONFIG_COMPAT) += compat
+obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o tmem_xen.o xlat.o)
 
 subdir-$(x86_64) += hvm
 
diff --git a/xen/common/compat/Makefile b/xen/common/compat/Makefile
deleted file mode 100644
index 1cf289a..0000000
--- a/xen/common/compat/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-obj-y += domain.o
-obj-y += kernel.o
-obj-y += memory.o
-obj-y += multicall.o
-obj-y += xlat.o
-obj-y += tmem_xen.o
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 157570a..c60d824 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -3,7 +3,8 @@
  *
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/domain.h>
diff --git a/xen/common/compat/kernel.c b/xen/common/compat/kernel.c
index 65cc25b..df93fdd 100644
--- a/xen/common/compat/kernel.c
+++ b/xen/common/compat/kernel.c
@@ -2,7 +2,8 @@
  * kernel.c
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 002948b..bb10993 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -1,4 +1,5 @@
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/types.h>
 #include <xen/hypercall.h>
 #include <xen/guest_access.h>
diff --git a/xen/common/compat/multicall.c b/xen/common/compat/multicall.c
index 2af8aef..43d2d81 100644
--- a/xen/common/compat/multicall.c
+++ b/xen/common/compat/multicall.c
@@ -2,7 +2,8 @@
  * multicall.c
  */
 
-#include <xen/config.h>
+asm(".file \"" __FILE__ "\"");
+
 #include <xen/types.h>
 #include <xen/multicall.h>
 #include <xen/trace.h>
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 6664107..c674f7f 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -58,7 +58,7 @@ compat/%.h: compat/%.i Makefile $(BASEDIR)/tools/compat-build-header.py
 	mv -f $@.new $@
 
 compat/%.i: compat/%.c Makefile
-	$(CPP) $(filter-out -M% .%.d -include %/include/xen/config.h,$(CFLAGS)) $(cppflags-y) -o $@ $<
+	$(CPP) $(filter-out -M% %.d -include %/include/xen/config.h,$(CFLAGS)) $(cppflags-y) -o $@ $<
 
 compat/%.c: public/%.h xlat.lst Makefile $(BASEDIR)/tools/compat-build-source.py
 	mkdir -p $(@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 Nov 06 13:03:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:03: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 1Zugfn-00046u-Nu; Fri, 06 Nov 2015 13:03: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 1Zugfm-00046e-44
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:18 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	C1/8C-18107-515AC365; Fri, 06 Nov 2015 13:03:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446814996!1585021!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32741 invoked from network); 6 Nov 2015 13:03:16 -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;
	6 Nov 2015 13:03:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugfj-0000s9-U1
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugfj-0004Oq-JI
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:15 +0000
Date: Fri, 06 Nov 2015 13:03:15 +0000
Message-Id: <E1Zugfj-0004Oq-JI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] timer-op: demote a debugging message
	to really be debugging only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e134a69f5c649290accfe2d5e905c5810425b4c4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 18:11:15 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:11:15 2015 +0100

    timer-op: demote a debugging message to really be debugging only
    
    The issue the message points out may have been of relevance during the
    early days, but shouldn't anymore.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/schedule.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index c5f640f..292e9a0 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1118,8 +1118,8 @@ long do_set_timer_op(s_time_t timeout)
          * timeout in this case can burn a lot of CPU. We therefore go for a
          * reasonable middleground of triggering a timer event in 100ms.
          */
-        gprintk(XENLOG_INFO, "Warning: huge timeout set: %"PRIx64"\n",
-                (uint64_t)timeout);
+        gdprintk(XENLOG_INFO, "Warning: huge timeout set: %"PRIx64"\n",
+                 timeout);
         set_timer(&v->singleshot_timer, NOW() + MILLISECS(100));
     }
     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 Nov 06 13:03:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:03: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 1Zugfn-00046u-Nu; Fri, 06 Nov 2015 13:03: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 1Zugfm-00046e-44
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:18 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	C1/8C-18107-515AC365; Fri, 06 Nov 2015 13:03:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446814996!1585021!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32741 invoked from network); 6 Nov 2015 13:03:16 -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;
	6 Nov 2015 13:03:16 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugfj-0000s9-U1
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugfj-0004Oq-JI
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:15 +0000
Date: Fri, 06 Nov 2015 13:03:15 +0000
Message-Id: <E1Zugfj-0004Oq-JI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] timer-op: demote a debugging message
	to really be debugging only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e134a69f5c649290accfe2d5e905c5810425b4c4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 18:11:15 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:11:15 2015 +0100

    timer-op: demote a debugging message to really be debugging only
    
    The issue the message points out may have been of relevance during the
    early days, but shouldn't anymore.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/schedule.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index c5f640f..292e9a0 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1118,8 +1118,8 @@ long do_set_timer_op(s_time_t timeout)
          * timeout in this case can burn a lot of CPU. We therefore go for a
          * reasonable middleground of triggering a timer event in 100ms.
          */
-        gprintk(XENLOG_INFO, "Warning: huge timeout set: %"PRIx64"\n",
-                (uint64_t)timeout);
+        gdprintk(XENLOG_INFO, "Warning: huge timeout set: %"PRIx64"\n",
+                 timeout);
         set_timer(&v->singleshot_timer, NOW() + MILLISECS(100));
     }
     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 Nov 06 13:03:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:03: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 1Zugfx-00048S-TA; Fri, 06 Nov 2015 13:03: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 1Zugfw-00048A-AX
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:28 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	4B/76-30270-F15AC365; Fri, 06 Nov 2015 13:03:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1446815006!1586122!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31409 invoked from network); 6 Nov 2015 13:03:27 -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;
	6 Nov 2015 13:03:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugfu-0000sH-7y
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugfu-0004Q5-53
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:26 +0000
Date: Fri, 06 Nov 2015 13:03:26 +0000
Message-Id: <E1Zugfu-0004Q5-53@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HAP: use %pv printk() format where
	suitable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0900d8b09f3f34cee07101f9cad53dd694080105
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 18:11:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:11:56 2015 +0100

    x86/HAP: use %pv printk() format where suitable
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/hap/hap.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index e9c0080..17a380f 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -671,8 +671,7 @@ static int hap_page_fault(struct vcpu *v, unsigned long va,
 {
     struct domain *d = v->domain;
 
-    HAP_ERROR("Intercepted a guest #PF (%u:%u) with HAP enabled.\n",
-              d->domain_id, v->vcpu_id);
+    HAP_ERROR("Intercepted a guest #PF (%pv) with HAP enabled\n", v);
     domain_crash(d);
     return 0;
 }
@@ -692,8 +691,7 @@ static int hap_invlpg(struct vcpu *v, unsigned long va)
         return 1;
     }
 
-    HAP_ERROR("Intercepted a guest INVLPG (%u:%u) with HAP enabled.\n",
-              v->domain->domain_id, v->vcpu_id);
+    HAP_ERROR("Intercepted a guest INVLPG (%pv) with HAP enabled\n", v);
     domain_crash(v->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 Fri Nov 06 13:03:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:03: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 1Zugfx-00048S-TA; Fri, 06 Nov 2015 13:03: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 1Zugfw-00048A-AX
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:28 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	4B/76-30270-F15AC365; Fri, 06 Nov 2015 13:03:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1446815006!1586122!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31409 invoked from network); 6 Nov 2015 13:03:27 -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;
	6 Nov 2015 13:03:27 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugfu-0000sH-7y
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugfu-0004Q5-53
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:26 +0000
Date: Fri, 06 Nov 2015 13:03:26 +0000
Message-Id: <E1Zugfu-0004Q5-53@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HAP: use %pv printk() format where
	suitable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0900d8b09f3f34cee07101f9cad53dd694080105
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 3 18:11:56 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:11:56 2015 +0100

    x86/HAP: use %pv printk() format where suitable
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/hap/hap.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index e9c0080..17a380f 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -671,8 +671,7 @@ static int hap_page_fault(struct vcpu *v, unsigned long va,
 {
     struct domain *d = v->domain;
 
-    HAP_ERROR("Intercepted a guest #PF (%u:%u) with HAP enabled.\n",
-              d->domain_id, v->vcpu_id);
+    HAP_ERROR("Intercepted a guest #PF (%pv) with HAP enabled\n", v);
     domain_crash(d);
     return 0;
 }
@@ -692,8 +691,7 @@ static int hap_invlpg(struct vcpu *v, unsigned long va)
         return 1;
     }
 
-    HAP_ERROR("Intercepted a guest INVLPG (%u:%u) with HAP enabled.\n",
-              v->domain->domain_id, v->vcpu_id);
+    HAP_ERROR("Intercepted a guest INVLPG (%pv) with HAP enabled\n", v);
     domain_crash(v->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 Fri Nov 06 13:03:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:03:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zugg9-0004AJ-1Y; Fri, 06 Nov 2015 13:03: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 1Zugg6-0004A2-VL
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:39 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	51/3D-10678-A25AC365; Fri, 06 Nov 2015 13:03:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446815016!1555924!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29026 invoked from network); 6 Nov 2015 13:03:37 -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;
	6 Nov 2015 13:03:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugg4-0000sR-M7
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugg4-0004Qg-Hu
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:36 +0000
Date: Fri, 06 Nov 2015 13:03:36 +0000
Message-Id: <E1Zugg4-0004Qg-Hu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vmx: improvements to vmentry
	failure 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 bbcf0b218f64b1e3e2b66b0fbb623f51d9014e81
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:14:02 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:14:02 2015 +0100

    x86/vmx: improvements to vmentry failure handling
    
    Combine the almost identical vm_launch_fail() and vm_resume_fail() into a
    single vmx_vmentry_failure().
    
    Re-save all GPRs so that domain_crash() prints the real register values,
    rather than the stack frame of the vmx_vmentry_failure() call.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/entry.S |    9 +++++----
 xen/arch/x86/hvm/vmx/vmcs.c  |   15 ++++-----------
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
index 2a4ed57..a5438a4 100644
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -101,14 +101,15 @@ UNLIKELY_END(realmode)
 
 /*.Lvmx_resume:*/
         VMRESUME
-        sti
-        call vm_resume_fail
-        ud2
+        jmp  .Lvmx_vmentry_fail
 
 .Lvmx_launch:
         VMLAUNCH
+
+.Lvmx_vmentry_fail:
         sti
-        call vm_launch_fail
+        SAVE_ALL
+        call vmx_vmentry_failure
         ud2
 
 ENTRY(vmx_asm_do_vmentry)
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 4ea1ad1..53207e6 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1612,21 +1612,14 @@ void vmx_destroy_vmcs(struct vcpu *v)
     free_xenheap_page(v->arch.hvm_vmx.msr_bitmap);
 }
 
-void vm_launch_fail(void)
-{
-    unsigned long error;
-
-    __vmread(VM_INSTRUCTION_ERROR, &error);
-    printk("<vm_launch_fail> error code %lx\n", error);
-    domain_crash_synchronous();
-}
-
-void vm_resume_fail(void)
+void vmx_vmentry_failure(void)
 {
+    struct vcpu *curr = current;
     unsigned long error;
 
     __vmread(VM_INSTRUCTION_ERROR, &error);
-    printk("<vm_resume_fail> error code %lx\n", error);
+    gprintk(XENLOG_ERR, "VM%s error: %#lx\n",
+            curr->arch.hvm_vmx.launched ? "RESUME" : "LAUNCH", error);
     domain_crash_synchronous();
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:03:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:03:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zugg9-0004AJ-1Y; Fri, 06 Nov 2015 13:03: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 1Zugg6-0004A2-VL
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:39 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	51/3D-10678-A25AC365; Fri, 06 Nov 2015 13:03:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1446815016!1555924!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29026 invoked from network); 6 Nov 2015 13:03:37 -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;
	6 Nov 2015 13:03:37 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugg4-0000sR-M7
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugg4-0004Qg-Hu
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:36 +0000
Date: Fri, 06 Nov 2015 13:03:36 +0000
Message-Id: <E1Zugg4-0004Qg-Hu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vmx: improvements to vmentry
	failure 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 bbcf0b218f64b1e3e2b66b0fbb623f51d9014e81
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:14:02 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:14:02 2015 +0100

    x86/vmx: improvements to vmentry failure handling
    
    Combine the almost identical vm_launch_fail() and vm_resume_fail() into a
    single vmx_vmentry_failure().
    
    Re-save all GPRs so that domain_crash() prints the real register values,
    rather than the stack frame of the vmx_vmentry_failure() call.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/entry.S |    9 +++++----
 xen/arch/x86/hvm/vmx/vmcs.c  |   15 ++++-----------
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
index 2a4ed57..a5438a4 100644
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -101,14 +101,15 @@ UNLIKELY_END(realmode)
 
 /*.Lvmx_resume:*/
         VMRESUME
-        sti
-        call vm_resume_fail
-        ud2
+        jmp  .Lvmx_vmentry_fail
 
 .Lvmx_launch:
         VMLAUNCH
+
+.Lvmx_vmentry_fail:
         sti
-        call vm_launch_fail
+        SAVE_ALL
+        call vmx_vmentry_failure
         ud2
 
 ENTRY(vmx_asm_do_vmentry)
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 4ea1ad1..53207e6 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1612,21 +1612,14 @@ void vmx_destroy_vmcs(struct vcpu *v)
     free_xenheap_page(v->arch.hvm_vmx.msr_bitmap);
 }
 
-void vm_launch_fail(void)
-{
-    unsigned long error;
-
-    __vmread(VM_INSTRUCTION_ERROR, &error);
-    printk("<vm_launch_fail> error code %lx\n", error);
-    domain_crash_synchronous();
-}
-
-void vm_resume_fail(void)
+void vmx_vmentry_failure(void)
 {
+    struct vcpu *curr = current;
     unsigned long error;
 
     __vmread(VM_INSTRUCTION_ERROR, &error);
-    printk("<vm_resume_fail> error code %lx\n", error);
+    gprintk(XENLOG_ERR, "VM%s error: %#lx\n",
+            curr->arch.hvm_vmx.launched ? "RESUME" : "LAUNCH", error);
     domain_crash_synchronous();
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:03:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:03:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZuggJ-0004Bs-66; Fri, 06 Nov 2015 13:03:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggH-0004Be-SN
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:49 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	D0/5C-29649-535AC365; Fri, 06 Nov 2015 13:03:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446815027!1620782!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37716 invoked from network); 6 Nov 2015 13:03:48 -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;
	6 Nov 2015 13:03:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggE-0000sW-Vr
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggE-0004RC-Tu
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:46 +0000
Date: Fri, 06 Nov 2015 13:03:46 +0000
Message-Id: <E1ZuggE-0004RC-Tu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: replace unqualified ud2
	instructions with BUG frames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a84e4d094a25c5a6b1a2e677059abd3e19b57924
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:14:27 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:14:27 2015 +0100

    x86: replace unqualified ud2 instructions with BUG frames
    
    No functional change, other than the failure cases, which now produce a
    far more clear error message.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/boot/x86_64.S      |    2 +-
 xen/arch/x86/hvm/vmx/entry.S    |    2 +-
 xen/arch/x86/x86_64/entry.S     |    4 ++--
 xen/include/asm-x86/asm_defns.h |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S
index c8bf9d0..94cf089 100644
--- a/xen/arch/x86/boot/x86_64.S
+++ b/xen/arch/x86/boot/x86_64.S
@@ -34,7 +34,7 @@ ENTRY(__high_start)
         /* Pass off the Multiboot info structure to C land. */
         mov     multiboot_ptr(%rip),%edi
         call    __start_xen
-        ud2     /* Force a panic (invalid opcode). */
+        BUG     /* __start_xen() shouldn't return. */
 
 /*** DESCRIPTOR TABLES ***/
 
diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
index a5438a4..5a1757e 100644
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -110,7 +110,7 @@ UNLIKELY_END(realmode)
         sti
         SAVE_ALL
         call vmx_vmentry_failure
-        ud2
+        BUG  /* vmx_vmentry_failure() shouldn't return. */
 
 ENTRY(vmx_asm_do_vmentry)
         GET_CURRENT(%rbx)
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 28c3214..d4dd8e8 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -547,7 +547,7 @@ exception_with_ints_disabled:
 FATAL_exception_with_ints_disabled:
         movq  %rsp,%rdi
         call  fatal_trap
-        ud2
+        BUG   /* fatal_trap() shouldn't return. */
 
 ENTRY(divide_error)
         pushq $0
@@ -620,7 +620,7 @@ ENTRY(double_fault)
         SAVE_ALL STAC
         movq  %rsp,%rdi
         call  do_double_fault
-        ud2
+        BUG   /* do_double_fault() shouldn't return. */
 
         .pushsection .init.text, "ax", @progbits
 ENTRY(early_page_fault)
diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h
index d750f03..95ea21d 100644
--- a/xen/include/asm-x86/asm_defns.h
+++ b/xen/include/asm-x86/asm_defns.h
@@ -324,7 +324,7 @@ static always_inline void stac(void)
         jne   789f
         cmpq  UREGS_r12(%rsp),%r12
         je    987f
-789:    ud2
+789:    BUG   /* Corruption of partial register state. */
         .subsection 0
 #endif
 .endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:03:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:03:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZuggJ-0004Bs-66; Fri, 06 Nov 2015 13:03:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggH-0004Be-SN
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:49 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	D0/5C-29649-535AC365; Fri, 06 Nov 2015 13:03:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446815027!1620782!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37716 invoked from network); 6 Nov 2015 13:03:48 -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;
	6 Nov 2015 13:03:48 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggE-0000sW-Vr
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggE-0004RC-Tu
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:46 +0000
Date: Fri, 06 Nov 2015 13:03:46 +0000
Message-Id: <E1ZuggE-0004RC-Tu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: replace unqualified ud2
	instructions with BUG frames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a84e4d094a25c5a6b1a2e677059abd3e19b57924
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:14:27 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:14:27 2015 +0100

    x86: replace unqualified ud2 instructions with BUG frames
    
    No functional change, other than the failure cases, which now produce a
    far more clear error message.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/boot/x86_64.S      |    2 +-
 xen/arch/x86/hvm/vmx/entry.S    |    2 +-
 xen/arch/x86/x86_64/entry.S     |    4 ++--
 xen/include/asm-x86/asm_defns.h |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S
index c8bf9d0..94cf089 100644
--- a/xen/arch/x86/boot/x86_64.S
+++ b/xen/arch/x86/boot/x86_64.S
@@ -34,7 +34,7 @@ ENTRY(__high_start)
         /* Pass off the Multiboot info structure to C land. */
         mov     multiboot_ptr(%rip),%edi
         call    __start_xen
-        ud2     /* Force a panic (invalid opcode). */
+        BUG     /* __start_xen() shouldn't return. */
 
 /*** DESCRIPTOR TABLES ***/
 
diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
index a5438a4..5a1757e 100644
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -110,7 +110,7 @@ UNLIKELY_END(realmode)
         sti
         SAVE_ALL
         call vmx_vmentry_failure
-        ud2
+        BUG  /* vmx_vmentry_failure() shouldn't return. */
 
 ENTRY(vmx_asm_do_vmentry)
         GET_CURRENT(%rbx)
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 28c3214..d4dd8e8 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -547,7 +547,7 @@ exception_with_ints_disabled:
 FATAL_exception_with_ints_disabled:
         movq  %rsp,%rdi
         call  fatal_trap
-        ud2
+        BUG   /* fatal_trap() shouldn't return. */
 
 ENTRY(divide_error)
         pushq $0
@@ -620,7 +620,7 @@ ENTRY(double_fault)
         SAVE_ALL STAC
         movq  %rsp,%rdi
         call  do_double_fault
-        ud2
+        BUG   /* do_double_fault() shouldn't return. */
 
         .pushsection .init.text, "ax", @progbits
 ENTRY(early_page_fault)
diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h
index d750f03..95ea21d 100644
--- a/xen/include/asm-x86/asm_defns.h
+++ b/xen/include/asm-x86/asm_defns.h
@@ -324,7 +324,7 @@ static always_inline void stac(void)
         jne   789f
         cmpq  UREGS_r12(%rsp),%r12
         je    987f
-789:    ud2
+789:    BUG   /* Corruption of partial register state. */
         .subsection 0
 #endif
 .endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:04:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZuggT-0004DK-B3; Fri, 06 Nov 2015 13:04:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggR-0004D3-Si
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:00 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	01/B1-01753-E35AC365; Fri, 06 Nov 2015 13:03:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446815037!1620842!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39978 invoked from network); 6 Nov 2015 13:03:58 -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;
	6 Nov 2015 13:03:58 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggP-0000sm-7x
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggP-0004Ri-6B
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:57 +0000
Date: Fri, 06 Nov 2015 13:03:57 +0000
Message-Id: <E1ZuggP-0004Ri-6B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/bug: break out the internals of
	BUG_FRAME()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d90b8f8c9fa7ebc07aa0e5f3e553411434ae8ac5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:14:49 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:14:49 2015 +0100

    x86/bug: break out the internals of BUG_FRAME()
    
    To allow bug frames can be created inside existing asm() statements.  In
    order to do so, the current bugframe positional parameters are altered
    to be named parameters, to avoid interactions with the parameters of the
    existing asm() statement.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/asm-x86/bug.h |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/xen/include/asm-x86/bug.h b/xen/include/asm-x86/bug.h
index cec6bce..e868e85 100644
--- a/xen/include/asm-x86/bug.h
+++ b/xen/include/asm-x86/bug.h
@@ -29,23 +29,30 @@ struct bug_frame {
                       ((1 << BUG_LINE_LO_WIDTH) - 1)))
 #define bug_msg(b) ((const char *)(b) + (b)->msg_disp[1])
 
+#define _ASM_BUGFRAME_TEXT(second_frame)                                     \
+    ".Lbug%=: ud2\n"                                                         \
+    ".pushsection .bug_frames.%c[bf_type], \"a\", @progbits\n"               \
+    ".p2align 2\n"                                                           \
+    ".Lfrm%=:\n"                                                             \
+    ".long (.Lbug%= - .Lfrm%=) + %c[bf_line_hi]\n"                           \
+    ".long (%c[bf_ptr] - .Lfrm%=) + %c[bf_line_lo]\n"                        \
+    ".if " #second_frame "\n"                                                \
+    ".long 0, %c[bf_msg] - .Lfrm%=\n"                                        \
+    ".endif\n"                                                               \
+    ".popsection\n"                                                          \
+
+#define _ASM_BUGFRAME_INFO(type, line, ptr, msg)                             \
+    [bf_type]    "i" (type),                                                 \
+    [bf_ptr]     "i" (ptr),                                                  \
+    [bf_msg]     "i" (msg),                                                  \
+    [bf_line_lo] "i" ((line & ((1 << BUG_LINE_LO_WIDTH) - 1))                \
+                      << BUG_DISP_WIDTH),                                    \
+    [bf_line_hi] "i" (((line) >> BUG_LINE_LO_WIDTH) << BUG_DISP_WIDTH)
+
 #define BUG_FRAME(type, line, ptr, second_frame, msg) do {                   \
     BUILD_BUG_ON((line) >> (BUG_LINE_LO_WIDTH + BUG_LINE_HI_WIDTH));         \
-    asm volatile ( ".Lbug%=: ud2\n"                                          \
-                   ".pushsection .bug_frames.%c0, \"a\", @progbits\n"        \
-                   ".p2align 2\n"                                            \
-                   ".Lfrm%=:\n"                                              \
-                   ".long (.Lbug%= - .Lfrm%=) + %c4\n"                       \
-                   ".long (%c1 - .Lfrm%=) + %c3\n"                           \
-                   ".if " #second_frame "\n"                                 \
-                   ".long 0, %c2 - .Lfrm%=\n"                                \
-                   ".endif\n"                                                \
-                   ".popsection"                                             \
-                   :                                                         \
-                   : "i" (type), "i" (ptr), "i" (msg),                       \
-                     "i" ((line & ((1 << BUG_LINE_LO_WIDTH) - 1))            \
-                          << BUG_DISP_WIDTH),                                \
-                     "i" (((line) >> BUG_LINE_LO_WIDTH) << BUG_DISP_WIDTH)); \
+    asm volatile ( _ASM_BUGFRAME_TEXT(second_frame)                          \
+                   :: _ASM_BUGFRAME_INFO(type, line, ptr, msg) );            \
 } while (0)
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:04:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZuggT-0004DK-B3; Fri, 06 Nov 2015 13:04:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggR-0004D3-Si
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:00 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	01/B1-01753-E35AC365; Fri, 06 Nov 2015 13:03:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1446815037!1620842!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39978 invoked from network); 6 Nov 2015 13:03:58 -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;
	6 Nov 2015 13:03:58 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggP-0000sm-7x
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggP-0004Ri-6B
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:03:57 +0000
Date: Fri, 06 Nov 2015 13:03:57 +0000
Message-Id: <E1ZuggP-0004Ri-6B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/bug: break out the internals of
	BUG_FRAME()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d90b8f8c9fa7ebc07aa0e5f3e553411434ae8ac5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:14:49 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:14:49 2015 +0100

    x86/bug: break out the internals of BUG_FRAME()
    
    To allow bug frames can be created inside existing asm() statements.  In
    order to do so, the current bugframe positional parameters are altered
    to be named parameters, to avoid interactions with the parameters of the
    existing asm() statement.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/asm-x86/bug.h |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/xen/include/asm-x86/bug.h b/xen/include/asm-x86/bug.h
index cec6bce..e868e85 100644
--- a/xen/include/asm-x86/bug.h
+++ b/xen/include/asm-x86/bug.h
@@ -29,23 +29,30 @@ struct bug_frame {
                       ((1 << BUG_LINE_LO_WIDTH) - 1)))
 #define bug_msg(b) ((const char *)(b) + (b)->msg_disp[1])
 
+#define _ASM_BUGFRAME_TEXT(second_frame)                                     \
+    ".Lbug%=: ud2\n"                                                         \
+    ".pushsection .bug_frames.%c[bf_type], \"a\", @progbits\n"               \
+    ".p2align 2\n"                                                           \
+    ".Lfrm%=:\n"                                                             \
+    ".long (.Lbug%= - .Lfrm%=) + %c[bf_line_hi]\n"                           \
+    ".long (%c[bf_ptr] - .Lfrm%=) + %c[bf_line_lo]\n"                        \
+    ".if " #second_frame "\n"                                                \
+    ".long 0, %c[bf_msg] - .Lfrm%=\n"                                        \
+    ".endif\n"                                                               \
+    ".popsection\n"                                                          \
+
+#define _ASM_BUGFRAME_INFO(type, line, ptr, msg)                             \
+    [bf_type]    "i" (type),                                                 \
+    [bf_ptr]     "i" (ptr),                                                  \
+    [bf_msg]     "i" (msg),                                                  \
+    [bf_line_lo] "i" ((line & ((1 << BUG_LINE_LO_WIDTH) - 1))                \
+                      << BUG_DISP_WIDTH),                                    \
+    [bf_line_hi] "i" (((line) >> BUG_LINE_LO_WIDTH) << BUG_DISP_WIDTH)
+
 #define BUG_FRAME(type, line, ptr, second_frame, msg) do {                   \
     BUILD_BUG_ON((line) >> (BUG_LINE_LO_WIDTH + BUG_LINE_HI_WIDTH));         \
-    asm volatile ( ".Lbug%=: ud2\n"                                          \
-                   ".pushsection .bug_frames.%c0, \"a\", @progbits\n"        \
-                   ".p2align 2\n"                                            \
-                   ".Lfrm%=:\n"                                              \
-                   ".long (.Lbug%= - .Lfrm%=) + %c4\n"                       \
-                   ".long (%c1 - .Lfrm%=) + %c3\n"                           \
-                   ".if " #second_frame "\n"                                 \
-                   ".long 0, %c2 - .Lfrm%=\n"                                \
-                   ".endif\n"                                                \
-                   ".popsection"                                             \
-                   :                                                         \
-                   : "i" (type), "i" (ptr), "i" (msg),                       \
-                     "i" ((line & ((1 << BUG_LINE_LO_WIDTH) - 1))            \
-                          << BUG_DISP_WIDTH),                                \
-                     "i" (((line) >> BUG_LINE_LO_WIDTH) << BUG_DISP_WIDTH)); \
+    asm volatile ( _ASM_BUGFRAME_TEXT(second_frame)                          \
+                   :: _ASM_BUGFRAME_INFO(type, line, ptr, msg) );            \
 } while (0)
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:04:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04: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 1Zuggd-0004FO-IC; Fri, 06 Nov 2015 13:04: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 1Zuggc-0004F6-Cg
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:10 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	C9/BA-00536-945AC365; Fri, 06 Nov 2015 13:04:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446815047!1637576!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39921 invoked from network); 6 Nov 2015 13:04:08 -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 Nov 2015 13:04:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggZ-0000tP-OJ
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggZ-0004SM-Fk
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:07 +0000
Date: Fri, 06 Nov 2015 13:04:07 +0000
Message-Id: <E1ZuggZ-0004SM-Fk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vmx: replace unqualified ud2
	instructions with BUG frames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6fc78e13f4770a27237804e484eef7f87b763286
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:15:15 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:15:15 2015 +0100

    x86/vmx: replace unqualified ud2 instructions with BUG frames
    
    Using new _ASM_BUGFRAME* internals.
    
    A side effect of complicating the ASM statements is that GCC now chooses to
    out-of-line the stub functions, resulting in identical copies being present in
    all translation units.  As with the stac()/clac() stubs, force them always
    inline.
    
    No functional change, other than the failure cases, which now produce a
    far more clear error message.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/include/asm-x86/hvm/vmx/vmx.h |   70 ++++++++++++++++++++----------------
 1 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index e750a76..f16a306 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -281,7 +281,7 @@ extern uint8_t posted_intr_vector;
 #define INVVPID_ALL_CONTEXT                     2
 #define INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL 3
 
-static inline void __vmptrld(u64 addr)
+static always_inline void __vmptrld(u64 addr)
 {
     asm volatile (
 #ifdef HAVE_GAS_VMX
@@ -289,20 +289,21 @@ static inline void __vmptrld(u64 addr)
 #else
                    VMPTRLD_OPCODE MODRM_EAX_06
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmptrld)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
 #ifdef HAVE_GAS_VMX
-                   : "m" (addr)
+                   : "m" (addr),
 #else
-                   : "a" (&addr)
+                   : "a" (&addr),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory");
 }
 
-static inline void __vmpclear(u64 addr)
+static always_inline void __vmpclear(u64 addr)
 {
     asm volatile (
 #ifdef HAVE_GAS_VMX
@@ -310,20 +311,21 @@ static inline void __vmpclear(u64 addr)
 #else
                    VMCLEAR_OPCODE MODRM_EAX_06
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmclear)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
 #ifdef HAVE_GAS_VMX
-                   : "m" (addr)
+                   : "m" (addr),
 #else
-                   : "a" (&addr)
+                   : "a" (&addr),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory");
 }
 
-static inline void __vmread(unsigned long field, unsigned long *value)
+static always_inline void __vmread(unsigned long field, unsigned long *value)
 {
     asm volatile (
 #ifdef HAVE_GAS_VMX
@@ -331,20 +333,22 @@ static inline void __vmread(unsigned long field, unsigned long *value)
 #else
                    VMREAD_OPCODE MODRM_EAX_ECX
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmread)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
 #ifdef HAVE_GAS_VMX
                    : "=rm" (*value)
-                   : "r" (field));
+                   : "r" (field),
 #else
                    : "=c" (*value)
-                   : "a" (field));
+                   : "a" (field),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
+        );
 }
 
-static inline void __vmwrite(unsigned long field, unsigned long value)
+static always_inline void __vmwrite(unsigned long field, unsigned long value)
 {
     asm volatile (
 #ifdef HAVE_GAS_VMX
@@ -352,16 +356,18 @@ static inline void __vmwrite(unsigned long field, unsigned long value)
 #else
                    VMWRITE_OPCODE MODRM_EAX_ECX
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmwrite)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
-                   : 
+                   :
 #ifdef HAVE_GAS_VMX
-                   : "r" (field) , "rm" (value));
+                   : "r" (field) , "rm" (value),
 #else
-                   : "a" (field) , "c" (value));
+                   : "a" (field) , "c" (value),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
+        );
 }
 
 static inline bool_t __vmread_safe(unsigned long field, unsigned long *value)
@@ -387,7 +393,7 @@ static inline bool_t __vmread_safe(unsigned long field, unsigned long *value)
     return okay;
 }
 
-static inline void __invept(unsigned long type, u64 eptp, u64 gpa)
+static always_inline void __invept(unsigned long type, u64 eptp, u64 gpa)
 {
     struct {
         u64 eptp, gpa;
@@ -407,20 +413,21 @@ static inline void __invept(unsigned long type, u64 eptp, u64 gpa)
 #else
                    INVEPT_OPCODE MODRM_EAX_08
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, invept)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
 #ifdef HAVE_GAS_EPT
-                   : "m" (operand), "r" (type)
+                   : "m" (operand), "r" (type),
 #else
-                   : "a" (&operand), "c" (type)
+                   : "a" (&operand), "c" (type),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory" );
 }
 
-static inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
+static always_inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
 {
     struct __packed {
         u64 vpid:16;
@@ -435,18 +442,19 @@ static inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
 #else
                    INVVPID_OPCODE MODRM_EAX_08
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, invvpid)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION "\n"
                    "2:"
                    _ASM_EXTABLE(1b, 2b)
                    :
 #ifdef HAVE_GAS_EPT
-                   : "m" (operand), "r" (type)
+                   : "m" (operand), "r" (type),
 #else
-                   : "a" (&operand), "c" (type)
+                   : "a" (&operand), "c" (type),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory" );
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:04:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04: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 1Zuggd-0004FO-IC; Fri, 06 Nov 2015 13:04: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 1Zuggc-0004F6-Cg
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:10 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	C9/BA-00536-945AC365; Fri, 06 Nov 2015 13:04:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1446815047!1637576!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39921 invoked from network); 6 Nov 2015 13:04:08 -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 Nov 2015 13:04:08 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggZ-0000tP-OJ
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZuggZ-0004SM-Fk
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:07 +0000
Date: Fri, 06 Nov 2015 13:04:07 +0000
Message-Id: <E1ZuggZ-0004SM-Fk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vmx: replace unqualified ud2
	instructions with BUG frames
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6fc78e13f4770a27237804e484eef7f87b763286
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:15:15 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:15:15 2015 +0100

    x86/vmx: replace unqualified ud2 instructions with BUG frames
    
    Using new _ASM_BUGFRAME* internals.
    
    A side effect of complicating the ASM statements is that GCC now chooses to
    out-of-line the stub functions, resulting in identical copies being present in
    all translation units.  As with the stac()/clac() stubs, force them always
    inline.
    
    No functional change, other than the failure cases, which now produce a
    far more clear error message.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/include/asm-x86/hvm/vmx/vmx.h |   70 ++++++++++++++++++++----------------
 1 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index e750a76..f16a306 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -281,7 +281,7 @@ extern uint8_t posted_intr_vector;
 #define INVVPID_ALL_CONTEXT                     2
 #define INVVPID_SINGLE_CONTEXT_RETAINING_GLOBAL 3
 
-static inline void __vmptrld(u64 addr)
+static always_inline void __vmptrld(u64 addr)
 {
     asm volatile (
 #ifdef HAVE_GAS_VMX
@@ -289,20 +289,21 @@ static inline void __vmptrld(u64 addr)
 #else
                    VMPTRLD_OPCODE MODRM_EAX_06
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmptrld)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
 #ifdef HAVE_GAS_VMX
-                   : "m" (addr)
+                   : "m" (addr),
 #else
-                   : "a" (&addr)
+                   : "a" (&addr),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory");
 }
 
-static inline void __vmpclear(u64 addr)
+static always_inline void __vmpclear(u64 addr)
 {
     asm volatile (
 #ifdef HAVE_GAS_VMX
@@ -310,20 +311,21 @@ static inline void __vmpclear(u64 addr)
 #else
                    VMCLEAR_OPCODE MODRM_EAX_06
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmclear)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
 #ifdef HAVE_GAS_VMX
-                   : "m" (addr)
+                   : "m" (addr),
 #else
-                   : "a" (&addr)
+                   : "a" (&addr),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory");
 }
 
-static inline void __vmread(unsigned long field, unsigned long *value)
+static always_inline void __vmread(unsigned long field, unsigned long *value)
 {
     asm volatile (
 #ifdef HAVE_GAS_VMX
@@ -331,20 +333,22 @@ static inline void __vmread(unsigned long field, unsigned long *value)
 #else
                    VMREAD_OPCODE MODRM_EAX_ECX
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmread)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
 #ifdef HAVE_GAS_VMX
                    : "=rm" (*value)
-                   : "r" (field));
+                   : "r" (field),
 #else
                    : "=c" (*value)
-                   : "a" (field));
+                   : "a" (field),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
+        );
 }
 
-static inline void __vmwrite(unsigned long field, unsigned long value)
+static always_inline void __vmwrite(unsigned long field, unsigned long value)
 {
     asm volatile (
 #ifdef HAVE_GAS_VMX
@@ -352,16 +356,18 @@ static inline void __vmwrite(unsigned long field, unsigned long value)
 #else
                    VMWRITE_OPCODE MODRM_EAX_ECX
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, vmwrite)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
-                   : 
+                   :
 #ifdef HAVE_GAS_VMX
-                   : "r" (field) , "rm" (value));
+                   : "r" (field) , "rm" (value),
 #else
-                   : "a" (field) , "c" (value));
+                   : "a" (field) , "c" (value),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
+        );
 }
 
 static inline bool_t __vmread_safe(unsigned long field, unsigned long *value)
@@ -387,7 +393,7 @@ static inline bool_t __vmread_safe(unsigned long field, unsigned long *value)
     return okay;
 }
 
-static inline void __invept(unsigned long type, u64 eptp, u64 gpa)
+static always_inline void __invept(unsigned long type, u64 eptp, u64 gpa)
 {
     struct {
         u64 eptp, gpa;
@@ -407,20 +413,21 @@ static inline void __invept(unsigned long type, u64 eptp, u64 gpa)
 #else
                    INVEPT_OPCODE MODRM_EAX_08
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, invept)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION
                    :
 #ifdef HAVE_GAS_EPT
-                   : "m" (operand), "r" (type)
+                   : "m" (operand), "r" (type),
 #else
-                   : "a" (&operand), "c" (type)
+                   : "a" (&operand), "c" (type),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory" );
 }
 
-static inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
+static always_inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
 {
     struct __packed {
         u64 vpid:16;
@@ -435,18 +442,19 @@ static inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
 #else
                    INVVPID_OPCODE MODRM_EAX_08
 #endif
-                   /* CF==1 or ZF==1 --> crash (ud2) */
+                   /* CF==1 or ZF==1 --> BUG() */
                    UNLIKELY_START(be, invvpid)
-                   "\tud2\n"
+                   _ASM_BUGFRAME_TEXT(0)
                    UNLIKELY_END_SECTION "\n"
                    "2:"
                    _ASM_EXTABLE(1b, 2b)
                    :
 #ifdef HAVE_GAS_EPT
-                   : "m" (operand), "r" (type)
+                   : "m" (operand), "r" (type),
 #else
-                   : "a" (&operand), "c" (type)
+                   : "a" (&operand), "c" (type),
 #endif
+                     _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__, __FILE__, 0)
                    : "memory" );
 }
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:04:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04: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 1Zuggm-0004HI-NM; Fri, 06 Nov 2015 13:04: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 1Zuggm-0004H6-6v
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:20 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	30/6B-00536-355AC365; Fri, 06 Nov 2015 13:04:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1446815058!1019284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13901 invoked from network); 6 Nov 2015 13:04:19 -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;
	6 Nov 2015 13:04:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuggk-0000tX-2A
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuggj-0004TA-VN
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:18 +0000
Date: Fri, 06 Nov 2015 13:04:17 +0000
Message-Id: <E1Zuggj-0004TA-VN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: correct {a,
	m}perf check in generic_identify()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b104a0ad2880123b0d36b57af0478cf56b9b412c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:15:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:15:39 2015 +0100

    x86: correct {a,m}perf check in generic_identify()
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/cpu/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 653b052..02f2504 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -239,7 +239,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	if ( cpu_has(c, X86_FEATURE_CLFLSH) )
 		c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
 
-	if ( (c->cpuid_level > CPUID_PM_LEAF) &&
+	if ( (c->cpuid_level >= CPUID_PM_LEAF) &&
 	     (cpuid_ecx(CPUID_PM_LEAF) & CPUID6_ECX_APERFMPERF_CAPABILITY) )
 		set_bit(X86_FEATURE_APERFMPERF, c->x86_capability);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:04:20 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04: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 1Zuggm-0004HI-NM; Fri, 06 Nov 2015 13:04: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 1Zuggm-0004H6-6v
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:20 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	30/6B-00536-355AC365; Fri, 06 Nov 2015 13:04:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1446815058!1019284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13901 invoked from network); 6 Nov 2015 13:04:19 -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;
	6 Nov 2015 13:04:19 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuggk-0000tX-2A
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuggj-0004TA-VN
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:18 +0000
Date: Fri, 06 Nov 2015 13:04:17 +0000
Message-Id: <E1Zuggj-0004TA-VN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: correct {a,
	m}perf check in generic_identify()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b104a0ad2880123b0d36b57af0478cf56b9b412c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:15:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:15:39 2015 +0100

    x86: correct {a,m}perf check in generic_identify()
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/cpu/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 653b052..02f2504 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -239,7 +239,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	if ( cpu_has(c, X86_FEATURE_CLFLSH) )
 		c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
 
-	if ( (c->cpuid_level > CPUID_PM_LEAF) &&
+	if ( (c->cpuid_level >= CPUID_PM_LEAF) &&
 	     (cpuid_ecx(CPUID_PM_LEAF) & CPUID6_ECX_APERFMPERF_CAPABILITY) )
 		set_bit(X86_FEATURE_APERFMPERF, c->x86_capability);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:04:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04: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 1Zuggx-0004J6-TM; Fri, 06 Nov 2015 13:04: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 1Zuggw-0004Iu-Ej
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:30 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	19/21-24856-D55AC365; Fri, 06 Nov 2015 13:04:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1446815068!1583500!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17825 invoked from network); 6 Nov 2015 13:04:29 -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;
	6 Nov 2015 13:04:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuggu-0000tk-Cy
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuggu-0004US-Ax
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:28 +0000
Date: Fri, 06 Nov 2015 13:04:28 +0000
Message-Id: <E1Zuggu-0004US-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: query for paddr_bits in
	early_cpu_detect()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32b31c17da1ba0da970cd182a8865ac20fabd0fa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:15:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:15:58 2015 +0100

    x86: query for paddr_bits in early_cpu_detect()
    
    It is __read_mostly, so repeatedly writing to it is suboptiomal.  As the
    MTRRs have already been set up, nothing good will come from its value
    changing across CPUs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/cpu/common.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 02f2504..ac8a258 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -207,6 +207,9 @@ static void __init early_cpu_detect(void)
 	/* Leaf 0x1 capabilities filled in early for Xen. */
 	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = cap0;
 	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = cap4;
+
+	if ( cpuid_eax(0x80000000) >= 0x80000008 )
+		paddr_bits = cpuid_eax(0x80000008) & 0xff;
 }
 
 static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
@@ -254,8 +257,6 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 		}
 		if ( c->extended_cpuid_level >= 0x80000004 )
 			get_model_name(c); /* Default name */
-		if ( c->extended_cpuid_level >= 0x80000008 )
-			paddr_bits = cpuid_eax(0x80000008) & 0xff;
 	}
 
 	/* Might lift BIOS max_leaf=3 limit. */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:04:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04: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 1Zuggx-0004J6-TM; Fri, 06 Nov 2015 13:04: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 1Zuggw-0004Iu-Ej
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:30 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	19/21-24856-D55AC365; Fri, 06 Nov 2015 13:04:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1446815068!1583500!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17825 invoked from network); 6 Nov 2015 13:04:29 -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;
	6 Nov 2015 13:04:29 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuggu-0000tk-Cy
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zuggu-0004US-Ax
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:28 +0000
Date: Fri, 06 Nov 2015 13:04:28 +0000
Message-Id: <E1Zuggu-0004US-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: query for paddr_bits in
	early_cpu_detect()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 32b31c17da1ba0da970cd182a8865ac20fabd0fa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 3 18:15:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 3 18:15:58 2015 +0100

    x86: query for paddr_bits in early_cpu_detect()
    
    It is __read_mostly, so repeatedly writing to it is suboptiomal.  As the
    MTRRs have already been set up, nothing good will come from its value
    changing across CPUs.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/cpu/common.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 02f2504..ac8a258 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -207,6 +207,9 @@ static void __init early_cpu_detect(void)
 	/* Leaf 0x1 capabilities filled in early for Xen. */
 	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = cap0;
 	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = cap4;
+
+	if ( cpuid_eax(0x80000000) >= 0x80000008 )
+		paddr_bits = cpuid_eax(0x80000008) & 0xff;
 }
 
 static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
@@ -254,8 +257,6 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 		}
 		if ( c->extended_cpuid_level >= 0x80000004 )
 			get_model_name(c); /* Default name */
-		if ( c->extended_cpuid_level >= 0x80000008 )
-			paddr_bits = cpuid_eax(0x80000008) & 0xff;
 	}
 
 	/* Might lift BIOS max_leaf=3 limit. */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:04:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04: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 1Zugh8-0004Kc-2E; Fri, 06 Nov 2015 13:04:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugh6-0004KQ-Rd
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:40 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	48/FC-13905-865AC365; Fri, 06 Nov 2015 13:04:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446815078!1585528!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54223 invoked from network); 6 Nov 2015 13:04:39 -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;
	6 Nov 2015 13:04:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugh4-0000tp-PI
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugh4-0004V7-Lf
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:38 +0000
Date: Fri, 06 Nov 2015 13:04:38 +0000
Message-Id: <E1Zugh4-0004V7-Lf@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 700772bc13a3d4e7a61cea166893c0f53b251f08
Merge: 8d05834df2612b8dfce93a0afd7425971c30143b 32b31c17da1ba0da970cd182a8865ac20fabd0fa
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 4 09:38:51 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 4 09:38:51 2015 +0000

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

 xen/Rules.mk                             |   11 ++-
 xen/arch/arm/Makefile                    |    6 +-
 xen/arch/x86/Makefile                    |   20 +++--
 xen/arch/x86/boot/x86_64.S               |    2 +-
 xen/arch/x86/cpu/common.c                |    7 +-
 xen/arch/x86/hvm/vmx/entry.S             |   11 ++-
 xen/arch/x86/hvm/vmx/vmcs.c              |   15 +---
 xen/arch/x86/mm/hap/hap.c                |    6 +-
 xen/arch/x86/x86_64/Makefile             |    4 -
 xen/arch/x86/x86_64/compat.c             |    3 +-
 xen/arch/x86/x86_64/entry.S              |    4 +-
 xen/arch/x86/x86_64/mm.c                 |    3 +-
 xen/arch/x86/x86_64/physdev.c            |    3 +-
 xen/arch/x86/x86_64/platform_hypercall.c |    3 +-
 xen/common/Makefile                      |    2 +-
 xen/common/compat/Makefile               |    6 --
 xen/common/compat/domain.c               |    3 +-
 xen/common/compat/kernel.c               |    3 +-
 xen/common/compat/memory.c               |    3 +-
 xen/common/compat/multicall.c            |    3 +-
 xen/common/schedule.c                    |    4 +-
 xen/include/Makefile                     |    2 +-
 xen/include/asm-x86/asm_defns.h          |    2 +-
 xen/include/asm-x86/bug.h                |   37 +++++----
 xen/include/asm-x86/hvm/vmx/vmx.h        |   70 +++++++++-------
 xen/tools/symbols.c                      |  129 +++++++++++++++++++++++++++---
 26 files changed, 242 insertions(+), 120 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 Nov 06 13:04:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04: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 1Zugh8-0004Kc-2E; Fri, 06 Nov 2015 13:04:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugh6-0004KQ-Rd
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:40 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	48/FC-13905-865AC365; Fri, 06 Nov 2015 13:04:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1446815078!1585528!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54223 invoked from network); 6 Nov 2015 13:04:39 -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;
	6 Nov 2015 13:04:39 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugh4-0000tp-PI
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugh4-0004V7-Lf
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:38 +0000
Date: Fri, 06 Nov 2015 13:04:38 +0000
Message-Id: <E1Zugh4-0004V7-Lf@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 700772bc13a3d4e7a61cea166893c0f53b251f08
Merge: 8d05834df2612b8dfce93a0afd7425971c30143b 32b31c17da1ba0da970cd182a8865ac20fabd0fa
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 4 09:38:51 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 4 09:38:51 2015 +0000

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

 xen/Rules.mk                             |   11 ++-
 xen/arch/arm/Makefile                    |    6 +-
 xen/arch/x86/Makefile                    |   20 +++--
 xen/arch/x86/boot/x86_64.S               |    2 +-
 xen/arch/x86/cpu/common.c                |    7 +-
 xen/arch/x86/hvm/vmx/entry.S             |   11 ++-
 xen/arch/x86/hvm/vmx/vmcs.c              |   15 +---
 xen/arch/x86/mm/hap/hap.c                |    6 +-
 xen/arch/x86/x86_64/Makefile             |    4 -
 xen/arch/x86/x86_64/compat.c             |    3 +-
 xen/arch/x86/x86_64/entry.S              |    4 +-
 xen/arch/x86/x86_64/mm.c                 |    3 +-
 xen/arch/x86/x86_64/physdev.c            |    3 +-
 xen/arch/x86/x86_64/platform_hypercall.c |    3 +-
 xen/common/Makefile                      |    2 +-
 xen/common/compat/Makefile               |    6 --
 xen/common/compat/domain.c               |    3 +-
 xen/common/compat/kernel.c               |    3 +-
 xen/common/compat/memory.c               |    3 +-
 xen/common/compat/multicall.c            |    3 +-
 xen/common/schedule.c                    |    4 +-
 xen/include/Makefile                     |    2 +-
 xen/include/asm-x86/asm_defns.h          |    2 +-
 xen/include/asm-x86/bug.h                |   37 +++++----
 xen/include/asm-x86/hvm/vmx/vmx.h        |   70 +++++++++-------
 xen/tools/symbols.c                      |  129 +++++++++++++++++++++++++++---
 26 files changed, 242 insertions(+), 120 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 Nov 06 13:04:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04: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 1ZughJ-0004Lz-6o; Fri, 06 Nov 2015 13:04:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughH-0004Ln-KA
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:51 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	5C/42-03763-275AC365; Fri, 06 Nov 2015 13:04:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1446815089!1551576!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11245 invoked from network); 6 Nov 2015 13:04:50 -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;
	6 Nov 2015 13:04:50 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughF-0000u0-4M
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughF-0004Vj-0p
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:49 +0000
Date: Fri, 06 Nov 2015 13:04:49 +0000
Message-Id: <E1ZughF-0004Vj-0p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: initialise rc before using it in
	vcpuset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6919a7dde48bf1a9314c328bfb93a8a2f741bb80
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Nov 4 11:32:57 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 4 11:37:33 2015 +0000

    xl: initialise rc before using it in vcpuset
    
    In 5b725e56 (xl: improve return and exit codes of vcpu related
    functions), the return value of libxl_cpu_bitmap_alloc was not stored in
    rc anymore. Yet the subsequent fprintf still used that.
    
    Reinstate the original implementation, that is, to store return value of
    libxl_cpu_bitmap_alloc in rc before using rc.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 2756d2f..9b6b42c 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5473,7 +5473,8 @@ static int vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
         if (rc)
             return 1;
     }
-    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus)) {
+    rc = libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus);
+    if (rc) {
         fprintf(stderr, "libxl_cpu_bitmap_alloc failed, rc: %d\n", rc);
         return 1;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:04:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:04: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 1ZughJ-0004Lz-6o; Fri, 06 Nov 2015 13:04:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughH-0004Ln-KA
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:51 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	5C/42-03763-275AC365; Fri, 06 Nov 2015 13:04:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1446815089!1551576!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11245 invoked from network); 6 Nov 2015 13:04:50 -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;
	6 Nov 2015 13:04:50 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughF-0000u0-4M
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughF-0004Vj-0p
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:49 +0000
Date: Fri, 06 Nov 2015 13:04:49 +0000
Message-Id: <E1ZughF-0004Vj-0p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: initialise rc before using it in
	vcpuset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6919a7dde48bf1a9314c328bfb93a8a2f741bb80
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Nov 4 11:32:57 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 4 11:37:33 2015 +0000

    xl: initialise rc before using it in vcpuset
    
    In 5b725e56 (xl: improve return and exit codes of vcpu related
    functions), the return value of libxl_cpu_bitmap_alloc was not stored in
    rc anymore. Yet the subsequent fprintf still used that.
    
    Reinstate the original implementation, that is, to store return value of
    libxl_cpu_bitmap_alloc in rc before using rc.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 2756d2f..9b6b42c 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5473,7 +5473,8 @@ static int vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
         if (rc)
             return 1;
     }
-    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus)) {
+    rc = libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus);
+    if (rc) {
         fprintf(stderr, "libxl_cpu_bitmap_alloc failed, rc: %d\n", rc);
         return 1;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:05:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13: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 1ZughU-0004Nh-CG; Fri, 06 Nov 2015 13:05:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughS-0004NK-Kr
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:02 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	DE/08-19110-D75AC365; Fri, 06 Nov 2015 13:05:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1446815099!1076999!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24512 invoked from network); 6 Nov 2015 13:05:01 -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;
	6 Nov 2015 13:05:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughP-0000uB-EE
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughP-0004We-Bc
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:59 +0000
Date: Fri, 06 Nov 2015 13:04:59 +0000
Message-Id: <E1ZughP-0004We-Bc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: avoid (another) uninitialised use
	of rc in vcpuset()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 08b986f88b4c4c5d19a50b9883fff2dff582c7df
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Nov 4 13:03:31 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 4 15:05:14 2015 +0000

    xl: avoid (another) uninitialised use of rc in vcpuset()
    
    Rearange the case when we check the new number of vCPUs
    against the number of host pCPUs not to use rc for internal
    error reporting. In fact:
     - rc was at risk of being used uninitialised;
     - rc should only be used for holding libxl error codes.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 9b6b42c..78048a1 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5457,21 +5457,21 @@ static int vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
      * by the host's amount of pCPUs.
      */
     if (check_host) {
-        unsigned int host_cpu = libxl_get_max_cpus(ctx);
+        unsigned int online_vcpus, host_cpu = libxl_get_max_cpus(ctx);
         libxl_dominfo dominfo;
 
         if (libxl_domain_info(ctx, &dominfo, domid))
             return 1;
 
-        if (max_vcpus > dominfo.vcpu_online && max_vcpus > host_cpu) {
+        online_vcpus = dominfo.vcpu_online;
+        libxl_dominfo_dispose(&dominfo);
+
+        if (max_vcpus > online_vcpus && max_vcpus > host_cpu) {
             fprintf(stderr, "You are overcommmitting! You have %d physical" \
                     " CPUs and want %d vCPUs! Aborting, use --ignore-host to" \
                     " continue\n", host_cpu, max_vcpus);
-            rc = 1;
-        }
-        libxl_dominfo_dispose(&dominfo);
-        if (rc)
             return 1;
+        }
     }
     rc = libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus);
     if (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 Nov 06 13:05:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13: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 1ZughU-0004Nh-CG; Fri, 06 Nov 2015 13:05:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughS-0004NK-Kr
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:02 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	DE/08-19110-D75AC365; Fri, 06 Nov 2015 13:05:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1446815099!1076999!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24512 invoked from network); 6 Nov 2015 13:05:01 -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;
	6 Nov 2015 13:05:01 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughP-0000uB-EE
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughP-0004We-Bc
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:04:59 +0000
Date: Fri, 06 Nov 2015 13:04:59 +0000
Message-Id: <E1ZughP-0004We-Bc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: avoid (another) uninitialised use
	of rc in vcpuset()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 08b986f88b4c4c5d19a50b9883fff2dff582c7df
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Nov 4 13:03:31 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 4 15:05:14 2015 +0000

    xl: avoid (another) uninitialised use of rc in vcpuset()
    
    Rearange the case when we check the new number of vCPUs
    against the number of host pCPUs not to use rc for internal
    error reporting. In fact:
     - rc was at risk of being used uninitialised;
     - rc should only be used for holding libxl error codes.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 9b6b42c..78048a1 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -5457,21 +5457,21 @@ static int vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
      * by the host's amount of pCPUs.
      */
     if (check_host) {
-        unsigned int host_cpu = libxl_get_max_cpus(ctx);
+        unsigned int online_vcpus, host_cpu = libxl_get_max_cpus(ctx);
         libxl_dominfo dominfo;
 
         if (libxl_domain_info(ctx, &dominfo, domid))
             return 1;
 
-        if (max_vcpus > dominfo.vcpu_online && max_vcpus > host_cpu) {
+        online_vcpus = dominfo.vcpu_online;
+        libxl_dominfo_dispose(&dominfo);
+
+        if (max_vcpus > online_vcpus && max_vcpus > host_cpu) {
             fprintf(stderr, "You are overcommmitting! You have %d physical" \
                     " CPUs and want %d vCPUs! Aborting, use --ignore-host to" \
                     " continue\n", host_cpu, max_vcpus);
-            rc = 1;
-        }
-        libxl_dominfo_dispose(&dominfo);
-        if (rc)
             return 1;
+        }
     }
     rc = libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus);
     if (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 Nov 06 13:05:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:05: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 1Zughd-0004PG-I5; Fri, 06 Nov 2015 13:05: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 1Zughc-0004On-0D
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:12 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	83/BC-31450-785AC365; Fri, 06 Nov 2015 13:05:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446815110!1588996!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39133 invoked from network); 6 Nov 2015 13:05:10 -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;
	6 Nov 2015 13:05:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughZ-0000up-Q9
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughZ-0004Xv-N7
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:09 +0000
Date: Fri, 06 Nov 2015 13:05:09 +0000
Message-Id: <E1ZughZ-0004Xv-N7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: log an error if
	libxl_cpupool_destroy() 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 6ae323094390eb849daa342c869a2958b8e31d3c
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Nov 4 11:48:24 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 4 15:09:50 2015 +0000

    xl: log an error if libxl_cpupool_destroy() fails
    
    In fact, right now, failing at destroying a cpupool is just
    not reported to the user in any explicit way.
    
    Let's log an error, as it is customary for xl in these cases.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 78048a1..03442e1 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7582,8 +7582,10 @@ int main_cpupooldestroy(int argc, char **argv)
         return EXIT_FAILURE;
     }
 
-    if (libxl_cpupool_destroy(ctx, poolid))
+    if (libxl_cpupool_destroy(ctx, poolid)) {
+        fprintf(stderr, "Can't destroy cpupool '%s'\n", pool);
         return EXIT_FAILURE;
+    }
 
     return EXIT_SUCCESS;
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:05:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:05: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 1Zughd-0004PG-I5; Fri, 06 Nov 2015 13:05: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 1Zughc-0004On-0D
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:12 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	83/BC-31450-785AC365; Fri, 06 Nov 2015 13:05:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446815110!1588996!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39133 invoked from network); 6 Nov 2015 13:05:10 -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;
	6 Nov 2015 13:05:10 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughZ-0000up-Q9
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZughZ-0004Xv-N7
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:09 +0000
Date: Fri, 06 Nov 2015 13:05:09 +0000
Message-Id: <E1ZughZ-0004Xv-N7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: log an error if
	libxl_cpupool_destroy() 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 6ae323094390eb849daa342c869a2958b8e31d3c
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Nov 4 11:48:24 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 4 15:09:50 2015 +0000

    xl: log an error if libxl_cpupool_destroy() fails
    
    In fact, right now, failing at destroying a cpupool is just
    not reported to the user in any explicit way.
    
    Let's log an error, as it is customary for xl in these cases.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/xl_cmdimpl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 78048a1..03442e1 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7582,8 +7582,10 @@ int main_cpupooldestroy(int argc, char **argv)
         return EXIT_FAILURE;
     }
 
-    if (libxl_cpupool_destroy(ctx, poolid))
+    if (libxl_cpupool_destroy(ctx, poolid)) {
+        fprintf(stderr, "Can't destroy cpupool '%s'\n", pool);
         return EXIT_FAILURE;
+    }
 
     return EXIT_SUCCESS;
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:05:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:05: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 1Zugho-0004S7-S5; Fri, 06 Nov 2015 13:05:24 +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 1Zughm-0004Rs-S1
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:23 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	B1/E0-00475-195AC365; Fri, 06 Nov 2015 13:05:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1446815120!1077917!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64644 invoked from network); 6 Nov 2015 13:05:21 -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;
	6 Nov 2015 13:05:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zughk-0000v0-9Z
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zughk-0004Yq-2X
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:20 +0000
Date: Fri, 06 Nov 2015 13:05:20 +0000
Message-Id: <E1Zughk-0004Yq-2X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenconsoled: Remove unexpected
	daemonize behavior
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26d4eebee81e5537dc2a04b57968ff3afe35e446
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Nov 2 11:17:38 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 4 15:11:00 2015 +0000

    xenconsoled: Remove unexpected daemonize behavior
    
    Previously, xenconsoled's daemonize function would do nothing if its
    parent process is init (as it is under systemd but not sysv init).
    This is confusing. Instead, always daemonize when asked to, but use the
    "interactive" switch when running from the systemd service.
    
    Because a pidfile is only written when daemonizing, drop the pidfile
    parameters from the service file (systemd keeps track of the pids
    anyway).
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/console/daemon/utils.c                       |    4 ----
 tools/hotplug/Linux/systemd/xenconsoled.service.in |    3 +--
 2 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c
index dbb3b12..644f6af 100644
--- a/tools/console/daemon/utils.c
+++ b/tools/console/daemon/utils.c
@@ -52,10 +52,6 @@ void daemonize(const char *pidfile)
 	int i;
 	char buf[100];
 
-	if (getppid() == 1) {
-		return;
-	}
-
 	if ((pid = fork()) > 0) {
 		exit(0);
 	} else if (pid == -1) {
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
index cd282bf..8e333b1 100644
--- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -10,10 +10,9 @@ Environment=XENCONSOLED_ARGS=
 Environment=XENCONSOLED_TRACE=none
 Environment=XENCONSOLED_LOG_DIR=@XEN_LOG_DIR@/console
 EnvironmentFile=@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons
-PIDFile=@XEN_RUN_DIR@/xenconsoled.pid
 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
 ExecStartPre=/bin/mkdir -p ${XENCONSOLED_LOG_DIR}
-ExecStart=@sbindir@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_TRACE} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
+ExecStart=@sbindir@/xenconsoled -i --log=${XENCONSOLED_TRACE} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
 
 [Install]
 WantedBy=multi-user.target
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:05:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:05: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 1Zugho-0004S7-S5; Fri, 06 Nov 2015 13:05:24 +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 1Zughm-0004Rs-S1
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:23 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	B1/E0-00475-195AC365; Fri, 06 Nov 2015 13:05:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1446815120!1077917!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64644 invoked from network); 6 Nov 2015 13:05:21 -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;
	6 Nov 2015 13:05:21 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zughk-0000v0-9Z
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zughk-0004Yq-2X
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:20 +0000
Date: Fri, 06 Nov 2015 13:05:20 +0000
Message-Id: <E1Zughk-0004Yq-2X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenconsoled: Remove unexpected
	daemonize behavior
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26d4eebee81e5537dc2a04b57968ff3afe35e446
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Nov 2 11:17:38 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 4 15:11:00 2015 +0000

    xenconsoled: Remove unexpected daemonize behavior
    
    Previously, xenconsoled's daemonize function would do nothing if its
    parent process is init (as it is under systemd but not sysv init).
    This is confusing. Instead, always daemonize when asked to, but use the
    "interactive" switch when running from the systemd service.
    
    Because a pidfile is only written when daemonizing, drop the pidfile
    parameters from the service file (systemd keeps track of the pids
    anyway).
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/console/daemon/utils.c                       |    4 ----
 tools/hotplug/Linux/systemd/xenconsoled.service.in |    3 +--
 2 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c
index dbb3b12..644f6af 100644
--- a/tools/console/daemon/utils.c
+++ b/tools/console/daemon/utils.c
@@ -52,10 +52,6 @@ void daemonize(const char *pidfile)
 	int i;
 	char buf[100];
 
-	if (getppid() == 1) {
-		return;
-	}
-
 	if ((pid = fork()) > 0) {
 		exit(0);
 	} else if (pid == -1) {
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
index cd282bf..8e333b1 100644
--- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -10,10 +10,9 @@ Environment=XENCONSOLED_ARGS=
 Environment=XENCONSOLED_TRACE=none
 Environment=XENCONSOLED_LOG_DIR=@XEN_LOG_DIR@/console
 EnvironmentFile=@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons
-PIDFile=@XEN_RUN_DIR@/xenconsoled.pid
 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
 ExecStartPre=/bin/mkdir -p ${XENCONSOLED_LOG_DIR}
-ExecStart=@sbindir@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_TRACE} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
+ExecStart=@sbindir@/xenconsoled -i --log=${XENCONSOLED_TRACE} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
 
 [Install]
 WantedBy=multi-user.target
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:05:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13: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 1Zughy-0004TX-0e; Fri, 06 Nov 2015 13:05:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zughw-0004TH-MW
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:32 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	EE/5B-30270-C95AC365; Fri, 06 Nov 2015 13:05:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446815130!1589120!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42469 invoked from network); 6 Nov 2015 13:05:31 -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;
	6 Nov 2015 13:05:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zughu-0000v8-Jh
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zughu-0004aM-Hn
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:30 +0000
Date: Fri, 06 Nov 2015 13:05:30 +0000
Message-Id: <E1Zughu-0004aM-Hn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blkif: document blkif multi-queue/ring
	extension
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c2f247c638ae7ee28e7e4ff07ed3d92cc16fbfdf
Author:     Bob Liu <bob.liu@oracle.com>
AuthorDate: Wed Nov 4 17:46:24 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 4 17:46:24 2015 +0100

    blkif: document blkif multi-queue/ring extension
    
    Document the multi-queue/ring feature in terms of XenStore keys to be written
    by the backend and by the frontend.
    
    Signed-off-by: Bob Liu <bob.liu@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/include/public/io/blkif.h |   48 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/blkif.h b/xen/include/public/io/blkif.h
index 8f0f9a6..fbc9ddb 100644
--- a/xen/include/public/io/blkif.h
+++ b/xen/include/public/io/blkif.h
@@ -394,6 +394,54 @@
  */
 
 /*
+ * Multiple hardware queues/rings:
+ * If supported, the backend will write the key "multi-queue-max-queues" to
+ * the directory for that vbd, and set its value to the maximum supported
+ * number of queues.
+ * Frontends that are aware of this feature and wish to use it can write the
+ * key "multi-queue-num-queues" with the number they wish to use, which must be
+ * greater than zero, and no more than the value reported by the backend in
+ * "multi-queue-max-queues".
+ *
+ * For frontends requesting just one queue, the usual event-channel and
+ * ring-ref keys are written as before, simplifying the backend processing
+ * to avoid distinguishing between a frontend that doesn't understand the
+ * multi-queue feature, and one that does, but requested only one queue.
+ *
+ * Frontends requesting two or more queues must not write the toplevel
+ * event-channel and ring-ref keys, instead writing those keys under sub-keys
+ * having the name "queue-N" where N is the integer ID of the queue/ring for
+ * which those keys belong. Queues are indexed from zero.
+ * For example, a frontend with two queues must write the following set of
+ * queue-related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref = "<ring-ref#0>"
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn#0>"
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref = "<ring-ref#1>"
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn#1>"
+ *
+ * It is also possible to use multiple queues/rings together with
+ * feature multi-page ring buffer.
+ * For example, a frontend requests two queues/rings and the size of each ring
+ * buffer is two pages must write the following set of related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/ring-page-order = "1"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref0 = "<ring-ref#0>"
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref1 = "<ring-ref#1>"
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn#0>"
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref0 = "<ring-ref#2>"
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref1 = "<ring-ref#3>"
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn#1>"
+ *
+ */
+
+/*
  * STATE DIAGRAMS
  *
  *****************************************************************************
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:05:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13: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 1Zughy-0004TX-0e; Fri, 06 Nov 2015 13:05:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zughw-0004TH-MW
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:32 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	EE/5B-30270-C95AC365; Fri, 06 Nov 2015 13:05:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1446815130!1589120!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 42469 invoked from network); 6 Nov 2015 13:05:31 -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;
	6 Nov 2015 13:05:31 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zughu-0000v8-Jh
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zughu-0004aM-Hn
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:30 +0000
Date: Fri, 06 Nov 2015 13:05:30 +0000
Message-Id: <E1Zughu-0004aM-Hn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blkif: document blkif multi-queue/ring
	extension
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c2f247c638ae7ee28e7e4ff07ed3d92cc16fbfdf
Author:     Bob Liu <bob.liu@oracle.com>
AuthorDate: Wed Nov 4 17:46:24 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 4 17:46:24 2015 +0100

    blkif: document blkif multi-queue/ring extension
    
    Document the multi-queue/ring feature in terms of XenStore keys to be written
    by the backend and by the frontend.
    
    Signed-off-by: Bob Liu <bob.liu@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/include/public/io/blkif.h |   48 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/blkif.h b/xen/include/public/io/blkif.h
index 8f0f9a6..fbc9ddb 100644
--- a/xen/include/public/io/blkif.h
+++ b/xen/include/public/io/blkif.h
@@ -394,6 +394,54 @@
  */
 
 /*
+ * Multiple hardware queues/rings:
+ * If supported, the backend will write the key "multi-queue-max-queues" to
+ * the directory for that vbd, and set its value to the maximum supported
+ * number of queues.
+ * Frontends that are aware of this feature and wish to use it can write the
+ * key "multi-queue-num-queues" with the number they wish to use, which must be
+ * greater than zero, and no more than the value reported by the backend in
+ * "multi-queue-max-queues".
+ *
+ * For frontends requesting just one queue, the usual event-channel and
+ * ring-ref keys are written as before, simplifying the backend processing
+ * to avoid distinguishing between a frontend that doesn't understand the
+ * multi-queue feature, and one that does, but requested only one queue.
+ *
+ * Frontends requesting two or more queues must not write the toplevel
+ * event-channel and ring-ref keys, instead writing those keys under sub-keys
+ * having the name "queue-N" where N is the integer ID of the queue/ring for
+ * which those keys belong. Queues are indexed from zero.
+ * For example, a frontend with two queues must write the following set of
+ * queue-related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref = "<ring-ref#0>"
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn#0>"
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref = "<ring-ref#1>"
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn#1>"
+ *
+ * It is also possible to use multiple queues/rings together with
+ * feature multi-page ring buffer.
+ * For example, a frontend requests two queues/rings and the size of each ring
+ * buffer is two pages must write the following set of related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/ring-page-order = "1"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref0 = "<ring-ref#0>"
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref1 = "<ring-ref#1>"
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn#0>"
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref0 = "<ring-ref#2>"
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref1 = "<ring-ref#3>"
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn#1>"
+ *
+ */
+
+/*
  * STATE DIAGRAMS
  *
  *****************************************************************************
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:05:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:05: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 1Zugi9-0004V7-5G; Fri, 06 Nov 2015 13:05: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 1Zugi7-0004Up-0e
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:43 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	96/44-24856-6A5AC365; Fri, 06 Nov 2015 13:05:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1446815141!1585960!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53352 invoked from network); 6 Nov 2015 13:05:41 -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;
	6 Nov 2015 13:05:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugi4-0000vG-TY
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugi4-0004cK-R8
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:40 +0000
Date: Fri, 06 Nov 2015 13:05:40 +0000
Message-Id: <E1Zugi4-0004cK-R8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit: remove cpu argument to
	__runq_insert()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e59321d1544518cd322a4dc09a4bff482c724f1c
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Nov 4 17:46:46 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 4 17:46:46 2015 +0100

    credit: remove cpu argument to __runq_insert()
    
    __runq_insert() takes two arguments, cpu and svc. However,
    the cpu argument is redundant because we can get all the
    information we need about cpu from svc.
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 xen/common/sched_credit.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 1b30e67..9eb457c 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -252,13 +252,12 @@ __runq_elem(struct list_head *elem)
 }
 
 static inline void
-__runq_insert(unsigned int cpu, struct csched_vcpu *svc)
+__runq_insert(struct csched_vcpu *svc)
 {
-    const struct list_head * const runq = RUNQ(cpu);
+    const struct list_head * const runq = RUNQ(svc->vcpu->processor);
     struct list_head *iter;
 
     BUG_ON( __vcpu_on_runq(svc) );
-    BUG_ON( cpu != svc->vcpu->processor );
 
     list_for_each( iter, runq )
     {
@@ -913,7 +912,7 @@ csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
     struct csched_vcpu *svc = vc->sched_priv;
 
     if ( !__vcpu_on_runq(svc) && vcpu_runnable(vc) && !vc->is_running )
-        __runq_insert(vc->processor, svc);
+        __runq_insert(svc);
 
     SCHED_STAT_CRANK(vcpu_insert);
 }
@@ -1024,7 +1023,7 @@ csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
     }
 
     /* Put the VCPU on the runq and tickle CPUs */
-    __runq_insert(cpu, svc);
+    __runq_insert(svc);
     __runq_tickle(cpu, svc);
 }
 
@@ -1689,7 +1688,7 @@ csched_schedule(
      * Select next runnable local VCPU (ie top of local runq)
      */
     if ( vcpu_runnable(current) )
-        __runq_insert(cpu, scurr);
+        __runq_insert(scurr);
     else
         BUG_ON( is_idle_vcpu(current) || list_empty(runq) );
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:05:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13:05: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 1Zugi9-0004V7-5G; Fri, 06 Nov 2015 13:05: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 1Zugi7-0004Up-0e
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:43 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	96/44-24856-6A5AC365; Fri, 06 Nov 2015 13:05:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1446815141!1585960!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53352 invoked from network); 6 Nov 2015 13:05:41 -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;
	6 Nov 2015 13:05:41 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugi4-0000vG-TY
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zugi4-0004cK-R8
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:40 +0000
Date: Fri, 06 Nov 2015 13:05:40 +0000
Message-Id: <E1Zugi4-0004cK-R8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] credit: remove cpu argument to
	__runq_insert()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e59321d1544518cd322a4dc09a4bff482c724f1c
Author:     Harmandeep Kaur <write.harmandeep@gmail.com>
AuthorDate: Wed Nov 4 17:46:46 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 4 17:46:46 2015 +0100

    credit: remove cpu argument to __runq_insert()
    
    __runq_insert() takes two arguments, cpu and svc. However,
    the cpu argument is redundant because we can get all the
    information we need about cpu from svc.
    
    Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
    Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
---
 xen/common/sched_credit.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 1b30e67..9eb457c 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -252,13 +252,12 @@ __runq_elem(struct list_head *elem)
 }
 
 static inline void
-__runq_insert(unsigned int cpu, struct csched_vcpu *svc)
+__runq_insert(struct csched_vcpu *svc)
 {
-    const struct list_head * const runq = RUNQ(cpu);
+    const struct list_head * const runq = RUNQ(svc->vcpu->processor);
     struct list_head *iter;
 
     BUG_ON( __vcpu_on_runq(svc) );
-    BUG_ON( cpu != svc->vcpu->processor );
 
     list_for_each( iter, runq )
     {
@@ -913,7 +912,7 @@ csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
     struct csched_vcpu *svc = vc->sched_priv;
 
     if ( !__vcpu_on_runq(svc) && vcpu_runnable(vc) && !vc->is_running )
-        __runq_insert(vc->processor, svc);
+        __runq_insert(svc);
 
     SCHED_STAT_CRANK(vcpu_insert);
 }
@@ -1024,7 +1023,7 @@ csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
     }
 
     /* Put the VCPU on the runq and tickle CPUs */
-    __runq_insert(cpu, svc);
+    __runq_insert(svc);
     __runq_tickle(cpu, svc);
 }
 
@@ -1689,7 +1688,7 @@ csched_schedule(
      * Select next runnable local VCPU (ie top of local runq)
      */
     if ( vcpu_runnable(current) )
-        __runq_insert(cpu, scurr);
+        __runq_insert(scurr);
     else
         BUG_ON( is_idle_vcpu(current) || list_empty(runq) );
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 06 13:05:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13: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 1ZugiI-0004WU-Ae; Fri, 06 Nov 2015 13:05:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugiH-0004WI-No
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:53 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	22/B5-25435-1B5AC365; Fri, 06 Nov 2015 13:05:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1446815151!1077628!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 59545 invoked from network); 6 Nov 2015 13:05:52 -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;
	6 Nov 2015 13:05:52 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugiF-0000vO-8k
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugiF-0004dl-4w
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:51 +0000
Date: Fri, 06 Nov 2015 13:05:51 +0000
Message-Id: <E1ZugiF-0004dl-4w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: cleanup of early cpuid 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 6f04de658574833688c3f9eab310e7834d56a9c0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 4 17:47:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 4 17:47:17 2015 +0100

    x86: cleanup of early cpuid handling
    
    Use register names for variables, rather than their content for leaf 1.
    Reduce the number of cpuid instructions issued.  Also drop some trailing
    whitespace.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/common.c |   68 ++++++++++++++++++++++-----------------------
 1 files changed, 33 insertions(+), 35 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index ac8a258..a111ed6 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -180,7 +180,7 @@ static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
 static void __init early_cpu_detect(void)
 {
 	struct cpuinfo_x86 *c = &boot_cpu_data;
-	u32 cap4, tfms, cap0, misc;
+	u32 eax, ebx, ecx, edx;
 
 	c->x86_cache_alignment = 32;
 
@@ -192,21 +192,21 @@ static void __init early_cpu_detect(void)
 
 	c->x86_vendor = get_cpu_vendor(c->x86_vendor_id, gcv_host_early);
 
-	cpuid(0x00000001, &tfms, &misc, &cap4, &cap0);
-	c->x86 = (tfms >> 8) & 15;
-	c->x86_model = (tfms >> 4) & 15;
+	cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
+	c->x86 = (eax >> 8) & 15;
+	c->x86_model = (eax >> 4) & 15;
 	if (c->x86 == 0xf)
-		c->x86 += (tfms >> 20) & 0xff;
+		c->x86 += (eax >> 20) & 0xff;
 	if (c->x86 >= 0x6)
-		c->x86_model += ((tfms >> 16) & 0xF) << 4;
-	c->x86_mask = tfms & 15;
-	cap0 &= ~cleared_caps[cpufeat_word(X86_FEATURE_FPU)];
-	cap4 &= ~cleared_caps[cpufeat_word(X86_FEATURE_XMM3)];
-	if (cap0 & cpufeat_mask(X86_FEATURE_CLFLSH))
-		c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
+		c->x86_model += ((eax >> 16) & 0xF) << 4;
+	c->x86_mask = eax & 15;
+	edx &= ~cleared_caps[cpufeat_word(X86_FEATURE_FPU)];
+	ecx &= ~cleared_caps[cpufeat_word(X86_FEATURE_XMM3)];
+	if (edx & cpufeat_mask(X86_FEATURE_CLFLSH))
+		c->x86_cache_alignment = ((ebx >> 8) & 0xff) * 8;
 	/* Leaf 0x1 capabilities filled in early for Xen. */
-	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = cap0;
-	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = cap4;
+	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = edx;
+	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = ecx;
 
 	if ( cpuid_eax(0x80000000) >= 0x80000008 )
 		paddr_bits = cpuid_eax(0x80000008) & 0xff;
@@ -214,29 +214,29 @@ static void __init early_cpu_detect(void)
 
 static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 {
-	u32 tfms, capability, excap, ebx;
+	u32 eax, ebx, ecx, edx, tmp;
 
 	/* Get vendor name */
 	cpuid(0x00000000, &c->cpuid_level,
 	      (int *)&c->x86_vendor_id[0],
 	      (int *)&c->x86_vendor_id[8],
 	      (int *)&c->x86_vendor_id[4]);
-		
+
 	c->x86_vendor = get_cpu_vendor(c->x86_vendor_id, gcv_host_late);
 	/* Initialize the standard set of capabilities */
 	/* Note that the vendor-specific code below might override */
-	
+
 	/* Intel-defined flags: level 0x00000001 */
-	cpuid(0x00000001, &tfms, &ebx, &excap, &capability);
-	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = capability;
-	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = excap;
-	c->x86 = (tfms >> 8) & 15;
-	c->x86_model = (tfms >> 4) & 15;
+	cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
+	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = edx;
+	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = ecx;
+	c->x86 = (eax >> 8) & 15;
+	c->x86_model = (eax >> 4) & 15;
 	if (c->x86 == 0xf)
-		c->x86 += (tfms >> 20) & 0xff;
+		c->x86 += (eax >> 20) & 0xff;
 	if (c->x86 >= 0x6)
-		c->x86_model += ((tfms >> 16) & 0xF) << 4;
-	c->x86_mask = tfms & 15;
+		c->x86_model += ((eax >> 16) & 0xF) << 4;
+	c->x86_mask = eax & 15;
 	c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
 	c->phys_proc_id = c->apicid;
 	if ( cpu_has(c, X86_FEATURE_CLFLSH) )
@@ -249,12 +249,11 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	/* AMD-defined flags: level 0x80000001 */
 	c->extended_cpuid_level = cpuid_eax(0x80000000);
 	if ( (c->extended_cpuid_level & 0xffff0000) == 0x80000000 ) {
-		if ( c->extended_cpuid_level >= 0x80000001 ) {
-			c->x86_capability[cpufeat_word(X86_FEATURE_SYSCALL)]
-				= cpuid_edx(0x80000001);
-			c->x86_capability[cpufeat_word(X86_FEATURE_LAHF_LM)]
-				= cpuid_ecx(0x80000001);
-		}
+		if ( c->extended_cpuid_level >= 0x80000001 )
+			cpuid(0x80000001, &tmp, &tmp,
+			      &c->x86_capability[cpufeat_word(X86_FEATURE_LAHF_LM)],
+			      &c->x86_capability[cpufeat_word(X86_FEATURE_SYSCALL)]);
+
 		if ( c->extended_cpuid_level >= 0x80000004 )
 			get_model_name(c); /* Default name */
 	}
@@ -263,11 +262,10 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	early_intel_workaround(c);
 
 	/* Intel-defined flags: level 0x00000007 */
-	if ( c->cpuid_level >= 0x00000007 ) {
-		u32 dummy;
-		cpuid_count(0x00000007, 0, &dummy, &ebx, &dummy, &dummy);
-		c->x86_capability[cpufeat_word(X86_FEATURE_FSGSBASE)] = ebx;
-	}
+	if ( c->cpuid_level >= 0x00000007 )
+		cpuid_count(0x00000007, 0, &tmp,
+			    &c->x86_capability[cpufeat_word(X86_FEATURE_FSGSBASE)],
+			    &tmp, &tmp);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Nov 06 13:05:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Nov 2015 13: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 1ZugiI-0004WU-Ae; Fri, 06 Nov 2015 13:05:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugiH-0004WI-No
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:53 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	22/B5-25435-1B5AC365; Fri, 06 Nov 2015 13:05:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1446815151!1077628!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 59545 invoked from network); 6 Nov 2015 13:05:52 -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;
	6 Nov 2015 13:05:52 -0000
Received: from [50.57.170.242] (helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugiF-0000vO-8k
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZugiF-0004dl-4w
	for xen-changelog@lists.xensource.com; Fri, 06 Nov 2015 13:05:51 +0000
Date: Fri, 06 Nov 2015 13:05:51 +0000
Message-Id: <E1ZugiF-0004dl-4w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: cleanup of early cpuid 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 6f04de658574833688c3f9eab310e7834d56a9c0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Nov 4 17:47:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 4 17:47:17 2015 +0100

    x86: cleanup of early cpuid handling
    
    Use register names for variables, rather than their content for leaf 1.
    Reduce the number of cpuid instructions issued.  Also drop some trailing
    whitespace.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/common.c |   68 ++++++++++++++++++++++-----------------------
 1 files changed, 33 insertions(+), 35 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index ac8a258..a111ed6 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -180,7 +180,7 @@ static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
 static void __init early_cpu_detect(void)
 {
 	struct cpuinfo_x86 *c = &boot_cpu_data;
-	u32 cap4, tfms, cap0, misc;
+	u32 eax, ebx, ecx, edx;
 
 	c->x86_cache_alignment = 32;
 
@@ -192,21 +192,21 @@ static void __init early_cpu_detect(void)
 
 	c->x86_vendor = get_cpu_vendor(c->x86_vendor_id, gcv_host_early);
 
-	cpuid(0x00000001, &tfms, &misc, &cap4, &cap0);
-	c->x86 = (tfms >> 8) & 15;
-	c->x86_model = (tfms >> 4) & 15;
+	cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
+	c->x86 = (eax >> 8) & 15;
+	c->x86_model = (eax >> 4) & 15;
 	if (c->x86 == 0xf)
-		c->x86 += (tfms >> 20) & 0xff;
+		c->x86 += (eax >> 20) & 0xff;
 	if (c->x86 >= 0x6)
-		c->x86_model += ((tfms >> 16) & 0xF) << 4;
-	c->x86_mask = tfms & 15;
-	cap0 &= ~cleared_caps[cpufeat_word(X86_FEATURE_FPU)];
-	cap4 &= ~cleared_caps[cpufeat_word(X86_FEATURE_XMM3)];
-	if (cap0 & cpufeat_mask(X86_FEATURE_CLFLSH))
-		c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
+		c->x86_model += ((eax >> 16) & 0xF) << 4;
+	c->x86_mask = eax & 15;
+	edx &= ~cleared_caps[cpufeat_word(X86_FEATURE_FPU)];
+	ecx &= ~cleared_caps[cpufeat_word(X86_FEATURE_XMM3)];
+	if (edx & cpufeat_mask(X86_FEATURE_CLFLSH))
+		c->x86_cache_alignment = ((ebx >> 8) & 0xff) * 8;
 	/* Leaf 0x1 capabilities filled in early for Xen. */
-	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = cap0;
-	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = cap4;
+	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = edx;
+	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = ecx;
 
 	if ( cpuid_eax(0x80000000) >= 0x80000008 )
 		paddr_bits = cpuid_eax(0x80000008) & 0xff;
@@ -214,29 +214,29 @@ static void __init early_cpu_detect(void)
 
 static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 {
-	u32 tfms, capability, excap, ebx;
+	u32 eax, ebx, ecx, edx, tmp;
 
 	/* Get vendor name */
 	cpuid(0x00000000, &c->cpuid_level,
 	      (int *)&c->x86_vendor_id[0],
 	      (int *)&c->x86_vendor_id[8],
 	      (int *)&c->x86_vendor_id[4]);
-		
+
 	c->x86_vendor = get_cpu_vendor(c->x86_vendor_id, gcv_host_late);
 	/* Initialize the standard set of capabilities */
 	/* Note that the vendor-specific code below might override */
-	
+
 	/* Intel-defined flags: level 0x00000001 */
-	cpuid(0x00000001, &tfms, &ebx, &excap, &capability);
-	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = capability;
-	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = excap;
-	c->x86 = (tfms >> 8) & 15;
-	c->x86_model = (tfms >> 4) & 15;
+	cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
+	c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = edx;
+	c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = ecx;
+	c->x86 = (eax >> 8) & 15;
+	c->x86_model = (eax >> 4) & 15;
 	if (c->x86 == 0xf)
-		c->x86 += (tfms >> 20) & 0xff;
+		c->x86 += (eax >> 20) & 0xff;
 	if (c->x86 >= 0x6)
-		c->x86_model += ((tfms >> 16) & 0xF) << 4;
-	c->x86_mask = tfms & 15;
+		c->x86_model += ((eax >> 16) & 0xF) << 4;
+	c->x86_mask = eax & 15;
 	c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
 	c->phys_proc_id = c->apicid;
 	if ( cpu_has(c, X86_FEATURE_CLFLSH) )
@@ -249,12 +249,11 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	/* AMD-defined flags: level 0x80000001 */
 	c->extended_cpuid_level = cpuid_eax(0x80000000);
 	if ( (c->extended_cpuid_level & 0xffff0000) == 0x80000000 ) {
-		if ( c->extended_cpuid_level >= 0x80000001 ) {
-			c->x86_capability[cpufeat_word(X86_FEATURE_SYSCALL)]
-				= cpuid_edx(0x80000001);
-			c->x86_capability[cpufeat_word(X86_FEATURE_LAHF_LM)]
-				= cpuid_ecx(0x80000001);
-		}
+		if ( c->extended_cpuid_level >= 0x80000001 )
+			cpuid(0x80000001, &tmp, &tmp,
+			      &c->x86_capability[cpufeat_word(X86_FEATURE_LAHF_LM)],
+			      &c->x86_capability[cpufeat_word(X86_FEATURE_SYSCALL)]);
+
 		if ( c->extended_cpuid_level >= 0x80000004 )
 			get_model_name(c); /* Default name */
 	}
@@ -263,11 +262,10 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
 	early_intel_workaround(c);
 
 	/* Intel-defined flags: level 0x00000007 */
-	if ( c->cpuid_level >= 0x00000007 ) {
-		u32 dummy;
-		cpuid_count(0x00000007, 0, &dummy, &ebx, &dummy, &dummy);
-		c->x86_capability[cpufeat_word(X86_FEATURE_FSGSBASE)] = ebx;
-	}
+	if ( c->cpuid_level >= 0x00000007 )
+		cpuid_count(0x00000007, 0, &tmp,
+			    &c->x86_capability[cpufeat_word(X86_FEATURE_FSGSBASE)],
+			    &tmp, &tmp);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Nov 11 19:11:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Nov 2015 19: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 1ZwanY-0001pZ-5k; Wed, 11 Nov 2015 19:11: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 1ZwanW-0001pM-Kr
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:10 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	1E/71-00536-DC293465; Wed, 11 Nov 2015 19:11:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1447269065!2831952!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21529 invoked from network); 11 Nov 2015 19:11:06 -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;
	11 Nov 2015 19:11:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZwanQ-0001jD-Hb
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZwanQ-0002t8-1R
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:04 +0000
Date: Wed, 11 Nov 2015 19:11:04 +0000
Message-Id: <E1ZwanQ-0002t8-1R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpufreq: allow ordinary boolean
	options to be passed on the command line
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit acd9bd133c04766b8457f55e072c39f38eec5a43
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 6 15:15:32 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 6 15:15:32 2015 +0100

    cpufreq: allow ordinary boolean options to be passed on the command line
    
    I was quite surprised to find "cpufreq=off" not doing what one would
    expect it to do. Fix this.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |    5 +++--
 xen/drivers/cpufreq/cpufreq.c       |   20 +++++++++++++-------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 416e559..70daa84 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -391,11 +391,12 @@ If set, force use of the performance counters for oprofile, rather than detectin
 available support.
 
 ### cpufreq
-> `= dom0-kernel | none | xen[,[powersave|performance|ondemand|userspace][,<maxfreq>][,[<minfreq>][,[verbose]]]]`
+> `= none | {{ <boolean> | xen } [:[powersave|performance|ondemand|userspace][,<maxfreq>][,[<minfreq>][,[verbose]]]]} | dom0-kernel`
 
 > Default: `xen`
 
-Indicate where the responsibility for driving power states lies.
+Indicate where the responsibility for driving power states lies.  Note that the
+choice of `dom0-kernel` is deprecated and not supported by all Dom0 kernels.
 
 * Default governor policy is ondemand.
 * `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies
diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 6e666e4..f19b403 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -64,9 +64,14 @@ enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
 
 static void __init setup_cpufreq_option(char *str)
 {
-    char *arg;
+    char *arg = strpbrk(str, ",:");
+    int choice;
 
-    if ( !strcmp(str, "dom0-kernel") )
+    if ( arg )
+        *arg++ = '\0';
+    choice = parse_bool(str);
+
+    if ( choice < 0 && !strcmp(str, "dom0-kernel") )
     {
         xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
         cpufreq_controller = FREQCTL_dom0_kernel;
@@ -74,19 +79,20 @@ static void __init setup_cpufreq_option(char *str)
         return;
     }
 
-    if ( !strcmp(str, "none") )
+    if ( choice == 0 || !strcmp(str, "none") )
     {
         xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
         cpufreq_controller = FREQCTL_none;
         return;
     }
 
-    if ( (arg = strpbrk(str, ",:")) != NULL )
-        *arg++ = '\0';
-
-    if ( !strcmp(str, "xen") )
+    if ( choice > 0 || !strcmp(str, "xen") )
+    {
+        xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
+        cpufreq_controller = FREQCTL_xen;
         if ( arg && *arg )
             cpufreq_cmdline_parse(arg);
+    }
 }
 custom_param("cpufreq", setup_cpufreq_option);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 11 19:11:17 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Nov 2015 19: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 1ZwanY-0001pZ-5k; Wed, 11 Nov 2015 19:11: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 1ZwanW-0001pM-Kr
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:10 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	1E/71-00536-DC293465; Wed, 11 Nov 2015 19:11:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1447269065!2831952!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21529 invoked from network); 11 Nov 2015 19:11:06 -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;
	11 Nov 2015 19:11:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZwanQ-0001jD-Hb
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZwanQ-0002t8-1R
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:04 +0000
Date: Wed, 11 Nov 2015 19:11:04 +0000
Message-Id: <E1ZwanQ-0002t8-1R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpufreq: allow ordinary boolean
	options to be passed on the command line
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit acd9bd133c04766b8457f55e072c39f38eec5a43
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 6 15:15:32 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 6 15:15:32 2015 +0100

    cpufreq: allow ordinary boolean options to be passed on the command line
    
    I was quite surprised to find "cpufreq=off" not doing what one would
    expect it to do. Fix this.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |    5 +++--
 xen/drivers/cpufreq/cpufreq.c       |   20 +++++++++++++-------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 416e559..70daa84 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -391,11 +391,12 @@ If set, force use of the performance counters for oprofile, rather than detectin
 available support.
 
 ### cpufreq
-> `= dom0-kernel | none | xen[,[powersave|performance|ondemand|userspace][,<maxfreq>][,[<minfreq>][,[verbose]]]]`
+> `= none | {{ <boolean> | xen } [:[powersave|performance|ondemand|userspace][,<maxfreq>][,[<minfreq>][,[verbose]]]]} | dom0-kernel`
 
 > Default: `xen`
 
-Indicate where the responsibility for driving power states lies.
+Indicate where the responsibility for driving power states lies.  Note that the
+choice of `dom0-kernel` is deprecated and not supported by all Dom0 kernels.
 
 * Default governor policy is ondemand.
 * `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies
diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index 6e666e4..f19b403 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -64,9 +64,14 @@ enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
 
 static void __init setup_cpufreq_option(char *str)
 {
-    char *arg;
+    char *arg = strpbrk(str, ",:");
+    int choice;
 
-    if ( !strcmp(str, "dom0-kernel") )
+    if ( arg )
+        *arg++ = '\0';
+    choice = parse_bool(str);
+
+    if ( choice < 0 && !strcmp(str, "dom0-kernel") )
     {
         xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
         cpufreq_controller = FREQCTL_dom0_kernel;
@@ -74,19 +79,20 @@ static void __init setup_cpufreq_option(char *str)
         return;
     }
 
-    if ( !strcmp(str, "none") )
+    if ( choice == 0 || !strcmp(str, "none") )
     {
         xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
         cpufreq_controller = FREQCTL_none;
         return;
     }
 
-    if ( (arg = strpbrk(str, ",:")) != NULL )
-        *arg++ = '\0';
-
-    if ( !strcmp(str, "xen") )
+    if ( choice > 0 || !strcmp(str, "xen") )
+    {
+        xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
+        cpufreq_controller = FREQCTL_xen;
         if ( arg && *arg )
             cpufreq_cmdline_parse(arg);
+    }
 }
 custom_param("cpufreq", setup_cpufreq_option);
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 11 19:11:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Nov 2015 19:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zwanf-0001qS-9V; Wed, 11 Nov 2015 19:11: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 1Zwand-0001q8-Ak
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:17 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	5B/DF-32615-4D293465; Wed, 11 Nov 2015 19:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1447269075!2842683!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8471 invoked from network); 11 Nov 2015 19:11:16 -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;
	11 Nov 2015 19:11:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zwanb-0001jP-1U
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zwana-0002tj-Pn
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:14 +0000
Date: Wed, 11 Nov 2015 19:11:14 +0000
Message-Id: <E1Zwana-0002tj-Pn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: fix locking of remove_vcpu() in
	credit1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 897cc6d07acd3e66356f021c5f7f9a49ef061d5d
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Fri Nov 6 15:16:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 6 15:16:38 2015 +0100

    sched: fix locking of remove_vcpu() in credit1
    
    In fact, csched_vcpu_remove() (i.e., the credit1
    implementation of remove_vcpu()) manipulates runqueues,
    so holding the runqueue lock is necessary.
    
    However, the vCPU just can't be on the runqueue, when
    the function is called. We can therefore ASSERT() that,
    and avoid doing any runqueue manipulations (rather than
    adding the runqueue locking around it).
    
    Also, while there, *_lock_irq() (for the private lock) is
    enough, there is no need to *_lock_irqsave().
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 9eb457c..72a2109 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -933,28 +933,25 @@ csched_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     struct csched_private *prv = CSCHED_PRIV(ops);
     struct csched_vcpu * const svc = CSCHED_VCPU(vc);
     struct csched_dom * const sdom = svc->sdom;
-    unsigned long flags;
 
     SCHED_STAT_CRANK(vcpu_remove);
 
+    ASSERT(!__vcpu_on_runq(svc));
+
     if ( test_and_clear_bit(CSCHED_FLAG_VCPU_PARKED, &svc->flags) )
     {
         SCHED_STAT_CRANK(vcpu_unpark);
         vcpu_unpause(svc->vcpu);
     }
 
-    if ( __vcpu_on_runq(svc) )
-        __runq_remove(svc);
-
-    spin_lock_irqsave(&(prv->lock), flags);
+    spin_lock_irq(&prv->lock);
 
     if ( !list_empty(&svc->active_vcpu_elem) )
         __csched_vcpu_acct_stop_locked(prv, svc);
 
-    spin_unlock_irqrestore(&(prv->lock), flags);
+    spin_unlock_irq(&prv->lock);
 
     BUG_ON( sdom == NULL );
-    BUG_ON( !list_empty(&svc->runq_elem) );
 }
 
 static 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 Nov 11 19:11:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Nov 2015 19:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zwanf-0001qS-9V; Wed, 11 Nov 2015 19:11: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 1Zwand-0001q8-Ak
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:17 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	5B/DF-32615-4D293465; Wed, 11 Nov 2015 19:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1447269075!2842683!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8471 invoked from network); 11 Nov 2015 19:11:16 -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;
	11 Nov 2015 19:11:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zwanb-0001jP-1U
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zwana-0002tj-Pn
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:14 +0000
Date: Wed, 11 Nov 2015 19:11:14 +0000
Message-Id: <E1Zwana-0002tj-Pn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: fix locking of remove_vcpu() in
	credit1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 897cc6d07acd3e66356f021c5f7f9a49ef061d5d
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Fri Nov 6 15:16:38 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 6 15:16:38 2015 +0100

    sched: fix locking of remove_vcpu() in credit1
    
    In fact, csched_vcpu_remove() (i.e., the credit1
    implementation of remove_vcpu()) manipulates runqueues,
    so holding the runqueue lock is necessary.
    
    However, the vCPU just can't be on the runqueue, when
    the function is called. We can therefore ASSERT() that,
    and avoid doing any runqueue manipulations (rather than
    adding the runqueue locking around it).
    
    Also, while there, *_lock_irq() (for the private lock) is
    enough, there is no need to *_lock_irqsave().
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 9eb457c..72a2109 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -933,28 +933,25 @@ csched_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     struct csched_private *prv = CSCHED_PRIV(ops);
     struct csched_vcpu * const svc = CSCHED_VCPU(vc);
     struct csched_dom * const sdom = svc->sdom;
-    unsigned long flags;
 
     SCHED_STAT_CRANK(vcpu_remove);
 
+    ASSERT(!__vcpu_on_runq(svc));
+
     if ( test_and_clear_bit(CSCHED_FLAG_VCPU_PARKED, &svc->flags) )
     {
         SCHED_STAT_CRANK(vcpu_unpark);
         vcpu_unpause(svc->vcpu);
     }
 
-    if ( __vcpu_on_runq(svc) )
-        __runq_remove(svc);
-
-    spin_lock_irqsave(&(prv->lock), flags);
+    spin_lock_irq(&prv->lock);
 
     if ( !list_empty(&svc->active_vcpu_elem) )
         __csched_vcpu_acct_stop_locked(prv, svc);
 
-    spin_unlock_irqrestore(&(prv->lock), flags);
+    spin_unlock_irq(&prv->lock);
 
     BUG_ON( sdom == NULL );
-    BUG_ON( !list_empty(&svc->runq_elem) );
 }
 
 static 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 Nov 11 19:11:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Nov 2015 19:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zwanq-0001rs-Dd; Wed, 11 Nov 2015 19:11: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 1Zwano-0001rd-7a
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:28 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	52/18-18744-FD293465; Wed, 11 Nov 2015 19:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1447269085!2498983!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2971 invoked from network); 11 Nov 2015 19:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Nov 2015 19:11:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zwanl-0001jb-DU
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zwanl-0002uB-77
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:25 +0000
Date: Wed, 11 Nov 2015 19:11:25 +0000
Message-Id: <E1Zwanl-0002uB-77@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: make sure stdvga cache cannot
	be re-enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22a1fbb575df3a3a7726cdeb5ddf19cc8f60827c
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Fri Nov 6 15:17:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 6 15:17:00 2015 +0100

    x86/hvm: make sure stdvga cache cannot be re-enabled
    
    As soon as the cache is disabled, it will become out-of-sync with the
    VGA device model and since no mechanism exists to acquire current VRAM
    state from the device model, re-enabling it leads to stale data
    being seen by the guest.
    
    The problem was introduced by commit 3bbaaec0 ("x86/hvm: unify stdvga
    mmio intercept with standard mmio intercept") and can be seen by
    deliberately crashing a Windows guest; the BSOD output is corrupted.
    
    This patch changes the existing 'cache' boolean in hvm_hw_stdvga into a
    tri-state enum and only allows the state to move from 'uninitialized' to
    'enabled'. Once the cache state becomes 'disabled' it will remain so for
    the lifetime of the VM.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/save.c      |    2 +-
 xen/arch/x86/hvm/stdvga.c    |   50 +++++++++++++++++++++++++++++++-----------
 xen/include/asm-x86/hvm/io.h |    8 ++++++-
 3 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
index 4660beb..f7d4999 100644
--- a/xen/arch/x86/hvm/save.c
+++ b/xen/arch/x86/hvm/save.c
@@ -73,7 +73,7 @@ int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr)
     d->arch.hvm_domain.sync_tsc = rdtsc();
 
     /* VGA state is not saved/restored, so we nobble the cache. */
-    d->arch.hvm_domain.stdvga.cache = 0;
+    d->arch.hvm_domain.stdvga.cache = STDVGA_CACHE_DISABLED;
 
     return 0;
 }
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 02a97f9..86c94d2 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -101,6 +101,37 @@ static void vram_put(struct hvm_hw_stdvga *s, void *p)
     unmap_domain_page(p);
 }
 
+static void stdvga_try_cache_enable(struct hvm_hw_stdvga *s)
+{
+    /*
+     * Caching mode can only be enabled if the the cache has
+     * never been used before. As soon as it is disabled, it will
+     * become out-of-sync with the VGA device model and since no
+     * mechanism exists to acquire current VRAM state from the
+     * device model, re-enabling it would lead to stale data being
+     * seen by the guest.
+     */
+    if ( s->cache != STDVGA_CACHE_UNINITIALIZED )
+        return;
+
+    gdprintk(XENLOG_INFO, "entering caching mode\n");
+    s->cache = STDVGA_CACHE_ENABLED;
+}
+
+static void stdvga_cache_disable(struct hvm_hw_stdvga *s)
+{
+    if ( s->cache != STDVGA_CACHE_ENABLED )
+        return;
+
+    gdprintk(XENLOG_INFO, "leaving caching mode\n");
+    s->cache = STDVGA_CACHE_DISABLED;
+}
+
+static bool_t stdvga_cache_is_enabled(const struct hvm_hw_stdvga *s)
+{
+    return s->cache == STDVGA_CACHE_ENABLED;
+}
+
 static int stdvga_outb(uint64_t addr, uint8_t val)
 {
     struct hvm_hw_stdvga *s = &current->domain->arch.hvm_domain.stdvga;
@@ -139,12 +170,8 @@ static int stdvga_outb(uint64_t addr, uint8_t val)
 
     if ( !prev_stdvga && s->stdvga )
     {
-        /*
-         * (Re)start caching of video buffer.
-         * XXX TODO: In case of a restart the cache could be unsynced.
-         */
-        s->cache = 1;
-        gdprintk(XENLOG_INFO, "entering stdvga and caching modes\n");
+        gdprintk(XENLOG_INFO, "entering stdvga mode\n");
+        stdvga_try_cache_enable(s);
     }
     else if ( prev_stdvga && !s->stdvga )
     {
@@ -441,7 +468,7 @@ static int stdvga_mem_write(const struct hvm_io_handler *handler,
     };
     struct hvm_ioreq_server *srv;
 
-    if ( !s->cache || !s->stdvga )
+    if ( !stdvga_cache_is_enabled(s) || !s->stdvga )
         goto done;
 
     /* Intercept mmio write */
@@ -515,15 +542,12 @@ static bool_t stdvga_mem_accept(const struct hvm_io_handler *handler,
          * not active since we can assert, when in stdvga mode, that writes
          * to VRAM have no side effect and thus we can try to buffer them.
          */
-        if ( s->cache )
-        {
-            gdprintk(XENLOG_INFO, "leaving caching mode\n");
-            s->cache = 0;
-        }
+        stdvga_cache_disable(s);
 
         goto reject;
     }
-    else if ( p->dir == IOREQ_READ && (!s->cache || !s->stdvga) )
+    else if ( p->dir == IOREQ_READ &&
+              (!stdvga_cache_is_enabled(s) || !s->stdvga) )
         goto reject;
 
     /* s->lock intentionally held */
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index 8585a1f..ceefa2e 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -128,13 +128,19 @@ void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
 void msix_write_completion(struct vcpu *);
 void msixtbl_init(struct domain *d);
 
+enum stdvga_cache_state {
+    STDVGA_CACHE_UNINITIALIZED,
+    STDVGA_CACHE_ENABLED,
+    STDVGA_CACHE_DISABLED
+};
+
 struct hvm_hw_stdvga {
     uint8_t sr_index;
     uint8_t sr[8];
     uint8_t gr_index;
     uint8_t gr[9];
     bool_t stdvga;
-    bool_t cache;
+    enum stdvga_cache_state cache;
     uint32_t latch;
     struct page_info *vram_page[64];  /* shadow of 0xa0000-0xaffff */
     spinlock_t 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 Nov 11 19:11:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Nov 2015 19:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Zwanq-0001rs-Dd; Wed, 11 Nov 2015 19:11: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 1Zwano-0001rd-7a
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:28 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	52/18-18744-FD293465; Wed, 11 Nov 2015 19:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1447269085!2498983!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2971 invoked from network); 11 Nov 2015 19:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Nov 2015 19:11:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zwanl-0001jb-DU
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Zwanl-0002uB-77
	for xen-changelog@lists.xensource.com; Wed, 11 Nov 2015 19:11:25 +0000
Date: Wed, 11 Nov 2015 19:11:25 +0000
Message-Id: <E1Zwanl-0002uB-77@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: make sure stdvga cache cannot
	be re-enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22a1fbb575df3a3a7726cdeb5ddf19cc8f60827c
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Fri Nov 6 15:17:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 6 15:17:00 2015 +0100

    x86/hvm: make sure stdvga cache cannot be re-enabled
    
    As soon as the cache is disabled, it will become out-of-sync with the
    VGA device model and since no mechanism exists to acquire current VRAM
    state from the device model, re-enabling it leads to stale data
    being seen by the guest.
    
    The problem was introduced by commit 3bbaaec0 ("x86/hvm: unify stdvga
    mmio intercept with standard mmio intercept") and can be seen by
    deliberately crashing a Windows guest; the BSOD output is corrupted.
    
    This patch changes the existing 'cache' boolean in hvm_hw_stdvga into a
    tri-state enum and only allows the state to move from 'uninitialized' to
    'enabled'. Once the cache state becomes 'disabled' it will remain so for
    the lifetime of the VM.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/save.c      |    2 +-
 xen/arch/x86/hvm/stdvga.c    |   50 +++++++++++++++++++++++++++++++-----------
 xen/include/asm-x86/hvm/io.h |    8 ++++++-
 3 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
index 4660beb..f7d4999 100644
--- a/xen/arch/x86/hvm/save.c
+++ b/xen/arch/x86/hvm/save.c
@@ -73,7 +73,7 @@ int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr)
     d->arch.hvm_domain.sync_tsc = rdtsc();
 
     /* VGA state is not saved/restored, so we nobble the cache. */
-    d->arch.hvm_domain.stdvga.cache = 0;
+    d->arch.hvm_domain.stdvga.cache = STDVGA_CACHE_DISABLED;
 
     return 0;
 }
diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 02a97f9..86c94d2 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -101,6 +101,37 @@ static void vram_put(struct hvm_hw_stdvga *s, void *p)
     unmap_domain_page(p);
 }
 
+static void stdvga_try_cache_enable(struct hvm_hw_stdvga *s)
+{
+    /*
+     * Caching mode can only be enabled if the the cache has
+     * never been used before. As soon as it is disabled, it will
+     * become out-of-sync with the VGA device model and since no
+     * mechanism exists to acquire current VRAM state from the
+     * device model, re-enabling it would lead to stale data being
+     * seen by the guest.
+     */
+    if ( s->cache != STDVGA_CACHE_UNINITIALIZED )
+        return;
+
+    gdprintk(XENLOG_INFO, "entering caching mode\n");
+    s->cache = STDVGA_CACHE_ENABLED;
+}
+
+static void stdvga_cache_disable(struct hvm_hw_stdvga *s)
+{
+    if ( s->cache != STDVGA_CACHE_ENABLED )
+        return;
+
+    gdprintk(XENLOG_INFO, "leaving caching mode\n");
+    s->cache = STDVGA_CACHE_DISABLED;
+}
+
+static bool_t stdvga_cache_is_enabled(const struct hvm_hw_stdvga *s)
+{
+    return s->cache == STDVGA_CACHE_ENABLED;
+}
+
 static int stdvga_outb(uint64_t addr, uint8_t val)
 {
     struct hvm_hw_stdvga *s = &current->domain->arch.hvm_domain.stdvga;
@@ -139,12 +170,8 @@ static int stdvga_outb(uint64_t addr, uint8_t val)
 
     if ( !prev_stdvga && s->stdvga )
     {
-        /*
-         * (Re)start caching of video buffer.
-         * XXX TODO: In case of a restart the cache could be unsynced.
-         */
-        s->cache = 1;
-        gdprintk(XENLOG_INFO, "entering stdvga and caching modes\n");
+        gdprintk(XENLOG_INFO, "entering stdvga mode\n");
+        stdvga_try_cache_enable(s);
     }
     else if ( prev_stdvga && !s->stdvga )
     {
@@ -441,7 +468,7 @@ static int stdvga_mem_write(const struct hvm_io_handler *handler,
     };
     struct hvm_ioreq_server *srv;
 
-    if ( !s->cache || !s->stdvga )
+    if ( !stdvga_cache_is_enabled(s) || !s->stdvga )
         goto done;
 
     /* Intercept mmio write */
@@ -515,15 +542,12 @@ static bool_t stdvga_mem_accept(const struct hvm_io_handler *handler,
          * not active since we can assert, when in stdvga mode, that writes
          * to VRAM have no side effect and thus we can try to buffer them.
          */
-        if ( s->cache )
-        {
-            gdprintk(XENLOG_INFO, "leaving caching mode\n");
-            s->cache = 0;
-        }
+        stdvga_cache_disable(s);
 
         goto reject;
     }
-    else if ( p->dir == IOREQ_READ && (!s->cache || !s->stdvga) )
+    else if ( p->dir == IOREQ_READ &&
+              (!stdvga_cache_is_enabled(s) || !s->stdvga) )
         goto reject;
 
     /* s->lock intentionally held */
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index 8585a1f..ceefa2e 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -128,13 +128,19 @@ void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
 void msix_write_completion(struct vcpu *);
 void msixtbl_init(struct domain *d);
 
+enum stdvga_cache_state {
+    STDVGA_CACHE_UNINITIALIZED,
+    STDVGA_CACHE_ENABLED,
+    STDVGA_CACHE_DISABLED
+};
+
 struct hvm_hw_stdvga {
     uint8_t sr_index;
     uint8_t sr[8];
     uint8_t gr_index;
     uint8_t gr[9];
     bool_t stdvga;
-    bool_t cache;
+    enum stdvga_cache_state cache;
     uint32_t latch;
     struct page_info *vram_page[64];  /* shadow of 0xa0000-0xaffff */
     spinlock_t 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 Fri Nov 13 19:22:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Nov 2015 19:22: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 1ZxJvF-0004kX-Bh; Fri, 13 Nov 2015 19:22: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 1ZxJvE-0004kM-Df
	for xen-changelog@lists.xensource.com; Fri, 13 Nov 2015 19:22:08 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	C5/E0-25435-F5836465; Fri, 13 Nov 2015 19:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1447442526!3024442!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48502 invoked from network); 13 Nov 2015 19:22:07 -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;
	13 Nov 2015 19:22:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZxJvB-0005hl-Tx
	for xen-changelog@lists.xensource.com; Fri, 13 Nov 2015 19:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZxJvA-0003SB-Br
	for xen-changelog@lists.xensource.com; Fri, 13 Nov 2015 19:22:04 +0000
Date: Fri, 13 Nov 2015 19:22:04 +0000
Message-Id: <E1ZxJvA-0003SB-Br@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/HVM: always intercept #AC and
	#DB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26b09fa24faff16b3795b3d47088b17727a4e670
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 10 12:22:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:22:25 2015 +0100

    x86/HVM: always intercept #AC and #DB
    
    Both being benign exceptions, and both being possible to get triggered
    by exception delivery, this is required to prevent a guest from locking
    up a CPU (resulting from no other VM exits occurring once getting into
    such a loop).
    
    The specific scenarios:
    
    1) #AC may be raised during exception delivery if the handler is set to
    be a ring-3 one by a 32-bit guest, and the stack is misaligned.
    
    This is CVE-2015-5307 / XSA-156.
    
    Reported-by: Benjamin Serebrin <serebrin@google.com>
    
    2) #DB may be raised during exception delivery when a breakpoint got
    placed on a data structure involved in delivering the exception. This
    can result in an endless loop when a 64-bit guest uses a non-zero IST
    for the vector 1 IDT entry, but even without use of IST the time it
    takes until a contributory fault would get raised (results depending
    on the handler) may be quite long.
    
    This is CVE-2015-8104 / XSA-156.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: bd2239d9fa975a1ee5bcd27c218ae042cd0a57bc
    master date: 2015-11-10 12:03:08 +0100
---
 xen/arch/x86/hvm/svm/svm.c    |   15 +++++++++++----
 xen/arch/x86/hvm/vmx/vmx.c    |   22 +++++++++++-----------
 xen/include/asm-x86/hvm/hvm.h |    5 ++++-
 3 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index db40c84..e21084d 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -941,10 +941,11 @@ static void svm_do_resume(struct vcpu *v)
         unlikely(v->arch.hvm_vcpu.debug_state_latch != debug_state) )
     {
         uint32_t intercepts = vmcb_get_exception_intercepts(vmcb);
-        uint32_t mask = (1U << TRAP_debug) | (1U << TRAP_int3);
+
         v->arch.hvm_vcpu.debug_state_latch = debug_state;
         vmcb_set_exception_intercepts(
-            vmcb, debug_state ? (intercepts | mask) : (intercepts & ~mask));
+            vmcb, debug_state ? (intercepts | (1U << TRAP_int3))
+                              : (intercepts & ~(1U << TRAP_int3)));
     }
 
     if ( v->arch.hvm_svm.launch_core != smp_processor_id() )
@@ -2225,8 +2226,9 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
 
     case VMEXIT_EXCEPTION_DB:
         if ( !v->domain->debugger_attached )
-            goto unexpected_exit_type;
-        domain_pause_for_debugger();
+            hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
+        else
+            domain_pause_for_debugger();
         break;
 
     case VMEXIT_EXCEPTION_BP:
@@ -2274,6 +2276,11 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
         break;
     }
 
+    case VMEXIT_EXCEPTION_AC:
+        HVMTRACE_1D(TRAP, TRAP_alignment_check);
+        hvm_inject_hw_exception(TRAP_alignment_check, vmcb->exitinfo1);
+        break;
+
     case VMEXIT_EXCEPTION_UD:
         svm_vmexit_ud_intercept(regs);
         break;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 35b4935..ced3092 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1132,16 +1132,10 @@ static void vmx_update_host_cr3(struct vcpu *v)
 
 void vmx_update_debug_state(struct vcpu *v)
 {
-    unsigned long mask;
-
-    mask = 1u << TRAP_int3;
-    if ( !cpu_has_monitor_trap_flag )
-        mask |= 1u << TRAP_debug;
-
     if ( v->arch.hvm_vcpu.debug_state_latch )
-        v->arch.hvm_vmx.exception_bitmap |= mask;
+        v->arch.hvm_vmx.exception_bitmap |= 1U << TRAP_int3;
     else
-        v->arch.hvm_vmx.exception_bitmap &= ~mask;
+        v->arch.hvm_vmx.exception_bitmap &= ~(1U << TRAP_int3);
 
     vmx_vmcs_enter(v);
     vmx_update_exception_bitmap(v);
@@ -2678,9 +2672,10 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             __vmread(EXIT_QUALIFICATION, &exit_qualification);
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
-            if ( !v->domain->debugger_attached || cpu_has_monitor_trap_flag )
-                goto exit_and_crash;
-            domain_pause_for_debugger();
+            if ( !v->domain->debugger_attached )
+                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+            else
+                domain_pause_for_debugger();
             break;
         case TRAP_int3: 
         {
@@ -2745,6 +2740,11 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
             hvm_inject_page_fault(regs->error_code, exit_qualification);
             break;
+        case TRAP_alignment_check:
+            HVMTRACE_1D(TRAP, vector);
+            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
+            hvm_inject_hw_exception(vector, ecode);
+            break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_MASK) !=
                  (X86_EVENTTYPE_NMI << 8) )
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 974bcc0..d22c419 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -393,7 +393,10 @@ static inline bool_t hvm_vcpu_has_smep(void)
 })
 
 /* These exceptions must always be intercepted. */
-#define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
+#define HVM_TRAP_MASK ((1U << TRAP_debug)           | \
+                       (1U << TRAP_invalid_op)      | \
+                       (1U << TRAP_alignment_check) | \
+                       (1U << TRAP_machine_check))
 
 /*
  * x86 event types. This enumeration is valid for:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Fri Nov 13 19:22:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Nov 2015 19:22: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 1ZxJvF-0004kX-Bh; Fri, 13 Nov 2015 19:22: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 1ZxJvE-0004kM-Df
	for xen-changelog@lists.xensource.com; Fri, 13 Nov 2015 19:22:08 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	C5/E0-25435-F5836465; Fri, 13 Nov 2015 19:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1447442526!3024442!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48502 invoked from network); 13 Nov 2015 19:22:07 -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;
	13 Nov 2015 19:22:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZxJvB-0005hl-Tx
	for xen-changelog@lists.xensource.com; Fri, 13 Nov 2015 19:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZxJvA-0003SB-Br
	for xen-changelog@lists.xensource.com; Fri, 13 Nov 2015 19:22:04 +0000
Date: Fri, 13 Nov 2015 19:22:04 +0000
Message-Id: <E1ZxJvA-0003SB-Br@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/HVM: always intercept #AC and
	#DB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26b09fa24faff16b3795b3d47088b17727a4e670
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 10 12:22:25 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:22:25 2015 +0100

    x86/HVM: always intercept #AC and #DB
    
    Both being benign exceptions, and both being possible to get triggered
    by exception delivery, this is required to prevent a guest from locking
    up a CPU (resulting from no other VM exits occurring once getting into
    such a loop).
    
    The specific scenarios:
    
    1) #AC may be raised during exception delivery if the handler is set to
    be a ring-3 one by a 32-bit guest, and the stack is misaligned.
    
    This is CVE-2015-5307 / XSA-156.
    
    Reported-by: Benjamin Serebrin <serebrin@google.com>
    
    2) #DB may be raised during exception delivery when a breakpoint got
    placed on a data structure involved in delivering the exception. This
    can result in an endless loop when a 64-bit guest uses a non-zero IST
    for the vector 1 IDT entry, but even without use of IST the time it
    takes until a contributory fault would get raised (results depending
    on the handler) may be quite long.
    
    This is CVE-2015-8104 / XSA-156.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: bd2239d9fa975a1ee5bcd27c218ae042cd0a57bc
    master date: 2015-11-10 12:03:08 +0100
---
 xen/arch/x86/hvm/svm/svm.c    |   15 +++++++++++----
 xen/arch/x86/hvm/vmx/vmx.c    |   22 +++++++++++-----------
 xen/include/asm-x86/hvm/hvm.h |    5 ++++-
 3 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index db40c84..e21084d 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -941,10 +941,11 @@ static void svm_do_resume(struct vcpu *v)
         unlikely(v->arch.hvm_vcpu.debug_state_latch != debug_state) )
     {
         uint32_t intercepts = vmcb_get_exception_intercepts(vmcb);
-        uint32_t mask = (1U << TRAP_debug) | (1U << TRAP_int3);
+
         v->arch.hvm_vcpu.debug_state_latch = debug_state;
         vmcb_set_exception_intercepts(
-            vmcb, debug_state ? (intercepts | mask) : (intercepts & ~mask));
+            vmcb, debug_state ? (intercepts | (1U << TRAP_int3))
+                              : (intercepts & ~(1U << TRAP_int3)));
     }
 
     if ( v->arch.hvm_svm.launch_core != smp_processor_id() )
@@ -2225,8 +2226,9 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
 
     case VMEXIT_EXCEPTION_DB:
         if ( !v->domain->debugger_attached )
-            goto unexpected_exit_type;
-        domain_pause_for_debugger();
+            hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
+        else
+            domain_pause_for_debugger();
         break;
 
     case VMEXIT_EXCEPTION_BP:
@@ -2274,6 +2276,11 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
         break;
     }
 
+    case VMEXIT_EXCEPTION_AC:
+        HVMTRACE_1D(TRAP, TRAP_alignment_check);
+        hvm_inject_hw_exception(TRAP_alignment_check, vmcb->exitinfo1);
+        break;
+
     case VMEXIT_EXCEPTION_UD:
         svm_vmexit_ud_intercept(regs);
         break;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 35b4935..ced3092 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1132,16 +1132,10 @@ static void vmx_update_host_cr3(struct vcpu *v)
 
 void vmx_update_debug_state(struct vcpu *v)
 {
-    unsigned long mask;
-
-    mask = 1u << TRAP_int3;
-    if ( !cpu_has_monitor_trap_flag )
-        mask |= 1u << TRAP_debug;
-
     if ( v->arch.hvm_vcpu.debug_state_latch )
-        v->arch.hvm_vmx.exception_bitmap |= mask;
+        v->arch.hvm_vmx.exception_bitmap |= 1U << TRAP_int3;
     else
-        v->arch.hvm_vmx.exception_bitmap &= ~mask;
+        v->arch.hvm_vmx.exception_bitmap &= ~(1U << TRAP_int3);
 
     vmx_vmcs_enter(v);
     vmx_update_exception_bitmap(v);
@@ -2678,9 +2672,10 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             __vmread(EXIT_QUALIFICATION, &exit_qualification);
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
-            if ( !v->domain->debugger_attached || cpu_has_monitor_trap_flag )
-                goto exit_and_crash;
-            domain_pause_for_debugger();
+            if ( !v->domain->debugger_attached )
+                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+            else
+                domain_pause_for_debugger();
             break;
         case TRAP_int3: 
         {
@@ -2745,6 +2740,11 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
             hvm_inject_page_fault(regs->error_code, exit_qualification);
             break;
+        case TRAP_alignment_check:
+            HVMTRACE_1D(TRAP, vector);
+            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
+            hvm_inject_hw_exception(vector, ecode);
+            break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_MASK) !=
                  (X86_EVENTTYPE_NMI << 8) )
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 974bcc0..d22c419 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -393,7 +393,10 @@ static inline bool_t hvm_vcpu_has_smep(void)
 })
 
 /* These exceptions must always be intercepted. */
-#define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
+#define HVM_TRAP_MASK ((1U << TRAP_debug)           | \
+                       (1U << TRAP_invalid_op)      | \
+                       (1U << TRAP_alignment_check) | \
+                       (1U << TRAP_machine_check))
 
 /*
  * x86 event types. This enumeration is valid for:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Mon Nov 16 11:44:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 11: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 1ZyICf-00017Z-1Q; Mon, 16 Nov 2015 11:44: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 1ZyICd-00017U-DG
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 11:44:07 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	7F/0B-02940-681C9465; Mon, 16 Nov 2015 11:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1447674245!3937488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55635 invoked from network); 16 Nov 2015 11:44:06 -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;
	16 Nov 2015 11:44:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyICa-0001O3-1j
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 11:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyICZ-0001We-Re
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 11:44:03 +0000
Date: Mon, 16 Nov 2015 11:44:03 +0000
Message-Id: <E1ZyICZ-0001We-Re@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] xenbus: notify the other end when
	necessary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22d01aab99180539b38b13ba30f0e1cd62b72147
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 27 15:43:28 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:29:23 2015 +0000

    xenbus: notify the other end when necessary
    
    The xenbus thread didn't send notification to other end when it expected
    more data or consumed responses, which led to stalling the ring from
    time to time.
    
    This is the culprit that guest was less responsive when using stubdom
    because the device model was stalled.
    
    Fix this by sending notification to the other end when it consumes a
    message. A bunch of memory barriers are also added to ensure
    correctness.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 xenbus/xenbus.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xenbus/xenbus.c b/xenbus/xenbus.c
index 4613ed6..0ab387a 100644
--- a/xenbus/xenbus.c
+++ b/xenbus/xenbus.c
@@ -237,6 +237,7 @@ static void xenbus_thread_func(void *ign)
 		event->path = data;
 		event->token = event->path + strlen(event->path) + 1;
 
+                mb();
                 xenstore_buf->rsp_cons += msg.len + sizeof(msg);
 
                 for (watch = watches; watch; watch = watch->next)
@@ -262,9 +263,13 @@ static void xenbus_thread_func(void *ign)
                     req_info[msg.req_id].reply,
                     MASK_XENSTORE_IDX(xenstore_buf->rsp_cons),
                     msg.len + sizeof(msg));
+                mb();
                 xenstore_buf->rsp_cons += msg.len + sizeof(msg);
                 wake_up(&req_info[msg.req_id].waitq);
             }
+
+            wmb();
+            notify_remote_via_evtchn(start_info.store_evtchn);
         }
     }
 }
--
generated by git-patchbot for /home/xen/git/mini-os.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 Nov 16 11:44:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 11: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 1ZyICf-00017Z-1Q; Mon, 16 Nov 2015 11:44: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 1ZyICd-00017U-DG
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 11:44:07 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	7F/0B-02940-681C9465; Mon, 16 Nov 2015 11:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1447674245!3937488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55635 invoked from network); 16 Nov 2015 11:44:06 -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;
	16 Nov 2015 11:44:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyICa-0001O3-1j
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 11:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyICZ-0001We-Re
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 11:44:03 +0000
Date: Mon, 16 Nov 2015 11:44:03 +0000
Message-Id: <E1ZyICZ-0001We-Re@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] xenbus: notify the other end when
	necessary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22d01aab99180539b38b13ba30f0e1cd62b72147
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 27 15:43:28 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:29:23 2015 +0000

    xenbus: notify the other end when necessary
    
    The xenbus thread didn't send notification to other end when it expected
    more data or consumed responses, which led to stalling the ring from
    time to time.
    
    This is the culprit that guest was less responsive when using stubdom
    because the device model was stalled.
    
    Fix this by sending notification to the other end when it consumes a
    message. A bunch of memory barriers are also added to ensure
    correctness.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 xenbus/xenbus.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xenbus/xenbus.c b/xenbus/xenbus.c
index 4613ed6..0ab387a 100644
--- a/xenbus/xenbus.c
+++ b/xenbus/xenbus.c
@@ -237,6 +237,7 @@ static void xenbus_thread_func(void *ign)
 		event->path = data;
 		event->token = event->path + strlen(event->path) + 1;
 
+                mb();
                 xenstore_buf->rsp_cons += msg.len + sizeof(msg);
 
                 for (watch = watches; watch; watch = watch->next)
@@ -262,9 +263,13 @@ static void xenbus_thread_func(void *ign)
                     req_info[msg.req_id].reply,
                     MASK_XENSTORE_IDX(xenstore_buf->rsp_cons),
                     msg.len + sizeof(msg));
+                mb();
                 xenstore_buf->rsp_cons += msg.len + sizeof(msg);
                 wake_up(&req_info[msg.req_id].waitq);
             }
+
+            wmb();
+            notify_remote_via_evtchn(start_info.store_evtchn);
         }
     }
 }
--
generated by git-patchbot for /home/xen/git/mini-os.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 Nov 16 12:44:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 12:44: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 1ZyJ8j-0006GI-Tb; Mon, 16 Nov 2015 12:44:09 +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 1ZyJ8i-0006FD-K3
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:08 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	0D/32-32641-79FC9465; Mon, 16 Nov 2015 12:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-31.messagelabs.com!1447677845!3954818!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54525 invoked from network); 16 Nov 2015 12:44:06 -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;
	16 Nov 2015 12:44:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1ZyJ8f-00025q-F6
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1ZyJ8f-00074v-7j
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:05 +0000
Message-Id: <E1ZyJ8f-00074v-7j@xenbits.xen.org>
Date: Mon, 16 Nov 2015 12:44:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] blktap: refine mm tracking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1447677635 -3600
# Node ID a0a79976ffebcfa5ff55feb09f833fc1adbeb2e8
# Parent  3ae3ae4c878fe95de3f895110806a428e88e90b1
blktap: refine mm tracking

As already noted in c/s 1013:eb21d96a6aae ("xen/blktap: fix cleanup
after unclean application exit") and 1015:2a4b455b1fba ("blktap: fix
cleanup after unclean application exit #2"), the extra reference
obtained on tapdisk's mm (from c/s 867:978499ee4f39 ["linux/blktap: fix
vma_close() for partial munmap"]) is problematic. However, while the
two c/s fixed what they claim to, the reconnect case got broken
(tap_blkif_schedule() clearing init->mm left no way for it to get set
again).

Do away with the extra reference: The mm of interest can't go away as
long as we have a VMA in it. To take care of VMA splitting, track the
amount of outstanding mapped space, and zap info->mm when that value
drops to zero.

At the same time also fix the oversight in the first of the mentioned
c/s of not keeping ring_ok up to date: The zapping of info->mm without
clearing info->ring_ok led to NULL pointer accesses in down_read()
called from dispatch_rw_block_io(). We don't really need the extra
flag, we can use info->mm for that purpose.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 3ae3ae4c878f -r a0a79976ffeb drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c	Mon Nov 16 13:38:00 2015 +0100
+++ b/drivers/xen/blktap/blktap.c	Mon Nov 16 13:40:35 2015 +0100
@@ -102,10 +102,10 @@ typedef struct domid_translate_ext {
 typedef struct tap_blkif {
 	struct mm_struct *mm;         /*User address space                   */
 	unsigned long rings_vstart;   /*Kernel memory mapping                */
+	unsigned long rings_total;    /*Kernel memory mapping size           */
 	unsigned long user_vstart;    /*User memory mapping                  */
 	unsigned long dev_inuse;      /*One process opens device at a time.  */
 	unsigned long dev_pending;    /*In process of being opened           */
-	unsigned long ring_ok;        /*make this ring->state                */
 	blkif_front_ring_t ufe_ring;  /*Rings up to user space.              */
 	wait_queue_head_t wait;       /*for poll                             */
 	unsigned long mode;           /*current switching mode               */
@@ -397,12 +397,22 @@ static void blktap_vma_open(struct vm_ar
  */
 static void blktap_vma_close(struct vm_area_struct *vma)
 {
+	tap_blkif_t *info;
 	struct vm_area_struct *next = vma->vm_next;
 
+	if (vma->vm_file == NULL)
+		return;
+
+	info = vma->vm_file->private_data;
+	info->rings_total -= vma->vm_end - vma->vm_start;
+	if (info->rings_total == 0) {
+		info->mm = NULL;
+		return;
+	}
+
 	if (next == NULL ||
 	    vma->vm_ops != next->vm_ops ||
 	    vma->vm_end != next->vm_start ||
-	    vma->vm_file == NULL ||
 	    vma->vm_file != next->vm_file)
 		return;
 
@@ -537,7 +547,6 @@ void signal_tapdisk(int idx)
 {
 	tap_blkif_t *info;
 	struct task_struct *ptask;
-	struct mm_struct *mm;
 
 	/*
 	 * if the userland tools set things up wrong, this could be negative;
@@ -556,10 +565,7 @@ void signal_tapdisk(int idx)
 			info->status = CLEANSHUTDOWN;
 	}
 	info->blkif = NULL;
-
-	mm = xchg(&info->mm, NULL);
-	if (mm)
-		mmput(mm);
+	info->mm = NULL;
 }
 
 static int blktap_open(struct inode *inode, struct file *filp)
@@ -629,19 +635,16 @@ static int blktap_open(struct inode *ino
 static int blktap_release(struct inode *inode, struct file *filp)
 {
 	tap_blkif_t *info = filp->private_data;
-	struct mm_struct *mm;
 	
 	/* check for control device */
 	if (!info)
 		return 0;
 
-	info->ring_ok = 0;
+	info->mm = NULL;
 	smp_wmb();
 	info->rings_vstart = 0;
+	info->rings_total = 0;
 
-	mm = xchg(&info->mm, NULL);
-	if (mm)
-		mmput(mm);
 	kfree(info->foreign_maps->map);
 	kfree(info->foreign_maps);
 	info->foreign_maps = NULL;
@@ -700,7 +703,7 @@ static int blktap_mmap(struct file *filp
 		return -ENOMEM;
 	}
 
-	if (info->rings_vstart) {
+	if (info->rings_total) {
 		WPRINTK("mmap already called on filp %p (minor %d)\n",
 			filp, info->minor);
 		return -EPERM;
@@ -718,6 +721,7 @@ static int blktap_mmap(struct file *filp
 
 	size >>= PAGE_SHIFT;
 	info->rings_vstart = vma->vm_start;
+	info->rings_total  = vma->vm_end - vma->vm_start;
 	info->user_vstart  = info->rings_vstart + (RING_PAGES << PAGE_SHIFT);
     
 	/* Map the ring pages to the start of the region and reserve it. */
@@ -754,15 +758,15 @@ static int blktap_mmap(struct file *filp
 	vma->vm_mm->context.has_foreign_mappings = 1;
 #endif
 
-	info->mm = get_task_mm(current);
 	smp_wmb();
-	info->ring_ok = 1;
+	info->mm = vma->vm_mm;
 	return 0;
  fail:
 	/* Clear any active mappings. */
 	zap_page_range(vma, vma->vm_start, 
 		       vma->vm_end - vma->vm_start, NULL);
 	info->rings_vstart = 0;
+	info->rings_total = 0;
 
 	return -ENOMEM;
 }
@@ -1057,6 +1061,7 @@ static void fast_flush_area(pending_req_
 	unsigned long uvaddr;
 	struct mm_struct *mm = info->mm;
 
+	smp_rmb();
 	if (mm != NULL)
 		down_read(&mm->mmap_sem);
 
@@ -1187,13 +1192,6 @@ int tap_blkif_schedule(void *arg)
 	info = tapfds[blkif->dev_num];
 	blkif_put(blkif);
 
-	if (info) {
-		struct mm_struct *mm = xchg(&info->mm, NULL);
-
-		if (mm)
-			mmput(mm);
-	}
-
 	return 0;
 }
 
@@ -1474,11 +1472,12 @@ static void dispatch_rw_block_io(blkif_t
 	}
 	
 	/* Make sure userspace is ready. */
-	if (!info->ring_ok) {
+	mm = info->mm;
+	smp_rmb();
+	if (!mm) {
 		WPRINTK("ring not ready for requests!\n");
 		goto fail_response;
 	}
-	smp_rmb();
 
 	if (RING_FULL(&info->ufe_ring)) {
 		WPRINTK("fe_ring is full, "
@@ -1496,7 +1495,6 @@ static void dispatch_rw_block_io(blkif_t
 	if (req->operation == BLKIF_OP_WRITE)
 		flags |= GNTMAP_readonly;
 	op = 0;
-	mm = info->mm;
 	if (!xen_feature(XENFEAT_auto_translated_physmap))
 		down_read(&mm->mmap_sem);
 	for (i = 0; i < nseg; i++) {

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

From xen-changelog-bounces@lists.xen.org Mon Nov 16 12:44:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 12:44: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 1ZyJ8i-0006FH-QG; Mon, 16 Nov 2015 12:44:08 +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 1ZyJ8h-0006F6-DH
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:07 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	41/61-29649-69FC9465; Mon, 16 Nov 2015 12:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-31.messagelabs.com!1447677845!4076355!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46060 invoked from network); 16 Nov 2015 12:44:06 -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;
	16 Nov 2015 12:44:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1ZyJ8e-00025m-W8
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1ZyJ8e-00074g-Ll
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:04 +0000
Message-Id: <E1ZyJ8e-00074g-Ll@xenbits.xen.org>
Date: Mon, 16 Nov 2015 12:44:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] blktap: also call
	blkif_disconnect() when frontend switched to closed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1447677480 -3600
# Node ID 3ae3ae4c878fe95de3f895110806a428e88e90b1
# Parent  bdbb8212e3b1e7f67cd5ca552b5ddc0d94c6bd33
blktap: also call blkif_disconnect() when frontend switched to closed

frontends aren't required to set their state to XenbusStateClosing, yet
backends should not hang on to resources when there's no connection. As
frontend_changed() already makes use of blkif_disconnect() being
idempotent, we're fine to utilize this here too. This mirrors the
respective blkback change (c/s 1162:4c2b7dcbfd8b).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r bdbb8212e3b1 -r 3ae3ae4c878f drivers/xen/blktap/xenbus.c
--- a/drivers/xen/blktap/xenbus.c	Fri Oct 16 17:04:25 2015 +0200
+++ b/drivers/xen/blktap/xenbus.c	Mon Nov 16 13:38:00 2015 +0100
@@ -385,13 +385,11 @@ static void tap_frontend_changed(struct 
 		break;
 
 	case XenbusStateClosing:
+	case XenbusStateClosed:
 		blkif_disconnect(be->blkif);
-		xenbus_switch_state(dev, XenbusStateClosing);
-		break;
-
-	case XenbusStateClosed:
-		xenbus_switch_state(dev, XenbusStateClosed);
-		if (xenbus_dev_is_online(dev))
+		xenbus_switch_state(dev, frontend_state);
+		if (frontend_state != XenbusStateClosed ||
+		    xenbus_dev_is_online(dev))
 			break;
 		/* fall through if not online */
 	case XenbusStateUnknown:

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

From xen-changelog-bounces@lists.xen.org Mon Nov 16 12:44:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 12:44: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 1ZyJ8j-0006GI-Tb; Mon, 16 Nov 2015 12:44:09 +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 1ZyJ8i-0006FD-K3
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:08 +0000
Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id
	0D/32-32641-79FC9465; Mon, 16 Nov 2015 12:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-31.messagelabs.com!1447677845!3954818!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54525 invoked from network); 16 Nov 2015 12:44:06 -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;
	16 Nov 2015 12:44:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1ZyJ8f-00025q-F6
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1ZyJ8f-00074v-7j
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:05 +0000
Message-Id: <E1ZyJ8f-00074v-7j@xenbits.xen.org>
Date: Mon, 16 Nov 2015 12:44:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] blktap: refine mm tracking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1447677635 -3600
# Node ID a0a79976ffebcfa5ff55feb09f833fc1adbeb2e8
# Parent  3ae3ae4c878fe95de3f895110806a428e88e90b1
blktap: refine mm tracking

As already noted in c/s 1013:eb21d96a6aae ("xen/blktap: fix cleanup
after unclean application exit") and 1015:2a4b455b1fba ("blktap: fix
cleanup after unclean application exit #2"), the extra reference
obtained on tapdisk's mm (from c/s 867:978499ee4f39 ["linux/blktap: fix
vma_close() for partial munmap"]) is problematic. However, while the
two c/s fixed what they claim to, the reconnect case got broken
(tap_blkif_schedule() clearing init->mm left no way for it to get set
again).

Do away with the extra reference: The mm of interest can't go away as
long as we have a VMA in it. To take care of VMA splitting, track the
amount of outstanding mapped space, and zap info->mm when that value
drops to zero.

At the same time also fix the oversight in the first of the mentioned
c/s of not keeping ring_ok up to date: The zapping of info->mm without
clearing info->ring_ok led to NULL pointer accesses in down_read()
called from dispatch_rw_block_io(). We don't really need the extra
flag, we can use info->mm for that purpose.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 3ae3ae4c878f -r a0a79976ffeb drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c	Mon Nov 16 13:38:00 2015 +0100
+++ b/drivers/xen/blktap/blktap.c	Mon Nov 16 13:40:35 2015 +0100
@@ -102,10 +102,10 @@ typedef struct domid_translate_ext {
 typedef struct tap_blkif {
 	struct mm_struct *mm;         /*User address space                   */
 	unsigned long rings_vstart;   /*Kernel memory mapping                */
+	unsigned long rings_total;    /*Kernel memory mapping size           */
 	unsigned long user_vstart;    /*User memory mapping                  */
 	unsigned long dev_inuse;      /*One process opens device at a time.  */
 	unsigned long dev_pending;    /*In process of being opened           */
-	unsigned long ring_ok;        /*make this ring->state                */
 	blkif_front_ring_t ufe_ring;  /*Rings up to user space.              */
 	wait_queue_head_t wait;       /*for poll                             */
 	unsigned long mode;           /*current switching mode               */
@@ -397,12 +397,22 @@ static void blktap_vma_open(struct vm_ar
  */
 static void blktap_vma_close(struct vm_area_struct *vma)
 {
+	tap_blkif_t *info;
 	struct vm_area_struct *next = vma->vm_next;
 
+	if (vma->vm_file == NULL)
+		return;
+
+	info = vma->vm_file->private_data;
+	info->rings_total -= vma->vm_end - vma->vm_start;
+	if (info->rings_total == 0) {
+		info->mm = NULL;
+		return;
+	}
+
 	if (next == NULL ||
 	    vma->vm_ops != next->vm_ops ||
 	    vma->vm_end != next->vm_start ||
-	    vma->vm_file == NULL ||
 	    vma->vm_file != next->vm_file)
 		return;
 
@@ -537,7 +547,6 @@ void signal_tapdisk(int idx)
 {
 	tap_blkif_t *info;
 	struct task_struct *ptask;
-	struct mm_struct *mm;
 
 	/*
 	 * if the userland tools set things up wrong, this could be negative;
@@ -556,10 +565,7 @@ void signal_tapdisk(int idx)
 			info->status = CLEANSHUTDOWN;
 	}
 	info->blkif = NULL;
-
-	mm = xchg(&info->mm, NULL);
-	if (mm)
-		mmput(mm);
+	info->mm = NULL;
 }
 
 static int blktap_open(struct inode *inode, struct file *filp)
@@ -629,19 +635,16 @@ static int blktap_open(struct inode *ino
 static int blktap_release(struct inode *inode, struct file *filp)
 {
 	tap_blkif_t *info = filp->private_data;
-	struct mm_struct *mm;
 	
 	/* check for control device */
 	if (!info)
 		return 0;
 
-	info->ring_ok = 0;
+	info->mm = NULL;
 	smp_wmb();
 	info->rings_vstart = 0;
+	info->rings_total = 0;
 
-	mm = xchg(&info->mm, NULL);
-	if (mm)
-		mmput(mm);
 	kfree(info->foreign_maps->map);
 	kfree(info->foreign_maps);
 	info->foreign_maps = NULL;
@@ -700,7 +703,7 @@ static int blktap_mmap(struct file *filp
 		return -ENOMEM;
 	}
 
-	if (info->rings_vstart) {
+	if (info->rings_total) {
 		WPRINTK("mmap already called on filp %p (minor %d)\n",
 			filp, info->minor);
 		return -EPERM;
@@ -718,6 +721,7 @@ static int blktap_mmap(struct file *filp
 
 	size >>= PAGE_SHIFT;
 	info->rings_vstart = vma->vm_start;
+	info->rings_total  = vma->vm_end - vma->vm_start;
 	info->user_vstart  = info->rings_vstart + (RING_PAGES << PAGE_SHIFT);
     
 	/* Map the ring pages to the start of the region and reserve it. */
@@ -754,15 +758,15 @@ static int blktap_mmap(struct file *filp
 	vma->vm_mm->context.has_foreign_mappings = 1;
 #endif
 
-	info->mm = get_task_mm(current);
 	smp_wmb();
-	info->ring_ok = 1;
+	info->mm = vma->vm_mm;
 	return 0;
  fail:
 	/* Clear any active mappings. */
 	zap_page_range(vma, vma->vm_start, 
 		       vma->vm_end - vma->vm_start, NULL);
 	info->rings_vstart = 0;
+	info->rings_total = 0;
 
 	return -ENOMEM;
 }
@@ -1057,6 +1061,7 @@ static void fast_flush_area(pending_req_
 	unsigned long uvaddr;
 	struct mm_struct *mm = info->mm;
 
+	smp_rmb();
 	if (mm != NULL)
 		down_read(&mm->mmap_sem);
 
@@ -1187,13 +1192,6 @@ int tap_blkif_schedule(void *arg)
 	info = tapfds[blkif->dev_num];
 	blkif_put(blkif);
 
-	if (info) {
-		struct mm_struct *mm = xchg(&info->mm, NULL);
-
-		if (mm)
-			mmput(mm);
-	}
-
 	return 0;
 }
 
@@ -1474,11 +1472,12 @@ static void dispatch_rw_block_io(blkif_t
 	}
 	
 	/* Make sure userspace is ready. */
-	if (!info->ring_ok) {
+	mm = info->mm;
+	smp_rmb();
+	if (!mm) {
 		WPRINTK("ring not ready for requests!\n");
 		goto fail_response;
 	}
-	smp_rmb();
 
 	if (RING_FULL(&info->ufe_ring)) {
 		WPRINTK("fe_ring is full, "
@@ -1496,7 +1495,6 @@ static void dispatch_rw_block_io(blkif_t
 	if (req->operation == BLKIF_OP_WRITE)
 		flags |= GNTMAP_readonly;
 	op = 0;
-	mm = info->mm;
 	if (!xen_feature(XENFEAT_auto_translated_physmap))
 		down_read(&mm->mmap_sem);
 	for (i = 0; i < nseg; i++) {

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

From xen-changelog-bounces@lists.xen.org Mon Nov 16 12:44:10 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 12:44: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 1ZyJ8i-0006FH-QG; Mon, 16 Nov 2015 12:44:08 +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 1ZyJ8h-0006F6-DH
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:07 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	41/61-29649-69FC9465; Mon, 16 Nov 2015 12:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-31.messagelabs.com!1447677845!4076355!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46060 invoked from network); 16 Nov 2015 12:44:06 -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;
	16 Nov 2015 12:44:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1ZyJ8e-00025m-W8
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1ZyJ8e-00074g-Ll
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 12:44:04 +0000
Message-Id: <E1ZyJ8e-00074g-Ll@xenbits.xen.org>
Date: Mon, 16 Nov 2015 12:44:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] blktap: also call
	blkif_disconnect() when frontend switched to closed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1447677480 -3600
# Node ID 3ae3ae4c878fe95de3f895110806a428e88e90b1
# Parent  bdbb8212e3b1e7f67cd5ca552b5ddc0d94c6bd33
blktap: also call blkif_disconnect() when frontend switched to closed

frontends aren't required to set their state to XenbusStateClosing, yet
backends should not hang on to resources when there's no connection. As
frontend_changed() already makes use of blkif_disconnect() being
idempotent, we're fine to utilize this here too. This mirrors the
respective blkback change (c/s 1162:4c2b7dcbfd8b).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r bdbb8212e3b1 -r 3ae3ae4c878f drivers/xen/blktap/xenbus.c
--- a/drivers/xen/blktap/xenbus.c	Fri Oct 16 17:04:25 2015 +0200
+++ b/drivers/xen/blktap/xenbus.c	Mon Nov 16 13:38:00 2015 +0100
@@ -385,13 +385,11 @@ static void tap_frontend_changed(struct 
 		break;
 
 	case XenbusStateClosing:
+	case XenbusStateClosed:
 		blkif_disconnect(be->blkif);
-		xenbus_switch_state(dev, XenbusStateClosing);
-		break;
-
-	case XenbusStateClosed:
-		xenbus_switch_state(dev, XenbusStateClosed);
-		if (xenbus_dev_is_online(dev))
+		xenbus_switch_state(dev, frontend_state);
+		if (frontend_state != XenbusStateClosed ||
+		    xenbus_dev_is_online(dev))
 			break;
 		/* fall through if not online */
 	case XenbusStateUnknown:

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

From xen-changelog-bounces@lists.xen.org Mon Nov 16 16:55:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16: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 1ZyN3d-0004RB-73; Mon, 16 Nov 2015 16:55: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 1ZyN3c-0004Qt-2y
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:08 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	F3/31-19110-B6A0A465; Mon, 16 Nov 2015 16:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1447692905!3593488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32428 invoked from network); 16 Nov 2015 16:55:06 -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;
	16 Nov 2015 16:55:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3Y-0005Kk-5b
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3X-0000Ny-Va
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:04 +0000
Date: Mon, 16 Nov 2015 16:55:03 +0000
Message-Id: <E1ZyN3X-0000Ny-Va@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xen: common: Use unbounded array
	for symbols_offset.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 39698f92e4185afdd956e9af6888923c27728875
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 14:10:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:10:31 2015 +0100

    xen: common: Use unbounded array for symbols_offset.
    
    Using a singleton array causes gcc5 to report:
    symbols.c: In function 'symbols_lookup':
    symbols.c:128:359: error: array subscript is above array bounds [-Werror=array-bounds]
    symbols.c:136:176: error: array subscript is above array bounds [-Werror=array-bounds]
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3f82ea62826d4eb06002d8dba475bafcc454b845
    master date: 2015-03-20 12:02:03 +0000
---
 xen/common/symbols.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/symbols.c b/xen/common/symbols.c
index 83b2b58..e576a1b 100644
--- a/xen/common/symbols.c
+++ b/xen/common/symbols.c
@@ -19,7 +19,7 @@
 #include <xen/spinlock.h>
 
 #ifdef SYMBOLS_ORIGIN
-extern const unsigned int symbols_offsets[1];
+extern const unsigned int symbols_offsets[];
 #define symbols_address(n) (SYMBOLS_ORIGIN + symbols_offsets[n])
 #else
 extern const unsigned long symbols_addresses[];
--
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 Mon Nov 16 16:55:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16: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 1ZyN3d-0004RB-73; Mon, 16 Nov 2015 16:55: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 1ZyN3c-0004Qt-2y
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:08 +0000
Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id
	F3/31-19110-B6A0A465; Mon, 16 Nov 2015 16:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1447692905!3593488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32428 invoked from network); 16 Nov 2015 16:55:06 -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;
	16 Nov 2015 16:55:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3Y-0005Kk-5b
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3X-0000Ny-Va
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:04 +0000
Date: Mon, 16 Nov 2015 16:55:03 +0000
Message-Id: <E1ZyN3X-0000Ny-Va@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xen: common: Use unbounded array
	for symbols_offset.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 39698f92e4185afdd956e9af6888923c27728875
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 14:10:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:10:31 2015 +0100

    xen: common: Use unbounded array for symbols_offset.
    
    Using a singleton array causes gcc5 to report:
    symbols.c: In function 'symbols_lookup':
    symbols.c:128:359: error: array subscript is above array bounds [-Werror=array-bounds]
    symbols.c:136:176: error: array subscript is above array bounds [-Werror=array-bounds]
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3f82ea62826d4eb06002d8dba475bafcc454b845
    master date: 2015-03-20 12:02:03 +0000
---
 xen/common/symbols.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/symbols.c b/xen/common/symbols.c
index 83b2b58..e576a1b 100644
--- a/xen/common/symbols.c
+++ b/xen/common/symbols.c
@@ -19,7 +19,7 @@
 #include <xen/spinlock.h>
 
 #ifdef SYMBOLS_ORIGIN
-extern const unsigned int symbols_offsets[1];
+extern const unsigned int symbols_offsets[];
 #define symbols_address(n) (SYMBOLS_ORIGIN + symbols_offsets[n])
 #else
 extern const unsigned long symbols_addresses[];
--
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 Mon Nov 16 16:55:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZyN3s-0004VA-Pv; Mon, 16 Nov 2015 16:55:24 +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 1ZyN3r-0004Uj-CX
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:23 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	CB/58-04752-A7A0A465; Mon, 16 Nov 2015 16:55:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1447692921!3592849!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22748 invoked from network); 16 Nov 2015 16:55:22 -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;
	16 Nov 2015 16:55:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3p-0005Ks-4S
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3j-0000TS-VY
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:16 +0000
Date: Mon, 16 Nov 2015 16:55:15 +0000
Message-Id: <E1ZyN3j-0000TS-VY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] AMD Vi: fix HPET ID 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 e06f1c36d36260b7d82f8563f1a6f226160d4b23
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:23:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:23:35 2015 +0100

    AMD Vi: fix HPET ID check
    
    Cherry picked from commit 2ca9fbd739 ("AMD IOMMU: allocate IRTE entries
    instead of using a static mapping") mainly to fix build with gcc 5.x.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/amd/iommu_intr.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 7943049..789f564 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -449,8 +449,7 @@ void* __init amd_iommu_alloc_intremap_table(void)
 
 int __init amd_setup_hpet_msi(struct msi_desc *msi_desc)
 {
-    if ( (!msi_desc->hpet_id != hpet_sbdf.id) ||
-         (hpet_sbdf.iommu == NULL) )
+    if ( msi_desc->hpet_id != hpet_sbdf.id || !hpet_sbdf.iommu )
     {
         AMD_IOMMU_DEBUG("Fail to setup HPET MSI remapping\n");
         return 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 Mon Nov 16 16:55:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZyN3s-0004VA-Pv; Mon, 16 Nov 2015 16:55:24 +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 1ZyN3r-0004Uj-CX
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:23 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	CB/58-04752-A7A0A465; Mon, 16 Nov 2015 16:55:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1447692921!3592849!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22748 invoked from network); 16 Nov 2015 16:55:22 -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;
	16 Nov 2015 16:55:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3p-0005Ks-4S
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3j-0000TS-VY
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:16 +0000
Date: Mon, 16 Nov 2015 16:55:15 +0000
Message-Id: <E1ZyN3j-0000TS-VY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] AMD Vi: fix HPET ID 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 e06f1c36d36260b7d82f8563f1a6f226160d4b23
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:23:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:23:35 2015 +0100

    AMD Vi: fix HPET ID check
    
    Cherry picked from commit 2ca9fbd739 ("AMD IOMMU: allocate IRTE entries
    instead of using a static mapping") mainly to fix build with gcc 5.x.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/amd/iommu_intr.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 7943049..789f564 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -449,8 +449,7 @@ void* __init amd_iommu_alloc_intremap_table(void)
 
 int __init amd_setup_hpet_msi(struct msi_desc *msi_desc)
 {
-    if ( (!msi_desc->hpet_id != hpet_sbdf.id) ||
-         (hpet_sbdf.iommu == NULL) )
+    if ( msi_desc->hpet_id != hpet_sbdf.id || !hpet_sbdf.iommu )
     {
         AMD_IOMMU_DEBUG("Fail to setup HPET MSI remapping\n");
         return 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 Mon Nov 16 16:55:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:55: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 1ZyN43-0004YL-Tb; Mon, 16 Nov 2015 16:55:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN41-0004Xj-QB
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:33 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	D0/1B-23747-58A0A465; Mon, 16 Nov 2015 16:55:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1447692931!3528591!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34079 invoked from network); 16 Nov 2015 16:55:32 -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;
	16 Nov 2015 16:55:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3z-0005Le-MM
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3z-0000Wt-BA
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:31 +0000
Date: Mon, 16 Nov 2015 16:55:31 +0000
Message-Id: <E1ZyN3z-0000Wt-BA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] arm: handle races between
	relinquish_memory and free_domheap_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 fb02dec2d06a2dd104682973a21375795e344e25
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 14:24:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:24:17 2015 +0100

    arm: handle races between relinquish_memory and free_domheap_pages
    
    Primarily this means XENMEM_decrease_reservation from a toolstack
    domain.
    
    Unlike x86 we have no requirement right now to queue such pages onto
    a separate list, if we hit this race then the other code has already
    fully accepted responsibility for freeing this page and therefore
    there is no more for relinquish_memory to do.
    
    This is CVE-2015-7814 / XSA-147.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ef01396fdff88b1c3331a09ca5c69619b90f4ea
    master date: 2015-10-29 13:34:17 +0100
---
 xen/arch/arm/domain.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 4c434a1..e806bc6 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -600,8 +600,15 @@ static int relinquish_memory(struct domain *d, struct page_list_head *list)
     {
         /* Grab a reference to the page so it won't disappear from under us. */
         if ( unlikely(!get_page(page, d)) )
-            /* Couldn't get a reference -- someone is freeing this page. */
-            BUG();
+            /*
+             * Couldn't get a reference -- someone is freeing this page and
+             * has already committed to doing so, so no more to do here.
+             *
+             * Note that the page must be left on the list, a list_del
+             * here will clash with the list_del done by the other
+             * party in the race and corrupt the list head.
+             */
+            continue;
 
         if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
             put_page(page);
--
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 Mon Nov 16 16:55:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:55: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 1ZyN43-0004YL-Tb; Mon, 16 Nov 2015 16:55:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN41-0004Xj-QB
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:33 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	D0/1B-23747-58A0A465; Mon, 16 Nov 2015 16:55:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1447692931!3528591!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34079 invoked from network); 16 Nov 2015 16:55:32 -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;
	16 Nov 2015 16:55:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3z-0005Le-MM
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN3z-0000Wt-BA
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:31 +0000
Date: Mon, 16 Nov 2015 16:55:31 +0000
Message-Id: <E1ZyN3z-0000Wt-BA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] arm: handle races between
	relinquish_memory and free_domheap_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 fb02dec2d06a2dd104682973a21375795e344e25
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Oct 29 14:24:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:24:17 2015 +0100

    arm: handle races between relinquish_memory and free_domheap_pages
    
    Primarily this means XENMEM_decrease_reservation from a toolstack
    domain.
    
    Unlike x86 we have no requirement right now to queue such pages onto
    a separate list, if we hit this race then the other code has already
    fully accepted responsibility for freeing this page and therefore
    there is no more for relinquish_memory to do.
    
    This is CVE-2015-7814 / XSA-147.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ef01396fdff88b1c3331a09ca5c69619b90f4ea
    master date: 2015-10-29 13:34:17 +0100
---
 xen/arch/arm/domain.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 4c434a1..e806bc6 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -600,8 +600,15 @@ static int relinquish_memory(struct domain *d, struct page_list_head *list)
     {
         /* Grab a reference to the page so it won't disappear from under us. */
         if ( unlikely(!get_page(page, d)) )
-            /* Couldn't get a reference -- someone is freeing this page. */
-            BUG();
+            /*
+             * Couldn't get a reference -- someone is freeing this page and
+             * has already committed to doing so, so no more to do here.
+             *
+             * Note that the page must be left on the list, a list_del
+             * here will clash with the list_del done by the other
+             * party in the race and corrupt the list head.
+             */
+            continue;
 
         if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
             put_page(page);
--
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 Mon Nov 16 16:55:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZyN4E-0004b9-1H; Mon, 16 Nov 2015 16:55:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4C-0004aa-5P
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:44 +0000
Content-Length: 2764
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	70/15-22142-F8A0A465; Mon, 16 Nov 2015 16:55:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1447692942!4083166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18489 invoked from network); 16 Nov 2015 16:55:42 -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;
	16 Nov 2015 16:55:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN49-0005M3-UA
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN49-0000bq-Sy
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:41 +0000
Date: Mon, 16 Nov 2015 16:55:41 +0000
Message-Id: <E1ZyN49-0000bq-Sy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: guard against undue super
	page PTE creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============6839910834697740357=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6839910834697740357==
Content-Length: 2367
Content-Transfer-Encoding: quoted-printable

commit 3be91e6c200af155a1badefc5945008c8da12ce7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:24:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:24:40 2015 +0100

    x86: guard against undue super page PTE creation
    
    When optional super page support got added (commit bd1cd81d64 "x86: PV
    support for hugepages"), two adjustments were missed: mod_l2_entry()
    needs to consider the PSE and RW bits when deciding whether to use the
    fast path, and the PSE bit must not be removed from L2_DISALLOW_MASK
    unconditionally.
    
    This is CVE-2015-7835 / XSA-148.
    
    Reported-by: "=E6=A0=BE=E5=B0=9A=E8=81=AA(=E5=A5=BD=E9=A3=8E)" <shangcong.lsc@alibaba-inc.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: fe360c90ea13f309ef78810f1a2b92f2ae3b30b8
    master date: 2015-10-29 13:35:07 +0100
---
 xen/arch/x86/mm.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 275d71b..1caa555 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -163,7 +163,10 @@ static void put_superpage(unsigned long mfn);
 
 static uint32_t base_disallow_mask;
 #define L1_DISALLOW_MASK (base_disallow_mask | _PAGE_GNTTAB)
-#define L2_DISALLOW_MASK (base_disallow_mask & ~_PAGE_PSE)
+
+#define L2_DISALLOW_MASK (unlikely(opt_allow_superpage) \
+                          =3F base_disallow_mask & ~_PAGE_PSE \
+                          : base_disallow_mask)
 
 #define l3_disallow_mask(d) (!is_pv_32on64_domain(d) =3F  \
                              base_disallow_mask :       \
@@ -1786,7 +1789,10 @@ static int mod_l2_entry(l2_pgentry_t *pl2e,
         }
 
         /* Fast path for identical mapping and presence. */
-        if ( !l2e_has_changed(ol2e, nl2e, _PAGE_PRESENT) )
+        if ( !l2e_has_changed(ol2e, nl2e,
+                              unlikely(opt_allow_superpage)
+                              =3F _PAGE_PSE | _PAGE_RW | _PAGE_PRESENT
+                              : _PAGE_PRESENT) )
         {
             adjust_guest_l2e(nl2e, d);
             if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3


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

From xen-changelog-bounces@lists.xen.org Mon Nov 16 16:55:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1ZyN4E-0004b9-1H; Mon, 16 Nov 2015 16:55:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4C-0004aa-5P
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:44 +0000
Content-Length: 2764
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	70/15-22142-F8A0A465; Mon, 16 Nov 2015 16:55:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1447692942!4083166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18489 invoked from network); 16 Nov 2015 16:55:42 -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;
	16 Nov 2015 16:55:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN49-0005M3-UA
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN49-0000bq-Sy
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:41 +0000
Date: Mon, 16 Nov 2015 16:55:41 +0000
Message-Id: <E1ZyN49-0000bq-Sy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: guard against undue super
	page PTE creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============6839910834697740357=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6839910834697740357==
Content-Length: 2367
Content-Transfer-Encoding: quoted-printable

commit 3be91e6c200af155a1badefc5945008c8da12ce7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:24:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:24:40 2015 +0100

    x86: guard against undue super page PTE creation
    
    When optional super page support got added (commit bd1cd81d64 "x86: PV
    support for hugepages"), two adjustments were missed: mod_l2_entry()
    needs to consider the PSE and RW bits when deciding whether to use the
    fast path, and the PSE bit must not be removed from L2_DISALLOW_MASK
    unconditionally.
    
    This is CVE-2015-7835 / XSA-148.
    
    Reported-by: "=E6=A0=BE=E5=B0=9A=E8=81=AA(=E5=A5=BD=E9=A3=8E)" <shangcong.lsc@alibaba-inc.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: fe360c90ea13f309ef78810f1a2b92f2ae3b30b8
    master date: 2015-10-29 13:35:07 +0100
---
 xen/arch/x86/mm.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 275d71b..1caa555 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -163,7 +163,10 @@ static void put_superpage(unsigned long mfn);
 
 static uint32_t base_disallow_mask;
 #define L1_DISALLOW_MASK (base_disallow_mask | _PAGE_GNTTAB)
-#define L2_DISALLOW_MASK (base_disallow_mask & ~_PAGE_PSE)
+
+#define L2_DISALLOW_MASK (unlikely(opt_allow_superpage) \
+                          =3F base_disallow_mask & ~_PAGE_PSE \
+                          : base_disallow_mask)
 
 #define l3_disallow_mask(d) (!is_pv_32on64_domain(d) =3F  \
                              base_disallow_mask :       \
@@ -1786,7 +1789,10 @@ static int mod_l2_entry(l2_pgentry_t *pl2e,
         }
 
         /* Fast path for identical mapping and presence. */
-        if ( !l2e_has_changed(ol2e, nl2e, _PAGE_PRESENT) )
+        if ( !l2e_has_changed(ol2e, nl2e,
+                              unlikely(opt_allow_superpage)
+                              =3F _PAGE_PSE | _PAGE_RW | _PAGE_PRESENT
+                              : _PAGE_PRESENT) )
         {
             adjust_guest_l2e(nl2e, d);
             if ( UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, vcpu, preserve_ad) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3


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

From xen-changelog-bounces@lists.xen.org Mon Nov 16 16:55:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:55: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 1ZyN4N-0004dD-5k; Mon, 16 Nov 2015 16:55: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 1ZyN4M-0004cv-82
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:54 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	D1/D8-30270-99A0A465; Mon, 16 Nov 2015 16:55:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1447692952!4079782!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3203 invoked from network); 16 Nov 2015 16:55:53 -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;
	16 Nov 2015 16:55:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4K-0005MX-56
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4K-0000fD-3N
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:52 +0000
Date: Mon, 16 Nov 2015 16:55:52 +0000
Message-Id: <E1ZyN4K-0000fD-3N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7f7c5c6559ac3fa52dba5d8fe952b2c00f962db
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:27:02 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:27:02 2015 +0100

    free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-149.
    
    Reported-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: d46896ebbb23f3a9fef2eb6066ae614fd1acfd96
    master date: 2015-10-29 13:35:40 +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 fefef40..fa6d939 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -734,6 +734,7 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
+    xfree(d->vcpu);
     free_domain_struct(d);
 
     send_global_virq(VIRQ_DOM_EXC);
--
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 Mon Nov 16 16:55:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:55: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 1ZyN4N-0004dD-5k; Mon, 16 Nov 2015 16:55: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 1ZyN4M-0004cv-82
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:54 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	D1/D8-30270-99A0A465; Mon, 16 Nov 2015 16:55:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1447692952!4079782!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3203 invoked from network); 16 Nov 2015 16:55:53 -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;
	16 Nov 2015 16:55:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4K-0005MX-56
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4K-0000fD-3N
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:55:52 +0000
Date: Mon, 16 Nov 2015 16:55:52 +0000
Message-Id: <E1ZyN4K-0000fD-3N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7f7c5c6559ac3fa52dba5d8fe952b2c00f962db
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:27:02 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:27:02 2015 +0100

    free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-149.
    
    Reported-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: d46896ebbb23f3a9fef2eb6066ae614fd1acfd96
    master date: 2015-10-29 13:35:40 +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 fefef40..fa6d939 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -734,6 +734,7 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     xsm_free_security_domain(d);
     free_cpumask_var(d->domain_dirty_cpumask);
+    xfree(d->vcpu);
     free_domain_struct(d);
 
     send_global_virq(VIRQ_DOM_EXC);
--
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 Mon Nov 16 16:56:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:56: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 1ZyN4Y-0004g0-FV; Mon, 16 Nov 2015 16:56:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4X-0004fc-2d
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:05 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	10/F8-01748-4AA0A465; Mon, 16 Nov 2015 16:56:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1447692962!3503104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9664 invoked from network); 16 Nov 2015 16:56:03 -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;
	16 Nov 2015 16:56:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4U-0005N9-Hi
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4U-0000ih-Be
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:02 +0000
Date: Mon, 16 Nov 2015 16:56:02 +0000
Message-Id: <E1ZyN4U-0000ih-Be@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/PoD: Eager sweep for zeroed
	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 2d330c121eff67f4828dc8536180986e0dfdf14b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 29 14:27:44 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:27:44 2015 +0100

    x86/PoD: Eager sweep for zeroed pages
    
    Based on the contents of a guests physical address space,
    p2m_pod_emergency_sweep() could degrade into a linear memcmp() from 0 to
    max_gfn, which runs non-preemptibly.
    
    As p2m_pod_emergency_sweep() runs behind the scenes in a number of contexts,
    making it preemptible is not feasible.
    
    Instead, a different approach is taken.  Recently-populated pages are eagerly
    checked for reclaimation, which amortises the p2m_pod_emergency_sweep()
    operation across each p2m_pod_demand_populate() operation.
    
    Note that in the case that a 2M superpage can't be reclaimed as a superpage,
    it is shattered if 4K pages of zeros can be reclaimed.  This is unfortunate
    but matches the previous behaviour, and is required to avoid regressions
    (domain crash from PoD exhaustion) with VMs configured close to the limit.
    
    This is CVE-2015-7970 / XSA-150.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 101ce53266866144e724ed593173bc4098b300b9
    master date: 2015-10-29 13:36:25 +0100
---
 xen/arch/x86/mm/p2m-pod.c |   86 +++++++++++++++++++++++++++++---------------
 xen/arch/x86/mm/p2m.c     |    4 ++
 xen/include/asm-x86/p2m.h |   18 +++++++--
 3 files changed, 75 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 0375afa..ff9362f 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -898,28 +898,6 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count)
 }
 
 #define POD_SWEEP_LIMIT 1024
-
-/* When populating a new superpage, look at recently populated superpages
- * hoping that they've been zeroed.  This will snap up zeroed pages as soon as 
- * the guest OS is done with them. */
-static void
-p2m_pod_check_last_super(struct p2m_domain *p2m, unsigned long gfn_aligned)
-{
-    unsigned long check_gfn;
-
-    ASSERT(p2m->pod.last_populated_index < POD_HISTORY_MAX);
-
-    check_gfn = p2m->pod.last_populated[p2m->pod.last_populated_index];
-
-    p2m->pod.last_populated[p2m->pod.last_populated_index] = gfn_aligned;
-
-    p2m->pod.last_populated_index =
-        ( p2m->pod.last_populated_index + 1 ) % POD_HISTORY_MAX;
-
-    p2m_pod_zero_check_superpage(p2m, check_gfn);
-}
-
-
 #define POD_SWEEP_STRIDE  16
 static void
 p2m_pod_emergency_sweep(struct p2m_domain *p2m)
@@ -960,7 +938,7 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
          * NB that this is a zero-sum game; we're increasing our cache size
          * by re-increasing our 'debt'.  Since we hold the pod lock,
          * (entry_count - count) must remain the same. */
-        if ( p2m->pod.count > 0 && i < limit )
+        if ( i < limit && (p2m->pod.count > 0 || hypercall_preempt_check()) )
             break;
     }
 
@@ -972,6 +950,58 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
 
 }
 
+static void pod_eager_reclaim(struct p2m_domain *p2m)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+    unsigned int i = 0;
+
+    /*
+     * Always check one page for reclaimation.
+     *
+     * If the PoD pool is empty, keep checking some space is found, or all
+     * entries have been exhaused.
+     */
+    do
+    {
+        unsigned int idx = (mrp->idx + i++) % ARRAY_SIZE(mrp->list);
+        unsigned long gfn = mrp->list[idx];
+
+        if ( gfn != INVALID_GFN )
+        {
+            if ( gfn & POD_LAST_SUPERPAGE )
+            {
+                gfn &= ~POD_LAST_SUPERPAGE;
+
+                if ( p2m_pod_zero_check_superpage(p2m, gfn) == 0 )
+                {
+                    unsigned int x;
+
+                    for ( x = 0; x < SUPERPAGE_PAGES; ++x, ++gfn )
+                        p2m_pod_zero_check(p2m, &gfn, 1);
+                }
+            }
+            else
+                p2m_pod_zero_check(p2m, &gfn, 1);
+
+            mrp->list[idx] = INVALID_GFN;
+        }
+
+    } while ( (p2m->pod.count == 0) && (i < ARRAY_SIZE(mrp->list)) );
+}
+
+static void pod_eager_record(struct p2m_domain *p2m,
+                             unsigned long gfn, unsigned int order)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+
+    ASSERT(mrp->list[mrp->idx] == INVALID_GFN);
+    ASSERT(gfn != INVALID_GFN);
+
+    mrp->list[mrp->idx++] =
+        gfn | (order == PAGE_ORDER_2M ? POD_LAST_SUPERPAGE : 0);
+    mrp->idx %= ARRAY_SIZE(mrp->list);
+}
+
 int
 p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
                         unsigned int order,
@@ -1012,6 +1042,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         return 0;
     }
 
+    pod_eager_reclaim(p2m);
+
     /* Only sweep if we're actually out of memory.  Doing anything else
      * causes unnecessary time and fragmentation of superpages in the p2m. */
     if ( p2m->pod.count == 0 )
@@ -1047,6 +1079,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
     p2m->pod.entry_count -= (1 << order);
     BUG_ON(p2m->pod.entry_count < 0);
 
+    pod_eager_record(p2m, gfn_aligned, order);
+
     if ( tb_init_done )
     {
         struct {
@@ -1062,12 +1096,6 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         __trace_var(TRC_MEM_POD_POPULATE, 0, sizeof(t), &t);
     }
 
-    /* Check the last guest demand-populate */
-    if ( p2m->pod.entry_count > p2m->pod.count 
-         && (order == PAGE_ORDER_2M)
-         && (q & P2M_ALLOC) )
-        p2m_pod_check_last_super(p2m, gfn_aligned);
-
     pod_unlock(p2m);
     return 0;
 out_of_memory:
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index d0934fe..fc43a3c 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -59,6 +59,7 @@ boolean_param("hap_2mb", opt_hap_2mb);
 /* Init the datastructures for later use by the p2m code */
 static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 {
+    unsigned int i;
     int ret = 0;
 
     mm_rwlock_init(&p2m->lock);
@@ -73,6 +74,9 @@ static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 
     p2m->np2m_base = P2M_BASE_EADDR;
 
+    for ( i = 0; i < ARRAY_SIZE(p2m->pod.mrp.list); ++i )
+        p2m->pod.mrp.list[i] = INVALID_GFN;
+
     if ( hap_enabled(d) && cpu_has_vmx )
         ret = ept_p2m_init(p2m);
     else
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index a2cb1b7..9d70d6c 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -270,10 +270,20 @@ struct p2m_domain {
                          entry_count;  /* # of pages in p2m marked pod      */
         unsigned long    reclaim_single; /* Last gpfn of a scan */
         unsigned long    max_guest;    /* gpfn of max guest demand-populate */
-#define POD_HISTORY_MAX 128
-        /* gpfn of last guest superpage demand-populated */
-        unsigned long    last_populated[POD_HISTORY_MAX]; 
-        unsigned int     last_populated_index;
+
+        /*
+         * Tracking of the most recently populated PoD pages, for eager
+         * reclamation.
+         */
+        struct pod_mrp_list {
+#define NR_POD_MRP_ENTRIES 32
+
+/* Encode ORDER_2M superpage in top bit of GFN */
+#define POD_LAST_SUPERPAGE (INVALID_GFN & ~(INVALID_GFN >> 1))
+
+            unsigned long list[NR_POD_MRP_ENTRIES];
+            unsigned int idx;
+        } mrp;
         mm_lock_t        lock;         /* Locking of private pod structs,   *
                                         * not relying on the p2m lock.      */
     } pod;
--
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 Mon Nov 16 16:56:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:56: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 1ZyN4Y-0004g0-FV; Mon, 16 Nov 2015 16:56:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4X-0004fc-2d
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:05 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	10/F8-01748-4AA0A465; Mon, 16 Nov 2015 16:56:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1447692962!3503104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9664 invoked from network); 16 Nov 2015 16:56:03 -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;
	16 Nov 2015 16:56:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4U-0005N9-Hi
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4U-0000ih-Be
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:02 +0000
Date: Mon, 16 Nov 2015 16:56:02 +0000
Message-Id: <E1ZyN4U-0000ih-Be@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/PoD: Eager sweep for zeroed
	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 2d330c121eff67f4828dc8536180986e0dfdf14b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 29 14:27:44 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:27:44 2015 +0100

    x86/PoD: Eager sweep for zeroed pages
    
    Based on the contents of a guests physical address space,
    p2m_pod_emergency_sweep() could degrade into a linear memcmp() from 0 to
    max_gfn, which runs non-preemptibly.
    
    As p2m_pod_emergency_sweep() runs behind the scenes in a number of contexts,
    making it preemptible is not feasible.
    
    Instead, a different approach is taken.  Recently-populated pages are eagerly
    checked for reclaimation, which amortises the p2m_pod_emergency_sweep()
    operation across each p2m_pod_demand_populate() operation.
    
    Note that in the case that a 2M superpage can't be reclaimed as a superpage,
    it is shattered if 4K pages of zeros can be reclaimed.  This is unfortunate
    but matches the previous behaviour, and is required to avoid regressions
    (domain crash from PoD exhaustion) with VMs configured close to the limit.
    
    This is CVE-2015-7970 / XSA-150.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
    master commit: 101ce53266866144e724ed593173bc4098b300b9
    master date: 2015-10-29 13:36:25 +0100
---
 xen/arch/x86/mm/p2m-pod.c |   86 +++++++++++++++++++++++++++++---------------
 xen/arch/x86/mm/p2m.c     |    4 ++
 xen/include/asm-x86/p2m.h |   18 +++++++--
 3 files changed, 75 insertions(+), 33 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 0375afa..ff9362f 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -898,28 +898,6 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count)
 }
 
 #define POD_SWEEP_LIMIT 1024
-
-/* When populating a new superpage, look at recently populated superpages
- * hoping that they've been zeroed.  This will snap up zeroed pages as soon as 
- * the guest OS is done with them. */
-static void
-p2m_pod_check_last_super(struct p2m_domain *p2m, unsigned long gfn_aligned)
-{
-    unsigned long check_gfn;
-
-    ASSERT(p2m->pod.last_populated_index < POD_HISTORY_MAX);
-
-    check_gfn = p2m->pod.last_populated[p2m->pod.last_populated_index];
-
-    p2m->pod.last_populated[p2m->pod.last_populated_index] = gfn_aligned;
-
-    p2m->pod.last_populated_index =
-        ( p2m->pod.last_populated_index + 1 ) % POD_HISTORY_MAX;
-
-    p2m_pod_zero_check_superpage(p2m, check_gfn);
-}
-
-
 #define POD_SWEEP_STRIDE  16
 static void
 p2m_pod_emergency_sweep(struct p2m_domain *p2m)
@@ -960,7 +938,7 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
          * NB that this is a zero-sum game; we're increasing our cache size
          * by re-increasing our 'debt'.  Since we hold the pod lock,
          * (entry_count - count) must remain the same. */
-        if ( p2m->pod.count > 0 && i < limit )
+        if ( i < limit && (p2m->pod.count > 0 || hypercall_preempt_check()) )
             break;
     }
 
@@ -972,6 +950,58 @@ p2m_pod_emergency_sweep(struct p2m_domain *p2m)
 
 }
 
+static void pod_eager_reclaim(struct p2m_domain *p2m)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+    unsigned int i = 0;
+
+    /*
+     * Always check one page for reclaimation.
+     *
+     * If the PoD pool is empty, keep checking some space is found, or all
+     * entries have been exhaused.
+     */
+    do
+    {
+        unsigned int idx = (mrp->idx + i++) % ARRAY_SIZE(mrp->list);
+        unsigned long gfn = mrp->list[idx];
+
+        if ( gfn != INVALID_GFN )
+        {
+            if ( gfn & POD_LAST_SUPERPAGE )
+            {
+                gfn &= ~POD_LAST_SUPERPAGE;
+
+                if ( p2m_pod_zero_check_superpage(p2m, gfn) == 0 )
+                {
+                    unsigned int x;
+
+                    for ( x = 0; x < SUPERPAGE_PAGES; ++x, ++gfn )
+                        p2m_pod_zero_check(p2m, &gfn, 1);
+                }
+            }
+            else
+                p2m_pod_zero_check(p2m, &gfn, 1);
+
+            mrp->list[idx] = INVALID_GFN;
+        }
+
+    } while ( (p2m->pod.count == 0) && (i < ARRAY_SIZE(mrp->list)) );
+}
+
+static void pod_eager_record(struct p2m_domain *p2m,
+                             unsigned long gfn, unsigned int order)
+{
+    struct pod_mrp_list *mrp = &p2m->pod.mrp;
+
+    ASSERT(mrp->list[mrp->idx] == INVALID_GFN);
+    ASSERT(gfn != INVALID_GFN);
+
+    mrp->list[mrp->idx++] =
+        gfn | (order == PAGE_ORDER_2M ? POD_LAST_SUPERPAGE : 0);
+    mrp->idx %= ARRAY_SIZE(mrp->list);
+}
+
 int
 p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
                         unsigned int order,
@@ -1012,6 +1042,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         return 0;
     }
 
+    pod_eager_reclaim(p2m);
+
     /* Only sweep if we're actually out of memory.  Doing anything else
      * causes unnecessary time and fragmentation of superpages in the p2m. */
     if ( p2m->pod.count == 0 )
@@ -1047,6 +1079,8 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
     p2m->pod.entry_count -= (1 << order);
     BUG_ON(p2m->pod.entry_count < 0);
 
+    pod_eager_record(p2m, gfn_aligned, order);
+
     if ( tb_init_done )
     {
         struct {
@@ -1062,12 +1096,6 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
         __trace_var(TRC_MEM_POD_POPULATE, 0, sizeof(t), &t);
     }
 
-    /* Check the last guest demand-populate */
-    if ( p2m->pod.entry_count > p2m->pod.count 
-         && (order == PAGE_ORDER_2M)
-         && (q & P2M_ALLOC) )
-        p2m_pod_check_last_super(p2m, gfn_aligned);
-
     pod_unlock(p2m);
     return 0;
 out_of_memory:
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index d0934fe..fc43a3c 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -59,6 +59,7 @@ boolean_param("hap_2mb", opt_hap_2mb);
 /* Init the datastructures for later use by the p2m code */
 static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 {
+    unsigned int i;
     int ret = 0;
 
     mm_rwlock_init(&p2m->lock);
@@ -73,6 +74,9 @@ static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
 
     p2m->np2m_base = P2M_BASE_EADDR;
 
+    for ( i = 0; i < ARRAY_SIZE(p2m->pod.mrp.list); ++i )
+        p2m->pod.mrp.list[i] = INVALID_GFN;
+
     if ( hap_enabled(d) && cpu_has_vmx )
         ret = ept_p2m_init(p2m);
     else
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index a2cb1b7..9d70d6c 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -270,10 +270,20 @@ struct p2m_domain {
                          entry_count;  /* # of pages in p2m marked pod      */
         unsigned long    reclaim_single; /* Last gpfn of a scan */
         unsigned long    max_guest;    /* gpfn of max guest demand-populate */
-#define POD_HISTORY_MAX 128
-        /* gpfn of last guest superpage demand-populated */
-        unsigned long    last_populated[POD_HISTORY_MAX]; 
-        unsigned int     last_populated_index;
+
+        /*
+         * Tracking of the most recently populated PoD pages, for eager
+         * reclamation.
+         */
+        struct pod_mrp_list {
+#define NR_POD_MRP_ENTRIES 32
+
+/* Encode ORDER_2M superpage in top bit of GFN */
+#define POD_LAST_SUPERPAGE (INVALID_GFN & ~(INVALID_GFN >> 1))
+
+            unsigned long list[NR_POD_MRP_ENTRIES];
+            unsigned int idx;
+        } mrp;
         mm_lock_t        lock;         /* Locking of private pod structs,   *
                                         * not relying on the p2m lock.      */
     } pod;
--
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 Mon Nov 16 16:56:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:56: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 1ZyN4i-0004iN-J1; Mon, 16 Nov 2015 16:56:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4h-0004hw-4M
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:15 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	4F/3F-12889-EAA0A465; Mon, 16 Nov 2015 16:56:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1447692973!3594089!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16973 invoked from network); 16 Nov 2015 16:56:13 -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;
	16 Nov 2015 16:56:13 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4e-0005NK-Rf
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4e-0000lE-PH
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:12 +0000
Date: Mon, 16 Nov 2015 16:56:12 +0000
Message-Id: <E1ZyN4e-0000lE-PH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xenoprof: free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7f28d311a80e9d33d8270d6fb7b949dd4eef37f0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:28:06 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:28:06 2015 +0100

    xenoprof: free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-151.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 6e97c4b37386c2d09e09e9b5d5d232e37728b960
    master date: 2015-10-29 13:36:52 +0100
---
 xen/common/xenoprof.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 52ab00d..4703142 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -239,6 +239,7 @@ static int alloc_xenoprof_struct(
     d->xenoprof->rawbuf = alloc_xenheap_pages(get_order_from_pages(npages), 0);
     if ( d->xenoprof->rawbuf == NULL )
     {
+        xfree(d->xenoprof->vcpu);
         xfree(d->xenoprof);
         d->xenoprof = NULL;
         return -ENOMEM;
@@ -286,6 +287,7 @@ void free_xenoprof_pages(struct domain *d)
         free_xenheap_pages(x->rawbuf, order);
     }
 
+    xfree(x->vcpu);
     xfree(x);
     d->xenoprof = NULL;
 }
--
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 Mon Nov 16 16:56:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:56: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 1ZyN4i-0004iN-J1; Mon, 16 Nov 2015 16:56:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4h-0004hw-4M
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:15 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	4F/3F-12889-EAA0A465; Mon, 16 Nov 2015 16:56:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1447692973!3594089!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16973 invoked from network); 16 Nov 2015 16:56:13 -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;
	16 Nov 2015 16:56:13 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4e-0005NK-Rf
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4e-0000lE-PH
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:12 +0000
Date: Mon, 16 Nov 2015 16:56:12 +0000
Message-Id: <E1ZyN4e-0000lE-PH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] xenoprof: free domain's vcpu array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7f28d311a80e9d33d8270d6fb7b949dd4eef37f0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:28:06 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:28:06 2015 +0100

    xenoprof: free domain's vcpu array
    
    This was overlooked in fb442e2171 ("x86_64: allow more vCPU-s per
    guest").
    
    This is CVE-2015-7969 / XSA-151.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 6e97c4b37386c2d09e09e9b5d5d232e37728b960
    master date: 2015-10-29 13:36:52 +0100
---
 xen/common/xenoprof.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 52ab00d..4703142 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -239,6 +239,7 @@ static int alloc_xenoprof_struct(
     d->xenoprof->rawbuf = alloc_xenheap_pages(get_order_from_pages(npages), 0);
     if ( d->xenoprof->rawbuf == NULL )
     {
+        xfree(d->xenoprof->vcpu);
         xfree(d->xenoprof);
         d->xenoprof = NULL;
         return -ENOMEM;
@@ -286,6 +287,7 @@ void free_xenoprof_pages(struct domain *d)
         free_xenheap_pages(x->rawbuf, order);
     }
 
+    xfree(x->vcpu);
     xfree(x);
     d->xenoprof = NULL;
 }
--
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 Mon Nov 16 16:56:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:56: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 1ZyN4s-0004kR-Ml; Mon, 16 Nov 2015 16:56: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 1ZyN4r-0004kB-Jk
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:25 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	98/29-21201-8BA0A465; Mon, 16 Nov 2015 16:56:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1447692983!4047825!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64912 invoked from network); 16 Nov 2015 16:56:24 -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;
	16 Nov 2015 16:56:24 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4p-0005NS-6b
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4p-0000nj-2X
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:23 +0000
Date: Mon, 16 Nov 2015 16:56:23 +0000
Message-Id: <E1ZyN4p-0000nj-2X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: rate-limit logging in
	do_xen{oprof, pmu}_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 9f359c61e3927f94bb280ffb200155dd20465fda
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:28:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:28:33 2015 +0100

    x86: rate-limit logging in do_xen{oprof,pmu}_op()
    
    Some of the sub-ops are acessible to all guests, and hence should be
    rate-limited. In the xenoprof case, just like for XSA-146, include them
    only in debug builds. Since the vPMU code is rather new, allow them to
    be always present, but downgrade them to (rate limited) guest messages.
    
    This is CVE-2015-7971 / XSA-152.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 95e7415843b94c346e5ba8682665f508f220e04b
    master date: 2015-10-29 13:37:19 +0100
---
 xen/common/xenoprof.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 4703142..abcb947 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -670,15 +670,13 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     
     if ( (op < 0) || (op > XENOPROF_last_op) )
     {
-        printk("xenoprof: invalid operation %d for domain %d\n",
-               op, current->domain->domain_id);
+        gdprintk(XENLOG_DEBUG, "invalid operation %d\n", op);
         return -EINVAL;
     }
 
     if ( !NONPRIV_OP(op) && (current->domain != xenoprof_primary_profiler) )
     {
-        printk("xenoprof: dom %d denied privileged operation %d\n",
-               current->domain->domain_id, op);
+        gdprintk(XENLOG_DEBUG, "denied privileged operation %d\n", op);
         return -EPERM;
     }
 
@@ -901,8 +899,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     spin_unlock(&xenoprof_lock);
 
     if ( ret < 0 )
-        printk("xenoprof: operation %d failed for dom %d (status : %d)\n",
-               op, current->domain->domain_id, ret);
+        gdprintk(XENLOG_DEBUG, "operation %d failed: %d\n", op, ret);
 
     return ret;
 }
--
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 Mon Nov 16 16:56:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:56: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 1ZyN4s-0004kR-Ml; Mon, 16 Nov 2015 16:56: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 1ZyN4r-0004kB-Jk
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:25 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	98/29-21201-8BA0A465; Mon, 16 Nov 2015 16:56:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1447692983!4047825!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64912 invoked from network); 16 Nov 2015 16:56:24 -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;
	16 Nov 2015 16:56:24 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4p-0005NS-6b
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4p-0000nj-2X
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:23 +0000
Date: Mon, 16 Nov 2015 16:56:23 +0000
Message-Id: <E1ZyN4p-0000nj-2X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: rate-limit logging in
	do_xen{oprof, pmu}_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 9f359c61e3927f94bb280ffb200155dd20465fda
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:28:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:28:33 2015 +0100

    x86: rate-limit logging in do_xen{oprof,pmu}_op()
    
    Some of the sub-ops are acessible to all guests, and hence should be
    rate-limited. In the xenoprof case, just like for XSA-146, include them
    only in debug builds. Since the vPMU code is rather new, allow them to
    be always present, but downgrade them to (rate limited) guest messages.
    
    This is CVE-2015-7971 / XSA-152.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    master commit: 95e7415843b94c346e5ba8682665f508f220e04b
    master date: 2015-10-29 13:37:19 +0100
---
 xen/common/xenoprof.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 4703142..abcb947 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -670,15 +670,13 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     
     if ( (op < 0) || (op > XENOPROF_last_op) )
     {
-        printk("xenoprof: invalid operation %d for domain %d\n",
-               op, current->domain->domain_id);
+        gdprintk(XENLOG_DEBUG, "invalid operation %d\n", op);
         return -EINVAL;
     }
 
     if ( !NONPRIV_OP(op) && (current->domain != xenoprof_primary_profiler) )
     {
-        printk("xenoprof: dom %d denied privileged operation %d\n",
-               current->domain->domain_id, op);
+        gdprintk(XENLOG_DEBUG, "denied privileged operation %d\n", op);
         return -EPERM;
     }
 
@@ -901,8 +899,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) arg)
     spin_unlock(&xenoprof_lock);
 
     if ( ret < 0 )
-        printk("xenoprof: operation %d failed for dom %d (status : %d)\n",
-               op, current->domain->domain_id, ret);
+        gdprintk(XENLOG_DEBUG, "operation %d failed: %d\n", op, ret);
 
     return ret;
 }
--
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 Mon Nov 16 16:56:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:56: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 1ZyN52-0004mU-R0; Mon, 16 Nov 2015 16:56:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN51-0004mD-V0
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:36 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	C2/45-02940-3CA0A465; Mon, 16 Nov 2015 16:56:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1447692993!4042857!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21720 invoked from network); 16 Nov 2015 16:56:34 -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;
	16 Nov 2015 16:56:34 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4z-0005Na-Fg
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4z-0000on-Da
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:33 +0000
Date: Mon, 16 Nov 2015 16:56:33 +0000
Message-Id: <E1ZyN4z-0000on-Da@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] libxl: adjust PoD target by memory
	fudge, 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 e875e0e5fcc5912f71422b53674a97e5c0ae77be
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 16:18:30 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:14:34 2015 +0000

    libxl: adjust PoD target by memory fudge, too
    
    PoD guests need to balloon at least as far as required by PoD, or risk
    crashing.  Currently they don't necessarily know what the right value
    is, because our memory accounting is (at the very least) confusing.
    
    Apply the memory limit fudge factor to the in-hypervisor PoD memory
    target, too.  This will increase the size of the guest's PoD cache by
    the fudge factor LIBXL_MAXMEM_CONSTANT (currently 1Mby).  This ensures
    that even with a slightly-off balloon driver, the guest will be
    stable even under memory pressure.
    
    There are two call sites of xc_domain_set_pod_target that need fixing:
    
    The one in libxl_set_memory_target is straightforward.
    
    The one in xc_hvm_build_x86.c:setup_guest is more awkward.  Simply
    setting the PoD target differently does not work because the various
    amounts of memory during domain construction no longer match up.
    Instead, we adjust the guest memory target in xenstore (but only for
    PoD guests).
    
    This introduces a 1Mby discrepancy between the balloon target of a PoD
    guest at boot, and the target set by an apparently-equivalent `xl
    mem-set' (or similar) later.  This approach is low-risk for a security
    fix but we need to fix this up properly in xen.git#staging and
    probably also in stable trees.
    
    This is XSA-153.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 56fb5fd62320eb40a7517206f9706aa9188d6f7b)
    (cherry picked from commit 423d2cd814e8460d5ea8bd191a770f3c48b3947c)
    
    Conflicts:
    	tools/libxl/libxl_dom.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 73b70e3c5d59e63126c890068ee0cbf8a2a3b640)
---
 tools/libxl/libxl.c     |    2 +-
 tools/libxl/libxl_dom.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 4d1d977..13694b9 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3755,7 +3755,7 @@ retry_transaction:
 
     new_target_memkb -= videoram;
     rc = xc_domain_set_pod_target(ctx->xch, domid,
-            new_target_memkb / 4, NULL, NULL, NULL);
+            (new_target_memkb + LIBXL_MAXMEM_CONSTANT) / 4, NULL, NULL, NULL);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "xc_domain_set_pod_target domid=%d, memkb=%d "
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index b38d0a7..ec4ebe4 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -263,6 +263,7 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     xs_transaction_t t;
     char **ents, **hvm_ents;
     int i, rc;
+    int64_t mem_target_fudge;
 
     rc = libxl_domain_sched_params_set(CTX, domid, &info->sched_params);
     if (rc)
@@ -272,11 +273,17 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     if (info->cpuid != NULL)
         libxl_cpuid_set(ctx, domid, info->cpuid);
 
+    mem_target_fudge =
+        (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+         info->max_memkb > info->target_memkb)
+        ? LIBXL_MAXMEM_CONSTANT : 0;
+
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
     ents[1] = GCSPRINTF("%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb);
+    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb
+                        - mem_target_fudge);
     ents[4] = "memory/videoram";
     ents[5] = GCSPRINTF("%"PRId64, info->video_memkb);
     ents[6] = "domid";
--
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 Mon Nov 16 16:56:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:56: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 1ZyN52-0004mU-R0; Mon, 16 Nov 2015 16:56:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN51-0004mD-V0
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:36 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	C2/45-02940-3CA0A465; Mon, 16 Nov 2015 16:56:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1447692993!4042857!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21720 invoked from network); 16 Nov 2015 16:56:34 -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;
	16 Nov 2015 16:56:34 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4z-0005Na-Fg
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN4z-0000on-Da
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:33 +0000
Date: Mon, 16 Nov 2015 16:56:33 +0000
Message-Id: <E1ZyN4z-0000on-Da@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] libxl: adjust PoD target by memory
	fudge, 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 e875e0e5fcc5912f71422b53674a97e5c0ae77be
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Wed Oct 21 16:18:30 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Oct 29 15:14:34 2015 +0000

    libxl: adjust PoD target by memory fudge, too
    
    PoD guests need to balloon at least as far as required by PoD, or risk
    crashing.  Currently they don't necessarily know what the right value
    is, because our memory accounting is (at the very least) confusing.
    
    Apply the memory limit fudge factor to the in-hypervisor PoD memory
    target, too.  This will increase the size of the guest's PoD cache by
    the fudge factor LIBXL_MAXMEM_CONSTANT (currently 1Mby).  This ensures
    that even with a slightly-off balloon driver, the guest will be
    stable even under memory pressure.
    
    There are two call sites of xc_domain_set_pod_target that need fixing:
    
    The one in libxl_set_memory_target is straightforward.
    
    The one in xc_hvm_build_x86.c:setup_guest is more awkward.  Simply
    setting the PoD target differently does not work because the various
    amounts of memory during domain construction no longer match up.
    Instead, we adjust the guest memory target in xenstore (but only for
    PoD guests).
    
    This introduces a 1Mby discrepancy between the balloon target of a PoD
    guest at boot, and the target set by an apparently-equivalent `xl
    mem-set' (or similar) later.  This approach is low-risk for a security
    fix but we need to fix this up properly in xen.git#staging and
    probably also in stable trees.
    
    This is XSA-153.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 56fb5fd62320eb40a7517206f9706aa9188d6f7b)
    (cherry picked from commit 423d2cd814e8460d5ea8bd191a770f3c48b3947c)
    
    Conflicts:
    	tools/libxl/libxl_dom.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 73b70e3c5d59e63126c890068ee0cbf8a2a3b640)
---
 tools/libxl/libxl.c     |    2 +-
 tools/libxl/libxl_dom.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 4d1d977..13694b9 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3755,7 +3755,7 @@ retry_transaction:
 
     new_target_memkb -= videoram;
     rc = xc_domain_set_pod_target(ctx->xch, domid,
-            new_target_memkb / 4, NULL, NULL, NULL);
+            (new_target_memkb + LIBXL_MAXMEM_CONSTANT) / 4, NULL, NULL, NULL);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                 "xc_domain_set_pod_target domid=%d, memkb=%d "
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index b38d0a7..ec4ebe4 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -263,6 +263,7 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     xs_transaction_t t;
     char **ents, **hvm_ents;
     int i, rc;
+    int64_t mem_target_fudge;
 
     rc = libxl_domain_sched_params_set(CTX, domid, &info->sched_params);
     if (rc)
@@ -272,11 +273,17 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     if (info->cpuid != NULL)
         libxl_cpuid_set(ctx, domid, info->cpuid);
 
+    mem_target_fudge =
+        (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+         info->max_memkb > info->target_memkb)
+        ? LIBXL_MAXMEM_CONSTANT : 0;
+
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
     ents[1] = GCSPRINTF("%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb);
+    ents[3] = GCSPRINTF("%"PRId64, info->target_memkb - info->video_memkb
+                        - mem_target_fudge);
     ents[4] = "memory/videoram";
     ents[5] = GCSPRINTF("%"PRId64, info->video_memkb);
     ents[6] = "domid";
--
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 Mon Nov 16 16:56:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:56: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 1ZyN5D-0004pJ-UD; Mon, 16 Nov 2015 16:56: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 1ZyN5C-0004oy-5v
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:46 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	EE/E6-03763-DCA0A465; Mon, 16 Nov 2015 16:56:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1447693003!4041934!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35721 invoked from network); 16 Nov 2015 16:56:44 -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;
	16 Nov 2015 16:56:44 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN59-0005Ni-NO
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN59-0000rU-M4
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:43 +0000
Date: Mon, 16 Nov 2015 16:56:43 +0000
Message-Id: <E1ZyN59-0000rU-M4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/HVM: always intercept #AC and
	#DB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd1e4cc4d1d100337931b6f6dc50ed0b9766968a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 10 12:23:43 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:23:43 2015 +0100

    x86/HVM: always intercept #AC and #DB
    
    Both being benign exceptions, and both being possible to get triggered
    by exception delivery, this is required to prevent a guest from locking
    up a CPU (resulting from no other VM exits occurring once getting into
    such a loop).
    
    The specific scenarios:
    
    1) #AC may be raised during exception delivery if the handler is set to
    be a ring-3 one by a 32-bit guest, and the stack is misaligned.
    
    This is CVE-2015-5307 / XSA-156.
    
    Reported-by: Benjamin Serebrin <serebrin@google.com>
    
    2) #DB may be raised during exception delivery when a breakpoint got
    placed on a data structure involved in delivering the exception. This
    can result in an endless loop when a 64-bit guest uses a non-zero IST
    for the vector 1 IDT entry, but even without use of IST the time it
    takes until a contributory fault would get raised (results depending
    on the handler) may be quite long.
    
    This is CVE-2015-8104 / XSA-156.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: bd2239d9fa975a1ee5bcd27c218ae042cd0a57bc
    master date: 2015-11-10 12:03:08 +0100
---
 xen/arch/x86/hvm/svm/svm.c    |   15 +++++++++++----
 xen/arch/x86/hvm/vmx/vmx.c    |   22 +++++++++++-----------
 xen/include/asm-x86/hvm/hvm.h |    5 ++++-
 3 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index df592de..c807bb2 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -941,10 +941,11 @@ static void svm_do_resume(struct vcpu *v)
         unlikely(v->arch.hvm_vcpu.debug_state_latch != debug_state) )
     {
         uint32_t intercepts = vmcb_get_exception_intercepts(vmcb);
-        uint32_t mask = (1U << TRAP_debug) | (1U << TRAP_int3);
+
         v->arch.hvm_vcpu.debug_state_latch = debug_state;
         vmcb_set_exception_intercepts(
-            vmcb, debug_state ? (intercepts | mask) : (intercepts & ~mask));
+            vmcb, debug_state ? (intercepts | (1U << TRAP_int3))
+                              : (intercepts & ~(1U << TRAP_int3)));
     }
 
     if ( v->arch.hvm_svm.launch_core != smp_processor_id() )
@@ -2223,8 +2224,9 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
 
     case VMEXIT_EXCEPTION_DB:
         if ( !v->domain->debugger_attached )
-            goto unexpected_exit_type;
-        domain_pause_for_debugger();
+            hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
+        else
+            domain_pause_for_debugger();
         break;
 
     case VMEXIT_EXCEPTION_BP:
@@ -2272,6 +2274,11 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
         break;
     }
 
+    case VMEXIT_EXCEPTION_AC:
+        HVMTRACE_1D(TRAP, TRAP_alignment_check);
+        hvm_inject_hw_exception(TRAP_alignment_check, vmcb->exitinfo1);
+        break;
+
     case VMEXIT_EXCEPTION_UD:
         svm_vmexit_ud_intercept(regs);
         break;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 43741e6..72c823e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1122,18 +1122,12 @@ static void vmx_update_host_cr3(struct vcpu *v)
 
 void vmx_update_debug_state(struct vcpu *v)
 {
-    unsigned long mask;
-
     ASSERT(v == current);
 
-    mask = 1u << TRAP_int3;
-    if ( !cpu_has_monitor_trap_flag )
-        mask |= 1u << TRAP_debug;
-
     if ( v->arch.hvm_vcpu.debug_state_latch )
-        v->arch.hvm_vmx.exception_bitmap |= mask;
+        v->arch.hvm_vmx.exception_bitmap |= 1U << TRAP_int3;
     else
-        v->arch.hvm_vmx.exception_bitmap &= ~mask;
+        v->arch.hvm_vmx.exception_bitmap &= ~(1U << TRAP_int3);
     vmx_update_exception_bitmap(v);
 }
 
@@ -2616,9 +2610,10 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             exit_qualification = __vmread(EXIT_QUALIFICATION);
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
-            if ( !v->domain->debugger_attached || cpu_has_monitor_trap_flag )
-                goto exit_and_crash;
-            domain_pause_for_debugger();
+            if ( !v->domain->debugger_attached )
+                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+            else
+                domain_pause_for_debugger();
             break;
         case TRAP_int3: 
         {
@@ -2679,6 +2674,11 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
             hvm_inject_page_fault(regs->error_code, exit_qualification);
             break;
+        case TRAP_alignment_check:
+            HVMTRACE_1D(TRAP, vector);
+            hvm_inject_hw_exception(vector,
+                                    __vmread(VM_EXIT_INTR_ERROR_CODE));
+            break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_MASK) !=
                  (X86_EVENTTYPE_NMI << 8) )
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 8f1f3ab..ddeb305 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -389,7 +389,10 @@ static inline bool_t hvm_vcpu_has_smep(void)
 })
 
 /* These exceptions must always be intercepted. */
-#define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
+#define HVM_TRAP_MASK ((1U << TRAP_debug)           | \
+                       (1U << TRAP_invalid_op)      | \
+                       (1U << TRAP_alignment_check) | \
+                       (1U << TRAP_machine_check))
 
 /*
  * x86 event types. This enumeration is valid for:
--
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 Mon Nov 16 16:56:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Nov 2015 16:56: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 1ZyN5D-0004pJ-UD; Mon, 16 Nov 2015 16:56: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 1ZyN5C-0004oy-5v
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:46 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	EE/E6-03763-DCA0A465; Mon, 16 Nov 2015 16:56:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1447693003!4041934!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35721 invoked from network); 16 Nov 2015 16:56:44 -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;
	16 Nov 2015 16:56:44 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN59-0005Ni-NO
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyN59-0000rU-M4
	for xen-changelog@lists.xensource.com; Mon, 16 Nov 2015 16:56:43 +0000
Date: Mon, 16 Nov 2015 16:56:43 +0000
Message-Id: <E1ZyN59-0000rU-M4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/HVM: always intercept #AC and
	#DB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd1e4cc4d1d100337931b6f6dc50ed0b9766968a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 10 12:23:43 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:23:43 2015 +0100

    x86/HVM: always intercept #AC and #DB
    
    Both being benign exceptions, and both being possible to get triggered
    by exception delivery, this is required to prevent a guest from locking
    up a CPU (resulting from no other VM exits occurring once getting into
    such a loop).
    
    The specific scenarios:
    
    1) #AC may be raised during exception delivery if the handler is set to
    be a ring-3 one by a 32-bit guest, and the stack is misaligned.
    
    This is CVE-2015-5307 / XSA-156.
    
    Reported-by: Benjamin Serebrin <serebrin@google.com>
    
    2) #DB may be raised during exception delivery when a breakpoint got
    placed on a data structure involved in delivering the exception. This
    can result in an endless loop when a 64-bit guest uses a non-zero IST
    for the vector 1 IDT entry, but even without use of IST the time it
    takes until a contributory fault would get raised (results depending
    on the handler) may be quite long.
    
    This is CVE-2015-8104 / XSA-156.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: bd2239d9fa975a1ee5bcd27c218ae042cd0a57bc
    master date: 2015-11-10 12:03:08 +0100
---
 xen/arch/x86/hvm/svm/svm.c    |   15 +++++++++++----
 xen/arch/x86/hvm/vmx/vmx.c    |   22 +++++++++++-----------
 xen/include/asm-x86/hvm/hvm.h |    5 ++++-
 3 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index df592de..c807bb2 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -941,10 +941,11 @@ static void svm_do_resume(struct vcpu *v)
         unlikely(v->arch.hvm_vcpu.debug_state_latch != debug_state) )
     {
         uint32_t intercepts = vmcb_get_exception_intercepts(vmcb);
-        uint32_t mask = (1U << TRAP_debug) | (1U << TRAP_int3);
+
         v->arch.hvm_vcpu.debug_state_latch = debug_state;
         vmcb_set_exception_intercepts(
-            vmcb, debug_state ? (intercepts | mask) : (intercepts & ~mask));
+            vmcb, debug_state ? (intercepts | (1U << TRAP_int3))
+                              : (intercepts & ~(1U << TRAP_int3)));
     }
 
     if ( v->arch.hvm_svm.launch_core != smp_processor_id() )
@@ -2223,8 +2224,9 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
 
     case VMEXIT_EXCEPTION_DB:
         if ( !v->domain->debugger_attached )
-            goto unexpected_exit_type;
-        domain_pause_for_debugger();
+            hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
+        else
+            domain_pause_for_debugger();
         break;
 
     case VMEXIT_EXCEPTION_BP:
@@ -2272,6 +2274,11 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
         break;
     }
 
+    case VMEXIT_EXCEPTION_AC:
+        HVMTRACE_1D(TRAP, TRAP_alignment_check);
+        hvm_inject_hw_exception(TRAP_alignment_check, vmcb->exitinfo1);
+        break;
+
     case VMEXIT_EXCEPTION_UD:
         svm_vmexit_ud_intercept(regs);
         break;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 43741e6..72c823e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1122,18 +1122,12 @@ static void vmx_update_host_cr3(struct vcpu *v)
 
 void vmx_update_debug_state(struct vcpu *v)
 {
-    unsigned long mask;
-
     ASSERT(v == current);
 
-    mask = 1u << TRAP_int3;
-    if ( !cpu_has_monitor_trap_flag )
-        mask |= 1u << TRAP_debug;
-
     if ( v->arch.hvm_vcpu.debug_state_latch )
-        v->arch.hvm_vmx.exception_bitmap |= mask;
+        v->arch.hvm_vmx.exception_bitmap |= 1U << TRAP_int3;
     else
-        v->arch.hvm_vmx.exception_bitmap &= ~mask;
+        v->arch.hvm_vmx.exception_bitmap &= ~(1U << TRAP_int3);
     vmx_update_exception_bitmap(v);
 }
 
@@ -2616,9 +2610,10 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             exit_qualification = __vmread(EXIT_QUALIFICATION);
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
-            if ( !v->domain->debugger_attached || cpu_has_monitor_trap_flag )
-                goto exit_and_crash;
-            domain_pause_for_debugger();
+            if ( !v->domain->debugger_attached )
+                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+            else
+                domain_pause_for_debugger();
             break;
         case TRAP_int3: 
         {
@@ -2679,6 +2674,11 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
             hvm_inject_page_fault(regs->error_code, exit_qualification);
             break;
+        case TRAP_alignment_check:
+            HVMTRACE_1D(TRAP, vector);
+            hvm_inject_hw_exception(vector,
+                                    __vmread(VM_EXIT_INTR_ERROR_CODE));
+            break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_MASK) !=
                  (X86_EVENTTYPE_NMI << 8) )
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 8f1f3ab..ddeb305 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -389,7 +389,10 @@ static inline bool_t hvm_vcpu_has_smep(void)
 })
 
 /* These exceptions must always be intercepted. */
-#define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
+#define HVM_TRAP_MASK ((1U << TRAP_debug)           | \
+                       (1U << TRAP_invalid_op)      | \
+                       (1U << TRAP_alignment_check) | \
+                       (1U << TRAP_machine_check))
 
 /*
  * x86 event types. This enumeration is valid for:
--
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 Nov 17 02:44:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Nov 2015 02: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 1ZyWFd-0007t0-Rn; Tue, 17 Nov 2015 02:44: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 1ZyWFc-0007su-5x
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:08 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	A8/02-14900-7749A465; Tue, 17 Nov 2015 02:44:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1447728245!3581305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47851 invoked from network); 17 Nov 2015 02:44:06 -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;
	17 Nov 2015 02:44:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyWFY-00026c-Ov
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyWFY-0008EZ-87
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:04 +0000
Date: Tue, 17 Nov 2015 02:44:04 +0000
Message-Id: <E1ZyWFY-0008EZ-87@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/HVM: always intercept #AC and
	#DB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6d8233dc06f75150ab6f7a3a4df1fd815d148b4d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 10 12:18:37 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:18:37 2015 +0100

    x86/HVM: always intercept #AC and #DB
    
    Both being benign exceptions, and both being possible to get triggered
    by exception delivery, this is required to prevent a guest from locking
    up a CPU (resulting from no other VM exits occurring once getting into
    such a loop).
    
    The specific scenarios:
    
    1) #AC may be raised during exception delivery if the handler is set to
    be a ring-3 one by a 32-bit guest, and the stack is misaligned.
    
    This is CVE-2015-5307 / XSA-156.
    
    Reported-by: Benjamin Serebrin <serebrin@google.com>
    
    2) #DB may be raised during exception delivery when a breakpoint got
    placed on a data structure involved in delivering the exception. This
    can result in an endless loop when a 64-bit guest uses a non-zero IST
    for the vector 1 IDT entry, but even without use of IST the time it
    takes until a contributory fault would get raised (results depending
    on the handler) may be quite long.
    
    This is CVE-2015-8104 / XSA-156.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: bd2239d9fa975a1ee5bcd27c218ae042cd0a57bc
    master date: 2015-11-10 12:03:08 +0100
---
 xen/arch/x86/hvm/svm/svm.c    |   15 +++++++++++----
 xen/arch/x86/hvm/vmx/vmx.c    |   22 +++++++++++-----------
 xen/include/asm-x86/hvm/hvm.h |    5 ++++-
 3 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index a7655bd..cc128b4 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1045,10 +1045,11 @@ static void noreturn svm_do_resume(struct vcpu *v)
         unlikely(v->arch.hvm_vcpu.debug_state_latch != debug_state) )
     {
         uint32_t intercepts = vmcb_get_exception_intercepts(vmcb);
-        uint32_t mask = (1U << TRAP_debug) | (1U << TRAP_int3);
+
         v->arch.hvm_vcpu.debug_state_latch = debug_state;
         vmcb_set_exception_intercepts(
-            vmcb, debug_state ? (intercepts | mask) : (intercepts & ~mask));
+            vmcb, debug_state ? (intercepts | (1U << TRAP_int3))
+                              : (intercepts & ~(1U << TRAP_int3)));
     }
 
     if ( v->arch.hvm_svm.launch_core != smp_processor_id() )
@@ -2435,8 +2436,9 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
 
     case VMEXIT_EXCEPTION_DB:
         if ( !v->domain->debugger_attached )
-            goto unexpected_exit_type;
-        domain_pause_for_debugger();
+            hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
+        else
+            domain_pause_for_debugger();
         break;
 
     case VMEXIT_EXCEPTION_BP:
@@ -2484,6 +2486,11 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
         break;
     }
 
+    case VMEXIT_EXCEPTION_AC:
+        HVMTRACE_1D(TRAP, TRAP_alignment_check);
+        hvm_inject_hw_exception(TRAP_alignment_check, vmcb->exitinfo1);
+        break;
+
     case VMEXIT_EXCEPTION_UD:
         svm_vmexit_ud_intercept(regs);
         break;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 8584f1f..4540cdc 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1186,16 +1186,10 @@ static void vmx_update_host_cr3(struct vcpu *v)
 
 void vmx_update_debug_state(struct vcpu *v)
 {
-    unsigned long mask;
-
-    mask = 1u << TRAP_int3;
-    if ( !cpu_has_monitor_trap_flag )
-        mask |= 1u << TRAP_debug;
-
     if ( v->arch.hvm_vcpu.debug_state_latch )
-        v->arch.hvm_vmx.exception_bitmap |= mask;
+        v->arch.hvm_vmx.exception_bitmap |= 1U << TRAP_int3;
     else
-        v->arch.hvm_vmx.exception_bitmap &= ~mask;
+        v->arch.hvm_vmx.exception_bitmap &= ~(1U << TRAP_int3);
 
     vmx_vmcs_enter(v);
     vmx_update_exception_bitmap(v);
@@ -2801,9 +2795,10 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             __vmread(EXIT_QUALIFICATION, &exit_qualification);
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
-            if ( !v->domain->debugger_attached || cpu_has_monitor_trap_flag )
-                goto exit_and_crash;
-            domain_pause_for_debugger();
+            if ( !v->domain->debugger_attached )
+                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+            else
+                domain_pause_for_debugger();
             break;
         case TRAP_int3: 
         {
@@ -2868,6 +2863,11 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
             hvm_inject_page_fault(regs->error_code, exit_qualification);
             break;
+        case TRAP_alignment_check:
+            HVMTRACE_1D(TRAP, vector);
+            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
+            hvm_inject_hw_exception(vector, ecode);
+            break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_MASK) !=
                  (X86_EVENTTYPE_NMI << 8) )
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index e3d2d9a..6a98267 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -378,7 +378,10 @@ static inline int hvm_event_pending(struct vcpu *v)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These exceptions must always be intercepted. */
-#define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
+#define HVM_TRAP_MASK ((1U << TRAP_debug)           | \
+                       (1U << TRAP_invalid_op)      | \
+                       (1U << TRAP_alignment_check) | \
+                       (1U << TRAP_machine_check))
 
 /*
  * x86 event types. This enumeration is valid for:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Tue Nov 17 02:44:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Nov 2015 02: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 1ZyWFd-0007t0-Rn; Tue, 17 Nov 2015 02:44: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 1ZyWFc-0007su-5x
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:08 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	A8/02-14900-7749A465; Tue, 17 Nov 2015 02:44:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1447728245!3581305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47851 invoked from network); 17 Nov 2015 02:44:06 -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;
	17 Nov 2015 02:44:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyWFY-00026c-Ov
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyWFY-0008EZ-87
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:04 +0000
Date: Tue, 17 Nov 2015 02:44:04 +0000
Message-Id: <E1ZyWFY-0008EZ-87@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] x86/HVM: always intercept #AC and
	#DB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6d8233dc06f75150ab6f7a3a4df1fd815d148b4d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 10 12:18:37 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:18:37 2015 +0100

    x86/HVM: always intercept #AC and #DB
    
    Both being benign exceptions, and both being possible to get triggered
    by exception delivery, this is required to prevent a guest from locking
    up a CPU (resulting from no other VM exits occurring once getting into
    such a loop).
    
    The specific scenarios:
    
    1) #AC may be raised during exception delivery if the handler is set to
    be a ring-3 one by a 32-bit guest, and the stack is misaligned.
    
    This is CVE-2015-5307 / XSA-156.
    
    Reported-by: Benjamin Serebrin <serebrin@google.com>
    
    2) #DB may be raised during exception delivery when a breakpoint got
    placed on a data structure involved in delivering the exception. This
    can result in an endless loop when a 64-bit guest uses a non-zero IST
    for the vector 1 IDT entry, but even without use of IST the time it
    takes until a contributory fault would get raised (results depending
    on the handler) may be quite long.
    
    This is CVE-2015-8104 / XSA-156.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: bd2239d9fa975a1ee5bcd27c218ae042cd0a57bc
    master date: 2015-11-10 12:03:08 +0100
---
 xen/arch/x86/hvm/svm/svm.c    |   15 +++++++++++----
 xen/arch/x86/hvm/vmx/vmx.c    |   22 +++++++++++-----------
 xen/include/asm-x86/hvm/hvm.h |    5 ++++-
 3 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index a7655bd..cc128b4 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1045,10 +1045,11 @@ static void noreturn svm_do_resume(struct vcpu *v)
         unlikely(v->arch.hvm_vcpu.debug_state_latch != debug_state) )
     {
         uint32_t intercepts = vmcb_get_exception_intercepts(vmcb);
-        uint32_t mask = (1U << TRAP_debug) | (1U << TRAP_int3);
+
         v->arch.hvm_vcpu.debug_state_latch = debug_state;
         vmcb_set_exception_intercepts(
-            vmcb, debug_state ? (intercepts | mask) : (intercepts & ~mask));
+            vmcb, debug_state ? (intercepts | (1U << TRAP_int3))
+                              : (intercepts & ~(1U << TRAP_int3)));
     }
 
     if ( v->arch.hvm_svm.launch_core != smp_processor_id() )
@@ -2435,8 +2436,9 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
 
     case VMEXIT_EXCEPTION_DB:
         if ( !v->domain->debugger_attached )
-            goto unexpected_exit_type;
-        domain_pause_for_debugger();
+            hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
+        else
+            domain_pause_for_debugger();
         break;
 
     case VMEXIT_EXCEPTION_BP:
@@ -2484,6 +2486,11 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
         break;
     }
 
+    case VMEXIT_EXCEPTION_AC:
+        HVMTRACE_1D(TRAP, TRAP_alignment_check);
+        hvm_inject_hw_exception(TRAP_alignment_check, vmcb->exitinfo1);
+        break;
+
     case VMEXIT_EXCEPTION_UD:
         svm_vmexit_ud_intercept(regs);
         break;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 8584f1f..4540cdc 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1186,16 +1186,10 @@ static void vmx_update_host_cr3(struct vcpu *v)
 
 void vmx_update_debug_state(struct vcpu *v)
 {
-    unsigned long mask;
-
-    mask = 1u << TRAP_int3;
-    if ( !cpu_has_monitor_trap_flag )
-        mask |= 1u << TRAP_debug;
-
     if ( v->arch.hvm_vcpu.debug_state_latch )
-        v->arch.hvm_vmx.exception_bitmap |= mask;
+        v->arch.hvm_vmx.exception_bitmap |= 1U << TRAP_int3;
     else
-        v->arch.hvm_vmx.exception_bitmap &= ~mask;
+        v->arch.hvm_vmx.exception_bitmap &= ~(1U << TRAP_int3);
 
     vmx_vmcs_enter(v);
     vmx_update_exception_bitmap(v);
@@ -2801,9 +2795,10 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             __vmread(EXIT_QUALIFICATION, &exit_qualification);
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | 0xffff0ff0);
-            if ( !v->domain->debugger_attached || cpu_has_monitor_trap_flag )
-                goto exit_and_crash;
-            domain_pause_for_debugger();
+            if ( !v->domain->debugger_attached )
+                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+            else
+                domain_pause_for_debugger();
             break;
         case TRAP_int3: 
         {
@@ -2868,6 +2863,11 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
             hvm_inject_page_fault(regs->error_code, exit_qualification);
             break;
+        case TRAP_alignment_check:
+            HVMTRACE_1D(TRAP, vector);
+            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
+            hvm_inject_hw_exception(vector, ecode);
+            break;
         case TRAP_nmi:
             if ( (intr_info & INTR_INFO_INTR_TYPE_MASK) !=
                  (X86_EVENTTYPE_NMI << 8) )
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index e3d2d9a..6a98267 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -378,7 +378,10 @@ static inline int hvm_event_pending(struct vcpu *v)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These exceptions must always be intercepted. */
-#define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
+#define HVM_TRAP_MASK ((1U << TRAP_debug)           | \
+                       (1U << TRAP_invalid_op)      | \
+                       (1U << TRAP_alignment_check) | \
+                       (1U << TRAP_machine_check))
 
 /*
  * x86 event types. This enumeration is valid for:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Tue Nov 17 02:44:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Nov 2015 02:44: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 1ZyWFp-0007tz-WE; Tue, 17 Nov 2015 02:44: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 1ZyWFo-0007to-KD
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:20 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	44/6D-18744-3849A465; Tue, 17 Nov 2015 02:44:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1447728256!3683121!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64561 invoked from network); 17 Nov 2015 02:44:17 -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;
	17 Nov 2015 02:44:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyWFj-00026k-CA
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyWFj-0008GX-1m
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:15 +0000
Date: Tue, 17 Nov 2015 02:44:15 +0000
Message-Id: <E1ZyWFj-0008GX-1m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] update Xen version to 4.5.3-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 f299bd482c6f53c61776cc8a408f8394df92ddd1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 10 12:20:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:20:59 2015 +0100

    update Xen version to 4.5.3-pre
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 5161fdc..ecad787 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 5
-export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Tue Nov 17 02:44:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Nov 2015 02:44: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 1ZyWFp-0007tz-WE; Tue, 17 Nov 2015 02:44: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 1ZyWFo-0007to-KD
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:20 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	44/6D-18744-3849A465; Tue, 17 Nov 2015 02:44:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1447728256!3683121!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64561 invoked from network); 17 Nov 2015 02:44:17 -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;
	17 Nov 2015 02:44:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyWFj-00026k-CA
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZyWFj-0008GX-1m
	for xen-changelog@lists.xensource.com; Tue, 17 Nov 2015 02:44:15 +0000
Date: Tue, 17 Nov 2015 02:44:15 +0000
Message-Id: <E1ZyWFj-0008GX-1m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] update Xen version to 4.5.3-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 f299bd482c6f53c61776cc8a408f8394df92ddd1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 10 12:20:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:20:59 2015 +0100

    update Xen version to 4.5.3-pre
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 5161fdc..ecad787 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 5
-export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Fri Nov 20 05:44:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Nov 2015 05: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 1ZzeUR-00025e-7f; Fri, 20 Nov 2015 05:44: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 1ZzeUP-00025R-CY
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 05:44:05 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	6E/65-18107-423BE465; Fri, 20 Nov 2015 05:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1447998243!5128003!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10309 invoked from network); 20 Nov 2015 05:44:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Nov 2015 05:44:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZzeUM-0006yC-Ri
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 05:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZzeUM-0006nO-F6
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 05:44:02 +0000
Date: Fri, 20 Nov 2015 05:44:02 +0000
Message-Id: <E1ZzeUM-0006nO-F6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Config: Switch to unified qemu
	trees.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aad8158460384bba77ad6f131f0ef693eee3e618
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Sep 10 14:31:34 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Nov 18 17:09:08 2015 +0000

    Config: Switch to unified qemu trees.
    
    Upstream qemu is now in qemu-xen.git and the trad fork is in
    qemu-xen-traditional.git.
    
    QEMU_UPSTREAM_REVISION is currently a tag and
    QEMU_TRADITIONAL_REVISION is a specific revision, so no changes are
    required to those.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 78833c04250416f1870c458309d3ac0e5cf915fd)
    
    Conflicts:
    	Config.mk
    (cherry picked from commit 0cabed0a0b322fbef30f3519465538df4ab1d9f2)
    
    Conflicts:
    	Config.mk
    (cherry picked from commit 602506b3efa8ddeae2976ec9f15d91366f823919)
    
    Conflicts:
    	Config.mk
---
 Config.mk |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Config.mk b/Config.mk
index 0aaed5f..10bd71c 100644
--- a/Config.mk
+++ b/Config.mk
@@ -197,18 +197,18 @@ XEN_EXTFILES_URL=http://xenbits.xen.org/xen-extfiles
 # near the place in the Xen Makefiles where the file is used.
 
 ifeq ($(GIT_HTTP),y)
-QEMU_REMOTE=http://xenbits.xen.org/git-http/qemu-xen-4.3-testing.git
+QEMU_REMOTE ?= http://xenbits.xen.org/git-http/qemu-xen-traditional.git
 else
-QEMU_REMOTE=git://xenbits.xen.org/qemu-xen-4.3-testing.git
+QEMU_REMOTE ?= git://xenbits.xen.org/qemu-xen-traditional.git
 endif
 
 ifeq ($(GIT_HTTP),y)
 OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
-QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-4.3-testing.git
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.3-testing.git
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
--
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 Nov 20 05:44:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Nov 2015 05: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 1ZzeUR-00025e-7f; Fri, 20 Nov 2015 05:44: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 1ZzeUP-00025R-CY
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 05:44:05 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	6E/65-18107-423BE465; Fri, 20 Nov 2015 05:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1447998243!5128003!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10309 invoked from network); 20 Nov 2015 05:44:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Nov 2015 05:44:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZzeUM-0006yC-Ri
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 05:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZzeUM-0006nO-F6
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 05:44:02 +0000
Date: Fri, 20 Nov 2015 05:44:02 +0000
Message-Id: <E1ZzeUM-0006nO-F6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Config: Switch to unified qemu
	trees.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aad8158460384bba77ad6f131f0ef693eee3e618
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Sep 10 14:31:34 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Nov 18 17:09:08 2015 +0000

    Config: Switch to unified qemu trees.
    
    Upstream qemu is now in qemu-xen.git and the trad fork is in
    qemu-xen-traditional.git.
    
    QEMU_UPSTREAM_REVISION is currently a tag and
    QEMU_TRADITIONAL_REVISION is a specific revision, so no changes are
    required to those.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 78833c04250416f1870c458309d3ac0e5cf915fd)
    
    Conflicts:
    	Config.mk
    (cherry picked from commit 0cabed0a0b322fbef30f3519465538df4ab1d9f2)
    
    Conflicts:
    	Config.mk
    (cherry picked from commit 602506b3efa8ddeae2976ec9f15d91366f823919)
    
    Conflicts:
    	Config.mk
---
 Config.mk |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Config.mk b/Config.mk
index 0aaed5f..10bd71c 100644
--- a/Config.mk
+++ b/Config.mk
@@ -197,18 +197,18 @@ XEN_EXTFILES_URL=http://xenbits.xen.org/xen-extfiles
 # near the place in the Xen Makefiles where the file is used.
 
 ifeq ($(GIT_HTTP),y)
-QEMU_REMOTE=http://xenbits.xen.org/git-http/qemu-xen-4.3-testing.git
+QEMU_REMOTE ?= http://xenbits.xen.org/git-http/qemu-xen-traditional.git
 else
-QEMU_REMOTE=git://xenbits.xen.org/qemu-xen-4.3-testing.git
+QEMU_REMOTE ?= git://xenbits.xen.org/qemu-xen-traditional.git
 endif
 
 ifeq ($(GIT_HTTP),y)
 OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
-QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-4.3-testing.git
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.3-testing.git
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
--
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 Nov 20 07:44:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Nov 2015 07: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 1ZzgMZ-0005Tx-QQ; Fri, 20 Nov 2015 07: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 1ZzgMY-0005Tn-Tu
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 07:44:07 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	72/03-01748-64FCE465; Fri, 20 Nov 2015 07:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1448005444!1971364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57479 invoked from network); 20 Nov 2015 07:44:05 -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;
	20 Nov 2015 07:44:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZzgMW-0008Bt-9L
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 07:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZzgMV-0000Gr-13
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 07:44:03 +0000
Date: Fri, 20 Nov 2015 07:44:03 +0000
Message-Id: <E1ZzgMV-0000Gr-13@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] Config: Switch to unified qemu
	trees.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 602506b3efa8ddeae2976ec9f15d91366f823919
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Sep 10 14:31:34 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Nov 18 17:07:55 2015 +0000

    Config: Switch to unified qemu trees.
    
    Upstream qemu is now in qemu-xen.git and the trad fork is in
    qemu-xen-traditional.git.
    
    QEMU_UPSTREAM_REVISION is currently a tag and
    QEMU_TRADITIONAL_REVISION is a specific revision, so no changes are
    required to those.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 78833c04250416f1870c458309d3ac0e5cf915fd)
    
    Conflicts:
    	Config.mk
    (cherry picked from commit 0cabed0a0b322fbef30f3519465538df4ab1d9f2)
    
    Conflicts:
    	Config.mk
---
 Config.mk |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Config.mk b/Config.mk
index 695e207..273150b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -219,18 +219,18 @@ XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # near the place in the Xen Makefiles where the file is used.
 
 ifeq ($(GIT_HTTP),y)
-QEMU_REMOTE ?= http://xenbits.xen.org/git-http/qemu-xen-4.4-testing.git
+QEMU_REMOTE ?= http://xenbits.xen.org/git-http/qemu-xen-traditional.git
 else
-QEMU_REMOTE ?= git://xenbits.xen.org/qemu-xen-4.4-testing.git
+QEMU_REMOTE ?= git://xenbits.xen.org/qemu-xen-traditional.git
 endif
 
 ifeq ($(GIT_HTTP),y)
 OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
-QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-4.4-testing.git
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.4-testing.git
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Fri Nov 20 07:44:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Nov 2015 07: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 1ZzgMZ-0005Tx-QQ; Fri, 20 Nov 2015 07: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 1ZzgMY-0005Tn-Tu
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 07:44:07 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	72/03-01748-64FCE465; Fri, 20 Nov 2015 07:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1448005444!1971364!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57479 invoked from network); 20 Nov 2015 07:44:05 -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;
	20 Nov 2015 07:44:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZzgMW-0008Bt-9L
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 07:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1ZzgMV-0000Gr-13
	for xen-changelog@lists.xensource.com; Fri, 20 Nov 2015 07:44:03 +0000
Date: Fri, 20 Nov 2015 07:44:03 +0000
Message-Id: <E1ZzgMV-0000Gr-13@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] Config: Switch to unified qemu
	trees.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 602506b3efa8ddeae2976ec9f15d91366f823919
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Sep 10 14:31:34 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Nov 18 17:07:55 2015 +0000

    Config: Switch to unified qemu trees.
    
    Upstream qemu is now in qemu-xen.git and the trad fork is in
    qemu-xen-traditional.git.
    
    QEMU_UPSTREAM_REVISION is currently a tag and
    QEMU_TRADITIONAL_REVISION is a specific revision, so no changes are
    required to those.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 78833c04250416f1870c458309d3ac0e5cf915fd)
    
    Conflicts:
    	Config.mk
    (cherry picked from commit 0cabed0a0b322fbef30f3519465538df4ab1d9f2)
    
    Conflicts:
    	Config.mk
---
 Config.mk |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Config.mk b/Config.mk
index 695e207..273150b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -219,18 +219,18 @@ XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # near the place in the Xen Makefiles where the file is used.
 
 ifeq ($(GIT_HTTP),y)
-QEMU_REMOTE ?= http://xenbits.xen.org/git-http/qemu-xen-4.4-testing.git
+QEMU_REMOTE ?= http://xenbits.xen.org/git-http/qemu-xen-traditional.git
 else
-QEMU_REMOTE ?= git://xenbits.xen.org/qemu-xen-4.4-testing.git
+QEMU_REMOTE ?= git://xenbits.xen.org/qemu-xen-traditional.git
 endif
 
 ifeq ($(GIT_HTTP),y)
 OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
-QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-4.4-testing.git
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.4-testing.git
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Mon Nov 23 09:55:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Nov 2015 09:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a0nq3-0002lP-OA; Mon, 23 Nov 2015 09:55:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a0nq2-0002lK-Jh
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 09:55:10 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	2B/CF-23747-D72E2565; Mon, 23 Nov 2015 09:55:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448272503!5788293!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57326 invoked from network); 23 Nov 2015 09:55: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;
	23 Nov 2015 09:55:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a0npv-0001fi-Bl
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 09:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a0npu-0003Tn-TT
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 09:55:03 +0000
Date: Mon, 23 Nov 2015 09:55:02 +0000
Message-Id: <E1a0npu-0003Tn-TT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] minios: don't rely on specific
	page table allocation scheme
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d84345a20d8a46ea26379c9f19961f6aa3e6e83
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Nov 20 19:32:42 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 23 09:38:58 2015 +0000

    minios: don't rely on specific page table allocation scheme
    
    Today mini-os is making assumptions how the page tables it is started
    with are being allocated. Especially it is using the number of page
    table frames to calculate which is the first unmapped pfn.
    
    Instead of relying on page table number assumptions just look into the
    page tables to find the first pfn not already mapped.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 arch/x86/mm.c         |   93 +++++++++++--------------------------------------
 include/x86/arch_mm.h |    7 ----
 2 files changed, 21 insertions(+), 79 deletions(-)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index 186659d..51aa966 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -132,61 +132,6 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
 }
 
 /*
- * Checks if a pagetable frame is needed at 'level' to map a given
- * address. Note, this function is specific to the initial page table
- * building.
- */
-static int need_pt_frame(unsigned long va, int level)
-{
-    unsigned long hyp_virt_start = HYPERVISOR_VIRT_START;
-#if defined(__x86_64__)
-    unsigned long hyp_virt_end = HYPERVISOR_VIRT_END;
-#else
-    unsigned long hyp_virt_end = 0xffffffff;
-#endif
-
-    /* In general frames will _not_ be needed if they were already
-       allocated to map the hypervisor into our VA space */
-#if defined(__x86_64__)
-    if ( level == L3_FRAME )
-    {
-        if ( l4_table_offset(va) >= 
-             l4_table_offset(hyp_virt_start) &&
-             l4_table_offset(va) <= 
-             l4_table_offset(hyp_virt_end))
-            return 0;
-        return 1;
-    } 
-    else
-#endif
-
-    if ( level == L2_FRAME )
-    {
-#if defined(__x86_64__)
-        if ( l4_table_offset(va) >= 
-             l4_table_offset(hyp_virt_start) &&
-             l4_table_offset(va) <= 
-             l4_table_offset(hyp_virt_end))
-#endif
-            if ( l3_table_offset(va) >= 
-                 l3_table_offset(hyp_virt_start) &&
-                 l3_table_offset(va) <= 
-                 l3_table_offset(hyp_virt_end))
-                return 0;
-
-        return 1;
-    } 
-    else 
-        /* Always need l1 frames */
-        if ( level == L1_FRAME )
-            return 1;
-
-    printk("ERROR: Unknown frame level %d, hypervisor %lx,%lx\n", 
-           level, hyp_virt_start, hyp_virt_end);
-    return -1;
-}
-
-/*
  * Build the initial pagetable.
  */
 static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
@@ -200,8 +145,9 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
     int count = 0;
     int rc;
 
-    pfn_to_map = 
-        (start_info.nr_pt_frames - NOT_L1_FRAMES) * L1_PAGETABLE_ENTRIES;
+    /* Be conservative: even if we know there will be more pages already
+       mapped, start the loop at the very beginning. */
+    pfn_to_map = *start_pfn;
 
     if ( *max_pfn >= virt_to_pfn(HYPERVISOR_VIRT_START) )
     {
@@ -229,9 +175,8 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
 #if defined(__x86_64__)
         offset = l4_table_offset(start_address);
         /* Need new L3 pt frame */
-        if ( !(start_address & L3_MASK) )
-            if ( need_pt_frame(start_address, L3_FRAME) ) 
-                new_pt_frame(&pt_pfn, pt_mfn, offset, L3_FRAME);
+        if ( !(tab[offset] & _PAGE_PRESENT) )
+            new_pt_frame(&pt_pfn, pt_mfn, offset, L3_FRAME);
 
         page = tab[offset];
         pt_mfn = pte_to_mfn(page);
@@ -239,29 +184,33 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
 #endif
         offset = l3_table_offset(start_address);
         /* Need new L2 pt frame */
-        if ( !(start_address & L2_MASK) )
-            if ( need_pt_frame(start_address, L2_FRAME) )
-                new_pt_frame(&pt_pfn, pt_mfn, offset, L2_FRAME);
+        if ( !(tab[offset] & _PAGE_PRESENT) )
+            new_pt_frame(&pt_pfn, pt_mfn, offset, L2_FRAME);
 
         page = tab[offset];
         pt_mfn = pte_to_mfn(page);
         tab = to_virt(mfn_to_pfn(pt_mfn) << PAGE_SHIFT);
         offset = l2_table_offset(start_address);        
         /* Need new L1 pt frame */
-        if ( !(start_address & L1_MASK) )
-            if ( need_pt_frame(start_address, L1_FRAME) )
-                new_pt_frame(&pt_pfn, pt_mfn, offset, L1_FRAME);
+        if ( !(tab[offset] & _PAGE_PRESENT) )
+            new_pt_frame(&pt_pfn, pt_mfn, offset, L1_FRAME);
 
         page = tab[offset];
         pt_mfn = pte_to_mfn(page);
+        tab = to_virt(mfn_to_pfn(pt_mfn) << PAGE_SHIFT);
         offset = l1_table_offset(start_address);
 
-        mmu_updates[count].ptr =
-            ((pgentry_t)pt_mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
-        mmu_updates[count].val = 
-            (pgentry_t)pfn_to_mfn(pfn_to_map++) << PAGE_SHIFT | L1_PROT;
-        count++;
-        if ( count == L1_PAGETABLE_ENTRIES || pfn_to_map == *max_pfn )
+        if ( !(tab[offset] & _PAGE_PRESENT) )
+        {
+            mmu_updates[count].ptr =
+                ((pgentry_t)pt_mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
+            mmu_updates[count].val =
+                (pgentry_t)pfn_to_mfn(pfn_to_map) << PAGE_SHIFT | L1_PROT;
+            count++;
+        }
+        pfn_to_map++;
+        if ( count == L1_PAGETABLE_ENTRIES ||
+             (count && pfn_to_map == *max_pfn) )
         {
             rc = HYPERVISOR_mmu_update(mmu_updates, count, NULL, DOMID_SELF);
             if ( rc < 0 )
diff --git a/include/x86/arch_mm.h b/include/x86/arch_mm.h
index 23cfca7..58f29fc 100644
--- a/include/x86/arch_mm.h
+++ b/include/x86/arch_mm.h
@@ -56,12 +56,6 @@
 
 #define L2_MASK  ((1UL << L3_PAGETABLE_SHIFT) - 1)
 
-/*
- * If starting from virtual address greater than 0xc0000000,
- * this value will be 2 to account for final mid-level page
- * directory which is always mapped in at this location.
- */
-#define NOT_L1_FRAMES           3
 #define PRIpte "016llx"
 #ifndef __ASSEMBLY__
 typedef uint64_t pgentry_t;
@@ -87,7 +81,6 @@ typedef uint64_t pgentry_t;
 #define L2_MASK  ((1UL << L3_PAGETABLE_SHIFT) - 1)
 #define L3_MASK  ((1UL << L4_PAGETABLE_SHIFT) - 1)
 
-#define NOT_L1_FRAMES           3
 #define PRIpte "016lx"
 #ifndef __ASSEMBLY__
 typedef unsigned long pgentry_t;
--
generated by git-patchbot for /home/xen/git/mini-os.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 Nov 23 09:55:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Nov 2015 09:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a0nq3-0002lP-OA; Mon, 23 Nov 2015 09:55:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a0nq2-0002lK-Jh
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 09:55:10 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	2B/CF-23747-D72E2565; Mon, 23 Nov 2015 09:55:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448272503!5788293!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57326 invoked from network); 23 Nov 2015 09:55: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;
	23 Nov 2015 09:55:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a0npv-0001fi-Bl
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 09:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a0npu-0003Tn-TT
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 09:55:03 +0000
Date: Mon, 23 Nov 2015 09:55:02 +0000
Message-Id: <E1a0npu-0003Tn-TT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] minios: don't rely on specific
	page table allocation scheme
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d84345a20d8a46ea26379c9f19961f6aa3e6e83
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Nov 20 19:32:42 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 23 09:38:58 2015 +0000

    minios: don't rely on specific page table allocation scheme
    
    Today mini-os is making assumptions how the page tables it is started
    with are being allocated. Especially it is using the number of page
    table frames to calculate which is the first unmapped pfn.
    
    Instead of relying on page table number assumptions just look into the
    page tables to find the first pfn not already mapped.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 arch/x86/mm.c         |   93 +++++++++++--------------------------------------
 include/x86/arch_mm.h |    7 ----
 2 files changed, 21 insertions(+), 79 deletions(-)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index 186659d..51aa966 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -132,61 +132,6 @@ static void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
 }
 
 /*
- * Checks if a pagetable frame is needed at 'level' to map a given
- * address. Note, this function is specific to the initial page table
- * building.
- */
-static int need_pt_frame(unsigned long va, int level)
-{
-    unsigned long hyp_virt_start = HYPERVISOR_VIRT_START;
-#if defined(__x86_64__)
-    unsigned long hyp_virt_end = HYPERVISOR_VIRT_END;
-#else
-    unsigned long hyp_virt_end = 0xffffffff;
-#endif
-
-    /* In general frames will _not_ be needed if they were already
-       allocated to map the hypervisor into our VA space */
-#if defined(__x86_64__)
-    if ( level == L3_FRAME )
-    {
-        if ( l4_table_offset(va) >= 
-             l4_table_offset(hyp_virt_start) &&
-             l4_table_offset(va) <= 
-             l4_table_offset(hyp_virt_end))
-            return 0;
-        return 1;
-    } 
-    else
-#endif
-
-    if ( level == L2_FRAME )
-    {
-#if defined(__x86_64__)
-        if ( l4_table_offset(va) >= 
-             l4_table_offset(hyp_virt_start) &&
-             l4_table_offset(va) <= 
-             l4_table_offset(hyp_virt_end))
-#endif
-            if ( l3_table_offset(va) >= 
-                 l3_table_offset(hyp_virt_start) &&
-                 l3_table_offset(va) <= 
-                 l3_table_offset(hyp_virt_end))
-                return 0;
-
-        return 1;
-    } 
-    else 
-        /* Always need l1 frames */
-        if ( level == L1_FRAME )
-            return 1;
-
-    printk("ERROR: Unknown frame level %d, hypervisor %lx,%lx\n", 
-           level, hyp_virt_start, hyp_virt_end);
-    return -1;
-}
-
-/*
  * Build the initial pagetable.
  */
 static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
@@ -200,8 +145,9 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
     int count = 0;
     int rc;
 
-    pfn_to_map = 
-        (start_info.nr_pt_frames - NOT_L1_FRAMES) * L1_PAGETABLE_ENTRIES;
+    /* Be conservative: even if we know there will be more pages already
+       mapped, start the loop at the very beginning. */
+    pfn_to_map = *start_pfn;
 
     if ( *max_pfn >= virt_to_pfn(HYPERVISOR_VIRT_START) )
     {
@@ -229,9 +175,8 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
 #if defined(__x86_64__)
         offset = l4_table_offset(start_address);
         /* Need new L3 pt frame */
-        if ( !(start_address & L3_MASK) )
-            if ( need_pt_frame(start_address, L3_FRAME) ) 
-                new_pt_frame(&pt_pfn, pt_mfn, offset, L3_FRAME);
+        if ( !(tab[offset] & _PAGE_PRESENT) )
+            new_pt_frame(&pt_pfn, pt_mfn, offset, L3_FRAME);
 
         page = tab[offset];
         pt_mfn = pte_to_mfn(page);
@@ -239,29 +184,33 @@ static void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
 #endif
         offset = l3_table_offset(start_address);
         /* Need new L2 pt frame */
-        if ( !(start_address & L2_MASK) )
-            if ( need_pt_frame(start_address, L2_FRAME) )
-                new_pt_frame(&pt_pfn, pt_mfn, offset, L2_FRAME);
+        if ( !(tab[offset] & _PAGE_PRESENT) )
+            new_pt_frame(&pt_pfn, pt_mfn, offset, L2_FRAME);
 
         page = tab[offset];
         pt_mfn = pte_to_mfn(page);
         tab = to_virt(mfn_to_pfn(pt_mfn) << PAGE_SHIFT);
         offset = l2_table_offset(start_address);        
         /* Need new L1 pt frame */
-        if ( !(start_address & L1_MASK) )
-            if ( need_pt_frame(start_address, L1_FRAME) )
-                new_pt_frame(&pt_pfn, pt_mfn, offset, L1_FRAME);
+        if ( !(tab[offset] & _PAGE_PRESENT) )
+            new_pt_frame(&pt_pfn, pt_mfn, offset, L1_FRAME);
 
         page = tab[offset];
         pt_mfn = pte_to_mfn(page);
+        tab = to_virt(mfn_to_pfn(pt_mfn) << PAGE_SHIFT);
         offset = l1_table_offset(start_address);
 
-        mmu_updates[count].ptr =
-            ((pgentry_t)pt_mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
-        mmu_updates[count].val = 
-            (pgentry_t)pfn_to_mfn(pfn_to_map++) << PAGE_SHIFT | L1_PROT;
-        count++;
-        if ( count == L1_PAGETABLE_ENTRIES || pfn_to_map == *max_pfn )
+        if ( !(tab[offset] & _PAGE_PRESENT) )
+        {
+            mmu_updates[count].ptr =
+                ((pgentry_t)pt_mfn << PAGE_SHIFT) + sizeof(pgentry_t) * offset;
+            mmu_updates[count].val =
+                (pgentry_t)pfn_to_mfn(pfn_to_map) << PAGE_SHIFT | L1_PROT;
+            count++;
+        }
+        pfn_to_map++;
+        if ( count == L1_PAGETABLE_ENTRIES ||
+             (count && pfn_to_map == *max_pfn) )
         {
             rc = HYPERVISOR_mmu_update(mmu_updates, count, NULL, DOMID_SELF);
             if ( rc < 0 )
diff --git a/include/x86/arch_mm.h b/include/x86/arch_mm.h
index 23cfca7..58f29fc 100644
--- a/include/x86/arch_mm.h
+++ b/include/x86/arch_mm.h
@@ -56,12 +56,6 @@
 
 #define L2_MASK  ((1UL << L3_PAGETABLE_SHIFT) - 1)
 
-/*
- * If starting from virtual address greater than 0xc0000000,
- * this value will be 2 to account for final mid-level page
- * directory which is always mapped in at this location.
- */
-#define NOT_L1_FRAMES           3
 #define PRIpte "016llx"
 #ifndef __ASSEMBLY__
 typedef uint64_t pgentry_t;
@@ -87,7 +81,6 @@ typedef uint64_t pgentry_t;
 #define L2_MASK  ((1UL << L3_PAGETABLE_SHIFT) - 1)
 #define L3_MASK  ((1UL << L4_PAGETABLE_SHIFT) - 1)
 
-#define NOT_L1_FRAMES           3
 #define PRIpte "016lx"
 #ifndef __ASSEMBLY__
 typedef unsigned long pgentry_t;
--
generated by git-patchbot for /home/xen/git/mini-os.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 Nov 23 12:22:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Nov 2015 12: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 1a0q8F-0001km-NG; Mon, 23 Nov 2015 12: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 1a0q8E-0001kh-DM
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 12:22:06 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	6D/40-03235-DE403565; Mon, 23 Nov 2015 12:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1448281323!5780334!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30743 invoked from network); 23 Nov 2015 12:22:04 -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;
	23 Nov 2015 12:22:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a0q8B-0003G8-OB
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 12:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a0q8B-00055Y-Eh
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 12:22:03 +0000
Date: Mon, 23 Nov 2015 12:22:03 +0000
Message-Id: <E1a0q8B-00055Y-Eh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] Config: Switch to unified qemu
	trees.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0cabed0a0b322fbef30f3519465538df4ab1d9f2
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Sep 10 14:31:34 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Nov 18 17:06:07 2015 +0000

    Config: Switch to unified qemu trees.
    
    Upstream qemu is now in qemu-xen.git and the trad fork is in
    qemu-xen-traditional.git.
    
    QEMU_UPSTREAM_REVISION is currently a tag and
    QEMU_TRADITIONAL_REVISION is a specific revision, so no changes are
    required to those.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 78833c04250416f1870c458309d3ac0e5cf915fd)
    
    Conflicts:
    	Config.mk
---
 Config.mk |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Config.mk b/Config.mk
index c1795e6..0076c3f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -242,13 +242,13 @@ endif
 
 ifeq ($(GIT_HTTP),y)
 OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
-QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-4.5-testing.git
-QEMU_TRADITIONAL_URL ?= http://xenbits.xen.org/git-http/qemu-xen-4.5-testing.git
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-xen.git
+QEMU_TRADITIONAL_URL ?= http://xenbits.xen.org/git-http/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.5-testing.git
-QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-4.5-testing.git
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
+QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Mon Nov 23 12:22:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Nov 2015 12: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 1a0q8F-0001km-NG; Mon, 23 Nov 2015 12: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 1a0q8E-0001kh-DM
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 12:22:06 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	6D/40-03235-DE403565; Mon, 23 Nov 2015 12:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1448281323!5780334!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30743 invoked from network); 23 Nov 2015 12:22:04 -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;
	23 Nov 2015 12:22:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a0q8B-0003G8-OB
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 12:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a0q8B-00055Y-Eh
	for xen-changelog@lists.xensource.com; Mon, 23 Nov 2015 12:22:03 +0000
Date: Mon, 23 Nov 2015 12:22:03 +0000
Message-Id: <E1a0q8B-00055Y-Eh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.5] Config: Switch to unified qemu
	trees.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0cabed0a0b322fbef30f3519465538df4ab1d9f2
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Sep 10 14:31:34 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Nov 18 17:06:07 2015 +0000

    Config: Switch to unified qemu trees.
    
    Upstream qemu is now in qemu-xen.git and the trad fork is in
    qemu-xen-traditional.git.
    
    QEMU_UPSTREAM_REVISION is currently a tag and
    QEMU_TRADITIONAL_REVISION is a specific revision, so no changes are
    required to those.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    
    Conflicts:
    	Config.mk
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 78833c04250416f1870c458309d3ac0e5cf915fd)
    
    Conflicts:
    	Config.mk
---
 Config.mk |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Config.mk b/Config.mk
index c1795e6..0076c3f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -242,13 +242,13 @@ endif
 
 ifeq ($(GIT_HTTP),y)
 OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
-QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-4.5-testing.git
-QEMU_TRADITIONAL_URL ?= http://xenbits.xen.org/git-http/qemu-xen-4.5-testing.git
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-xen.git
+QEMU_TRADITIONAL_URL ?= http://xenbits.xen.org/git-http/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
-QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.5-testing.git
-QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-4.5-testing.git
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-xen.git
+QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= cb9a7ebabcd6b8a49dc0854b2f9592d732b5afbd
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

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

From xen-changelog-bounces@lists.xen.org Tue Nov 24 13:44:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Nov 2015 13:44: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 1a1DtU-0006Qj-BP; Tue, 24 Nov 2015 13:44:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1DtS-0006QZ-EL
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 13:44:27 +0000
Content-Length: 148493
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	FD/C9-21201-8B964565; Tue, 24 Nov 2015 13:44:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448372661!6135306!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60803 invoked from network); 24 Nov 2015 13:44:22 -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;
	24 Nov 2015 13:44:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1DtN-0001w1-64
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 13:44:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1DtM-0004cO-Tr
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 13:44:21 +0000
Date: Tue, 24 Nov 2015 13:44:20 +0000
Message-Id: <E1a1DtM-0004cO-Tr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] Merge remote-tracking branch
	'qemu-xen/staging' into qemu-xen-4.7
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============9041100416986667532=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============9041100416986667532==
Content-Length: 151034
Content-Transfer-Encoding: quoted-printable

=3D=3D=3D This changeset includes merge from high-traffic branch =3D=3D=3D
Commits on that branch are not reported individually.

commit 3fb401edbd8e9741c611bfddf6a2032ca91f55ed
Merge: a44c2800d990252b3632bbb35af34ec5ff99e2f1 816609b2841297925a223ec377c336360e044ee5
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Nov 23 16:55:36 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Nov 23 16:55:36 2015 +0000

    Merge remote-tracking branch 'qemu-xen/staging' into qemu-xen-4.7

 .gitignore                                         |   12 +-
 .travis.yml                                        |    3 +
 LICENSE                                            |    2 +-
 MAINTAINERS                                        |  322 +-
 Makefile                                           |  114 +-
 Makefile.objs                                      |   14 +-
 Makefile.target                                    |   18 +-
 VERSION                                            |    2 +-
 aio-posix.c                                        |  109 +-
 aio-win32.c                                        |   60 +-
 arch_init.c                                        | 1118 ---
 async.c                                            |  105 +-
 audio/Makefile.objs                                |    4 -
 audio/alsaaudio.c                                  |  195 +-
 audio/audio.c                                      |   35 +-
 audio/audio_int.h                                  |    7 +-
 audio/audio_template.h                             |   43 +-
 audio/coreaudio.c                                  |   46 +-
 audio/dsound_template.h                            |   51 +-
 audio/dsoundaudio.c                                |  238 +-
 audio/esdaudio.c                                   |  557 --
 audio/fmodaudio.c                                  |  685 --
 audio/noaudio.c                                    |    4 +-
 audio/ossaudio.c                                   |  141 +-
 audio/paaudio.c                                    |  105 +-
 audio/sdlaudio.c                                   |   10 +-
 audio/spiceaudio.c                                 |    6 +-
 audio/wavaudio.c                                   |   42 +-
 audio/wavcapture.c                                 |    1 +
 audio/winwaveaudio.c                               |  717 --
 backends/hostmem-file.c                            |    2 +-
 backends/hostmem.c                                 |   45 +-
 backends/rng-egd.c                                 |   11 +-
 backends/rng-random.c                              |   12 +-
 backends/rng.c                                     |    2 +-
 backends/tpm.c                                     |   29 +-
 balloon.c                                          |   65 +-
 block-migration.c                                  |  892 --
 block.c                                            | 3465 ++------
 block/Makefile.objs                                |   10 +-
 block/accounting.c                                 |   13 +-
 block/archipelago.c                                |    6 +-
 block/backup.c                                     |  188 +-
 block/blkdebug.c                                   |  125 +-
 block/blkverify.c                                  |    4 +-
 block/block-backend.c                              |  303 +-
 block/commit.c                                     |    3 +-
 block/curl.c                                       |   16 +-
 block/dmg.c                                        |  503 +-
 block/io.c                                         | 2610 ++++++
 block/iscsi.c                                      |  204 +-
 block/linux-aio.c                                  |   99 +-
 block/mirror.c                                     |  145 +-
 block/nbd-client.c                                 |  129 +-
 block/nbd-client.h                                 |   35 +-
 block/nbd.c                                        |   50 +-
 block/nfs.c                                        |    9 +-
 block/null.c                                       |   66 +-
 block/parallels.c                                  |  679 ++-
 block/qapi.c                                       |  116 +-
 block/qcow.c                                       |  121 +-
 block/qcow2-cache.c                                |  172 +-
 block/qcow2-cluster.c                              |  169 +-
 block/qcow2-refcount.c                             |  675 +-
 block/qcow2-snapshot.c                             |    9 +-
 block/qcow2.c                                      |  281 +-
 block/qcow2.h                                      |   67 +-
 block/qed.c                                        |   13 +-
 block/qed.h                                        |    1 -
 block/quorum.c                                     |  102 +-
 block/raw-aio.h                                    |    2 +-
 block/raw-posix.c                                  |  454 +-
 block/raw-win32.c                                  |    3 +-
 block/raw_bsd.c                                    |   76 +-
 block/rbd.c                                        |   74 +-
 block/sheepdog.c                                   |  363 +-
 block/snapshot.c                                   |   19 +-
 block/ssh.c                                        |    4 +-
 block/stream.c                                     |    5 +-
 block/throttle-groups.c                            |  501 ++
 block/vdi.c                                        |   36 +-
 block/vhdx-log.c                                   |    1 +
 block/vhdx.c                                       |   41 +-
 block/vhdx.h                                       |    3 +-
 block/vmdk.c                                       |  227 +-
 block/vpc.c                                        |  165 +-
 block/vvfat.c                                      |   46 +-
 block/write-threshold.c                            |  125 +
 blockdev-nbd.c                                     |   34 +-
 blockdev.c                                         |  878 ++-
 blockjob.c                                         |   52 +-
 bootdevice.c                                       |  113 +-
 bsd-user/elfload.c                                 |   11 +-
 bsd-user/main.c                                    |   19 +-
 configure                                          |  793 ++-
 coroutine-ucontext.c                               |   69 +-
 cpu-exec.c                                         |   98 +-
 cpus.c                                             |  206 +-
 cputlb.c                                           |   45 +-
 crypto/Makefile.objs                               |    5 +
 crypto/aes.c                                       | 1652 ++++
 crypto/cipher-builtin.c                            |  400 +
 crypto/cipher-gcrypt.c                             |  195 +
 crypto/cipher-nettle.c                             |  245 +
 crypto/cipher.c                                    |   74 +
 crypto/desrfb.c                                    |  415 +
 crypto/hash.c                                      |  200 +
 crypto/init.c                                      |  150 +
 default-configs/aarch64-softmmu.mak                |    2 +-
 default-configs/alpha-softmmu.mak                  |    2 -
 default-configs/arm-softmmu.mak                    |   14 +
 default-configs/i386-softmmu.mak                   |   10 +-
 default-configs/lm32-softmmu.mak                   |    2 +-
 default-configs/microblazeel-softmmu.mak           |   10 +-
 default-configs/mips-softmmu.mak                   |   10 +-
 default-configs/mips64-softmmu.mak                 |    6 +-
 default-configs/mips64el-softmmu.mak               |    6 +-
 default-configs/mipsel-softmmu.mak                 |   10 +-
 default-configs/pci.mak                            |    7 +
 default-configs/ppc-softmmu.mak                    |    4 +-
 default-configs/ppc64-softmmu.mak                  |   10 +-
 default-configs/ppcemb-softmmu.mak                 |    3 -
 default-configs/s390x-softmmu.mak                  |    3 +
 default-configs/sparc64-softmmu.mak                |    2 -
 default-configs/usb.mak                            |    1 +
 default-configs/x86_64-softmmu.mak                 |   11 +-
 device-hotplug.c                                   |    9 +-
 device_tree.c                                      |   22 +-
 disas.c                                            |  133 +-
 disas/arm-a64.cc                                   |   31 +-
 disas/arm.c                                        |  128 -
 disas/cris.c                                       |   19 +-
 disas/libvixl/README                               |    2 +-
 disas/libvixl/a64/assembler-a64.h                  |  290 +-
 disas/libvixl/a64/constants-a64.h                  |   61 +-
 disas/libvixl/a64/decoder-a64.h                    |    2 +-
 disas/libvixl/a64/disasm-a64.cc                    |  142 +-
 disas/libvixl/a64/disasm-a64.h                     |   48 +-
 disas/libvixl/a64/instructions-a64.cc              |   63 +
 disas/libvixl/a64/instructions-a64.h               |  110 +-
 disas/libvixl/globals.h                            |    2 +-
 disas/libvixl/utils.cc                             |   13 +
 disas/libvixl/utils.h                              |   14 +-
 disas/microblaze.c                                 |   13 +-
 disas/mips.c                                       |   25 +-
 disas/s390.c                                       |   35 -
 disas/sh4.c                                        |    2 +-
 disas/sparc.c                                      |   32 -
 disas/tci.c                                        |    1 +
 dma-helpers.c                                      |   21 +-
 docs/aio_notify.promela                            |   77 +-
 docs/aio_notify_accept.promela                     |  152 +
 docs/aio_notify_bug.promela                        |  140 +
 docs/atomics.txt                                   |    4 +-
 docs/bitmaps.md                                    |  352 +
 docs/memory-hotplug.txt                            |   93 +
 docs/memory.txt                                    |   74 +-
 docs/migration.txt                                 |   11 +-
 docs/multi-thread-compression.txt                  |  149 +
 docs/multiseat.txt                                 |   55 +-
 docs/pci_expander_bridge.txt                       |   58 +
 docs/qapi-code-gen.txt                             |  497 +-
 docs/qmp/qmp-events.txt                            |   53 +-
 docs/qmp/qmp-spec.txt                              |  115 +-
 docs/rcu.txt                                       |  390 +
 docs/specs/acpi_mem_hotplug.txt                    |   58 +-
 docs/specs/edu.txt                                 |  110 +
 docs/specs/fw_cfg.txt                              |  226 +
 docs/specs/pci-ids.txt                             |    4 +
 docs/specs/ppc-spapr-hotplug.txt                   |  305 +
 docs/specs/rocker.txt                              | 1014 +++
 docs/writing-qmp-commands.txt                      |    2 +-
 docs/xbzrle.txt                                    |    8 +
 dtc                                                |    2 +-
 dump.c                                             |   13 +-
 exec.c                                             | 1328 +++-
 fpu/softfloat-macros.h                             |   86 +-
 fpu/softfloat-specialize.h                         |  267 +-
 fpu/softfloat.c                                    | 1787 +++--
 fsdev/virtfs-proxy-helper.c                        |   25 +-
 gdb-xml/s390-vx.xml                                |   59 +
 gdbstub.c                                          |   64 +-
 hmp-commands.hx                                    |  258 +-
 hmp.c                                              |  836 ++-
 hmp.h                                              |   20 +-
 hw/9pfs/virtio-9p-coth.c                           |   29 +-
 hw/9pfs/virtio-9p-coth.h                           |    4 +-
 hw/9pfs/virtio-9p-device.c                         |    8 +-
 hw/9pfs/virtio-9p-handle.c                         |    4 +-
 hw/9pfs/virtio-9p-local.c                          |   57 +-
 hw/9pfs/virtio-9p-posix-acl.c                      |    2 +-
 hw/9pfs/virtio-9p-proxy.c                          |   26 +-
 hw/9pfs/virtio-9p-synth.c                          |    3 +-
 hw/9pfs/virtio-9p.c                                |   27 +-
 hw/9pfs/virtio-9p.h                                |   22 +-
 hw/Makefile.objs                                   |    1 +
 hw/acpi/Makefile.objs                              |    8 +-
 hw/acpi/aml-build.c                                | 1217 +++
 hw/acpi/bios-linker-loader.c                       |  159 +
 hw/acpi/core.c                                     |   23 +-
 hw/acpi/cpu_hotplug.c                              |    3 +-
 hw/acpi/ich9.c                                     |  199 +-
 hw/acpi/memory_hotplug.c                           |  101 +-
 hw/acpi/pcihp.c                                    |   28 +-
 hw/acpi/piix4.c                                    |   64 +-
 hw/acpi/tco.c                                      |  264 +
 hw/alpha/dp264.c                                   |   22 +-
 hw/alpha/typhoon.c                                 |   18 +-
 hw/arm/Makefile.objs                               |    5 +
 hw/arm/allwinner-a10.c                             |    8 +
 hw/arm/armv7m.c                                    |   39 +-
 hw/arm/boot.c                                      |  208 +-
 hw/arm/cubieboard.c                                |    5 +-
 hw/arm/digic.c                                     |    6 +
 hw/arm/digic_boards.c                              |   10 +-
 hw/arm/exynos4210.c                                |   13 +-
 hw/arm/highbank.c                                  |   35 +-
 hw/arm/integratorcp.c                              |  130 +-
 hw/arm/kzm.c                                       |    3 +-
 hw/arm/musicpal.c                                  |   11 +-
 hw/arm/netduino2.c                                 |   57 +
 hw/arm/nseries.c                                   |   16 +-
 hw/arm/omap1.c                                     |   78 +-
 hw/arm/omap2.c                                     |   18 +-
 hw/arm/omap_sx1.c                                  |    2 +-
 hw/arm/pxa2xx.c                                    |  260 +-
 hw/arm/pxa2xx_gpio.c                               |    2 +-
 hw/arm/pxa2xx_pic.c                                |    2 +-
 hw/arm/realview.c                                  |   21 +-
 hw/arm/spitz.c                                     |    3 +
 hw/arm/stellaris.c                                 |   29 +-
 hw/arm/stm32f205_soc.c                             |  160 +
 hw/arm/strongarm.c                                 |   11 +-
 hw/arm/sysbus-fdt.c                                |  247 +
 hw/arm/versatilepb.c                               |   39 +-
 hw/arm/vexpress.c                                  |  176 +-
 hw/arm/virt-acpi-build.c                           |  697 ++
 hw/arm/virt.c                                      |  489 +-
 hw/arm/xilinx_zynq.c                               |   23 +-
 hw/arm/xlnx-ep108.c                                |   82 +
 hw/arm/xlnx-zynqmp.c                               |  272 +
 hw/audio/ac97.c                                    |    5 +-
 hw/audio/es1370.c                                  |    5 +-
 hw/audio/gus.c                                     |   20 +-
 hw/audio/intel-hda.c                               |    6 +-
 hw/audio/pcspk.c                                   |    2 +-
 hw/audio/sb16.c                                    |    7 -
 hw/block/block.c                                   |   24 +
 hw/block/dataplane/virtio-blk.c                    |   24 +-
 hw/block/fdc.c                                     |  351 +-
 hw/block/hd-geometry.c                             |   10 +-
 hw/block/m25p80.c                                  |    6 +-
 hw/block/nand.c                                    |    2 +-
 hw/block/nvme.c                                    |   51 +-
 hw/block/nvme.h                                    |    3 +-
 hw/block/onenand.c                                 |    8 +-
 hw/block/pflash_cfi01.c                            |  208 +-
 hw/block/pflash_cfi02.c                            |    5 +-
 hw/block/virtio-blk.c                              |  522 +-
 hw/block/xen_disk.c                                |   27 +-
 hw/bt/sdp.c                                        |    2 +-
 hw/char/Makefile.objs                              |    1 +
 hw/char/cadence_uart.c                             |  142 +-
 hw/char/digic-uart.c                               |    3 +
 hw/char/etraxfs_ser.c                              |    3 +
 hw/char/lm32_juart.c                               |    3 +
 hw/char/lm32_uart.c                                |    3 +
 hw/char/milkymist-uart.c                           |    3 +
 hw/char/omap_uart.c                                |    3 +-
 hw/char/pl011.c                                    |    3 +
 hw/char/sclpconsole-lm.c                           |    1 +
 hw/char/sclpconsole.c                              |    1 +
 hw/char/serial-isa.c                               |   23 +-
 hw/char/serial-pci.c                               |   43 +-
 hw/char/serial.c                                   |  119 +-
 hw/char/spapr_vty.c                                |   22 +-
 hw/char/stm32f2xx_usart.c                          |  232 +
 hw/char/virtio-console.c                           |   10 +
 hw/char/virtio-serial-bus.c                        |  108 +-
 hw/char/xilinx_uartlite.c                          |    3 +
 hw/core/Makefile.objs                              |    2 +-
 hw/core/fw-path-provider.c                         |    2 +-
 hw/core/loader.c                                   |   70 +-
 hw/core/machine.c                                  |  132 +-
 hw/core/nmi.c                                      |   22 +-
 hw/core/platform-bus.c                             |    1 -
 hw/core/ptimer.c                                   |    4 +-
 hw/core/qdev-properties-system.c                   |  155 +-
 hw/core/qdev-properties.c                          |   95 +-
 hw/core/qdev.c                                     |   95 +-
 hw/core/sysbus.c                                   |   35 +-
 hw/cris/axis_dev88.c                               |    5 +-
 hw/display/Makefile.objs                           |    7 +-
 hw/display/blizzard.c                              |    1 -
 hw/display/cg3.c                                   |    7 +-
 hw/display/cirrus_vga.c                            |   61 +-
 hw/display/exynos4210_fimd.c                       |   22 +-
 hw/display/framebuffer.c                           |   73 +-
 hw/display/framebuffer.h                           |   44 +-
 hw/display/g364fb.c                                |    4 +-
 hw/display/milkymist-vgafb.c                       |   15 +-
 hw/display/omap_dss.c                              |   15 +-
 hw/display/omap_lcdc.c                             |   12 +-
 hw/display/pl110.c                                 |   13 +-
 hw/display/pxa2xx_lcd.c                            |   29 +-
 hw/display/qxl-logger.c                            |   16 +-
 hw/display/qxl-render.c                            |    2 +
 hw/display/qxl.c                                   |  162 +-
 hw/display/qxl.h                                   |    6 +
 hw/display/sm501.c                                 |    2 +
 hw/display/tc6393xb.c                              |    4 +-
 hw/display/tcx.c                                   |    7 +-
 hw/display/vga-isa.c                               |    2 +-
 hw/display/vga-pci.c                               |  178 +-
 hw/display/vga.c                                   |   71 +-
 hw/display/vga_int.h                               |    9 +
 hw/display/virtio-gpu-pci.c                        |   76 +
 hw/display/virtio-gpu.c                            |  919 ++
 hw/display/virtio-vga.c                            |  182 +
 hw/display/vmware_vga.c                            |    8 +-
 hw/display/xenfb.c                                 |    5 +
 hw/dma/omap_dma.c                                  |    8 +-
 hw/dma/pl080.c                                     |   20 +-
 hw/dma/pl330.c                                     |    6 +-
 hw/dma/rc4030.c                                    |  462 +-
 hw/dma/sun4m_iommu.c                               |    3 +-
 hw/dma/xilinx_axidma.c                             |    1 -
 hw/gpio/max7310.c                                  |    2 +-
 hw/gpio/omap_gpio.c                                |   16 +-
 hw/gpio/pl061.c                                    |    2 +-
 hw/gpio/zaurus.c                                   |    2 +-
 hw/i2c/Makefile.objs                               |    2 +-
 hw/i2c/omap_i2c.c                                  |   10 +-
 hw/i2c/smbus_ich9.c                                |    5 +-
 hw/i386/Makefile.objs                              |    8 +-
 hw/i386/acpi-build.c                               | 1721 ++--
 hw/i386/acpi-defs.h                                |  368 -
 hw/i386/acpi-dsdt-cpu-hotplug.dsl                  |   17 +-
 hw/i386/acpi-dsdt-isa.dsl                          |   11 -
 hw/i386/acpi-dsdt-mem-hotplug.dsl                  |   49 +-
 hw/i386/acpi-dsdt-pci-crs.dsl                      |   92 -
 hw/i386/acpi-dsdt.dsl                              |   46 -
 hw/i386/acpi-dsdt.hex.generated                    |  714 +--
 hw/i386/bios-linker-loader.c                       |  157 -
 hw/i386/bios-linker-loader.h                       |   27 -
 hw/i386/intel_iommu.c                              |    6 +-
 hw/i386/kvm/clock.c                                |    3 +-
 hw/i386/kvm/i8254.c                                |    2 +-
 hw/i386/kvm/pci-assign.c                           |   63 +-
 hw/i386/multiboot.c                                |   42 +-
 hw/i386/pc.c                                       |  578 +-
 hw/i386/pc_piix.c                                  |  745 +-
 hw/i386/pc_q35.c                                   |  273 +-
 hw/i386/pc_sysfw.c                                 |    4 +-
 hw/i386/q35-acpi-dsdt.dsl                          |   19 -
 hw/i386/q35-acpi-dsdt.hex.generated                |  662 +--
 hw/i386/smbios.c                                   |   32 +-
 hw/i386/ssdt-mem.dsl                               |   77 -
 hw/i386/ssdt-mem.hex.generated                     |  213 -
 hw/i386/ssdt-misc.dsl                              |  122 -
 hw/i386/ssdt-misc.hex.generated                    |  399 -
 hw/i386/ssdt-pcihp.dsl                             |  100 -
 hw/i386/ssdt-pcihp.hex.generated                   |  251 -
 hw/i386/ssdt-proc.dsl                              |   63 -
 hw/i386/ssdt-proc.hex.generated                    |  134 -
 hw/i386/ssdt-tpm.dsl                               |   43 -
 hw/i386/ssdt-tpm.hex.generated                     |   95 -
 hw/ide/ahci.c                                      |  660 +-
 hw/ide/ahci.h                                      |   58 +-
 hw/ide/atapi.c                                     |  131 +-
 hw/ide/cmd646.c                                    |    8 +-
 hw/ide/core.c                                      |  209 +-
 hw/ide/ich.c                                       |   14 +-
 hw/ide/internal.h                                  |   24 +-
 hw/ide/isa.c                                       |    7 +-
 hw/ide/macio.c                                     |  476 +-
 hw/ide/pci.c                                       |  142 +-
 hw/ide/pci.h                                       |   12 +-
 hw/ide/piix.c                                      |   13 +-
 hw/ide/qdev.c                                      |    9 +-
 hw/ide/via.c                                       |    9 +-
 hw/input/Makefile.objs                             |    6 +
 hw/input/adb.c                                     |   22 +-
 hw/input/hid.c                                     |   53 +-
 hw/input/lm832x.c                                  |    2 +-
 hw/input/milkymist-softusb.c                       |   19 +-
 hw/input/pckbd.c                                   |   22 +-
 hw/input/ps2.c                                     |   27 +-
 hw/input/virtio-input-hid.c                        |  514 ++
 hw/input/virtio-input-host.c                       |  189 +
 hw/input/virtio-input.c                            |  293 +
 hw/intc/Makefile.objs                              |    1 +
 hw/intc/allwinner-a10-pic.c                        |    8 +-
 hw/intc/apic.c                                     |    9 +-
 hw/intc/apic_common.c                              |   42 +-
 hw/intc/arm_gic.c                                  |  470 +-
 hw/intc/arm_gic_common.c                           |   43 +-
 hw/intc/arm_gic_kvm.c                              |   99 +-
 hw/intc/arm_gicv2m.c                               |  192 +
 hw/intc/armv7m_nvic.c                              |   19 +-
 hw/intc/etraxfs_pic.c                              |    8 +-
 hw/intc/exynos4210_gic.c                           |    7 +-
 hw/intc/gic_internal.h                             |   29 +-
 hw/intc/i8259.c                                    |    4 +-
 hw/intc/lm32_pic.c                                 |    4 +-
 hw/intc/omap_intc.c                                |    9 +-
 hw/intc/openpic.c                                  |  286 +-
 hw/intc/openpic_kvm.c                              |    1 -
 hw/intc/s390_flic.c                                |    6 +-
 hw/intc/xics.c                                     |   20 +-
 hw/intc/xics_kvm.c                                 |   13 +-
 hw/ipack/tpci200.c                                 |    6 +-
 hw/isa/i82378.c                                    |   16 +-
 hw/isa/isa-bus.c                                   |   41 +-
 hw/isa/lpc_ich9.c                                  |   76 +-
 hw/isa/pc87312.c                                   |    4 +
 hw/isa/piix4.c                                     |   16 +-
 hw/isa/vt82c686.c                                  |  119 +-
 hw/lm32/lm32_boards.c                              |   20 +-
 hw/lm32/lm32_hwsetup.h                             |    3 +-
 hw/lm32/milkymist-hw.h                             |    4 +-
 hw/lm32/milkymist.c                                |   11 +-
 hw/m68k/an5206.c                                   |    3 +-
 hw/m68k/dummy_m68k.c                               |   10 +-
 hw/m68k/mcf5208.c                                  |    3 +-
 hw/m68k/mcf_intc.c                                 |   14 +
 hw/mem/pc-dimm.c                                   |  150 +-
 hw/microblaze/boot.c                               |   20 +-
 hw/microblaze/petalogix_ml605_mmu.c                |   28 +-
 hw/microblaze/petalogix_s3adsp1800_mmu.c           |   17 +-
 hw/mips/Makefile.objs                              |    3 +-
 hw/mips/gt64xxx_pci.c                              |   95 +-
 hw/mips/mips_fulong2e.c                            |   16 +-
 hw/mips/mips_jazz.c                                |  100 +-
 hw/mips/mips_malta.c                               |   41 +-
 hw/mips/mips_mipssim.c                             |    5 +-
 hw/mips/mips_r4k.c                                 |   29 +-
 hw/misc/Makefile.objs                              |    7 +-
 hw/misc/applesmc.c                                 |    5 +-
 hw/misc/arm_integrator_debug.c                     |    2 +-
 hw/misc/edu.c                                      |  408 +
 hw/misc/ivshmem.c                                  |    3 +-
 hw/misc/macio/cuda.c                               |    9 +-
 hw/misc/macio/mac_dbdma.c                          |   12 +-
 hw/misc/macio/macio.c                              |  112 +-
 hw/misc/milkymist-pfpu.c                           |    2 +-
 hw/misc/omap_gpmc.c                                |    3 +-
 hw/misc/omap_l4.c                                  |    3 +-
 hw/misc/omap_sdrc.c                                |    3 +-
 hw/misc/omap_tap.c                                 |    3 +-
 hw/misc/pci-testdev.c                              |    6 +-
 hw/misc/slavio_misc.c                              |    5 +-
 hw/misc/stm32f2xx_syscfg.c                         |  160 +
 hw/misc/vfio.c                                     | 4472 ----------
 hw/misc/zynq_slcr.c                                |    8 +-
 hw/net/Makefile.objs                               |    5 +
 hw/net/allwinner_emac.c                            |    8 -
 hw/net/cadence_gem.c                               |  106 +-
 hw/net/dp8393x.c                                   |  401 +-
 hw/net/e1000.c                                     |   54 +-
 hw/net/eepro100.c                                  |   25 +-
 hw/net/etraxfs_eth.c                               |   19 -
 hw/net/fsl_etsec/etsec.c                           |   31 +-
 hw/net/fsl_etsec/etsec.h                           |    4 +-
 hw/net/fsl_etsec/rings.c                           |   17 +-
 hw/net/lan9118.c                                   |   14 -
 hw/net/lance.c                                     |   12 +-
 hw/net/mcf_fec.c                                   |  109 +-
 hw/net/milkymist-minimac2.c                        |   41 +-
 hw/net/mipsnet.c                                   |   17 +-
 hw/net/ne2000-isa.c                                |    8 -
 hw/net/ne2000.c                                    |   14 +-
 hw/net/opencores_eth.c                             |    5 -
 hw/net/pcnet-pci.c                                 |   64 +-
 hw/net/pcnet.c                                     |   48 +-
 hw/net/pcnet.h                                     |    4 +-
 hw/net/rocker/qmp-norocker.c                       |   50 +
 hw/net/rocker/rocker.c                             | 1553 ++++
 hw/net/rocker/rocker.h                             |   84 +
 hw/net/rocker/rocker_desc.c                        |  377 +
 hw/net/rocker/rocker_desc.h                        |   53 +
 hw/net/rocker/rocker_fp.c                          |  263 +
 hw/net/rocker/rocker_fp.h                          |   53 +
 hw/net/rocker/rocker_hw.h                          |  493 ++
 hw/net/rocker/rocker_of_dpa.c                      | 2630 ++++++
 hw/net/rocker/rocker_of_dpa.h                      |   22 +
 hw/net/rocker/rocker_tlv.h                         |  244 +
 hw/net/rocker/rocker_world.c                       |  106 +
 hw/net/rocker/rocker_world.h                       |   60 +
 hw/net/rtl8139.c                                   |  124 +-
 hw/net/smc91c111.c                                 |    8 -
 hw/net/spapr_llan.c                                |   26 +-
 hw/net/stellaris_enet.c                            |   22 +-
 hw/net/vhost_net.c                                 |   85 +-
 hw/net/virtio-net.c                                |  377 +-
 hw/net/vmxnet3.c                                   |  106 +-
 hw/net/vmxnet_rx_pkt.c                             |   19 +-
 hw/net/vmxnet_rx_pkt.h                             |   20 +-
 hw/net/xen_nic.c                                   |   41 +-
 hw/net/xgmac.c                                     |   16 +-
 hw/net/xilinx_axienet.c                            |   27 +-
 hw/net/xilinx_ethlite.c                            |    9 +-
 hw/nvram/fw_cfg.c                                  |  280 +-
 hw/nvram/spapr_nvram.c                             |   19 +-
 hw/pci-bridge/Makefile.objs                        |    6 +-
 hw/pci-bridge/dec.c                                |    5 +-
 hw/pci-bridge/i82801b11.c                          |   21 -
 hw/pci-bridge/pci_bridge_dev.c                     |  131 +-
 hw/pci-bridge/pci_expander_bridge.c                |  286 +
 hw/pci-host/Makefile.objs                          |    1 +
 hw/pci-host/apb.c                                  |    9 +-
 hw/pci-host/bonito.c                               |   12 +-
 hw/pci-host/gpex.c                                 |  154 +
 hw/pci-host/grackle.c                              |    5 +-
 hw/pci-host/pam.c                                  |   20 -
 hw/pci-host/piix.c                                 |  124 +-
 hw/pci-host/ppce500.c                              |  117 +-
 hw/pci-host/prep.c                                 |   12 +-
 hw/pci-host/q35.c                                  |  149 +-
 hw/pci-host/uninorth.c                             |   25 +-
 hw/pci-host/versatile.c                            |   16 +-
 hw/pci/Makefile.objs                               |    2 -
 hw/pci/msi.c                                       |   23 +-
 hw/pci/msix.c                                      |   32 +-
 hw/pci/pci-hotplug-old.c                           |  343 -
 hw/pci/pci-stub.c                                  |   17 +-
 hw/pci/pci.c                                       |  313 +-
 hw/pci/pcie.c                                      |    5 +-
 hw/pci/pcie_aer.c                                  |   57 +-
 hw/pci/pcie_host.c                                 |   16 +-
 hw/pci/shpc.c                                      |   24 +-
 hw/pci/slotid_cap.c                                |    2 +-
 hw/pcmcia/pxa2xx.c                                 |    6 +-
 hw/ppc/Makefile.objs                               |    2 +-
 hw/ppc/e500.c                                      |   75 +-
 hw/ppc/e500.h                                      |    5 +
 hw/ppc/e500plat.c                                  |    5 +
 hw/ppc/mac_newworld.c                              |   58 +-
 hw/ppc/mac_oldworld.c                              |   19 +-
 hw/ppc/mpc8544ds.c                                 |   11 +
 hw/ppc/ppc.c                                       |  172 +-
 hw/ppc/ppc405_boards.c                             |    2 +-
 hw/ppc/ppc440_bamboo.c                             |    7 +-
 hw/ppc/ppce500_spin.c                              |    2 +-
 hw/ppc/prep.c                                      |  177 +-
 hw/ppc/spapr.c                                     |  770 ++-
 hw/ppc/spapr_drc.c                                 |  745 ++
 hw/ppc/spapr_events.c                              |  349 +-
 hw/ppc/spapr_hcall.c                               |   41 +-
 hw/ppc/spapr_iommu.c                               |  101 +-
 hw/ppc/spapr_pci.c                                 | 1053 +++-
 hw/ppc/spapr_pci_vfio.c                            |  182 +-
 hw/ppc/spapr_rtas.c                                |  446 +-
 hw/ppc/spapr_rtc.c                                 |  211 +
 hw/ppc/spapr_vio.c                                 |   67 +-
 hw/ppc/virtex_ml507.c                              |    9 +-
 hw/s390x/Makefile.objs                             |    1 +
 hw/s390x/css.c                                     |  113 +-
 hw/s390x/css.h                                     |    2 +
 hw/s390x/event-facility.c                          |    2 +-
 hw/s390x/ipl.c                                     |  221 +-
 hw/s390x/ipl.h                                     |   25 +
 hw/s390x/s390-pci-bus.c                            |  596 ++
 hw/s390x/s390-pci-bus.h                            |  251 +
 hw/s390x/s390-pci-inst.c                           |  839 ++
 hw/s390x/s390-pci-inst.h                           |  289 +
 hw/s390x/s390-virtio-bus.c                         |  242 +-
 hw/s390x/s390-virtio-bus.h                         |   40 +-
 hw/s390x/s390-virtio-ccw.c                         |  117 +-
 hw/s390x/s390-virtio.c                             |   79 +-
 hw/s390x/s390-virtio.h                             |   10 +-
 hw/s390x/sclp.c                                    |   19 +-
 hw/s390x/sclpcpu.c                                 |    2 +
 hw/s390x/sclpquiesce.c                             |    1 +
 hw/s390x/virtio-ccw.c                              |  674 +-
 hw/s390x/virtio-ccw.h                              |   32 +-
 hw/scsi/esp-pci.c                                  |   28 +-
 hw/scsi/lsi53c895a.c                               |   21 +-
 hw/scsi/megasas.c                                  |   86 +-
 hw/scsi/scsi-bus.c                                 |   24 +-
 hw/scsi/scsi-disk.c                                |   54 +-
 hw/scsi/scsi-generic.c                             |    6 +-
 hw/scsi/spapr_vscsi.c                              |   15 +-
 hw/scsi/vhost-scsi.c                               |   64 +-
 hw/scsi/virtio-scsi-dataplane.c                    |   16 +-
 hw/scsi/virtio-scsi.c                              |   78 +-
 hw/scsi/vmw_pvscsi.c                               |   50 +-
 hw/sd/milkymist-memcard.c                          |    3 +
 hw/sd/omap_mmc.c                                   |    3 +-
 hw/sd/pl181.c                                      |    3 +
 hw/sd/pxa2xx_mmci.c                                |   68 +-
 hw/sd/sd.c                                         |   20 +-
 hw/sd/sdhci.c                                      |  217 +-
 hw/sd/sdhci.h                                      |   39 +-
 hw/sd/ssi-sd.c                                     |    1 +
 hw/sh4/r2d.c                                       |   20 +-
 hw/sparc/leon3.c                                   |    4 +-
 hw/sparc/sun4m.c                                   |   34 +-
 hw/sparc64/sun4u.c                                 |   44 +-
 hw/ssi/omap_spi.c                                  |    3 +-
 hw/timer/Makefile.objs                             |    2 +
 hw/timer/a9gtimer.c                                |    6 +-
 hw/timer/arm_mptimer.c                             |   15 +-
 hw/timer/arm_timer.c                               |    6 +-
 hw/timer/cadence_ttc.c                             |    9 +-
 hw/timer/hpet.c                                    |   21 +-
 hw/timer/i8254.c                                   |    6 +
 hw/timer/m48t59.c                                  |  359 +-
 hw/timer/mc146818rtc.c                             |   96 +-
 hw/timer/omap_gptimer.c                            |    2 +-
 hw/timer/stm32f2xx_timer.c                         |  328 +
 hw/tpm/Makefile.objs                               |    2 +-
 hw/tpm/tpm_int.h                                   |    8 +
 hw/tpm/tpm_passthrough.c                           |  133 +-
 hw/tpm/tpm_tis.c                                   |  272 +-
 hw/tpm/tpm_tis.h                                   |    3 +-
 hw/tpm/tpm_util.c                                  |  126 +
 hw/tpm/tpm_util.h                                  |   28 +
 hw/unicore32/puv3.c                                |   14 +-
 hw/usb/Makefile.objs                               |   11 +-
 hw/usb/bus.c                                       |   82 +-
 hw/usb/ccid-card-emulated.c                        |    1 -
 hw/usb/ccid-card-passthru.c                        |    2 +-
 hw/usb/core.c                                      |   41 -
 hw/usb/desc-msos.c                                 |    2 +-
 hw/usb/dev-audio.c                                 |   23 +-
 hw/usb/dev-bluetooth.c                             |   24 +-
 hw/usb/dev-hid.c                                   |   34 +-
 hw/usb/dev-hub.c                                   |   11 +-
 hw/usb/dev-mtp.c                                   |   15 +-
 hw/usb/dev-network.c                               |   40 +-
 hw/usb/dev-serial.c                                |   52 +-
 hw/usb/dev-smartcard-reader.c                      |   56 +-
 hw/usb/dev-storage.c                               |   83 +-
 hw/usb/dev-uas.c                                   |   15 +-
 hw/usb/dev-wacom.c                                 |    9 +-
 hw/usb/hcd-ehci-pci.c                              |   16 +-
 hw/usb/hcd-ehci-sysbus.c                           |   10 +
 hw/usb/hcd-ehci.c                                  |   35 +-
 hw/usb/hcd-ehci.h                                  |    2 +-
 hw/usb/hcd-musb.c                                  |   20 +-
 hw/usb/hcd-ohci.c                                  |   75 +-
 hw/usb/hcd-uhci.c                                  |   81 +-
 hw/usb/hcd-xhci.c                                  |   17 +-
 hw/usb/host-legacy.c                               |    1 -
 hw/usb/host-libusb.c                               |   11 +-
 hw/usb/host-stub.c                                 |    2 +-
 hw/usb/redirect.c                                  |   73 +-
 hw/vfio/Makefile.objs                              |    6 +
 hw/vfio/calxeda-xgmac.c                            |   55 +
 hw/vfio/common.c                                   |  972 +++
 hw/vfio/pci.c                                      | 3797 +++++++++
 hw/vfio/platform.c                                 |  715 ++
 hw/virtio/Makefile.objs                            |    2 +-
 hw/virtio/dataplane/Makefile.objs                  |    2 +-
 hw/virtio/dataplane/vring.c                        |  140 +-
 hw/virtio/vhost-backend.c                          |    2 +-
 hw/virtio/vhost-user.c                             |   22 +-
 hw/virtio/vhost.c                                  |  171 +-
 hw/virtio/virtio-balloon.c                         |   56 +-
 hw/virtio/virtio-bus.c                             |   40 +-
 hw/virtio/virtio-mmio.c                            |  208 +-
 hw/virtio/virtio-pci.c                             | 1057 ++-
 hw/virtio/virtio-pci.h                             |   89 +-
 hw/virtio/virtio-rng.c                             |   26 +-
 hw/virtio/virtio.c                                 |  463 +-
 hw/watchdog/Makefile.objs                          |    1 +
 hw/watchdog/watchdog.c                             |   12 +-
 hw/watchdog/wdt_diag288.c                          |  130 +
 hw/watchdog/wdt_i6300esb.c                         |   34 +-
 hw/watchdog/wdt_ib700.c                            |    2 +-
 hw/xen/xen_backend.c                               |    4 +-
 hw/xen/xen_pt.c                                    |   12 +-
 hw/xen/xen_pt.h                                    |    4 +
 hw/xen/xen_pt_config_init.c                        |    8 +-
 hw/xtensa/sim.c                                    |    2 +-
 hw/xtensa/xtfpga.c                                 |   32 +-
 include/block/accounting.h                         |    3 +
 include/block/aio.h                                |   82 +-
 include/block/block.h                              |  105 +-
 include/block/block_int.h                          |   85 +-
 include/block/blockjob.h                           |   30 +-
 include/block/coroutine.h                          |   10 -
 include/block/coroutine_int.h                      |    1 +
 include/block/nbd.h                                |   17 +-
 include/block/qapi.h                               |    2 +-
 include/block/throttle-groups.h                    |   46 +
 include/block/write-threshold.h                    |   64 +
 include/crypto/aes.h                               |   68 +
 include/crypto/cipher.h                            |  210 +
 include/crypto/desrfb.h                            |   49 +
 include/crypto/hash.h                              |  189 +
 include/crypto/init.h                              |   29 +
 include/disas/bfd.h                                |    6 +
 include/disas/disas.h                              |    4 +-
 include/elf.h                                      |    4 +
 include/exec/cpu-all.h                             |   78 +-
 include/exec/cpu-common.h                          |   10 +-
 include/exec/cpu-defs.h                            |   65 +-
 include/exec/cpu_ldst.h                            |  302 +-
 include/exec/cpu_ldst_template.h                   |   60 +-
 include/exec/cpu_ldst_useronly_template.h          |   81 +
 include/exec/cputlb.h                              |    5 +-
 include/exec/exec-all.h                            |   59 +-
 include/exec/gdbstub.h                             |    2 +-
 include/exec/gen-icount.h                          |   30 +-
 include/exec/memattrs.h                            |   49 +
 include/exec/memory-internal.h                     |    1 +
 include/exec/memory.h                              |  259 +-
 include/exec/ram_addr.h                            |  142 +-
 include/exec/semihost.h                            |   62 +
 include/exec/softmmu-semi.h                        |   13 +-
 include/exec/tb-hash.h                             |   51 +
 include/exec/user/thunk.h                          |    4 +-
 include/fpu/softfloat.h                            |  451 +-
 include/glib-compat.h                              |   41 +-
 include/hw/acpi/acpi-defs.h                        |  564 ++
 include/hw/acpi/acpi.h                             |   13 +-
 include/hw/acpi/aml-build.h                        |  290 +
 include/hw/acpi/bios-linker-loader.h               |   27 +
 include/hw/acpi/ich9.h                             |   16 +
 include/hw/acpi/memory_hotplug.h                   |   14 +-
 include/hw/acpi/pc-hotplug.h                       |    5 +-
 include/hw/acpi/pcihp.h                            |    7 +-
 include/hw/acpi/tco.h                              |   82 +
 include/hw/acpi/tpm.h                              |    5 +
 include/hw/arm/arm.h                               |   41 +-
 include/hw/arm/fdt.h                               |   34 +
 include/hw/arm/stm32f205_soc.h                     |   57 +
 include/hw/arm/sysbus-fdt.h                        |   60 +
 include/hw/arm/virt-acpi-build.h                   |   44 +
 include/hw/arm/virt.h                              |   67 +
 include/hw/arm/xlnx-zynqmp.h                       |   63 +
 include/hw/block/block.h                           |    5 +-
 include/hw/boards.h                                |   38 +-
 include/hw/char/cadence_uart.h                     |   53 +
 include/hw/char/serial.h                           |    2 +-
 include/hw/char/stm32f2xx_usart.h                  |   73 +
 include/hw/compat.h                                |   28 +-
 include/hw/elf_ops.h                               |   82 +-
 include/hw/hotplug.h                               |    2 +-
 include/hw/hw.h                                    |    6 -
 include/hw/i386/apic.h                             |    2 +-
 include/hw/i386/ich9.h                             |   24 +-
 include/hw/i386/pc.h                               |  208 +-
 include/hw/i386/topology.h                         |  134 +
 include/hw/intc/arm_gic_common.h                   |   24 +-
 include/hw/isa/isa.h                               |   17 +-
 include/hw/lm32/lm32_pic.h                         |    4 +-
 include/hw/loader.h                                |   24 +-
 include/hw/mem/pc-dimm.h                           |   16 +
 include/hw/mips/mips.h                             |   11 +-
 include/hw/misc/stm32f2xx_syscfg.h                 |   61 +
 include/hw/misc/vfio.h                             |    9 -
 include/hw/net/allwinner_emac.h                    |   40 +-
 include/hw/net/cadence_gem.h                       |   73 +
 include/hw/net/mii.h                               |   76 +
 include/hw/nmi.h                                   |    1 +
 include/hw/nvram/fw_cfg.h                          |    9 +-
 include/hw/pci-host/gpex.h                         |   56 +
 include/hw/pci-host/pam.h                          |    4 -
 include/hw/pci-host/q35.h                          |   37 +-
 include/hw/pci-host/spapr.h                        |   26 +-
 include/hw/pci/msi.h                               |    1 +
 include/hw/pci/pci.h                               |   42 +-
 include/hw/pci/pci_bridge.h                        |    4 +
 include/hw/pci/pci_bus.h                           |   10 +
 include/hw/pci/pci_ids.h                           |   11 +
 include/hw/pci/pci_regs.h                          |  720 +--
 include/hw/pci/pcie_aer.h                          |    2 +-
 include/hw/pci/pcie_host.h                         |    1 +
 include/hw/pci/pcie_regs.h                         |   20 +-
 include/hw/pci/shpc.h                              |   12 +-
 include/hw/ppc/mac_dbdma.h                         |    8 +-
 include/hw/ppc/spapr.h                             |  165 +-
 include/hw/ppc/spapr_drc.h                         |  201 +
 include/hw/ppc/spapr_vio.h                         |   10 +-
 include/hw/ppc/xics.h                              |    1 +
 include/hw/qdev-core.h                             |   24 +-
 include/hw/qdev-properties.h                       |   22 +-
 include/hw/s390x/s390_flic.h                       |    5 +-
 include/hw/s390x/sclp.h                            |    8 +
 include/hw/sparc/grlib.h                           |   12 +-
 include/hw/sparc/sun4m.h                           |    4 +-
 include/hw/sysbus.h                                |   18 +
 include/hw/timer/a9gtimer.h                        |    2 +-
 include/hw/timer/m48t59.h                          |   61 +-
 include/hw/timer/stm32f2xx_timer.h                 |  101 +
 include/hw/usb.h                                   |   19 +-
 include/hw/vfio/vfio-calxeda-xgmac.h               |   46 +
 include/hw/vfio/vfio-common.h                      |  149 +
 include/hw/vfio/vfio-platform.h                    |   77 +
 include/hw/vfio/vfio.h                             |    9 +
 include/hw/virtio/dataplane/vring-accessors.h      |   75 +
 include/hw/virtio/dataplane/vring.h                |   20 +-
 include/hw/virtio/vhost-scsi.h                     |   12 +-
 include/hw/virtio/vhost.h                          |   19 +-
 include/hw/virtio/virtio-access.h                  |   26 +
 include/hw/virtio/virtio-balloon.h                 |   40 +-
 include/hw/virtio/virtio-blk.h                     |   99 +-
 include/hw/virtio/virtio-bus.h                     |    9 +-
 include/hw/virtio/virtio-gpu.h                     |  142 +
 include/hw/virtio/virtio-input.h                   |  119 +
 include/hw/virtio/virtio-net.h                     |  194 +-
 include/hw/virtio/virtio-rng.h                     |   15 +-
 include/hw/virtio/virtio-scsi.h                    |  151 +-
 include/hw/virtio/virtio-serial.h                  |   56 +-
 include/hw/virtio/virtio.h                         |  141 +-
 include/hw/virtio/virtio_ring.h                    |  167 -
 include/hw/watchdog/wdt_diag288.h                  |   36 +
 include/hw/xen/xen.h                               |    1 -
 include/hw/xen/xen_common.h                        |    2 +-
 include/migration/migration.h                      |   46 +-
 include/migration/page_cache.h                     |   10 +-
 include/migration/qemu-file.h                      |   36 +-
 include/migration/vmstate.h                        |   72 +-
 include/monitor/monitor.h                          |   21 +-
 include/monitor/qdev.h                             |   12 +-
 include/net/net.h                                  |   15 +-
 include/net/slirp.h                                |    6 +-
 include/net/tap.h                                  |   24 +-
 include/net/vhost_net.h                            |    6 +-
 include/qapi/error.h                               |    5 +
 include/qapi/qmp/qbool.h                           |    8 +-
 include/qapi/qmp/qdict.h                           |    8 +-
 include/qapi/qmp/qerror.h                          |  112 +-
 include/qapi/qmp/qobject.h                         |   14 +-
 include/qapi/util.h                                |    2 +-
 include/qapi/visitor-impl.h                        |    6 +-
 include/qapi/visitor.h                             |    2 +-
 include/qemu-common.h                              |  141 +-
 include/qemu-io.h                                  |    4 +-
 include/qemu/aes.h                                 |   68 -
 include/qemu/atomic.h                              |   73 +-
 include/qemu/bitmap.h                              |    4 +
 include/qemu/bitops.h                              |   77 +-
 include/qemu/bswap.h                               |   11 +-
 include/qemu/compatfd.h                            |    1 -
 include/qemu/compiler.h                            |    6 +
 include/qemu/fprintf-fn.h                          |   17 +
 include/qemu/hbitmap.h                             |   31 +
 include/qemu/iov.h                                 |    2 +-
 include/qemu/log.h                                 |    5 +-
 include/qemu/main-loop.h                           |   67 +-
 include/qemu/option.h                              |   37 +-
 include/qemu/osdep.h                               |    2 +
 include/qemu/queue.h                               |   57 +-
 include/qemu/rcu.h                                 |  156 +
 include/qemu/rcu_queue.h                           |  134 +
 include/qemu/sockets.h                             |    8 +-
 include/qemu/thread.h                              |    7 +-
 include/qemu/throttle.h                            |   48 +-
 include/qemu/timer.h                               |  120 +-
 include/qemu/typedefs.h                            |  109 +-
 include/qjson.h                                    |   29 +
 include/qom/cpu.h                                  |   38 +-
 include/qom/object.h                               |  197 +-
 include/qom/object_interfaces.h                    |   13 +
 include/standard-headers/asm-s390/kvm_virtio.h     |   64 +
 include/standard-headers/asm-s390/virtio-ccw.h     |   21 +
 include/standard-headers/linux/if_ether.h          |    1 +
 include/standard-headers/linux/input.h             | 1203 +++
 include/standard-headers/linux/pci_regs.h          |  719 ++
 include/standard-headers/linux/types.h             |    2 +
 include/standard-headers/linux/virtio_9p.h         |   44 +
 include/standard-headers/linux/virtio_balloon.h    |   84 +
 include/standard-headers/linux/virtio_blk.h        |  147 +
 include/standard-headers/linux/virtio_config.h     |   64 +
 include/standard-headers/linux/virtio_console.h    |   78 +
 include/standard-headers/linux/virtio_gpu.h        |  206 +
 include/standard-headers/linux/virtio_ids.h        |   45 +
 include/standard-headers/linux/virtio_input.h      |   76 +
 include/standard-headers/linux/virtio_net.h        |  245 +
 include/standard-headers/linux/virtio_pci.h        |  199 +
 include/standard-headers/linux/virtio_ring.h       |  171 +
 include/standard-headers/linux/virtio_rng.h        |    8 +
 include/standard-headers/linux/virtio_scsi.h       |  172 +
 include/standard-headers/linux/virtio_types.h      |   46 +
 include/sysemu/arch_init.h                         |    1 -
 include/sysemu/balloon.h                           |    1 -
 include/sysemu/block-backend.h                     |   33 +-
 include/sysemu/blockdev.h                          |    6 +-
 include/sysemu/device_tree.h                       |    9 +
 include/sysemu/dma.h                               |    3 +-
 include/sysemu/iothread.h                          |    1 -
 include/sysemu/kvm.h                               |   45 +-
 include/sysemu/kvm_int.h                           |   39 +
 include/sysemu/numa.h                              |   36 +
 include/sysemu/os-win32.h                          |    4 -
 include/sysemu/sysemu.h                            |   62 +-
 include/sysemu/tpm.h                               |   19 +-
 include/sysemu/tpm_backend.h                       |   25 +-
 include/sysemu/tpm_backend_int.h                   |    2 -
 include/ui/console.h                               |   73 +-
 include/ui/egl-helpers.h                           |   16 +
 include/ui/gtk.h                                   |   99 +
 include/ui/qemu-pixman.h                           |   20 +
 include/ui/qemu-spice.h                            |   22 +-
 include/ui/sdl2.h                                  |   51 +
 include/ui/shader.h                                |   13 +
 include/ui/spice-display.h                         |    6 +-
 iohandler.c                                        |   21 +-
 ioport.c                                           |   46 +-
 iothread.c                                         |   21 +-
 kvm-all.c                                          |  509 +-
 kvm-stub.c                                         |    8 +-
 libcacard/cac.c                                    |    5 +-
 libcacard/card_7816.c                              |    4 +-
 libcacard/event.c                                  |    2 +-
 libcacard/libcacard.pc.in                          |    2 +-
 libcacard/vcard.c                                  |    4 +-
 libcacard/vcard_emul_nss.c                         |    4 +-
 libcacard/vcardt.c                                 |    4 +-
 libcacard/vreader.c                                |    4 +-
 libcacard/vscclient.c                              |    8 +-
 libdecnumber/dpd/decimal128Local.h                 |   42 -
 linux-headers/asm-arm/kvm.h                        |   11 +-
 linux-headers/asm-arm64/kvm.h                      |   18 +-
 linux-headers/asm-mips/kvm.h                       |  164 +-
 linux-headers/asm-s390/kvm.h                       |   41 +
 linux-headers/asm-x86/hyperv.h                     |   24 +
 linux-headers/asm-x86/kvm.h                        |   14 +-
 linux-headers/linux/kvm.h                          |   95 +-
 linux-headers/linux/vfio.h                         |  105 +-
 linux-headers/linux/vhost.h                        |   14 +
 linux-headers/linux/virtio_config.h                |   58 +-
 linux-headers/linux/virtio_ring.h                  |  164 +-
 linux-user/aarch64/target_cpu.h                    |    2 +-
 linux-user/alpha/syscall_nr.h                      |    4 +
 linux-user/arm/nwfpe/fpopcode.c                    |   22 -
 linux-user/arm/syscall_nr.h                        |    2 +-
 linux-user/arm/target_cpu.h                        |   15 +-
 linux-user/elfload.c                               |   42 +-
 linux-user/main.c                                  |  161 +-
 linux-user/mips64/target_signal.h                  |    2 +-
 linux-user/mmap.c                                  |    7 +-
 linux-user/signal.c                                |   65 +-
 linux-user/syscall.c                               |  157 +-
 linux-user/syscall_defs.h                          |   95 +-
 linux-user/vm86.c                                  |   57 +-
 main-loop.c                                        |   14 +-
 memory.c                                           |  487 +-
 memory_mapping.c                                   |    2 +-
 migration-exec.c                                   |   69 -
 migration-fd.c                                     |   68 -
 migration-rdma.c                                   | 3438 --------
 migration-tcp.c                                    |  103 -
 migration-unix.c                                   |  103 -
 migration.c                                        |  700 --
 migration/Makefile.objs                            |   10 +
 migration/block.c                                  |  895 ++
 migration/exec.c                                   |   69 +
 migration/fd.c                                     |   88 +
 migration/migration.c                              | 1054 +++
 migration/qemu-file-buf.c                          |  462 +
 migration/qemu-file-internal.h                     |   53 +
 migration/qemu-file-stdio.c                        |  194 +
 migration/qemu-file-unix.c                         |  238 +
 migration/qemu-file.c                              |  613 ++
 migration/ram.c                                    | 1670 ++++
 migration/rdma.c                                   | 3516 ++++++++
 migration/savevm.c                                 | 1605 ++++
 migration/tcp.c                                    |  103 +
 migration/unix.c                                   |  103 +
 migration/vmstate.c                                |  890 ++
 migration/xbzrle.c                                 |  175 +
 monitor.c                                          |  990 +--
 nbd.c                                              |  287 +-
 net/clients.h                                      |   20 +-
 net/dump.c                                         |   13 +-
 net/hub.c                                          |   13 +-
 net/l2tpv3.c                                       |   32 +-
 net/net.c                                          |  288 +-
 net/netmap.c                                       |   23 +-
 net/queue.c                                        |    2 +-
 net/slirp.c                                        |   19 +-
 net/socket.c                                       |   44 +-
 net/tap-aix.c                                      |   17 +-
 net/tap-bsd.c                                      |   48 +-
 net/tap-haiku.c                                    |   17 +-
 net/tap-linux.c                                    |   58 +-
 net/tap-linux.h                                    |    2 +
 net/tap-solaris.c                                  |   73 +-
 net/tap-win32.c                                    |   13 +-
 net/tap.c                                          |  251 +-
 net/tap_int.h                                      |    6 +-
 net/vde.c                                          |    3 +-
 net/vhost-user.c                                   |   52 +-
 numa.c                                             |  204 +-
 os-posix.c                                         |    2 +
 page_cache.c                                       |   43 +-
 pc-bios/README                                     |    2 +-
 pc-bios/bios-256k.bin                              |  Bin 262144 -> 262144 bytes
 pc-bios/bios.bin                                   |  Bin 131072 -> 131072 bytes
 pc-bios/keymaps/ru                                 |    2 +-
 pc-bios/openbios-ppc                               |  Bin 746588 -> 746588 bytes
 pc-bios/openbios-sparc32                           |  Bin 381512 -> 381512 bytes
 pc-bios/openbios-sparc64                           |  Bin 1616768 -> 1616768 bytes
 pc-bios/qemu.rsrc                                  | 1504 ++++
 pc-bios/s390-ccw.img                               |  Bin 17752 -> 13784 bytes
 pc-bios/s390-ccw/Makefile                          |   11 +-
 pc-bios/s390-ccw/bootmap.c                         |    4 +-
 pc-bios/s390-ccw/bootmap.h                         |    2 +-
 pc-bios/s390-ccw/main.c                            |    3 +-
 pc-bios/s390-ccw/s390-ccw.h                        |    4 +
 pc-bios/s390-ccw/sclp-ascii.c                      |    1 +
 pc-bios/s390-ccw/start.S                           |   32 +
 pc-bios/s390-ccw/virtio.c                          |    7 +-
 pc-bios/slof.bin                                   |  Bin 923896 -> 912720 bytes
 pc-bios/u-boot.e500                                |  Bin 330260 -> 347788 bytes
 pc-bios/vgabios-cirrus.bin                         |  Bin 37376 -> 38400 bytes
 pc-bios/vgabios-qxl.bin                            |  Bin 37376 -> 38400 bytes
 pc-bios/vgabios-stdvga.bin                         |  Bin 37376 -> 38400 bytes
 pc-bios/vgabios-virtio.bin                         |  Bin 0 -> 38400 bytes
 pc-bios/vgabios-vmware.bin                         |  Bin 37376 -> 38400 bytes
 pc-bios/vgabios.bin                                |  Bin 37376 -> 38400 bytes
 qapi-schema.json                                   |  539 +-
 qapi/block-core.json                               |  389 +-
 qapi/block.json                                    |    2 +-
 qapi/common.json                                   |   30 +-
 qapi/event.json                                    |   26 +
 qapi/opts-visitor.c                                |   24 +-
 qapi/qapi-dealloc-visitor.c                        |    3 +-
 qapi/qapi-util.c                                   |    2 +-
 qapi/qapi-visit-core.c                             |   34 +-
 qapi/qmp-dispatch.c                                |   15 +-
 qapi/qmp-input-visitor.c                           |   30 +-
 qapi/qmp-output-visitor.c                          |    3 +-
 qapi/rocker.json                                   |  286 +
 qapi/string-input-visitor.c                        |   24 +-
 qapi/string-output-visitor.c                       |    1 -
 qapi/trace.json                                    |    2 +-
 qdev-monitor.c                                     |  267 +-
 qemu-char.c                                        |  122 +-
 qemu-coroutine-io.c                                |    2 +-
 qemu-coroutine-lock.c                              |    2 +-
 qemu-coroutine.c                                   |  135 +-
 qemu-doc.texi                                      |   31 +-
 qemu-file-stdio.c                                  |  194 -
 qemu-file-unix.c                                   |  223 -
 qemu-file.c                                        |  995 ---
 qemu-img.c                                         |  864 +-
 qemu-io-cmds.c                                     |  309 +-
 qemu-io.c                                          |   94 +-
 qemu-log.c                                         |    4 +-
 qemu-nbd.c                                         |  107 +-
 qemu-options.hx                                    |  410 +-
 qemu-seccomp.c                                     |    4 +-
 qemu-tech.texi                                     |    2 +-
 qemu-timer.c                                       |   34 +-
 qga/channel-win32.c                                |    2 +-
 qga/commands-posix.c                               |  564 ++-
 qga/commands-win32.c                               |  930 ++-
 qga/installer/qemu-ga.wxs                          |  145 +
 qga/main.c                                         |   16 +-
 qga/qapi-schema.json                               |  233 +-
 qga/vss-win32/Makefile.objs                        |    2 +-
 qjson.c                                            |  129 +
 qmp-commands.hx                                    |  493 +-
 qmp.c                                              |  184 +-
 qobject/Makefile.objs                              |    3 +-
 qobject/json-parser.c                              |    9 +-
 qobject/qbool.c                                    |    8 +-
 qobject/qdict.c                                    |  119 +-
 qobject/qerror.c                                   |  148 -
 qobject/qjson.c                                    |   21 +-
 qobject/qnull.c                                    |   29 +
 qom/cpu.c                                          |   15 +-
 qom/object.c                                       |  364 +-
 qom/object_interfaces.c                            |   12 +
 qtest.c                                            |  149 +-
 roms/Makefile                                      |    7 +-
 roms/SLOF                                          |    2 +-
 roms/config.seabios-128k                           |    1 +
 roms/config.vga-virtio                             |    6 +
 roms/openbios                                      |    2 +-
 roms/seabios                                       |    2 +-
 rules.mak                                          |   27 +-
 savevm.c                                           | 1353 ---
 scripts/analyze-migration.py                       |  597 ++
 scripts/checkpatch.pl                              |   24 +-
 scripts/coverity-model.c                           |  242 +-
 scripts/dump-guest-memory.py                       |   10 +-
 scripts/get_maintainer.pl                          |   45 +-
 scripts/kvm/kvm_stat                               |   69 +-
 scripts/kvm/kvm_stat.texi                          |   55 +
 scripts/make_device_config.sh                      |   18 +-
 scripts/qapi-commands.py                           |  277 +-
 scripts/qapi-event.py                              |  129 +-
 scripts/qapi-types.py                              |  268 +-
 scripts/qapi-visit.py                              |  291 +-
 scripts/qapi.py                                    |  892 ++-
 scripts/qemu-gdb.py                                |   75 +
 scripts/qmp/qmp-shell                              |  147 +-
 scripts/qmp/qmp.py                                 |   95 +-
 scripts/qmp/qom-tree                               |   75 +
 scripts/qtest.py                                   |   71 +
 scripts/shaderinclude.pl                           |   16 +
 scripts/tracetool/backend/stderr.py                |   10 +-
 scripts/tracetool/format/d.py                      |   26 +-
 scripts/update-linux-headers.sh                    |   56 +-
 scripts/vmstate-static-checker.py                  |    2 +
 slirp/misc.c                                       |    1 +
 slirp/tcp_input.c                                  |    8 +-
 softmmu_template.h                                 |  178 +-
 spice-qemu-char.c                                  |   14 +-
 stubs/Makefile.objs                                |    2 -
 stubs/arch-query-cpu-def.c                         |    2 +-
 stubs/dump.c                                       |    1 -
 stubs/iothread-lock.c                              |    5 +
 stubs/mon-is-qmp.c                                 |    6 +-
 stubs/mon-set-error.c                              |    8 -
 stubs/pci-drive-hot-add.c                          |   10 -
 stubs/qmp_pc_dimm_device_list.c                    |    5 +
 stubs/qtest.c                                      |    2 +-
 stubs/set-fd-handler.c                             |    3 +-
 target-alpha/Makefile.objs                         |    2 +-
 target-alpha/cpu.c                                 |    9 +-
 target-alpha/cpu.h                                 |  108 +-
 target-alpha/fpu_helper.c                          |  530 +-
 target-alpha/helper.c                              |  132 +-
 target-alpha/helper.h                              |   14 +-
 target-alpha/int_helper.c                          |   89 +-
 target-alpha/mem_helper.c                          |    9 +-
 target-alpha/sys_helper.c                          |    2 +-
 target-alpha/translate.c                           |  297 +-
 target-alpha/vax_helper.c                          |  353 +
 target-arm/arm-semi.c                              |   30 +-
 target-arm/cpu-qom.h                               |   12 +
 target-arm/cpu.c                                   |  316 +-
 target-arm/cpu.h                                   |  722 ++-
 target-arm/cpu64.c                                 |  104 +-
 target-arm/crypto_helper.c                         |  116 +-
 target-arm/helper-a64.c                            |   29 +-
 target-arm/helper.c                                | 2678 +++++--
 target-arm/helper.h                                |    3 +-
 target-arm/internals.h                             |   21 +-
 target-arm/kvm-consts.h                            |    4 +
 target-arm/kvm-stub.c                              |    2 +-
 target-arm/kvm.c                                   |  174 +-
 target-arm/kvm32.c                                 |  133 +-
 target-arm/kvm64.c                                 |  232 +-
 target-arm/kvm_arm.h                               |   51 +-
 target-arm/machine.c                               |   88 +-
 target-arm/op_helper.c                             |  233 +-
 target-arm/psci.c                                  |   19 +-
 target-arm/translate-a64.c                         |  162 +-
 target-arm/translate.c                             |  355 +-
 target-arm/translate.h                             |   34 +-
 target-cris/cpu.c                                  |   25 +-
 target-cris/cpu.h                                  |   13 +-
 target-cris/helper.c                               |   11 +-
 target-cris/opcode-cris.h                          |   10 -
 target-cris/translate.c                            |   42 +-
 target-cris/translate_v10.c                        |    6 +-
 target-i386/Makefile.objs                          |    2 -
 target-i386/arch_dump.c                            |   16 +-
 target-i386/arch_memory_mapping.c                  |   15 +-
 target-i386/cpu-qom.h                              |    4 +
 target-i386/cpu.c                                  |  603 +-
 target-i386/cpu.h                                  |  145 +-
 target-i386/fpu_helper.c                           |   21 +-
 target-i386/helper.c                               |  150 +-
 target-i386/helper.h                               |   12 +-
 target-i386/ioport-user.c                          |   60 -
 target-i386/kvm-stub.c                             |    5 +
 target-i386/kvm.c                                  |  300 +-
 target-i386/kvm_i386.h                             |    1 +
 target-i386/machine.c                              |  172 +-
 target-i386/misc_helper.c                          |   59 +-
 target-i386/ops_sse.h                              |   18 +-
 target-i386/seg_helper.c                           |   32 +-
 target-i386/smm_helper.c                           |  333 +-
 target-i386/svm_helper.c                           |  230 +-
 target-i386/topology.h                             |  134 -
 target-i386/translate.c                            |  146 +-
 target-lm32/cpu.c                                  |    9 +-
 target-lm32/cpu.h                                  |   13 +-
 target-lm32/helper.c                               |    3 +-
 target-lm32/translate.c                            |   48 +-
 target-m68k/cpu.c                                  |    9 +-
 target-m68k/cpu.h                                  |   13 +-
 target-m68k/m68k-qreg.h                            |   11 -
 target-m68k/op_helper.c                            |   12 +-
 target-m68k/translate.c                            |   44 +-
 target-microblaze/cpu-qom.h                        |   14 +-
 target-microblaze/cpu.c                            |  145 +-
 target-microblaze/cpu.h                            |   60 +-
 target-microblaze/helper.c                         |   22 +-
 target-microblaze/mmu.h                            |    1 -
 target-microblaze/op_helper.c                      |   10 +-
 target-microblaze/translate.c                      |   52 +-
 target-mips/Makefile.objs                          |    2 +-
 target-mips/cpu-qom.h                              |    4 +
 target-mips/cpu.c                                  |   10 +-
 target-mips/cpu.h                                  |  207 +-
 target-mips/dsp_helper.c                           |    2 +-
 target-mips/gdbstub.c                              |   56 +-
 target-mips/helper.c                               |   69 +-
 target-mips/helper.h                               |   14 +-
 target-mips/kvm.c                                  |   59 +-
 target-mips/machine.c                              |  573 +-
 target-mips/mips-defs.h                            |    6 +-
 target-mips/mips-semi.c                            |  373 +
 target-mips/msa_helper.c                           |  161 +-
 target-mips/op_helper.c                            |  698 +-
 target-mips/translate.c                            | 3082 +++++---
 target-mips/translate_init.c                       |  224 +-
 target-moxie/cpu.c                                 |    9 +-
 target-moxie/cpu.h                                 |   13 +-
 target-moxie/machine.c                             |    1 +
 target-moxie/mmu.h                                 |   10 +-
 target-moxie/translate.c                           |   14 +-
 target-openrisc/cpu.c                              |    9 +-
 target-openrisc/cpu.h                              |   16 +-
 target-openrisc/translate.c                        |   55 +-
 target-ppc/cpu-models.c                            |   10 +-
 target-ppc/cpu-models.h                            |    3 +-
 target-ppc/cpu.h                                   |   58 +-
 target-ppc/fpu_helper.c                            |   85 +-
 target-ppc/helper.h                                |    4 +-
 target-ppc/int_helper.c                            |   21 +-
 target-ppc/kvm.c                                   |  122 +-
 target-ppc/kvm_ppc.h                               |    5 +
 target-ppc/machine.c                               |   70 +-
 target-ppc/mem_helper.c                            |   22 +
 target-ppc/misc_helper.c                           |    7 +-
 target-ppc/mmu-hash32.c                            |   18 +-
 target-ppc/mmu-hash64.c                            |   60 +-
 target-ppc/mmu-hash64.h                            |    3 +
 target-ppc/mmu_helper.c                            |   61 +-
 target-ppc/translate.c                             |  435 +-
 target-ppc/translate_init.c                        |  298 +-
 target-s390x/Makefile.objs                         |    2 +-
 target-s390x/arch_dump.c                           |   42 +-
 target-s390x/cc_helper.c                           |   22 +-
 target-s390x/cpu-qom.h                             |    4 +
 target-s390x/cpu.c                                 |   39 +-
 target-s390x/cpu.h                                 |  351 +-
 target-s390x/fpu_helper.c                          |   43 +-
 target-s390x/gdbstub.c                             |   51 +-
 target-s390x/helper.c                              |  511 +-
 target-s390x/helper.h                              |   28 +-
 target-s390x/insn-data.def                         |  168 +-
 target-s390x/int_helper.c                          |   51 +-
 target-s390x/ioinst.c                              |  250 +-
 target-s390x/ioinst.h                              |    7 +-
 target-s390x/kvm.c                                 | 1154 +++-
 target-s390x/machine.c                             |  134 +-
 target-s390x/mem_helper.c                          |  347 +-
 target-s390x/misc_helper.c                         |  227 +-
 target-s390x/mmu_helper.c                          |  480 ++
 target-s390x/translate.c                           |  719 ++-
 target-sh4/cpu.c                                   |   12 +-
 target-sh4/cpu.h                                   |   62 +-
 target-sh4/gdbstub.c                               |    8 +-
 target-sh4/helper.c                                |   29 +-
 target-sh4/helper.h                                |    1 -
 target-sh4/op_helper.c                             |  148 +-
 target-sh4/translate.c                             |  361 +-
 target-sparc/cpu.c                                 |   12 +-
 target-sparc/cpu.h                                 |   13 +-
 target-sparc/ldst_helper.c                         |   34 +-
 target-sparc/mmu_helper.c                          |    7 +-
 target-sparc/translate.c                           |   51 +-
 target-tricore/cpu.c                               |   35 +-
 target-tricore/cpu.h                               |   26 +-
 target-tricore/csfr.def                            |  124 +
 target-tricore/helper.h                            |  109 +
 target-tricore/op_helper.c                         | 2295 +++++-
 target-tricore/translate.c                         | 8830 ++++++++++++++++----
 target-tricore/tricore-opcodes.h                   |  129 +-
 target-unicore32/cpu.c                             |    9 +-
 target-unicore32/cpu.h                             |    9 +-
 target-unicore32/helper.c                          |   10 +-
 target-unicore32/translate.c                       |   20 +-
 target-xtensa/core-dc232b.c                        |    2 +-
 target-xtensa/core-dc233c.c                        |    2 +-
 target-xtensa/core-fsf.c                           |    7 +-
 target-xtensa/cpu-qom.h                            |    3 +
 target-xtensa/cpu.c                                |   10 +-
 target-xtensa/cpu.h                                |   44 +-
 target-xtensa/gdbstub.c                            |   25 +-
 target-xtensa/helper.c                             |   14 +
 target-xtensa/helper.h                             |    2 +-
 target-xtensa/import_core.sh                       |    6 +-
 target-xtensa/op_helper.c                          |   43 +-
 target-xtensa/overlay_tool.h                       |    4 +-
 target-xtensa/translate.c                          |  703 +-
 tcg/aarch64/tcg-target.c                           |  145 +-
 tcg/aarch64/tcg-target.h                           |    1 +
 tcg/arm/tcg-target.c                               |   59 +-
 tcg/arm/tcg-target.h                               |    1 +
 tcg/i386/tcg-target.c                              |  239 +-
 tcg/i386/tcg-target.h                              |    1 +
 tcg/ia64/tcg-target.c                              |   51 +-
 tcg/ia64/tcg-target.h                              |    2 +
 tcg/mips/tcg-target.c                              |   90 +-
 tcg/mips/tcg-target.h                              |    1 +
 tcg/optimize.c                                     |  388 +-
 tcg/ppc/tcg-target.c                               |   66 +-
 tcg/ppc/tcg-target.h                               |    1 +
 tcg/s390/tcg-target.c                              |   86 +-
 tcg/s390/tcg-target.h                              |    1 +
 tcg/sparc/tcg-target.c                             |   72 +-
 tcg/sparc/tcg-target.h                             |    1 +
 tcg/tcg-be-ldst.h                                  |   29 +-
 tcg/tcg-op.c                                       | 1945 +++++
 tcg/tcg-op.h                                       | 2484 +-----
 tcg/tcg-opc.h                                      |   17 +-
 tcg/tcg.c                                          |  638 +-
 tcg/tcg.h                                          |  230 +-
 tcg/tci/tcg-target.c                               |   25 +-
 tcg/tci/tcg-target.h                               |    4 +-
 tci.c                                              |   60 +-
 tests/.gitignore                                   |    6 +
 tests/Makefile                                     |  142 +-
 tests/acpi-test-data/pc/DSDT                       |  Bin 3621 -> 3028 bytes
 tests/acpi-test-data/pc/SSDT                       |  Bin 2279 -> 2486 bytes
 tests/acpi-test-data/pc/SSDT.bridge                |  Bin 0 -> 4345 bytes
 tests/acpi-test-data/q35/DSDT                      |  Bin 8211 -> 7666 bytes
 tests/acpi-test-data/q35/SSDT                      |  Bin 560 -> 691 bytes
 tests/acpi-test-data/q35/SSDT.bridge               |  Bin 0 -> 708 bytes
 tests/ahci-test.c                                  | 1827 +++--
 tests/bios-tables-test.c                           |  135 +-
 tests/check-qdict.c                                |   67 +
 tests/check-qjson.c                                |   26 +-
 tests/check-qom-proplist.c                         |  302 +
 tests/device-introspect-test.c                     |  158 +
 tests/display-vga-test.c                           |   18 +
 tests/drive_del-test.c                             |   24 +-
 tests/e1000-test.c                                 |    4 +-
 tests/eepro100-test.c                              |    5 +-
 tests/endianness-test.c                            |   20 +-
 tests/fdc-test.c                                   |   36 +-
 tests/fw_cfg-test.c                                |   26 +-
 tests/hd-geo-test.c                                |    4 +-
 tests/i440fx-test.c                                |   17 +-
 tests/ide-test.c                                   |   98 +-
 tests/libqos/ahci.c                                |  962 +++
 tests/libqos/ahci.h                                |  586 ++
 tests/libqos/libqos-pc.c                           |   29 +
 tests/libqos/libqos-pc.h                           |   10 +
 tests/libqos/libqos.c                              |  214 +
 tests/libqos/libqos.h                              |   38 +
 tests/libqos/malloc-generic.c                      |   39 +
 tests/libqos/malloc-generic.h                      |   21 +
 tests/libqos/malloc-pc.c                           |  296 +-
 tests/libqos/malloc-pc.h                           |   11 +-
 tests/libqos/malloc.c                              |  374 +
 tests/libqos/malloc.h                              |   32 +-
 tests/libqos/virtio-mmio.c                         |  198 +
 tests/libqos/virtio-mmio.h                         |   46 +
 tests/libqos/virtio-pci.c                          |   66 +-
 tests/libqos/virtio-pci.h                          |   24 +-
 tests/libqos/virtio.c                              |    8 +-
 tests/libqos/virtio.h                              |   26 +-
 tests/libqtest.c                                   |  138 +-
 tests/libqtest.h                                   |  161 +
 tests/multiboot/Makefile                           |    5 +-
 tests/multiboot/libc.c                             |   12 +
 tests/multiboot/libc.h                             |    1 +
 tests/multiboot/mmap.out                           |   37 +-
 tests/multiboot/module.txt                         |    1 +
 tests/multiboot/modules.c                          |   55 +
 tests/multiboot/modules.out                        |   38 +
 tests/multiboot/run_test.sh                        |    9 +-
 tests/nvme-test.c                                  |    2 +-
 tests/pc-cpu-test.c                                |  146 +
 tests/q35-test.c                                   |   91 +
 tests/qapi-schema/alternate-array.err              |    1 +
 tests/qapi-schema/alternate-array.exit             |    1 +
 tests/qapi-schema/alternate-array.json             |    7 +
 tests/qapi-schema/alternate-base.err               |    1 +
 tests/qapi-schema/alternate-base.exit              |    1 +
 tests/qapi-schema/alternate-base.json              |    6 +
 tests/qapi-schema/alternate-clash.err              |    1 +
 tests/qapi-schema/alternate-clash.exit             |    1 +
 tests/qapi-schema/alternate-clash.json             |    3 +
 tests/qapi-schema/alternate-conflict-dict.err      |    1 +
 tests/qapi-schema/alternate-conflict-dict.exit     |    1 +
 tests/qapi-schema/alternate-conflict-dict.json     |    8 +
 tests/qapi-schema/alternate-conflict-string.err    |    1 +
 tests/qapi-schema/alternate-conflict-string.exit   |    1 +
 tests/qapi-schema/alternate-conflict-string.json   |    6 +
 tests/qapi-schema/alternate-good.exit              |    1 +
 tests/qapi-schema/alternate-good.json              |    9 +
 tests/qapi-schema/alternate-good.out               |    6 +
 tests/qapi-schema/alternate-nested.err             |    1 +
 tests/qapi-schema/alternate-nested.exit            |    1 +
 tests/qapi-schema/alternate-nested.json            |    5 +
 tests/qapi-schema/alternate-unknown.err            |    1 +
 tests/qapi-schema/alternate-unknown.exit           |    1 +
 tests/qapi-schema/alternate-unknown.json           |    3 +
 tests/qapi-schema/bad-base.err                     |    1 +
 tests/qapi-schema/bad-base.exit                    |    1 +
 tests/qapi-schema/bad-base.json                    |    3 +
 tests/qapi-schema/bad-data.err                     |    1 +
 tests/qapi-schema/bad-data.exit                    |    1 +
 tests/qapi-schema/bad-data.json                    |    2 +
 tests/qapi-schema/bad-ident.err                    |    1 +
 tests/qapi-schema/bad-ident.exit                   |    1 +
 tests/qapi-schema/bad-ident.json                   |    2 +
 tests/qapi-schema/bad-type-bool.err                |    1 +
 tests/qapi-schema/bad-type-bool.exit               |    1 +
 tests/qapi-schema/bad-type-bool.json               |    2 +
 tests/qapi-schema/bad-type-dict.err                |    1 +
 tests/qapi-schema/bad-type-dict.exit               |    1 +
 tests/qapi-schema/bad-type-dict.json               |    2 +
 tests/qapi-schema/bad-type-int.err                 |    1 +
 tests/qapi-schema/bad-type-int.exit                |    1 +
 tests/qapi-schema/bad-type-int.json                |    3 +
 tests/qapi-schema/command-int.err                  |    1 +
 tests/qapi-schema/command-int.exit                 |    1 +
 tests/qapi-schema/command-int.json                 |    3 +
 tests/qapi-schema/data-array-empty.err             |    1 +
 tests/qapi-schema/data-array-empty.exit            |    1 +
 tests/qapi-schema/data-array-empty.json            |    2 +
 tests/qapi-schema/data-array-unknown.err           |    1 +
 tests/qapi-schema/data-array-unknown.exit          |    1 +
 tests/qapi-schema/data-array-unknown.json          |    2 +
 tests/qapi-schema/data-int.err                     |    1 +
 tests/qapi-schema/data-int.exit                    |    1 +
 tests/qapi-schema/data-int.json                    |    2 +
 tests/qapi-schema/data-member-array-bad.err        |    1 +
 tests/qapi-schema/data-member-array-bad.exit       |    1 +
 tests/qapi-schema/data-member-array-bad.json       |    2 +
 tests/qapi-schema/data-member-array.exit           |    1 +
 tests/qapi-schema/data-member-array.json           |    4 +
 tests/qapi-schema/data-member-array.out            |    5 +
 tests/qapi-schema/data-member-unknown.err          |    1 +
 tests/qapi-schema/data-member-unknown.exit         |    1 +
 tests/qapi-schema/data-member-unknown.json         |    2 +
 tests/qapi-schema/data-unknown.err                 |    1 +
 tests/qapi-schema/data-unknown.exit                |    1 +
 tests/qapi-schema/data-unknown.json                |    2 +
 tests/qapi-schema/double-data.err                  |    1 +
 tests/qapi-schema/double-data.exit                 |    1 +
 tests/qapi-schema/double-data.json                 |    2 +
 tests/qapi-schema/double-type.err                  |    1 +
 tests/qapi-schema/double-type.exit                 |    1 +
 tests/qapi-schema/double-type.json                 |    2 +
 tests/qapi-schema/enum-bad-name.err                |    1 +
 tests/qapi-schema/enum-bad-name.exit               |    1 +
 tests/qapi-schema/enum-bad-name.json               |    2 +
 tests/qapi-schema/enum-clash-member.err            |    1 +
 tests/qapi-schema/enum-clash-member.exit           |    1 +
 tests/qapi-schema/enum-clash-member.json           |    2 +
 tests/qapi-schema/enum-dict-member.err             |    1 +
 tests/qapi-schema/enum-dict-member.exit            |    1 +
 tests/qapi-schema/enum-dict-member.json            |    2 +
 tests/qapi-schema/enum-empty.exit                  |    1 +
 tests/qapi-schema/enum-empty.json                  |    2 +
 tests/qapi-schema/enum-empty.out                   |    3 +
 tests/qapi-schema/enum-int-member.err              |    1 +
 tests/qapi-schema/enum-int-member.exit             |    1 +
 tests/qapi-schema/enum-int-member.json             |    3 +
 tests/qapi-schema/enum-max-member.err              |    1 +
 tests/qapi-schema/enum-max-member.exit             |    1 +
 tests/qapi-schema/enum-max-member.json             |    3 +
 tests/qapi-schema/enum-missing-data.err            |    1 +
 tests/qapi-schema/enum-missing-data.exit           |    1 +
 tests/qapi-schema/enum-missing-data.json           |    2 +
 tests/qapi-schema/enum-union-clash.err             |    1 +
 tests/qapi-schema/enum-union-clash.exit            |    1 +
 tests/qapi-schema/enum-union-clash.json            |    4 +
 tests/qapi-schema/enum-wrong-data.err              |    1 +
 tests/qapi-schema/enum-wrong-data.exit             |    1 +
 tests/qapi-schema/enum-wrong-data.json             |    2 +
 tests/qapi-schema/escape-outside-string.err        |    1 +
 tests/qapi-schema/escape-outside-string.exit       |    1 +
 tests/qapi-schema/escape-outside-string.json       |    3 +
 tests/qapi-schema/escape-too-big.err               |    1 +
 tests/qapi-schema/escape-too-big.exit              |    1 +
 tests/qapi-schema/escape-too-big.json              |    3 +
 tests/qapi-schema/escape-too-short.err             |    1 +
 tests/qapi-schema/escape-too-short.exit            |    1 +
 tests/qapi-schema/escape-too-short.json            |    3 +
 tests/qapi-schema/event-case.exit                  |    1 +
 tests/qapi-schema/event-case.json                  |    3 +
 tests/qapi-schema/event-case.out                   |    3 +
 tests/qapi-schema/event-max.err                    |    1 +
 tests/qapi-schema/event-max.exit                   |    1 +
 tests/qapi-schema/event-max.json                   |    2 +
 tests/qapi-schema/event-nest-struct.err            |    2 +-
 tests/qapi-schema/flat-union-array-branch.err      |    1 +
 tests/qapi-schema/flat-union-array-branch.exit     |    1 +
 tests/qapi-schema/flat-union-array-branch.json     |   12 +
 tests/qapi-schema/flat-union-bad-base.err          |    1 +
 tests/qapi-schema/flat-union-bad-base.exit         |    1 +
 tests/qapi-schema/flat-union-bad-base.json         |   13 +
 tests/qapi-schema/flat-union-bad-discriminator.err |    1 +
 .../qapi-schema/flat-union-bad-discriminator.exit  |    1 +
 .../qapi-schema/flat-union-bad-discriminator.json  |   15 +
 tests/qapi-schema/flat-union-base-star.err         |    1 +
 tests/qapi-schema/flat-union-base-star.exit        |    1 +
 tests/qapi-schema/flat-union-base-star.json        |   12 +
 tests/qapi-schema/flat-union-base-union.err        |    1 +
 tests/qapi-schema/flat-union-base-union.exit       |    1 +
 tests/qapi-schema/flat-union-base-union.json       |   15 +
 tests/qapi-schema/flat-union-branch-clash.err      |    1 +
 tests/qapi-schema/flat-union-branch-clash.exit     |    1 +
 tests/qapi-schema/flat-union-branch-clash.json     |   14 +
 tests/qapi-schema/flat-union-inline.err            |    1 +
 tests/qapi-schema/flat-union-inline.exit           |    1 +
 tests/qapi-schema/flat-union-inline.json           |   11 +
 tests/qapi-schema/flat-union-int-branch.err        |    1 +
 tests/qapi-schema/flat-union-int-branch.exit       |    1 +
 tests/qapi-schema/flat-union-int-branch.json       |   12 +
 .../qapi-schema/flat-union-invalid-branch-key.json |    6 +-
 .../flat-union-invalid-discriminator.err           |    2 +-
 .../flat-union-invalid-discriminator.json          |    6 +-
 tests/qapi-schema/flat-union-no-base.err           |    2 +-
 tests/qapi-schema/flat-union-no-base.json          |   12 +-
 .../flat-union-optional-discriminator.err          |    1 +
 .../flat-union-optional-discriminator.exit         |    1 +
 .../flat-union-optional-discriminator.json         |   10 +
 tests/qapi-schema/flat-union-reverse-define.json   |    6 +-
 tests/qapi-schema/flat-union-reverse-define.out    |   12 +-
 .../flat-union-string-discriminator.json           |    6 +-
 tests/qapi-schema/ident-with-escape.exit           |    1 +
 tests/qapi-schema/ident-with-escape.json           |    4 +
 tests/qapi-schema/ident-with-escape.out            |    3 +
 tests/qapi-schema/include-cycle.err                |    4 +-
 tests/qapi-schema/include-nested-err.err           |    2 +-
 tests/qapi-schema/indented-expr.json               |    4 +-
 tests/qapi-schema/indented-expr.out                |    2 +-
 tests/qapi-schema/missing-type.err                 |    1 +
 tests/qapi-schema/missing-type.exit                |    1 +
 tests/qapi-schema/missing-type.json                |    2 +
 tests/qapi-schema/nested-struct-data.err           |    1 +
 tests/qapi-schema/nested-struct-data.exit          |    1 +
 tests/qapi-schema/nested-struct-data.json          |    4 +
 tests/qapi-schema/nested-struct-returns.err        |    1 +
 tests/qapi-schema/nested-struct-returns.exit       |    1 +
 tests/qapi-schema/nested-struct-returns.json       |    3 +
 tests/qapi-schema/qapi-schema-test.json            |   66 +-
 tests/qapi-schema/qapi-schema-test.out             |   73 +-
 tests/qapi-schema/redefined-builtin.err            |    1 +
 tests/qapi-schema/redefined-builtin.exit           |    1 +
 tests/qapi-schema/redefined-builtin.json           |    2 +
 tests/qapi-schema/redefined-command.err            |    1 +
 tests/qapi-schema/redefined-command.exit           |    1 +
 tests/qapi-schema/redefined-command.json           |    3 +
 tests/qapi-schema/redefined-event.err              |    1 +
 tests/qapi-schema/redefined-event.exit             |    1 +
 tests/qapi-schema/redefined-event.json             |    3 +
 tests/qapi-schema/redefined-type.err               |    1 +
 tests/qapi-schema/redefined-type.exit              |    1 +
 tests/qapi-schema/redefined-type.json              |    3 +
 tests/qapi-schema/returns-alternate.err            |    1 +
 tests/qapi-schema/returns-alternate.exit           |    1 +
 tests/qapi-schema/returns-alternate.json           |    3 +
 tests/qapi-schema/returns-array-bad.err            |    1 +
 tests/qapi-schema/returns-array-bad.exit           |    1 +
 tests/qapi-schema/returns-array-bad.json           |    2 +
 tests/qapi-schema/returns-int.exit                 |    1 +
 tests/qapi-schema/returns-int.json                 |    3 +
 tests/qapi-schema/returns-int.out                  |    3 +
 tests/qapi-schema/returns-unknown.err              |    1 +
 tests/qapi-schema/returns-unknown.exit             |    1 +
 tests/qapi-schema/returns-unknown.json             |    2 +
 tests/qapi-schema/returns-whitelist.err            |    1 +
 tests/qapi-schema/returns-whitelist.exit           |    1 +
 tests/qapi-schema/returns-whitelist.json           |   11 +
 tests/qapi-schema/struct-base-clash-deep.err       |    1 +
 tests/qapi-schema/struct-base-clash-deep.exit      |    1 +
 tests/qapi-schema/struct-base-clash-deep.json      |    9 +
 tests/qapi-schema/struct-base-clash.err            |    1 +
 tests/qapi-schema/struct-base-clash.exit           |    1 +
 tests/qapi-schema/struct-base-clash.json           |    6 +
 tests/qapi-schema/type-bypass-bad-gen.err          |    1 +
 tests/qapi-schema/type-bypass-bad-gen.exit         |    1 +
 tests/qapi-schema/type-bypass-bad-gen.json         |    2 +
 tests/qapi-schema/type-bypass-no-gen.err           |    1 +
 tests/qapi-schema/type-bypass-no-gen.exit          |    1 +
 tests/qapi-schema/type-bypass-no-gen.json          |    2 +
 tests/qapi-schema/type-bypass.exit                 |    1 +
 tests/qapi-schema/type-bypass.json                 |    2 +
 tests/qapi-schema/type-bypass.out                  |    3 +
 tests/qapi-schema/unicode-str.err                  |    1 +
 tests/qapi-schema/unicode-str.exit                 |    1 +
 tests/qapi-schema/unicode-str.json                 |    2 +
 tests/qapi-schema/union-bad-branch.err             |    1 +
 tests/qapi-schema/union-bad-branch.exit            |    1 +
 tests/qapi-schema/union-bad-branch.json            |    8 +
 tests/qapi-schema/union-base-no-discriminator.err  |    1 +
 tests/qapi-schema/union-base-no-discriminator.exit |    1 +
 tests/qapi-schema/union-base-no-discriminator.json |   14 +
 tests/qapi-schema/union-invalid-base.err           |    2 +-
 tests/qapi-schema/union-invalid-base.json          |    8 +-
 tests/qapi-schema/union-max.err                    |    1 +
 tests/qapi-schema/union-max.exit                   |    1 +
 tests/qapi-schema/union-max.json                   |    3 +
 tests/qapi-schema/union-optional-branch.err        |    1 +
 tests/qapi-schema/union-optional-branch.exit       |    1 +
 tests/qapi-schema/union-optional-branch.json       |    2 +
 tests/qapi-schema/union-unknown.err                |    1 +
 tests/qapi-schema/union-unknown.exit               |    1 +
 tests/qapi-schema/union-unknown.json               |    3 +
 tests/qapi-schema/unknown-escape.err               |    1 +
 tests/qapi-schema/unknown-escape.exit              |    1 +
 tests/qapi-schema/unknown-escape.json              |    3 +
 tests/qapi-schema/unknown-expr-key.err             |    1 +
 tests/qapi-schema/unknown-expr-key.exit            |    1 +
 tests/qapi-schema/unknown-expr-key.json            |    2 +
 tests/qemu-iotests-quick.sh                        |    2 +-
 tests/qemu-iotests/.gitignore                      |    1 +
 tests/qemu-iotests/001.out                         |    2 +-
 tests/qemu-iotests/002.out                         |    2 +-
 tests/qemu-iotests/003.out                         |    2 +-
 tests/qemu-iotests/004                             |    2 +-
 tests/qemu-iotests/004.out                         |    2 +-
 tests/qemu-iotests/005.out                         |    2 +-
 tests/qemu-iotests/006                             |   54 -
 tests/qemu-iotests/006.out                         |    6 -
 tests/qemu-iotests/007                             |    3 +
 tests/qemu-iotests/007.out                         |    2 +-
 tests/qemu-iotests/008.out                         |    2 +-
 tests/qemu-iotests/009.out                         |    2 +-
 tests/qemu-iotests/010.out                         |    2 +-
 tests/qemu-iotests/011.out                         |    2 +-
 tests/qemu-iotests/012.out                         |    2 +-
 tests/qemu-iotests/013.out                         |    2 +-
 tests/qemu-iotests/014.out                         |    2 +-
 tests/qemu-iotests/015                             |    2 +
 tests/qemu-iotests/015.out                         |    2 +-
 tests/qemu-iotests/016                             |   70 -
 tests/qemu-iotests/016.out                         |   23 -
 tests/qemu-iotests/017.out                         |    2 +-
 tests/qemu-iotests/018.out                         |    2 +-
 tests/qemu-iotests/019.out                         |    4 +-
 tests/qemu-iotests/020.out                         |    4 +-
 tests/qemu-iotests/021.out                         |    2 +-
 tests/qemu-iotests/022.out                         |    2 +-
 tests/qemu-iotests/023.out                         |   16 +-
 tests/qemu-iotests/024.out                         |    6 +-
 tests/qemu-iotests/025.out                         |    2 +-
 tests/qemu-iotests/026                             |    7 +
 tests/qemu-iotests/026.out                         |  324 +-
 tests/qemu-iotests/027.out                         |    2 +-
 tests/qemu-iotests/028.out                         |    6 +-
 tests/qemu-iotests/029                             |    2 +
 tests/qemu-iotests/029.out                         |    8 +-
 tests/qemu-iotests/030                             |   22 +-
 tests/qemu-iotests/031.out                         |    4 +-
 tests/qemu-iotests/032.out                         |    2 +-
 tests/qemu-iotests/033                             |   66 +-
 tests/qemu-iotests/033.out                         |   58 +-
 tests/qemu-iotests/034.out                         |    4 +-
 tests/qemu-iotests/035.out                         |    2 +-
 tests/qemu-iotests/036.out                         |    6 +-
 tests/qemu-iotests/037.out                         |    4 +-
 tests/qemu-iotests/038.out                         |    4 +-
 tests/qemu-iotests/039                             |   18 +-
 tests/qemu-iotests/039.out                         |   18 +-
 tests/qemu-iotests/040                             |   32 +-
 tests/qemu-iotests/041                             |   66 +-
 tests/qemu-iotests/042.out                         |    2 +-
 tests/qemu-iotests/043.out                         |   52 +-
 tests/qemu-iotests/046.out                         |    4 +-
 tests/qemu-iotests/047.out                         |    2 +-
 tests/qemu-iotests/048                             |    2 +-
 tests/qemu-iotests/048.out                         |    4 +-
 tests/qemu-iotests/049.out                         |  118 +-
 tests/qemu-iotests/050.out                         |    6 +-
 tests/qemu-iotests/051                             |   11 +-
 tests/qemu-iotests/051.out                         |   96 +-
 tests/qemu-iotests/052.out                         |    2 +-
 tests/qemu-iotests/053.out                         |    2 +-
 tests/qemu-iotests/054.out                         |    4 +-
 tests/qemu-iotests/055                             |  232 +-
 tests/qemu-iotests/055.out                         |    4 +-
 tests/qemu-iotests/058                             |   14 +-
 tests/qemu-iotests/059                             |   15 +-
 tests/qemu-iotests/059.out                         |    7 +
 tests/qemu-iotests/060                             |   17 +-
 tests/qemu-iotests/060.out                         |   41 +-
 tests/qemu-iotests/061.out                         |   45 +-
 tests/qemu-iotests/062.out                         |    2 +-
 tests/qemu-iotests/064                             |   19 +-
 tests/qemu-iotests/064.out                         |   34 +-
 tests/qemu-iotests/065                             |   23 +-
 tests/qemu-iotests/066.out                         |    2 +-
 tests/qemu-iotests/067                             |    7 +-
 tests/qemu-iotests/067.out                         |  816 ++-
 tests/qemu-iotests/068.out                         |    2 +-
 tests/qemu-iotests/069.out                         |    4 +-
 tests/qemu-iotests/071                             |   12 +-
 tests/qemu-iotests/071.out                         |   22 +-
 tests/qemu-iotests/072.out                         |    2 +-
 tests/qemu-iotests/073.out                         |    4 +-
 tests/qemu-iotests/076                             |   15 +-
 tests/qemu-iotests/076.out                         |   10 +
 tests/qemu-iotests/077                             |    2 +-
 tests/qemu-iotests/077.out                         |    2 +-
 tests/qemu-iotests/079                             |   10 +-
 tests/qemu-iotests/079.out                         |   38 +-
 tests/qemu-iotests/080                             |    2 +
 tests/qemu-iotests/080.out                         |   24 +-
 tests/qemu-iotests/081                             |   10 +-
 tests/qemu-iotests/081.out                         |    8 +-
 tests/qemu-iotests/082                             |   14 +-
 tests/qemu-iotests/082.out                         |   97 +-
 tests/qemu-iotests/083                             |    3 +-
 tests/qemu-iotests/083.out                         |   81 +-
 tests/qemu-iotests/084.out                         |    4 +-
 tests/qemu-iotests/085.out                         |   38 +-
 tests/qemu-iotests/086.out                         |    2 +-
 tests/qemu-iotests/087                             |    3 +-
 tests/qemu-iotests/087.out                         |   33 +-
 tests/qemu-iotests/088.out                         |    2 +-
 tests/qemu-iotests/089                             |    8 +-
 tests/qemu-iotests/089.out                         |    6 +-
 tests/qemu-iotests/090.out                         |    2 +-
 tests/qemu-iotests/091.out                         |    2 +-
 tests/qemu-iotests/092.out                         |    8 +-
 tests/qemu-iotests/093                             |  151 +
 tests/qemu-iotests/093.out                         |    5 +
 tests/qemu-iotests/094                             |   81 +
 tests/qemu-iotests/094.out                         |   11 +
 tests/qemu-iotests/095.out                         |    6 +-
 tests/qemu-iotests/097.out                         |   24 +-
 tests/qemu-iotests/098.out                         |   16 +-
 tests/qemu-iotests/099                             |   20 +-
 tests/qemu-iotests/099.out                         |   16 +-
 tests/qemu-iotests/100                             |   12 +
 tests/qemu-iotests/100.out                         |   14 +-
 tests/qemu-iotests/103                             |   10 +
 tests/qemu-iotests/103.out                         |    7 +-
 tests/qemu-iotests/104                             |   11 +-
 tests/qemu-iotests/104.out                         |    4 +-
 tests/qemu-iotests/107.out                         |    2 +-
 tests/qemu-iotests/108                             |    2 +
 tests/qemu-iotests/108.out                         |   12 +-
 tests/qemu-iotests/109                             |  132 +
 tests/qemu-iotests/109.out                         |  231 +
 tests/qemu-iotests/110                             |   94 +
 tests/qemu-iotests/110.out                         |   19 +
 tests/qemu-iotests/112                             |  187 +
 tests/qemu-iotests/112.out                         |   84 +
 tests/qemu-iotests/115                             |   95 +
 tests/qemu-iotests/115.out                         |    8 +
 tests/qemu-iotests/116                             |   96 +
 tests/qemu-iotests/116.out                         |   37 +
 tests/qemu-iotests/119                             |   60 +
 tests/qemu-iotests/119.out                         |   11 +
 tests/qemu-iotests/120                             |   65 +
 tests/qemu-iotests/120.out                         |   15 +
 tests/qemu-iotests/121                             |  102 +
 tests/qemu-iotests/121.out                         |   23 +
 tests/qemu-iotests/122                             |  223 +
 tests/qemu-iotests/122.out                         |  209 +
 tests/qemu-iotests/123                             |   62 +
 tests/qemu-iotests/123.out                         |    9 +
 tests/qemu-iotests/124                             |  363 +
 tests/qemu-iotests/124.out                         |    5 +
 tests/qemu-iotests/128                             |   84 +
 tests/qemu-iotests/128.out                         |    5 +
 tests/qemu-iotests/129                             |   86 +
 tests/qemu-iotests/129.out                         |    5 +
 tests/qemu-iotests/130                             |   95 +
 tests/qemu-iotests/130.out                         |   43 +
 tests/qemu-iotests/131                             |   77 +
 tests/qemu-iotests/131.out                         |   41 +
 tests/qemu-iotests/132                             |   59 +
 tests/qemu-iotests/132.out                         |    5 +
 tests/qemu-iotests/134                             |   69 +
 tests/qemu-iotests/134.out                         |   46 +
 tests/qemu-iotests/135                             |   54 +
 tests/qemu-iotests/135.out                         |    5 +
 tests/qemu-iotests/check                           |   13 +-
 tests/qemu-iotests/common                          |   16 +-
 tests/qemu-iotests/common.config                   |    4 +-
 tests/qemu-iotests/common.filter                   |   13 +-
 tests/qemu-iotests/common.qemu                     |   15 +-
 tests/qemu-iotests/common.rc                       |   15 +-
 tests/qemu-iotests/group                           |   26 +-
 tests/qemu-iotests/iotests.py                      |  103 +-
 tests/qemu-iotests/sample_images/afl5.img.bz2      |  Bin 0 -> 175 bytes
 tests/qemu-iotests/sample_images/afl9.vmdk.bz2     |  Bin 0 -> 178 bytes
 tests/qemu-iotests/sample_images/grub_mbr.raw.bz2  |  Bin 0 -> 552 bytes
 tests/qom-test.c                                   |    4 +-
 tests/rcutorture.c                                 |  463 +
 tests/rocker/README                                |    5 +
 tests/rocker/all                                   |   19 +
 tests/rocker/bridge                                |   43 +
 tests/rocker/bridge-stp                            |   52 +
 tests/rocker/bridge-vlan                           |   52 +
 tests/rocker/bridge-vlan-stp                       |   64 +
 tests/rocker/port                                  |   22 +
 tests/rocker/tut.dot                               |    8 +
 tests/rtl8139-test.c                               |  181 +
 tests/tco-test.c                                   |  465 +
 tests/test-aio.c                                   |   26 +-
 tests/test-coroutine.c                             |   28 +-
 tests/test-crypto-cipher.c                         |  302 +
 tests/test-crypto-hash.c                           |  209 +
 tests/test-hbitmap.c                               |  293 +
 tests/test-opts-visitor.c                          |    3 +-
 tests/test-qemu-opts.c                             |   40 +-
 tests/test-qmp-commands.c                          |   52 +-
 tests/test-qmp-event.c                             |    4 +-
 tests/test-qmp-input-strict.c                      |   98 +-
 tests/test-qmp-input-visitor.c                     |  119 +-
 tests/test-qmp-output-visitor.c                    |  162 +-
 tests/test-rcu-list.c                              |  316 +
 tests/test-throttle.c                              |  163 +-
 tests/test-visitor-serialization.c                 |   87 +-
 tests/test-vmstate.c                               |   26 +-
 tests/test-write-threshold.c                       |  119 +
 tests/test-x86-cpuid.c                             |    2 +-
 tests/usb-hcd-ohci-test.c                          |    2 +-
 tests/usb-hcd-uhci-test.c                          |    4 +-
 tests/usb-hcd-xhci-test.c                          |    4 +-
 tests/virtio-blk-test.c                            |  331 +-
 tests/virtio-scsi-test.c                           |  201 +-
 tests/wdt_ib700-test.c                             |   15 +-
 thread-pool.c                                      |   14 +-
 thunk.c                                            |   16 +-
 tpm.c                                              |   25 +-
 trace-events                                       |  282 +-
 trace/control.c                                    |    2 +-
 translate-all.c                                    |  144 +-
 translate-all.h                                    |    8 +-
 ui/Makefile.objs                                   |   30 +-
 ui/cocoa.m                                         |  421 +-
 ui/console-gl.c                                    |  168 +
 ui/console.c                                       |  148 +-
 ui/d3des.c                                         |  424 -
 ui/d3des.h                                         |   55 -
 ui/egl-helpers.c                                   |  148 +
 ui/gtk-egl.c                                       |  141 +
 ui/gtk.c                                           |  388 +-
 ui/input-keymap.c                                  |    4 +
 ui/input-legacy.c                                  |    9 -
 ui/input.c                                         |    6 +-
 ui/keymaps.c                                       |  196 +-
 ui/qemu-pixman.c                                   |   29 +-
 ui/sdl.c                                           |   66 +-
 ui/sdl2-2d.c                                       |  147 +
 ui/sdl2-gl.c                                       |  112 +
 ui/sdl2-input.c                                    |  100 +
 ui/sdl2.c                                          |  403 +-
 ui/shader.c                                        |  114 +
 ui/shader/texture-blit.frag                        |   10 +
 ui/shader/texture-blit.vert                        |   10 +
 ui/spice-core.c                                    |   52 +-
 ui/spice-display.c                                 |  108 +-
 ui/vnc-auth-sasl.c                                 |    4 +-
 ui/vnc-auth-vencrypt.c                             |   11 +-
 ui/vnc-enc-tight.c                                 |    2 +-
 ui/vnc-jobs.c                                      |   14 +-
 ui/vnc-jobs.h                                      |    1 -
 ui/vnc-tls.c                                       |   82 +-
 ui/vnc-tls.h                                       |    7 -
 ui/vnc-ws.c                                        |  196 +-
 ui/vnc-ws.h                                        |   13 +-
 ui/vnc.c                                           | 1156 ++-
 ui/vnc.h                                           |   30 +-
 ui/vnc_keysym.h                                    |    1 +
 ui/x_keymap.c                                      |    4 +-
 user-exec.c                                        |   17 +-
 util/Makefile.objs                                 |    3 +-
 util/aes.c                                         | 1652 ----
 util/bitmap.c                                      |   83 +
 util/compatfd.c                                    |   19 -
 util/cutils.c                                      |   33 +-
 util/envlist.c                                     |   32 +-
 util/error.c                                       |   14 +-
 util/event_notifier-posix.c                        |    3 +-
 util/hbitmap.c                                     |  102 +-
 util/iov.c                                         |   18 +-
 util/osdep.c                                       |   67 +-
 util/oslib-posix.c                                 |   71 +-
 util/oslib-win32.c                                 |   24 +
 util/qemu-config.c                                 |  123 +-
 util/qemu-error.c                                  |    5 +-
 util/qemu-option.c                                 |  196 +-
 util/qemu-sockets.c                                |   98 +-
 util/qemu-thread-posix.c                           |   43 +-
 util/qemu-thread-win32.c                           |   48 +-
 util/rcu.c                                         |  330 +
 util/throttle.c                                    |   81 +-
 util/uri.c                                         |  179 +-
 vl.c                                               | 1339 ++--
 vmstate.c                                          |  687 --
 xbzrle.c                                           |  175 -
 xen-common.c                                       |    5 +
 xen-hvm-stub.c                                     |    4 -
 xen-hvm.c                                          |   22 +-
 xen-mapcache.c                                     |   94 +-
 1892 files changed, 146035 insertions(+), 66598 deletions(-)

diff --git a/.gitignore b/.gitignore
index e32a584..61bc492 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,8 @@
 /trace/generated-tcg-tracers.h
 /trace/generated-ust-provider.h
 /trace/generated-ust.c
+/ui/shader/texture-blit-frag.h
+/ui/shader/texture-blit-vert.h
 /libcacard/trace/generated-tracers.c
 *-timestamp
 /*-softmmu
@@ -37,14 +39,8 @@
 /qemu-tech.html
 /qemu-doc.info
 /qemu-tech.info
-/qemu.1
-/qemu.pod
-/qemu-img.1
-/qemu-img.pod
 /qemu-img
 /qemu-nbd
-/qemu-nbd.8
-/qemu-nbd.pod
 /qemu-options.def
 /qemu-options.texi
 /qemu-img-cmds.texi
@@ -56,8 +52,7 @@
 /qmp-commands.txt
 /vscclient
 /fsdev/virtfs-proxy-helper
-/fsdev/virtfs-proxy-helper.1
-/fsdev/virtfs-proxy-helper.pod
+*.[1-9]
 *.a
 *.aux
 *.cp
@@ -70,6 +65,7 @@
 *.ky
 *.log
 *.pdf
+*.pod
 *.cps
 *.fns
 *.kys
diff --git a/.travis.yml b/.travis.yml
index ad66e5b..0ac170b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -98,3 +98,6 @@ matrix:
           EXTRA_PKGS=3D"liblttng-ust-dev liburcu-dev"
           EXTRA_CONFIG=3D"--enable-trace-backends=3Dust"
       compiler: gcc
+    - env: TARGETS=3Di386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG=3D"--enable-modules"
+      compiler: gcc
diff --git a/LICENSE b/LICENSE
index da70e94..0e0b4b9 100644
--- a/LICENSE
+++ b/LICENSE
@@ -11,7 +11,7 @@ option) any later version.
 
 As of July 2013, contributions under version 2 of the GNU General Public
 License (and no later version) are only accepted for the following files
-or directories: bsd-user/, linux-user/, hw/misc/vfio.c, hw/xen/xen_pt*.
+or directories: bsd-user/, linux-user/, hw/vfio/, hw/xen/xen_pt*.
 
 3) The Tiny Code Generator (TCG) is released under the BSD license
    (see license headers in files).
diff --git a/MAINTAINERS b/MAINTAINERS
index bcb69e8..978b717 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -50,14 +50,12 @@ Descriptions of section entries:
 
 General Project Administration
 ------------------------------
-M: Anthony Liguori <aliguori@amazon.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 
 Responsible Disclosure, Reporting Security Issues
 ------------------------------
 W: http://wiki.qemu.org/SecurityProcess
 M: Michael S. Tsirkin <mst@redhat.com>
-M: Anthony Liguori <aliguori@amazon.com>
 L: secalert@redhat.com
 
 Guest CPU cores (TCG):
@@ -98,8 +96,12 @@ LM32
 M: Michael Walle <michael@walle.cc>
 S: Maintained
 F: target-lm32/
+F: disas/lm32.c
 F: hw/lm32/
-F: hw/char/lm32_*
+F: hw/*/lm32_*
+F: hw/*/milkymist-*
+F: include/hw/char/lm32_juart.h
+F: include/hw/lm32/
 F: tests/tcg/lm32/
 
 M68K
@@ -155,6 +157,7 @@ F: hw/sh4/
 
 SPARC
 M: Blue Swirl <blauwirbel@gmail.com>
+M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
 S: Maintained
 F: target-sparc/
 F: hw/sparc/
@@ -169,7 +172,8 @@ F: hw/unicore32/
 X86
 M: Paolo Bonzini <pbonzini@redhat.com>
 M: Richard Henderson <rth@twiddle.net>
-S: Odd Fixes
+M: Eduardo Habkost <ehabkost@redhat.com>
+S: Maintained
 F: target-i386/
 F: hw/i386/
 
@@ -352,6 +356,13 @@ F: hw/misc/zynq_slcr.c
 F: hw/*/cadence_*
 F: hw/ssi/xilinx_spips.c
 
+ARM ACPI Subsystem
+M: Shannon Zhao <zhaoshenglong@huawei.com>
+M: Shannon Zhao <shannon.zhao@linaro.org>
+S: Maintained
+F: hw/arm/virt-acpi-build.c
+F: include/hw/arm/virt-acpi-build.h
+
 CRIS Machines
 -------------
 Axis Dev88
@@ -482,7 +493,8 @@ F: hw/ppc/prep.c
 F: hw/pci-host/prep.[hc]
 F: hw/isa/pc87312.[hc]
 
-sPAPR
+sPAPR (pseries)
+M: David Gibson <david@gibson.dropbear.id.au>
 M: Alexander Graf <agraf@suse.de>
 L: qemu-ppc@nongnu.org
 S: Supported
@@ -514,11 +526,13 @@ SPARC Machines
 --------------
 Sun4m
 M: Blue Swirl <blauwirbel@gmail.com>
+M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
 S: Maintained
 F: hw/sparc/sun4m.c
 
 Sun4u
 M: Blue Swirl <blauwirbel@gmail.com>
+M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
 S: Maintained
 F: hw/sparc64/sun4u.c
 
@@ -534,6 +548,7 @@ S390 Virtio
 M: Alexander Graf <agraf@suse.de>
 S: Maintained
 F: hw/s390x/s390-*.c
+X: hw/s390x/*pci*.[hc]
 
 S390 Virtio-ccw
 M: Cornelia Huck <cornelia.huck@de.ibm.com>
@@ -544,6 +559,7 @@ F: hw/s390x/s390-virtio-ccw.c
 F: hw/s390x/css.[hc]
 F: hw/s390x/sclp*.[hc]
 F: hw/s390x/ipl*.[hc]
+F: hw/s390x/*pci*.[hc]
 F: include/hw/s390x/
 F: pc-bios/s390-ccw/
 T: git git://github.com/cohuck/qemu virtio-ccw-upstr
@@ -559,7 +575,6 @@ F: hw/unicore32/
 X86 Machines
 ------------
 PC
-M: Anthony Liguori <aliguori@amazon.com>
 M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
 F: include/hw/i386/
@@ -593,12 +608,31 @@ F: hw/net/opencores_eth.c
 
 Devices
 -------
+EDU
+M: Jiri Slaby <jslaby@suse.cz>
+S: Maintained
+F: hw/misc/edu.c
+
 IDE
-M: Kevin Wolf <kwolf@redhat.com>
-M: Stefan Hajnoczi <stefanha@redhat.com>
-S: Odd Fixes
+M: John Snow <jsnow@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
 F: include/hw/ide.h
 F: hw/ide/
+F: hw/block/block.c
+F: hw/block/cdrom.c
+F: hw/block/hd-geometry.c
+F: tests/ide-test.c
+F: tests/ahci-test.c
+T: git git://github.com/jnsnow/qemu.git ide
+
+Floppy
+M: John Snow <jsnow@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: hw/block/fdc.c
+F: include/hw/block/fdc.h
+T: git git://github.com/jnsnow/qemu.git ide
 
 OMAP
 M: Peter Maydell <peter.maydell@linaro.org>
@@ -610,7 +644,19 @@ M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
 F: include/hw/pci/*
 F: hw/pci/*
+
+ACPI
+M: Michael S. Tsirkin <mst@redhat.com>
+M: Igor Mammedov <imammedo@redhat.com>
+S: Supported
+F: include/hw/acpi/*
+F: hw/mem/*
 F: hw/acpi/*
+F: hw/i386/acpi-build.[hc]
+F: hw/i386/*dsl
+F: hw/arm/virt-acpi-build.c
+F: include/hw/arm/virt-acpi-build.h
+F: scripts/acpi*py
 
 ppc4xx
 M: Alexander Graf <agraf@suse.de>
@@ -657,7 +703,7 @@ F: hw/usb/dev-serial.c
 VFIO
 M: Alex Williamson <alex.williamson@redhat.com>
 S: Supported
-F: hw/misc/vfio.c
+F: hw/vfio/*
 
 vhost
 M: Michael S. Tsirkin <mst@redhat.com>
@@ -665,10 +711,10 @@ S: Supported
 F: hw/*/*vhost*
 
 virtio
-M: Anthony Liguori <aliguori@amazon.com>
 M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
 F: hw/*/virtio*
+F: net/vhost-user.c
 
 virtio-9p
 M: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
@@ -679,10 +725,13 @@ F: tests/virtio-9p-test.c
 T: git git://github.com/kvaneesh/QEMU.git
 
 virtio-blk
-M: Kevin Wolf <kwolf@redhat.com>
 M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: hw/block/virtio-blk.c
+F: hw/block/dataplane/*
+F: hw/virtio/dataplane/*
+T: git git://github.com/stefanha/qemu.git block
 
 virtio-ccw
 M: Cornelia Huck <cornelia.huck@de.ibm.com>
@@ -691,20 +740,36 @@ S: Supported
 F: hw/s390x/virtio-ccw.[hc]
 T: git git://github.com/cohuck/qemu virtio-ccw-upstr
 
+virtio-input
+M: Gerd Hoffmann <kraxel@redhat.com>
+S: Maintained
+F: hw/input/virtio-input*.c
+F: include/hw/virtio/virtio-input.h
+
 virtio-serial
 M: Amit Shah <amit.shah@redhat.com>
 S: Supported
 F: hw/char/virtio-serial-bus.c
 F: hw/char/virtio-console.c
+F: include/hw/virtio/virtio-serial.h
+
+virtio-rng
+M: Amit Shah <amit.shah@redhat.com>
+S: Supported
+F: hw/virtio/virtio-rng.c
+F: include/hw/virtio/virtio-rng.h
+F: backends/rng*.c
 
 nvme
 M: Keith Busch <keith.busch@intel.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: hw/block/nvme*
 F: tests/nvme-test.c
 
 megasas
 M: Hannes Reinecke <hare@suse.de>
+L: qemu-block@nongnu.org
 S: Supported
 F: hw/scsi/megasas.c
 F: hw/scsi/mfi.h
@@ -722,10 +787,15 @@ S: Maintained
 F: hw/net/vmxnet*
 F: hw/scsi/vmw_pvscsi*
 
+Rocker
+M: Scott Feldman <sfeldma@gmail.com>
+M: Jiri Pirko <jiri@resnulli.us>
+S: Maintained
+F: hw/net/rocker/
+
 Subsystems
 ----------
 Audio
-M: Vassili Karpov (malc) <av1474@comtv.ru>
 M: Gerd Hoffmann <kraxel@redhat.com>
 S: Maintained
 F: audio/
@@ -734,24 +804,50 @@ F: tests/ac97-test.c
 F: tests/es1370-test.c
 F: tests/intel-hda-test.c
 
-Block
+Block layer core
 M: Kevin Wolf <kwolf@redhat.com>
-M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
-F: async.c
-F: aio-*.c
 F: block*
 F: block/
 F: hw/block/
+F: include/block/
 F: qemu-img*
 F: qemu-io*
-F: tests/image-fuzzer/
 F: tests/qemu-iotests/
 T: git git://repo.or.cz/qemu/kevin.git block
+
+Block I/O path
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: async.c
+F: aio-*.c
+F: block/io.c
+F: migration/block*
 T: git git://github.com/stefanha/qemu.git block
 
+Block Jobs
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: blockjob.c
+F: include/block/blockjob.h
+F: block/backup.c
+F: block/commit.c
+F: block/stream.h
+F: block/mirror.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
+
+Block QAPI, monitor, command line
+M: Markus Armbruster <armbru@redhat.com>
+S: Supported
+F: blockdev.c
+F: block/qapi.c
+F: qapi/block*.json
+T: git git://repo.or.cz/qemu/armbru.git block-next
+
 Character Devices
-M: Anthony Liguori <aliguori@amazon.com>
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
 F: qemu-char.c
@@ -763,6 +859,11 @@ M: Samuel Thibault <samuel.thibault@ens-lyon.org>
 S: Maintained
 F: backends/baum.c
 
+Coverity model
+M: Markus Armbruster <armbru@redhat.com>
+S: Supported
+F: scripts/coverity-model.c
+
 CPU
 M: Andreas F=C3=A4rber <afaerber@suse.de>
 S: Supported
@@ -807,7 +908,6 @@ F: audio/spiceaudio.c
 F: hw/display/qxl*
 
 Graphics
-M: Anthony Liguori <aliguori@amazon.com>
 M: Gerd Hoffmann <kraxel@redhat.com>
 S: Odd Fixes
 F: ui/
@@ -819,7 +919,6 @@ S: Odd Fixes
 F: ui/cocoa.m
 
 Main loop
-M: Anthony Liguori <aliguori@amazon.com>
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
 F: cpus.c
@@ -836,8 +935,8 @@ F: hmp-commands.hx
 T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
 
 Network device layer
-M: Anthony Liguori <aliguori@amazon.com>
 M: Stefan Hajnoczi <stefanha@redhat.com>
+M: Jason Wang <jasowang@redhat.com>
 S: Maintained
 F: net/
 T: git git://github.com/stefanha/qemu.git net
@@ -858,21 +957,33 @@ F: nbd.*
 F: qemu-nbd.c
 T: git git://github.com/bonzini/qemu.git nbd-next
 
+NUMA
+M: Eduardo Habkost <ehabkost@redhat.com>
+S: Maintained
+F: numa.c
+F: include/sysemu/numa.h
+K: numa|NUMA
+K: srat|SRAT
+T: git git://github.com/ehabkost/qemu.git numa
+
 QAPI
-M: Luiz Capitulino <lcapitulino@redhat.com>
+M: Markus Armbruster <armbru@redhat.com>
 M: Michael Roth <mdroth@linux.vnet.ibm.com>
-S: Maintained
+S: Supported
 F: qapi/
+X: qapi/*.json
 F: tests/qapi-schema/
-T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
+F: scripts/qapi*
+F: docs/qapi*
+T: git git://repo.or.cz/qemu/armbru.git qapi-next
 
 QAPI Schema
 M: Eric Blake <eblake@redhat.com>
-M: Luiz Capitulino <lcapitulino@redhat.com>
 M: Markus Armbruster <armbru@redhat.com>
 S: Supported
 F: qapi-schema.json
-T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
+F: qapi/*.json
+T: git git://repo.or.cz/qemu/armbru.git qapi-next
 
 QObject
 M: Luiz Capitulino <lcapitulino@redhat.com>
@@ -887,7 +998,6 @@ F: qga/
 T: git git://github.com/mdroth/qemu.git qga
 
 QOM
-M: Anthony Liguori <aliguori@amazon.com>
 M: Andreas F=C3=A4rber <afaerber@suse.de>
 S: Supported
 T: git git://github.com/afaerber/qemu-cpu.git qom-next
@@ -898,13 +1008,14 @@ X: qom/cpu.c
 F: tests/qom-test.c
 
 QMP
-M: Luiz Capitulino <lcapitulino@redhat.com>
-S: Maintained
+M: Markus Armbruster <armbru@redhat.com>
+S: Supported
 F: qmp.c
 F: monitor.c
 F: qmp-commands.hx
-F: QMP/
-T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
+F: docs/qmp/
+F: scripts/qmp/
+T: git git://repo.or.cz/qemu/armbru.git qapi-next
 
 SLIRP
 M: Jan Kiszka <jan.kiszka@siemens.com>
@@ -928,12 +1039,12 @@ F: scripts/checkpatch.pl
 
 Migration
 M: Juan Quintela <quintela@redhat.com>
+M: Amit Shah <amit.shah@redhat.com>
 S: Maintained
 F: include/migration/
-F: migration*
-F: savevm.c
-F: arch_init.c
-F: vmstate.c
+F: migration/
+F: scripts/vmstate-static-checker.py
+F: tests/vmstate-static-checker-data/
 
 Seccomp
 M: Eduardo Otubo <eduardo.otubo@profitbricks.com>
@@ -941,6 +1052,13 @@ S: Supported
 F: qemu-seccomp.c
 F: include/sysemu/seccomp.h
 
+Cryptography
+M: Daniel P. Berrange <berrange@redhat.com>
+S: Maintained
+F: crypto/
+F: include/crypto/
+F: tests/test-crypto-*
+
 Usermode Emulation
 ------------------
 Overall
@@ -1046,28 +1164,38 @@ Block drivers
 -------------
 VMDK
 M: Fam Zheng <famz@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: block/vmdk.c
 
 RBD
-M: Josh Durgin <josh.durgin@inktank.com>
+M: Josh Durgin <jdurgin@redhat.com>
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: block/rbd.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
 
 Sheepdog
 M: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
 M: Liu Yuan <namei.unix@gmail.com>
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
 L: sheepdog@lists.wpkg.org
 S: Supported
 F: block/sheepdog.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
 
 VHDX
 M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: block/vhdx*
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
 
 VDI
 M: Stefan Weil <sw@weilnetz.de>
+L: qemu-block@nongnu.org
 S: Maintained
 F: block/vdi.c
 
@@ -1075,26 +1203,144 @@ iSCSI
 M: Ronnie Sahlberg <ronniesahlberg@gmail.com>
 M: Paolo Bonzini <pbonzini@redhat.com>
 M: Peter Lieven <pl@kamp.de>
+L: qemu-block@nongnu.org
 S: Supported
 F: block/iscsi.c
 
 NFS
+M: Jeff Cody <jcody@redhat.com>
 M: Peter Lieven <pl@kamp.de>
+L: qemu-block@nongnu.org
 S: Maintained
 F: block/nfs.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
 
 SSH
 M: Richard W.M. Jones <rjones@redhat.com>
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: block/ssh.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
 
 ARCHIPELAGO
-M: Chrysostomos Nanakos <cnanakos@grnet.gr>
 M: Chrysostomos Nanakos <chris@include.gr>
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
 S: Maintained
 F: block/archipelago.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
+
+CURL
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/curl.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
+
+GLUSTER
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/gluster.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
+
+Null Block Driver
+M: Fam Zheng <famz@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/null.c
 
 Bootdevice
 M: Gonglei <arei.gonglei@huawei.com>
 S: Maintained
 F: bootdevice.c
+
+Quorum
+M: Alberto Garcia <berto@igalia.com>
+S: Supported
+F: block/quorum.c
+L: qemu-block@nongnu.org
+
+blkverify
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/blkverify.c
+
+bochs
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/bochs.c
+
+cloop
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/cloop.c
+
+dmg
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/dmg.c
+
+parallels
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/parallels.c
+
+qed
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/qed.c
+
+raw
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/linux-aio.c
+F: block/raw-aio.h
+F: block/raw-posix.c
+F: block/raw-win32.c
+F: block/raw_bsd.c
+F: block/win32-aio.c
+
+qcow2
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/qcow2*
+
+qcow
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/qcow.c
+
+blkdebug
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/blkdebug.c
+
+vpc
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/vpc.c
+
+vvfat
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/vvfat.c
+
+Image format fuzzer
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: tests/image-fuzzer/
diff --git a/Makefile b/Makefile
index f505202..340d9c8 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,11 @@
 # Always point to the root of the build tree (needs GNU make).
 BUILD_DIR=3D$(CURDIR)
 
+# Before including a proper config-host.mak, assume we are in the source tree
+SRC_PATH=3D.
+
+UNCHECKED_GOALS :=3D %clean TAGS cscope ctags
+
 # All following code might depend on configuration variables
 ifneq ($(wildcard config-host.mak),)
 # Put the all: rule here so that config-host.mak can contain dependencies.
@@ -38,7 +43,7 @@ config-host.mak: $(SRC_PATH)/configure
 	fi
 else
 config-host.mak:
-ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
+ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
 	@echo "Please call configure before running make!"
 	@exit 1
 endif
@@ -74,7 +79,7 @@ Makefile: ;
 configure: ;
 
 .PHONY: all clean cscope distclean dvi html info install install-doc \
-	pdf recurse-all speed test dist
+	pdf recurse-all speed test dist msi
 
 $(call set-vpath, $(SRC_PATH))
 
@@ -84,6 +89,9 @@ HELPERS-$(CONFIG_LINUX) =3D qemu-bridge-helper$(EXESUF)
 
 ifdef BUILD_DOCS
 DOCS=3Dqemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qmp-commands.txt
+ifdef CONFIG_LINUX
+DOCS+=3Dkvm_stat.1
+endif
 ifdef CONFIG_VIRTFS
 DOCS+=3Dfsdev/virtfs-proxy-helper.1
 endif
@@ -109,8 +117,9 @@ endif
 -include $(SUBDIR_DEVICES_MAK_DEP)
 
 %/config-devices.mak: default-configs/%.mak
-	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
-	@if test -f $@; then \
+	$(call quiet-command, \
+            $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > $@.tmp, "  GEN   $@.tmp")
+	$(call quiet-command, if test -f $@; then \
 	  if cmp -s $@.old $@; then \
 	    mv $@.tmp $@; \
 	    cp -p $@ $@.old; \
@@ -126,7 +135,7 @@ endif
 	 else \
 	  mv $@.tmp $@; \
 	  cp -p $@ $@.old; \
-	 fi
+	 fi, "  GEN   $@");
 
 defconfig:
 	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
@@ -197,9 +206,9 @@ ALL_SUBDIRS=3D$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
 
 recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
 
-$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h | $(BUILD_DIR)/version.lo
+$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h | $(BUILD_DIR)/version.lo
 	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.o")
-$(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h
+$(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc config-host.h
 	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.lo")
 
 Makefile: $(version-obj-y) $(version-lobj-y)
@@ -239,17 +248,17 @@ qapi-py =3D $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
 qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
-		$(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
+		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
 		"  GEN   $@")
 qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
-		$(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
+		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
 		"  GEN   $@")
 qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
-		$(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
+		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
 		"  GEN   $@")
 
 qapi-modules =3D $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
@@ -259,22 +268,22 @@ qapi-modules =3D $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
 qapi-types.c qapi-types.h :\
 $(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
-		$(gen-out-type) -o "." -b -i $<, \
+		$(gen-out-type) -o "." -b $<, \
 		"  GEN   $@")
 qapi-visit.c qapi-visit.h :\
 $(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
-		$(gen-out-type) -o "." -b -i $<, \
+		$(gen-out-type) -o "." -b $<, \
 		"  GEN   $@")
 qapi-event.c qapi-event.h :\
 $(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
-		$(gen-out-type) -o "." -b -i $<, \
+		$(gen-out-type) -o "." $<, \
 		"  GEN   $@")
 qmp-commands.h qmp-marshal.c :\
 $(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
-		$(gen-out-type) -o "." -m -i $<, \
+		$(gen-out-type) -o "." -m $<, \
 		"  GEN   $@")
 
 QGALIB_GEN=3D$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
@@ -283,15 +292,38 @@ $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
 qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
 	$(call LINK, $^)
 
+ifdef QEMU_GA_MSI_ENABLED
+QEMU_GA_MSI=3Dqemu-ga-$(ARCH).msi
+
+msi: ${QEMU_GA_MSI}
+
+$(QEMU_GA_MSI): qemu-ga.exe
+
+ifdef QEMU_GA_MSI_WITH_VSS
+$(QEMU_GA_MSI): qga/vss-win32/qga-vss.dll
+endif
+
+$(QEMU_GA_MSI): config-host.mak
+
+$(QEMU_GA_MSI):  qga/installer/qemu-ga.wxs
+	$(call quiet-command,QEMU_GA_VERSION=3D"$(QEMU_GA_VERSION)" QEMU_GA_MANUFACTURER=3D"$(QEMU_GA_MANUFACTURER)" QEMU_GA_DISTRO=3D"$(QEMU_GA_DISTRO)" \
+	wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<, "  WIXL  $@")
+else
+msi:
+	@echo MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)
+endif
+
 clean:
 # avoid old build problems by removing potentially incorrect old files
 	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
 	rm -f qemu-options.def
+	rm -f *.msi
 	find . \( -name '*.l[oa]' -o -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
 	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
 	rm -f fsdev/*.pod
 	rm -rf .libs */.libs
 	rm -f qemu-img-cmds.h
+	rm -f ui/shader/*-vert.h ui/shader/*-frag.h
 	@# May not be present in GENERATED_HEADERS
 	rm -f trace/generated-tracers-dtrace.dtrace*
 	rm -f trace/generated-tracers-dtrace.h*
@@ -313,8 +345,8 @@ qemu-%.tar.bz2:
 
 distclean: clean
 	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
-	rm -f config-all-devices.mak config-all-disas.mak
-	rm -f po/*.mo
+	rm -f config-all-devices.mak config-all-disas.mak config.status
+	rm -f po/*.mo tests/qemu-iotests/common.env
 	rm -f roms/seabios/config.mak roms/vgabios/config.mak
 	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
 	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
@@ -327,8 +359,8 @@ distclean: clean
 	rm -rf $$d || exit 1 ; \
         done
 	rm -Rf .sdk
-	if test -f pixman/config.log; then make -C pixman distclean; fi
-	if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
+	if test -f pixman/config.log; then $(MAKE) -C pixman distclean; fi
+	if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi
 
 KEYMAPS=3Dda     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
 ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
@@ -337,7 +369,7 @@ bepo    cz
 
 ifdef INSTALL_BLOBS
 BLOBS=3Dbios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
-vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
+vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
 acpi-dsdt.aml q35-acpi-dsdt.aml \
 ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
 pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
@@ -384,13 +416,8 @@ ifneq (,$(findstring qemu-ga,$(TOOLS)))
 endif
 endif
 
-install-confdir:
-	$(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
 
-install-sysconfig: install-datadir install-confdir
-	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
-
-install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig \
+install: all $(if $(BUILD_DOCS),install-doc) \
 install-datadir install-localstatedir
 ifneq ($(TOOLS),)
 	$(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
@@ -427,15 +454,36 @@ endif
 test speed: all
 	$(MAKE) -C tests/tcg $@
 
+.PHONY: ctags
+ctags:
+	rm -f $@
+	find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +
+
 .PHONY: TAGS
 TAGS:
 	rm -f $@
 	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
 
 cscope:
-	rm -f ./cscope.*
-	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
-	cscope -b
+	rm -f "$(SRC_PATH)"/cscope.*
+	find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed 's,^\./,,' > "$(SRC_PATH)/cscope.files"
+	cscope -b -i"$(SRC_PATH)/cscope.files"
+
+# opengl shader programs
+ui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert $(SRC_PATH)/scripts/shaderinclude.pl
+	@mkdir -p $(dir $@)
+	$(call quiet-command,\
+		perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
+		"  VERT  $@")
+
+ui/shader/%-frag.h: $(SRC_PATH)/ui/shader/%.frag $(SRC_PATH)/scripts/shaderinclude.pl
+	@mkdir -p $(dir $@)
+	$(call quiet-command,\
+		perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
+		"  FRAG  $@")
+
+ui/console-gl.o: $(SRC_PATH)/ui/console-gl.c \
+	ui/shader/texture-blit-vert.h ui/shader/texture-blit-frag.h
 
 # documentation
 MAKEINFO=3Dmakeinfo
@@ -490,6 +538,12 @@ qemu-nbd.8: qemu-nbd.texi
 	  $(POD2MAN) --section=3D8 --center=3D" " --release=3D" " qemu-nbd.pod > $@, \
 	  "  GEN   $@")
 
+kvm_stat.1: scripts/kvm/kvm_stat.texi
+	$(call quiet-command, \
+	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< kvm_stat.pod && \
+	  $(POD2MAN) --section=3D1 --center=3D" " --release=3D" " kvm_stat.pod > $@, \
+	  "  GEN   $@")
+
 dvi: qemu-doc.dvi qemu-tech.dvi
 html: qemu-doc.html qemu-tech.html
 info: qemu-doc.info qemu-tech.info
@@ -522,7 +576,7 @@ installer: $(INSTALLER)
 INSTDIR=3D/tmp/qemu-nsis
 
 $(INSTALLER): $(SRC_PATH)/qemu.nsi
-	make install prefix=3D${INSTDIR}
+	$(MAKE) install prefix=3D${INSTDIR}
 ifdef SIGNCODE
 	(cd ${INSTDIR}; \
          for i in *.exe; do \
@@ -556,7 +610,7 @@ endif # CONFIG_WIN
 
 # Add a dependency on the generated files, so that they are always
 # rebuilt before other object files
-ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
+ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
 Makefile: $(GENERATED_HEADERS)
 endif
 
diff --git a/Makefile.objs b/Makefile.objs
index 18fd35c..f094eff 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -2,6 +2,7 @@
 # Common libraries for tools and emulators
 stub-obj-y =3D stubs/
 util-obj-y =3D util/ qobject/ qapi/ qapi-types.o qapi-visit.o qapi-event.o
+util-obj-y +=3D crypto/
 
 #######################################################################
 # block-obj-y is code used by both qemu system emulation and qemu-img
@@ -48,15 +49,10 @@ common-obj-$(CONFIG_POSIX) +=3D os-posix.o
 
 common-obj-$(CONFIG_LINUX) +=3D fsdev/
 
-common-obj-y +=3D migration.o migration-tcp.o
-common-obj-y +=3D vmstate.o
-common-obj-y +=3D qemu-file.o qemu-file-unix.o qemu-file-stdio.o
-common-obj-$(CONFIG_RDMA) +=3D migration-rdma.o
+common-obj-y +=3D migration/
 common-obj-y +=3D qemu-char.o #aio.o
-common-obj-y +=3D block-migration.o
-common-obj-y +=3D page_cache.o xbzrle.o
-
-common-obj-$(CONFIG_POSIX) +=3D migration-exec.o migration-unix.o migration-fd.o
+common-obj-y +=3D page_cache.o
+common-obj-y +=3D qjson.o
 
 common-obj-$(CONFIG_SPICE) +=3D spice-qemu-char.o
 
@@ -81,6 +77,8 @@ common-obj-$(CONFIG_SECCOMP) +=3D qemu-seccomp.o
 
 common-obj-$(CONFIG_SMARTCARD_NSS) +=3D $(libcacard-y)
 
+common-obj-$(CONFIG_FDT) +=3D device_tree.o
+
 ######################################################################
 # qapi
 
diff --git a/Makefile.target b/Makefile.target
index e9ff1ee..3e7aafd 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -1,5 +1,7 @@
 # -*- Mode: makefile -*-
 
+BUILD_DIR=3F=3D$(CURDIR)/..
+
 include ../config-host.mak
 include config-target.mak
 include config-devices.mak
@@ -83,7 +85,7 @@ all: $(PROGS) stap
 #########################################################
 # cpu emulator library
 obj-y =3D exec.o translate-all.o cpu-exec.o
-obj-y +=3D tcg/tcg.o tcg/optimize.o
+obj-y +=3D tcg/tcg.o tcg/tcg-op.o tcg/optimize.o
 obj-$(CONFIG_TCG_INTERPRETER) +=3D tci.o
 obj-$(CONFIG_TCG_INTERPRETER) +=3D disas/tci.o
 obj-y +=3D fpu/softfloat.o
@@ -129,12 +131,12 @@ ifdef CONFIG_SOFTMMU
 obj-y +=3D arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o
 obj-y +=3D qtest.o bootdevice.o
 obj-y +=3D hw/
-obj-$(CONFIG_FDT) +=3D device_tree.o
 obj-$(CONFIG_KVM) +=3D kvm-all.o
-obj-y +=3D memory.o savevm.o cputlb.o
+obj-y +=3D memory.o cputlb.o
 obj-y +=3D memory_mapping.o
 obj-y +=3D dump.o
-LIBS+=3D$(libs_softmmu)
+obj-y +=3D migration/ram.o migration/savevm.o
+LIBS :=3D $(libs_softmmu) $(LIBS)
 
 # xen support
 obj-$(CONFIG_XEN) +=3D xen-common.o
@@ -175,9 +177,15 @@ all-obj-y +=3D $(common-obj-y)
 all-obj-y +=3D $(target-obj-y)
 all-obj-$(CONFIG_SOFTMMU) +=3D $(block-obj-y)
 
+$(QEMU_PROG_BUILD): config-devices.mak
+
 # build either PROG or PROGW
 $(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
-	$(call LINK,$^)
+	$(call LINK, $(filter-out %.mak, $^))
+ifdef CONFIG_DARWIN
+	$(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $@,"  REZ   $(TARGET_DIR)$@")
+	$(call quiet-command,SetFile -a C $@,"  SETFILE $(TARGET_DIR)$@")
+endif
 
 gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
 	$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
diff --git a/VERSION b/VERSION
index c043eea..005119b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.2.1
+2.4.1
diff --git a/aio-posix.c b/aio-posix.c


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

From xen-changelog-bounces@lists.xen.org Tue Nov 24 13:44:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Nov 2015 13:44: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 1a1DtU-0006Qj-BP; Tue, 24 Nov 2015 13:44:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1DtS-0006QZ-EL
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 13:44:27 +0000
Content-Length: 148493
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	FD/C9-21201-8B964565; Tue, 24 Nov 2015 13:44:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448372661!6135306!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.8 required=7.0 tests=BODY_RANDOM_LONG,
	MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60803 invoked from network); 24 Nov 2015 13:44:22 -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;
	24 Nov 2015 13:44:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1DtN-0001w1-64
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 13:44:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1DtM-0004cO-Tr
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 13:44:21 +0000
Date: Tue, 24 Nov 2015 13:44:20 +0000
Message-Id: <E1a1DtM-0004cO-Tr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen master] Merge remote-tracking branch
	'qemu-xen/staging' into qemu-xen-4.7
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============9041100416986667532=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============9041100416986667532==
Content-Length: 151034
Content-Transfer-Encoding: quoted-printable

=3D=3D=3D This changeset includes merge from high-traffic branch =3D=3D=3D
Commits on that branch are not reported individually.

commit 3fb401edbd8e9741c611bfddf6a2032ca91f55ed
Merge: a44c2800d990252b3632bbb35af34ec5ff99e2f1 816609b2841297925a223ec377c336360e044ee5
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Nov 23 16:55:36 2015 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Mon Nov 23 16:55:36 2015 +0000

    Merge remote-tracking branch 'qemu-xen/staging' into qemu-xen-4.7

 .gitignore                                         |   12 +-
 .travis.yml                                        |    3 +
 LICENSE                                            |    2 +-
 MAINTAINERS                                        |  322 +-
 Makefile                                           |  114 +-
 Makefile.objs                                      |   14 +-
 Makefile.target                                    |   18 +-
 VERSION                                            |    2 +-
 aio-posix.c                                        |  109 +-
 aio-win32.c                                        |   60 +-
 arch_init.c                                        | 1118 ---
 async.c                                            |  105 +-
 audio/Makefile.objs                                |    4 -
 audio/alsaaudio.c                                  |  195 +-
 audio/audio.c                                      |   35 +-
 audio/audio_int.h                                  |    7 +-
 audio/audio_template.h                             |   43 +-
 audio/coreaudio.c                                  |   46 +-
 audio/dsound_template.h                            |   51 +-
 audio/dsoundaudio.c                                |  238 +-
 audio/esdaudio.c                                   |  557 --
 audio/fmodaudio.c                                  |  685 --
 audio/noaudio.c                                    |    4 +-
 audio/ossaudio.c                                   |  141 +-
 audio/paaudio.c                                    |  105 +-
 audio/sdlaudio.c                                   |   10 +-
 audio/spiceaudio.c                                 |    6 +-
 audio/wavaudio.c                                   |   42 +-
 audio/wavcapture.c                                 |    1 +
 audio/winwaveaudio.c                               |  717 --
 backends/hostmem-file.c                            |    2 +-
 backends/hostmem.c                                 |   45 +-
 backends/rng-egd.c                                 |   11 +-
 backends/rng-random.c                              |   12 +-
 backends/rng.c                                     |    2 +-
 backends/tpm.c                                     |   29 +-
 balloon.c                                          |   65 +-
 block-migration.c                                  |  892 --
 block.c                                            | 3465 ++------
 block/Makefile.objs                                |   10 +-
 block/accounting.c                                 |   13 +-
 block/archipelago.c                                |    6 +-
 block/backup.c                                     |  188 +-
 block/blkdebug.c                                   |  125 +-
 block/blkverify.c                                  |    4 +-
 block/block-backend.c                              |  303 +-
 block/commit.c                                     |    3 +-
 block/curl.c                                       |   16 +-
 block/dmg.c                                        |  503 +-
 block/io.c                                         | 2610 ++++++
 block/iscsi.c                                      |  204 +-
 block/linux-aio.c                                  |   99 +-
 block/mirror.c                                     |  145 +-
 block/nbd-client.c                                 |  129 +-
 block/nbd-client.h                                 |   35 +-
 block/nbd.c                                        |   50 +-
 block/nfs.c                                        |    9 +-
 block/null.c                                       |   66 +-
 block/parallels.c                                  |  679 ++-
 block/qapi.c                                       |  116 +-
 block/qcow.c                                       |  121 +-
 block/qcow2-cache.c                                |  172 +-
 block/qcow2-cluster.c                              |  169 +-
 block/qcow2-refcount.c                             |  675 +-
 block/qcow2-snapshot.c                             |    9 +-
 block/qcow2.c                                      |  281 +-
 block/qcow2.h                                      |   67 +-
 block/qed.c                                        |   13 +-
 block/qed.h                                        |    1 -
 block/quorum.c                                     |  102 +-
 block/raw-aio.h                                    |    2 +-
 block/raw-posix.c                                  |  454 +-
 block/raw-win32.c                                  |    3 +-
 block/raw_bsd.c                                    |   76 +-
 block/rbd.c                                        |   74 +-
 block/sheepdog.c                                   |  363 +-
 block/snapshot.c                                   |   19 +-
 block/ssh.c                                        |    4 +-
 block/stream.c                                     |    5 +-
 block/throttle-groups.c                            |  501 ++
 block/vdi.c                                        |   36 +-
 block/vhdx-log.c                                   |    1 +
 block/vhdx.c                                       |   41 +-
 block/vhdx.h                                       |    3 +-
 block/vmdk.c                                       |  227 +-
 block/vpc.c                                        |  165 +-
 block/vvfat.c                                      |   46 +-
 block/write-threshold.c                            |  125 +
 blockdev-nbd.c                                     |   34 +-
 blockdev.c                                         |  878 ++-
 blockjob.c                                         |   52 +-
 bootdevice.c                                       |  113 +-
 bsd-user/elfload.c                                 |   11 +-
 bsd-user/main.c                                    |   19 +-
 configure                                          |  793 ++-
 coroutine-ucontext.c                               |   69 +-
 cpu-exec.c                                         |   98 +-
 cpus.c                                             |  206 +-
 cputlb.c                                           |   45 +-
 crypto/Makefile.objs                               |    5 +
 crypto/aes.c                                       | 1652 ++++
 crypto/cipher-builtin.c                            |  400 +
 crypto/cipher-gcrypt.c                             |  195 +
 crypto/cipher-nettle.c                             |  245 +
 crypto/cipher.c                                    |   74 +
 crypto/desrfb.c                                    |  415 +
 crypto/hash.c                                      |  200 +
 crypto/init.c                                      |  150 +
 default-configs/aarch64-softmmu.mak                |    2 +-
 default-configs/alpha-softmmu.mak                  |    2 -
 default-configs/arm-softmmu.mak                    |   14 +
 default-configs/i386-softmmu.mak                   |   10 +-
 default-configs/lm32-softmmu.mak                   |    2 +-
 default-configs/microblazeel-softmmu.mak           |   10 +-
 default-configs/mips-softmmu.mak                   |   10 +-
 default-configs/mips64-softmmu.mak                 |    6 +-
 default-configs/mips64el-softmmu.mak               |    6 +-
 default-configs/mipsel-softmmu.mak                 |   10 +-
 default-configs/pci.mak                            |    7 +
 default-configs/ppc-softmmu.mak                    |    4 +-
 default-configs/ppc64-softmmu.mak                  |   10 +-
 default-configs/ppcemb-softmmu.mak                 |    3 -
 default-configs/s390x-softmmu.mak                  |    3 +
 default-configs/sparc64-softmmu.mak                |    2 -
 default-configs/usb.mak                            |    1 +
 default-configs/x86_64-softmmu.mak                 |   11 +-
 device-hotplug.c                                   |    9 +-
 device_tree.c                                      |   22 +-
 disas.c                                            |  133 +-
 disas/arm-a64.cc                                   |   31 +-
 disas/arm.c                                        |  128 -
 disas/cris.c                                       |   19 +-
 disas/libvixl/README                               |    2 +-
 disas/libvixl/a64/assembler-a64.h                  |  290 +-
 disas/libvixl/a64/constants-a64.h                  |   61 +-
 disas/libvixl/a64/decoder-a64.h                    |    2 +-
 disas/libvixl/a64/disasm-a64.cc                    |  142 +-
 disas/libvixl/a64/disasm-a64.h                     |   48 +-
 disas/libvixl/a64/instructions-a64.cc              |   63 +
 disas/libvixl/a64/instructions-a64.h               |  110 +-
 disas/libvixl/globals.h                            |    2 +-
 disas/libvixl/utils.cc                             |   13 +
 disas/libvixl/utils.h                              |   14 +-
 disas/microblaze.c                                 |   13 +-
 disas/mips.c                                       |   25 +-
 disas/s390.c                                       |   35 -
 disas/sh4.c                                        |    2 +-
 disas/sparc.c                                      |   32 -
 disas/tci.c                                        |    1 +
 dma-helpers.c                                      |   21 +-
 docs/aio_notify.promela                            |   77 +-
 docs/aio_notify_accept.promela                     |  152 +
 docs/aio_notify_bug.promela                        |  140 +
 docs/atomics.txt                                   |    4 +-
 docs/bitmaps.md                                    |  352 +
 docs/memory-hotplug.txt                            |   93 +
 docs/memory.txt                                    |   74 +-
 docs/migration.txt                                 |   11 +-
 docs/multi-thread-compression.txt                  |  149 +
 docs/multiseat.txt                                 |   55 +-
 docs/pci_expander_bridge.txt                       |   58 +
 docs/qapi-code-gen.txt                             |  497 +-
 docs/qmp/qmp-events.txt                            |   53 +-
 docs/qmp/qmp-spec.txt                              |  115 +-
 docs/rcu.txt                                       |  390 +
 docs/specs/acpi_mem_hotplug.txt                    |   58 +-
 docs/specs/edu.txt                                 |  110 +
 docs/specs/fw_cfg.txt                              |  226 +
 docs/specs/pci-ids.txt                             |    4 +
 docs/specs/ppc-spapr-hotplug.txt                   |  305 +
 docs/specs/rocker.txt                              | 1014 +++
 docs/writing-qmp-commands.txt                      |    2 +-
 docs/xbzrle.txt                                    |    8 +
 dtc                                                |    2 +-
 dump.c                                             |   13 +-
 exec.c                                             | 1328 +++-
 fpu/softfloat-macros.h                             |   86 +-
 fpu/softfloat-specialize.h                         |  267 +-
 fpu/softfloat.c                                    | 1787 +++--
 fsdev/virtfs-proxy-helper.c                        |   25 +-
 gdb-xml/s390-vx.xml                                |   59 +
 gdbstub.c                                          |   64 +-
 hmp-commands.hx                                    |  258 +-
 hmp.c                                              |  836 ++-
 hmp.h                                              |   20 +-
 hw/9pfs/virtio-9p-coth.c                           |   29 +-
 hw/9pfs/virtio-9p-coth.h                           |    4 +-
 hw/9pfs/virtio-9p-device.c                         |    8 +-
 hw/9pfs/virtio-9p-handle.c                         |    4 +-
 hw/9pfs/virtio-9p-local.c                          |   57 +-
 hw/9pfs/virtio-9p-posix-acl.c                      |    2 +-
 hw/9pfs/virtio-9p-proxy.c                          |   26 +-
 hw/9pfs/virtio-9p-synth.c                          |    3 +-
 hw/9pfs/virtio-9p.c                                |   27 +-
 hw/9pfs/virtio-9p.h                                |   22 +-
 hw/Makefile.objs                                   |    1 +
 hw/acpi/Makefile.objs                              |    8 +-
 hw/acpi/aml-build.c                                | 1217 +++
 hw/acpi/bios-linker-loader.c                       |  159 +
 hw/acpi/core.c                                     |   23 +-
 hw/acpi/cpu_hotplug.c                              |    3 +-
 hw/acpi/ich9.c                                     |  199 +-
 hw/acpi/memory_hotplug.c                           |  101 +-
 hw/acpi/pcihp.c                                    |   28 +-
 hw/acpi/piix4.c                                    |   64 +-
 hw/acpi/tco.c                                      |  264 +
 hw/alpha/dp264.c                                   |   22 +-
 hw/alpha/typhoon.c                                 |   18 +-
 hw/arm/Makefile.objs                               |    5 +
 hw/arm/allwinner-a10.c                             |    8 +
 hw/arm/armv7m.c                                    |   39 +-
 hw/arm/boot.c                                      |  208 +-
 hw/arm/cubieboard.c                                |    5 +-
 hw/arm/digic.c                                     |    6 +
 hw/arm/digic_boards.c                              |   10 +-
 hw/arm/exynos4210.c                                |   13 +-
 hw/arm/highbank.c                                  |   35 +-
 hw/arm/integratorcp.c                              |  130 +-
 hw/arm/kzm.c                                       |    3 +-
 hw/arm/musicpal.c                                  |   11 +-
 hw/arm/netduino2.c                                 |   57 +
 hw/arm/nseries.c                                   |   16 +-
 hw/arm/omap1.c                                     |   78 +-
 hw/arm/omap2.c                                     |   18 +-
 hw/arm/omap_sx1.c                                  |    2 +-
 hw/arm/pxa2xx.c                                    |  260 +-
 hw/arm/pxa2xx_gpio.c                               |    2 +-
 hw/arm/pxa2xx_pic.c                                |    2 +-
 hw/arm/realview.c                                  |   21 +-
 hw/arm/spitz.c                                     |    3 +
 hw/arm/stellaris.c                                 |   29 +-
 hw/arm/stm32f205_soc.c                             |  160 +
 hw/arm/strongarm.c                                 |   11 +-
 hw/arm/sysbus-fdt.c                                |  247 +
 hw/arm/versatilepb.c                               |   39 +-
 hw/arm/vexpress.c                                  |  176 +-
 hw/arm/virt-acpi-build.c                           |  697 ++
 hw/arm/virt.c                                      |  489 +-
 hw/arm/xilinx_zynq.c                               |   23 +-
 hw/arm/xlnx-ep108.c                                |   82 +
 hw/arm/xlnx-zynqmp.c                               |  272 +
 hw/audio/ac97.c                                    |    5 +-
 hw/audio/es1370.c                                  |    5 +-
 hw/audio/gus.c                                     |   20 +-
 hw/audio/intel-hda.c                               |    6 +-
 hw/audio/pcspk.c                                   |    2 +-
 hw/audio/sb16.c                                    |    7 -
 hw/block/block.c                                   |   24 +
 hw/block/dataplane/virtio-blk.c                    |   24 +-
 hw/block/fdc.c                                     |  351 +-
 hw/block/hd-geometry.c                             |   10 +-
 hw/block/m25p80.c                                  |    6 +-
 hw/block/nand.c                                    |    2 +-
 hw/block/nvme.c                                    |   51 +-
 hw/block/nvme.h                                    |    3 +-
 hw/block/onenand.c                                 |    8 +-
 hw/block/pflash_cfi01.c                            |  208 +-
 hw/block/pflash_cfi02.c                            |    5 +-
 hw/block/virtio-blk.c                              |  522 +-
 hw/block/xen_disk.c                                |   27 +-
 hw/bt/sdp.c                                        |    2 +-
 hw/char/Makefile.objs                              |    1 +
 hw/char/cadence_uart.c                             |  142 +-
 hw/char/digic-uart.c                               |    3 +
 hw/char/etraxfs_ser.c                              |    3 +
 hw/char/lm32_juart.c                               |    3 +
 hw/char/lm32_uart.c                                |    3 +
 hw/char/milkymist-uart.c                           |    3 +
 hw/char/omap_uart.c                                |    3 +-
 hw/char/pl011.c                                    |    3 +
 hw/char/sclpconsole-lm.c                           |    1 +
 hw/char/sclpconsole.c                              |    1 +
 hw/char/serial-isa.c                               |   23 +-
 hw/char/serial-pci.c                               |   43 +-
 hw/char/serial.c                                   |  119 +-
 hw/char/spapr_vty.c                                |   22 +-
 hw/char/stm32f2xx_usart.c                          |  232 +
 hw/char/virtio-console.c                           |   10 +
 hw/char/virtio-serial-bus.c                        |  108 +-
 hw/char/xilinx_uartlite.c                          |    3 +
 hw/core/Makefile.objs                              |    2 +-
 hw/core/fw-path-provider.c                         |    2 +-
 hw/core/loader.c                                   |   70 +-
 hw/core/machine.c                                  |  132 +-
 hw/core/nmi.c                                      |   22 +-
 hw/core/platform-bus.c                             |    1 -
 hw/core/ptimer.c                                   |    4 +-
 hw/core/qdev-properties-system.c                   |  155 +-
 hw/core/qdev-properties.c                          |   95 +-
 hw/core/qdev.c                                     |   95 +-
 hw/core/sysbus.c                                   |   35 +-
 hw/cris/axis_dev88.c                               |    5 +-
 hw/display/Makefile.objs                           |    7 +-
 hw/display/blizzard.c                              |    1 -
 hw/display/cg3.c                                   |    7 +-
 hw/display/cirrus_vga.c                            |   61 +-
 hw/display/exynos4210_fimd.c                       |   22 +-
 hw/display/framebuffer.c                           |   73 +-
 hw/display/framebuffer.h                           |   44 +-
 hw/display/g364fb.c                                |    4 +-
 hw/display/milkymist-vgafb.c                       |   15 +-
 hw/display/omap_dss.c                              |   15 +-
 hw/display/omap_lcdc.c                             |   12 +-
 hw/display/pl110.c                                 |   13 +-
 hw/display/pxa2xx_lcd.c                            |   29 +-
 hw/display/qxl-logger.c                            |   16 +-
 hw/display/qxl-render.c                            |    2 +
 hw/display/qxl.c                                   |  162 +-
 hw/display/qxl.h                                   |    6 +
 hw/display/sm501.c                                 |    2 +
 hw/display/tc6393xb.c                              |    4 +-
 hw/display/tcx.c                                   |    7 +-
 hw/display/vga-isa.c                               |    2 +-
 hw/display/vga-pci.c                               |  178 +-
 hw/display/vga.c                                   |   71 +-
 hw/display/vga_int.h                               |    9 +
 hw/display/virtio-gpu-pci.c                        |   76 +
 hw/display/virtio-gpu.c                            |  919 ++
 hw/display/virtio-vga.c                            |  182 +
 hw/display/vmware_vga.c                            |    8 +-
 hw/display/xenfb.c                                 |    5 +
 hw/dma/omap_dma.c                                  |    8 +-
 hw/dma/pl080.c                                     |   20 +-
 hw/dma/pl330.c                                     |    6 +-
 hw/dma/rc4030.c                                    |  462 +-
 hw/dma/sun4m_iommu.c                               |    3 +-
 hw/dma/xilinx_axidma.c                             |    1 -
 hw/gpio/max7310.c                                  |    2 +-
 hw/gpio/omap_gpio.c                                |   16 +-
 hw/gpio/pl061.c                                    |    2 +-
 hw/gpio/zaurus.c                                   |    2 +-
 hw/i2c/Makefile.objs                               |    2 +-
 hw/i2c/omap_i2c.c                                  |   10 +-
 hw/i2c/smbus_ich9.c                                |    5 +-
 hw/i386/Makefile.objs                              |    8 +-
 hw/i386/acpi-build.c                               | 1721 ++--
 hw/i386/acpi-defs.h                                |  368 -
 hw/i386/acpi-dsdt-cpu-hotplug.dsl                  |   17 +-
 hw/i386/acpi-dsdt-isa.dsl                          |   11 -
 hw/i386/acpi-dsdt-mem-hotplug.dsl                  |   49 +-
 hw/i386/acpi-dsdt-pci-crs.dsl                      |   92 -
 hw/i386/acpi-dsdt.dsl                              |   46 -
 hw/i386/acpi-dsdt.hex.generated                    |  714 +--
 hw/i386/bios-linker-loader.c                       |  157 -
 hw/i386/bios-linker-loader.h                       |   27 -
 hw/i386/intel_iommu.c                              |    6 +-
 hw/i386/kvm/clock.c                                |    3 +-
 hw/i386/kvm/i8254.c                                |    2 +-
 hw/i386/kvm/pci-assign.c                           |   63 +-
 hw/i386/multiboot.c                                |   42 +-
 hw/i386/pc.c                                       |  578 +-
 hw/i386/pc_piix.c                                  |  745 +-
 hw/i386/pc_q35.c                                   |  273 +-
 hw/i386/pc_sysfw.c                                 |    4 +-
 hw/i386/q35-acpi-dsdt.dsl                          |   19 -
 hw/i386/q35-acpi-dsdt.hex.generated                |  662 +--
 hw/i386/smbios.c                                   |   32 +-
 hw/i386/ssdt-mem.dsl                               |   77 -
 hw/i386/ssdt-mem.hex.generated                     |  213 -
 hw/i386/ssdt-misc.dsl                              |  122 -
 hw/i386/ssdt-misc.hex.generated                    |  399 -
 hw/i386/ssdt-pcihp.dsl                             |  100 -
 hw/i386/ssdt-pcihp.hex.generated                   |  251 -
 hw/i386/ssdt-proc.dsl                              |   63 -
 hw/i386/ssdt-proc.hex.generated                    |  134 -
 hw/i386/ssdt-tpm.dsl                               |   43 -
 hw/i386/ssdt-tpm.hex.generated                     |   95 -
 hw/ide/ahci.c                                      |  660 +-
 hw/ide/ahci.h                                      |   58 +-
 hw/ide/atapi.c                                     |  131 +-
 hw/ide/cmd646.c                                    |    8 +-
 hw/ide/core.c                                      |  209 +-
 hw/ide/ich.c                                       |   14 +-
 hw/ide/internal.h                                  |   24 +-
 hw/ide/isa.c                                       |    7 +-
 hw/ide/macio.c                                     |  476 +-
 hw/ide/pci.c                                       |  142 +-
 hw/ide/pci.h                                       |   12 +-
 hw/ide/piix.c                                      |   13 +-
 hw/ide/qdev.c                                      |    9 +-
 hw/ide/via.c                                       |    9 +-
 hw/input/Makefile.objs                             |    6 +
 hw/input/adb.c                                     |   22 +-
 hw/input/hid.c                                     |   53 +-
 hw/input/lm832x.c                                  |    2 +-
 hw/input/milkymist-softusb.c                       |   19 +-
 hw/input/pckbd.c                                   |   22 +-
 hw/input/ps2.c                                     |   27 +-
 hw/input/virtio-input-hid.c                        |  514 ++
 hw/input/virtio-input-host.c                       |  189 +
 hw/input/virtio-input.c                            |  293 +
 hw/intc/Makefile.objs                              |    1 +
 hw/intc/allwinner-a10-pic.c                        |    8 +-
 hw/intc/apic.c                                     |    9 +-
 hw/intc/apic_common.c                              |   42 +-
 hw/intc/arm_gic.c                                  |  470 +-
 hw/intc/arm_gic_common.c                           |   43 +-
 hw/intc/arm_gic_kvm.c                              |   99 +-
 hw/intc/arm_gicv2m.c                               |  192 +
 hw/intc/armv7m_nvic.c                              |   19 +-
 hw/intc/etraxfs_pic.c                              |    8 +-
 hw/intc/exynos4210_gic.c                           |    7 +-
 hw/intc/gic_internal.h                             |   29 +-
 hw/intc/i8259.c                                    |    4 +-
 hw/intc/lm32_pic.c                                 |    4 +-
 hw/intc/omap_intc.c                                |    9 +-
 hw/intc/openpic.c                                  |  286 +-
 hw/intc/openpic_kvm.c                              |    1 -
 hw/intc/s390_flic.c                                |    6 +-
 hw/intc/xics.c                                     |   20 +-
 hw/intc/xics_kvm.c                                 |   13 +-
 hw/ipack/tpci200.c                                 |    6 +-
 hw/isa/i82378.c                                    |   16 +-
 hw/isa/isa-bus.c                                   |   41 +-
 hw/isa/lpc_ich9.c                                  |   76 +-
 hw/isa/pc87312.c                                   |    4 +
 hw/isa/piix4.c                                     |   16 +-
 hw/isa/vt82c686.c                                  |  119 +-
 hw/lm32/lm32_boards.c                              |   20 +-
 hw/lm32/lm32_hwsetup.h                             |    3 +-
 hw/lm32/milkymist-hw.h                             |    4 +-
 hw/lm32/milkymist.c                                |   11 +-
 hw/m68k/an5206.c                                   |    3 +-
 hw/m68k/dummy_m68k.c                               |   10 +-
 hw/m68k/mcf5208.c                                  |    3 +-
 hw/m68k/mcf_intc.c                                 |   14 +
 hw/mem/pc-dimm.c                                   |  150 +-
 hw/microblaze/boot.c                               |   20 +-
 hw/microblaze/petalogix_ml605_mmu.c                |   28 +-
 hw/microblaze/petalogix_s3adsp1800_mmu.c           |   17 +-
 hw/mips/Makefile.objs                              |    3 +-
 hw/mips/gt64xxx_pci.c                              |   95 +-
 hw/mips/mips_fulong2e.c                            |   16 +-
 hw/mips/mips_jazz.c                                |  100 +-
 hw/mips/mips_malta.c                               |   41 +-
 hw/mips/mips_mipssim.c                             |    5 +-
 hw/mips/mips_r4k.c                                 |   29 +-
 hw/misc/Makefile.objs                              |    7 +-
 hw/misc/applesmc.c                                 |    5 +-
 hw/misc/arm_integrator_debug.c                     |    2 +-
 hw/misc/edu.c                                      |  408 +
 hw/misc/ivshmem.c                                  |    3 +-
 hw/misc/macio/cuda.c                               |    9 +-
 hw/misc/macio/mac_dbdma.c                          |   12 +-
 hw/misc/macio/macio.c                              |  112 +-
 hw/misc/milkymist-pfpu.c                           |    2 +-
 hw/misc/omap_gpmc.c                                |    3 +-
 hw/misc/omap_l4.c                                  |    3 +-
 hw/misc/omap_sdrc.c                                |    3 +-
 hw/misc/omap_tap.c                                 |    3 +-
 hw/misc/pci-testdev.c                              |    6 +-
 hw/misc/slavio_misc.c                              |    5 +-
 hw/misc/stm32f2xx_syscfg.c                         |  160 +
 hw/misc/vfio.c                                     | 4472 ----------
 hw/misc/zynq_slcr.c                                |    8 +-
 hw/net/Makefile.objs                               |    5 +
 hw/net/allwinner_emac.c                            |    8 -
 hw/net/cadence_gem.c                               |  106 +-
 hw/net/dp8393x.c                                   |  401 +-
 hw/net/e1000.c                                     |   54 +-
 hw/net/eepro100.c                                  |   25 +-
 hw/net/etraxfs_eth.c                               |   19 -
 hw/net/fsl_etsec/etsec.c                           |   31 +-
 hw/net/fsl_etsec/etsec.h                           |    4 +-
 hw/net/fsl_etsec/rings.c                           |   17 +-
 hw/net/lan9118.c                                   |   14 -
 hw/net/lance.c                                     |   12 +-
 hw/net/mcf_fec.c                                   |  109 +-
 hw/net/milkymist-minimac2.c                        |   41 +-
 hw/net/mipsnet.c                                   |   17 +-
 hw/net/ne2000-isa.c                                |    8 -
 hw/net/ne2000.c                                    |   14 +-
 hw/net/opencores_eth.c                             |    5 -
 hw/net/pcnet-pci.c                                 |   64 +-
 hw/net/pcnet.c                                     |   48 +-
 hw/net/pcnet.h                                     |    4 +-
 hw/net/rocker/qmp-norocker.c                       |   50 +
 hw/net/rocker/rocker.c                             | 1553 ++++
 hw/net/rocker/rocker.h                             |   84 +
 hw/net/rocker/rocker_desc.c                        |  377 +
 hw/net/rocker/rocker_desc.h                        |   53 +
 hw/net/rocker/rocker_fp.c                          |  263 +
 hw/net/rocker/rocker_fp.h                          |   53 +
 hw/net/rocker/rocker_hw.h                          |  493 ++
 hw/net/rocker/rocker_of_dpa.c                      | 2630 ++++++
 hw/net/rocker/rocker_of_dpa.h                      |   22 +
 hw/net/rocker/rocker_tlv.h                         |  244 +
 hw/net/rocker/rocker_world.c                       |  106 +
 hw/net/rocker/rocker_world.h                       |   60 +
 hw/net/rtl8139.c                                   |  124 +-
 hw/net/smc91c111.c                                 |    8 -
 hw/net/spapr_llan.c                                |   26 +-
 hw/net/stellaris_enet.c                            |   22 +-
 hw/net/vhost_net.c                                 |   85 +-
 hw/net/virtio-net.c                                |  377 +-
 hw/net/vmxnet3.c                                   |  106 +-
 hw/net/vmxnet_rx_pkt.c                             |   19 +-
 hw/net/vmxnet_rx_pkt.h                             |   20 +-
 hw/net/xen_nic.c                                   |   41 +-
 hw/net/xgmac.c                                     |   16 +-
 hw/net/xilinx_axienet.c                            |   27 +-
 hw/net/xilinx_ethlite.c                            |    9 +-
 hw/nvram/fw_cfg.c                                  |  280 +-
 hw/nvram/spapr_nvram.c                             |   19 +-
 hw/pci-bridge/Makefile.objs                        |    6 +-
 hw/pci-bridge/dec.c                                |    5 +-
 hw/pci-bridge/i82801b11.c                          |   21 -
 hw/pci-bridge/pci_bridge_dev.c                     |  131 +-
 hw/pci-bridge/pci_expander_bridge.c                |  286 +
 hw/pci-host/Makefile.objs                          |    1 +
 hw/pci-host/apb.c                                  |    9 +-
 hw/pci-host/bonito.c                               |   12 +-
 hw/pci-host/gpex.c                                 |  154 +
 hw/pci-host/grackle.c                              |    5 +-
 hw/pci-host/pam.c                                  |   20 -
 hw/pci-host/piix.c                                 |  124 +-
 hw/pci-host/ppce500.c                              |  117 +-
 hw/pci-host/prep.c                                 |   12 +-
 hw/pci-host/q35.c                                  |  149 +-
 hw/pci-host/uninorth.c                             |   25 +-
 hw/pci-host/versatile.c                            |   16 +-
 hw/pci/Makefile.objs                               |    2 -
 hw/pci/msi.c                                       |   23 +-
 hw/pci/msix.c                                      |   32 +-
 hw/pci/pci-hotplug-old.c                           |  343 -
 hw/pci/pci-stub.c                                  |   17 +-
 hw/pci/pci.c                                       |  313 +-
 hw/pci/pcie.c                                      |    5 +-
 hw/pci/pcie_aer.c                                  |   57 +-
 hw/pci/pcie_host.c                                 |   16 +-
 hw/pci/shpc.c                                      |   24 +-
 hw/pci/slotid_cap.c                                |    2 +-
 hw/pcmcia/pxa2xx.c                                 |    6 +-
 hw/ppc/Makefile.objs                               |    2 +-
 hw/ppc/e500.c                                      |   75 +-
 hw/ppc/e500.h                                      |    5 +
 hw/ppc/e500plat.c                                  |    5 +
 hw/ppc/mac_newworld.c                              |   58 +-
 hw/ppc/mac_oldworld.c                              |   19 +-
 hw/ppc/mpc8544ds.c                                 |   11 +
 hw/ppc/ppc.c                                       |  172 +-
 hw/ppc/ppc405_boards.c                             |    2 +-
 hw/ppc/ppc440_bamboo.c                             |    7 +-
 hw/ppc/ppce500_spin.c                              |    2 +-
 hw/ppc/prep.c                                      |  177 +-
 hw/ppc/spapr.c                                     |  770 ++-
 hw/ppc/spapr_drc.c                                 |  745 ++
 hw/ppc/spapr_events.c                              |  349 +-
 hw/ppc/spapr_hcall.c                               |   41 +-
 hw/ppc/spapr_iommu.c                               |  101 +-
 hw/ppc/spapr_pci.c                                 | 1053 +++-
 hw/ppc/spapr_pci_vfio.c                            |  182 +-
 hw/ppc/spapr_rtas.c                                |  446 +-
 hw/ppc/spapr_rtc.c                                 |  211 +
 hw/ppc/spapr_vio.c                                 |   67 +-
 hw/ppc/virtex_ml507.c                              |    9 +-
 hw/s390x/Makefile.objs                             |    1 +
 hw/s390x/css.c                                     |  113 +-
 hw/s390x/css.h                                     |    2 +
 hw/s390x/event-facility.c                          |    2 +-
 hw/s390x/ipl.c                                     |  221 +-
 hw/s390x/ipl.h                                     |   25 +
 hw/s390x/s390-pci-bus.c                            |  596 ++
 hw/s390x/s390-pci-bus.h                            |  251 +
 hw/s390x/s390-pci-inst.c                           |  839 ++
 hw/s390x/s390-pci-inst.h                           |  289 +
 hw/s390x/s390-virtio-bus.c                         |  242 +-
 hw/s390x/s390-virtio-bus.h                         |   40 +-
 hw/s390x/s390-virtio-ccw.c                         |  117 +-
 hw/s390x/s390-virtio.c                             |   79 +-
 hw/s390x/s390-virtio.h                             |   10 +-
 hw/s390x/sclp.c                                    |   19 +-
 hw/s390x/sclpcpu.c                                 |    2 +
 hw/s390x/sclpquiesce.c                             |    1 +
 hw/s390x/virtio-ccw.c                              |  674 +-
 hw/s390x/virtio-ccw.h                              |   32 +-
 hw/scsi/esp-pci.c                                  |   28 +-
 hw/scsi/lsi53c895a.c                               |   21 +-
 hw/scsi/megasas.c                                  |   86 +-
 hw/scsi/scsi-bus.c                                 |   24 +-
 hw/scsi/scsi-disk.c                                |   54 +-
 hw/scsi/scsi-generic.c                             |    6 +-
 hw/scsi/spapr_vscsi.c                              |   15 +-
 hw/scsi/vhost-scsi.c                               |   64 +-
 hw/scsi/virtio-scsi-dataplane.c                    |   16 +-
 hw/scsi/virtio-scsi.c                              |   78 +-
 hw/scsi/vmw_pvscsi.c                               |   50 +-
 hw/sd/milkymist-memcard.c                          |    3 +
 hw/sd/omap_mmc.c                                   |    3 +-
 hw/sd/pl181.c                                      |    3 +
 hw/sd/pxa2xx_mmci.c                                |   68 +-
 hw/sd/sd.c                                         |   20 +-
 hw/sd/sdhci.c                                      |  217 +-
 hw/sd/sdhci.h                                      |   39 +-
 hw/sd/ssi-sd.c                                     |    1 +
 hw/sh4/r2d.c                                       |   20 +-
 hw/sparc/leon3.c                                   |    4 +-
 hw/sparc/sun4m.c                                   |   34 +-
 hw/sparc64/sun4u.c                                 |   44 +-
 hw/ssi/omap_spi.c                                  |    3 +-
 hw/timer/Makefile.objs                             |    2 +
 hw/timer/a9gtimer.c                                |    6 +-
 hw/timer/arm_mptimer.c                             |   15 +-
 hw/timer/arm_timer.c                               |    6 +-
 hw/timer/cadence_ttc.c                             |    9 +-
 hw/timer/hpet.c                                    |   21 +-
 hw/timer/i8254.c                                   |    6 +
 hw/timer/m48t59.c                                  |  359 +-
 hw/timer/mc146818rtc.c                             |   96 +-
 hw/timer/omap_gptimer.c                            |    2 +-
 hw/timer/stm32f2xx_timer.c                         |  328 +
 hw/tpm/Makefile.objs                               |    2 +-
 hw/tpm/tpm_int.h                                   |    8 +
 hw/tpm/tpm_passthrough.c                           |  133 +-
 hw/tpm/tpm_tis.c                                   |  272 +-
 hw/tpm/tpm_tis.h                                   |    3 +-
 hw/tpm/tpm_util.c                                  |  126 +
 hw/tpm/tpm_util.h                                  |   28 +
 hw/unicore32/puv3.c                                |   14 +-
 hw/usb/Makefile.objs                               |   11 +-
 hw/usb/bus.c                                       |   82 +-
 hw/usb/ccid-card-emulated.c                        |    1 -
 hw/usb/ccid-card-passthru.c                        |    2 +-
 hw/usb/core.c                                      |   41 -
 hw/usb/desc-msos.c                                 |    2 +-
 hw/usb/dev-audio.c                                 |   23 +-
 hw/usb/dev-bluetooth.c                             |   24 +-
 hw/usb/dev-hid.c                                   |   34 +-
 hw/usb/dev-hub.c                                   |   11 +-
 hw/usb/dev-mtp.c                                   |   15 +-
 hw/usb/dev-network.c                               |   40 +-
 hw/usb/dev-serial.c                                |   52 +-
 hw/usb/dev-smartcard-reader.c                      |   56 +-
 hw/usb/dev-storage.c                               |   83 +-
 hw/usb/dev-uas.c                                   |   15 +-
 hw/usb/dev-wacom.c                                 |    9 +-
 hw/usb/hcd-ehci-pci.c                              |   16 +-
 hw/usb/hcd-ehci-sysbus.c                           |   10 +
 hw/usb/hcd-ehci.c                                  |   35 +-
 hw/usb/hcd-ehci.h                                  |    2 +-
 hw/usb/hcd-musb.c                                  |   20 +-
 hw/usb/hcd-ohci.c                                  |   75 +-
 hw/usb/hcd-uhci.c                                  |   81 +-
 hw/usb/hcd-xhci.c                                  |   17 +-
 hw/usb/host-legacy.c                               |    1 -
 hw/usb/host-libusb.c                               |   11 +-
 hw/usb/host-stub.c                                 |    2 +-
 hw/usb/redirect.c                                  |   73 +-
 hw/vfio/Makefile.objs                              |    6 +
 hw/vfio/calxeda-xgmac.c                            |   55 +
 hw/vfio/common.c                                   |  972 +++
 hw/vfio/pci.c                                      | 3797 +++++++++
 hw/vfio/platform.c                                 |  715 ++
 hw/virtio/Makefile.objs                            |    2 +-
 hw/virtio/dataplane/Makefile.objs                  |    2 +-
 hw/virtio/dataplane/vring.c                        |  140 +-
 hw/virtio/vhost-backend.c                          |    2 +-
 hw/virtio/vhost-user.c                             |   22 +-
 hw/virtio/vhost.c                                  |  171 +-
 hw/virtio/virtio-balloon.c                         |   56 +-
 hw/virtio/virtio-bus.c                             |   40 +-
 hw/virtio/virtio-mmio.c                            |  208 +-
 hw/virtio/virtio-pci.c                             | 1057 ++-
 hw/virtio/virtio-pci.h                             |   89 +-
 hw/virtio/virtio-rng.c                             |   26 +-
 hw/virtio/virtio.c                                 |  463 +-
 hw/watchdog/Makefile.objs                          |    1 +
 hw/watchdog/watchdog.c                             |   12 +-
 hw/watchdog/wdt_diag288.c                          |  130 +
 hw/watchdog/wdt_i6300esb.c                         |   34 +-
 hw/watchdog/wdt_ib700.c                            |    2 +-
 hw/xen/xen_backend.c                               |    4 +-
 hw/xen/xen_pt.c                                    |   12 +-
 hw/xen/xen_pt.h                                    |    4 +
 hw/xen/xen_pt_config_init.c                        |    8 +-
 hw/xtensa/sim.c                                    |    2 +-
 hw/xtensa/xtfpga.c                                 |   32 +-
 include/block/accounting.h                         |    3 +
 include/block/aio.h                                |   82 +-
 include/block/block.h                              |  105 +-
 include/block/block_int.h                          |   85 +-
 include/block/blockjob.h                           |   30 +-
 include/block/coroutine.h                          |   10 -
 include/block/coroutine_int.h                      |    1 +
 include/block/nbd.h                                |   17 +-
 include/block/qapi.h                               |    2 +-
 include/block/throttle-groups.h                    |   46 +
 include/block/write-threshold.h                    |   64 +
 include/crypto/aes.h                               |   68 +
 include/crypto/cipher.h                            |  210 +
 include/crypto/desrfb.h                            |   49 +
 include/crypto/hash.h                              |  189 +
 include/crypto/init.h                              |   29 +
 include/disas/bfd.h                                |    6 +
 include/disas/disas.h                              |    4 +-
 include/elf.h                                      |    4 +
 include/exec/cpu-all.h                             |   78 +-
 include/exec/cpu-common.h                          |   10 +-
 include/exec/cpu-defs.h                            |   65 +-
 include/exec/cpu_ldst.h                            |  302 +-
 include/exec/cpu_ldst_template.h                   |   60 +-
 include/exec/cpu_ldst_useronly_template.h          |   81 +
 include/exec/cputlb.h                              |    5 +-
 include/exec/exec-all.h                            |   59 +-
 include/exec/gdbstub.h                             |    2 +-
 include/exec/gen-icount.h                          |   30 +-
 include/exec/memattrs.h                            |   49 +
 include/exec/memory-internal.h                     |    1 +
 include/exec/memory.h                              |  259 +-
 include/exec/ram_addr.h                            |  142 +-
 include/exec/semihost.h                            |   62 +
 include/exec/softmmu-semi.h                        |   13 +-
 include/exec/tb-hash.h                             |   51 +
 include/exec/user/thunk.h                          |    4 +-
 include/fpu/softfloat.h                            |  451 +-
 include/glib-compat.h                              |   41 +-
 include/hw/acpi/acpi-defs.h                        |  564 ++
 include/hw/acpi/acpi.h                             |   13 +-
 include/hw/acpi/aml-build.h                        |  290 +
 include/hw/acpi/bios-linker-loader.h               |   27 +
 include/hw/acpi/ich9.h                             |   16 +
 include/hw/acpi/memory_hotplug.h                   |   14 +-
 include/hw/acpi/pc-hotplug.h                       |    5 +-
 include/hw/acpi/pcihp.h                            |    7 +-
 include/hw/acpi/tco.h                              |   82 +
 include/hw/acpi/tpm.h                              |    5 +
 include/hw/arm/arm.h                               |   41 +-
 include/hw/arm/fdt.h                               |   34 +
 include/hw/arm/stm32f205_soc.h                     |   57 +
 include/hw/arm/sysbus-fdt.h                        |   60 +
 include/hw/arm/virt-acpi-build.h                   |   44 +
 include/hw/arm/virt.h                              |   67 +
 include/hw/arm/xlnx-zynqmp.h                       |   63 +
 include/hw/block/block.h                           |    5 +-
 include/hw/boards.h                                |   38 +-
 include/hw/char/cadence_uart.h                     |   53 +
 include/hw/char/serial.h                           |    2 +-
 include/hw/char/stm32f2xx_usart.h                  |   73 +
 include/hw/compat.h                                |   28 +-
 include/hw/elf_ops.h                               |   82 +-
 include/hw/hotplug.h                               |    2 +-
 include/hw/hw.h                                    |    6 -
 include/hw/i386/apic.h                             |    2 +-
 include/hw/i386/ich9.h                             |   24 +-
 include/hw/i386/pc.h                               |  208 +-
 include/hw/i386/topology.h                         |  134 +
 include/hw/intc/arm_gic_common.h                   |   24 +-
 include/hw/isa/isa.h                               |   17 +-
 include/hw/lm32/lm32_pic.h                         |    4 +-
 include/hw/loader.h                                |   24 +-
 include/hw/mem/pc-dimm.h                           |   16 +
 include/hw/mips/mips.h                             |   11 +-
 include/hw/misc/stm32f2xx_syscfg.h                 |   61 +
 include/hw/misc/vfio.h                             |    9 -
 include/hw/net/allwinner_emac.h                    |   40 +-
 include/hw/net/cadence_gem.h                       |   73 +
 include/hw/net/mii.h                               |   76 +
 include/hw/nmi.h                                   |    1 +
 include/hw/nvram/fw_cfg.h                          |    9 +-
 include/hw/pci-host/gpex.h                         |   56 +
 include/hw/pci-host/pam.h                          |    4 -
 include/hw/pci-host/q35.h                          |   37 +-
 include/hw/pci-host/spapr.h                        |   26 +-
 include/hw/pci/msi.h                               |    1 +
 include/hw/pci/pci.h                               |   42 +-
 include/hw/pci/pci_bridge.h                        |    4 +
 include/hw/pci/pci_bus.h                           |   10 +
 include/hw/pci/pci_ids.h                           |   11 +
 include/hw/pci/pci_regs.h                          |  720 +--
 include/hw/pci/pcie_aer.h                          |    2 +-
 include/hw/pci/pcie_host.h                         |    1 +
 include/hw/pci/pcie_regs.h                         |   20 +-
 include/hw/pci/shpc.h                              |   12 +-
 include/hw/ppc/mac_dbdma.h                         |    8 +-
 include/hw/ppc/spapr.h                             |  165 +-
 include/hw/ppc/spapr_drc.h                         |  201 +
 include/hw/ppc/spapr_vio.h                         |   10 +-
 include/hw/ppc/xics.h                              |    1 +
 include/hw/qdev-core.h                             |   24 +-
 include/hw/qdev-properties.h                       |   22 +-
 include/hw/s390x/s390_flic.h                       |    5 +-
 include/hw/s390x/sclp.h                            |    8 +
 include/hw/sparc/grlib.h                           |   12 +-
 include/hw/sparc/sun4m.h                           |    4 +-
 include/hw/sysbus.h                                |   18 +
 include/hw/timer/a9gtimer.h                        |    2 +-
 include/hw/timer/m48t59.h                          |   61 +-
 include/hw/timer/stm32f2xx_timer.h                 |  101 +
 include/hw/usb.h                                   |   19 +-
 include/hw/vfio/vfio-calxeda-xgmac.h               |   46 +
 include/hw/vfio/vfio-common.h                      |  149 +
 include/hw/vfio/vfio-platform.h                    |   77 +
 include/hw/vfio/vfio.h                             |    9 +
 include/hw/virtio/dataplane/vring-accessors.h      |   75 +
 include/hw/virtio/dataplane/vring.h                |   20 +-
 include/hw/virtio/vhost-scsi.h                     |   12 +-
 include/hw/virtio/vhost.h                          |   19 +-
 include/hw/virtio/virtio-access.h                  |   26 +
 include/hw/virtio/virtio-balloon.h                 |   40 +-
 include/hw/virtio/virtio-blk.h                     |   99 +-
 include/hw/virtio/virtio-bus.h                     |    9 +-
 include/hw/virtio/virtio-gpu.h                     |  142 +
 include/hw/virtio/virtio-input.h                   |  119 +
 include/hw/virtio/virtio-net.h                     |  194 +-
 include/hw/virtio/virtio-rng.h                     |   15 +-
 include/hw/virtio/virtio-scsi.h                    |  151 +-
 include/hw/virtio/virtio-serial.h                  |   56 +-
 include/hw/virtio/virtio.h                         |  141 +-
 include/hw/virtio/virtio_ring.h                    |  167 -
 include/hw/watchdog/wdt_diag288.h                  |   36 +
 include/hw/xen/xen.h                               |    1 -
 include/hw/xen/xen_common.h                        |    2 +-
 include/migration/migration.h                      |   46 +-
 include/migration/page_cache.h                     |   10 +-
 include/migration/qemu-file.h                      |   36 +-
 include/migration/vmstate.h                        |   72 +-
 include/monitor/monitor.h                          |   21 +-
 include/monitor/qdev.h                             |   12 +-
 include/net/net.h                                  |   15 +-
 include/net/slirp.h                                |    6 +-
 include/net/tap.h                                  |   24 +-
 include/net/vhost_net.h                            |    6 +-
 include/qapi/error.h                               |    5 +
 include/qapi/qmp/qbool.h                           |    8 +-
 include/qapi/qmp/qdict.h                           |    8 +-
 include/qapi/qmp/qerror.h                          |  112 +-
 include/qapi/qmp/qobject.h                         |   14 +-
 include/qapi/util.h                                |    2 +-
 include/qapi/visitor-impl.h                        |    6 +-
 include/qapi/visitor.h                             |    2 +-
 include/qemu-common.h                              |  141 +-
 include/qemu-io.h                                  |    4 +-
 include/qemu/aes.h                                 |   68 -
 include/qemu/atomic.h                              |   73 +-
 include/qemu/bitmap.h                              |    4 +
 include/qemu/bitops.h                              |   77 +-
 include/qemu/bswap.h                               |   11 +-
 include/qemu/compatfd.h                            |    1 -
 include/qemu/compiler.h                            |    6 +
 include/qemu/fprintf-fn.h                          |   17 +
 include/qemu/hbitmap.h                             |   31 +
 include/qemu/iov.h                                 |    2 +-
 include/qemu/log.h                                 |    5 +-
 include/qemu/main-loop.h                           |   67 +-
 include/qemu/option.h                              |   37 +-
 include/qemu/osdep.h                               |    2 +
 include/qemu/queue.h                               |   57 +-
 include/qemu/rcu.h                                 |  156 +
 include/qemu/rcu_queue.h                           |  134 +
 include/qemu/sockets.h                             |    8 +-
 include/qemu/thread.h                              |    7 +-
 include/qemu/throttle.h                            |   48 +-
 include/qemu/timer.h                               |  120 +-
 include/qemu/typedefs.h                            |  109 +-
 include/qjson.h                                    |   29 +
 include/qom/cpu.h                                  |   38 +-
 include/qom/object.h                               |  197 +-
 include/qom/object_interfaces.h                    |   13 +
 include/standard-headers/asm-s390/kvm_virtio.h     |   64 +
 include/standard-headers/asm-s390/virtio-ccw.h     |   21 +
 include/standard-headers/linux/if_ether.h          |    1 +
 include/standard-headers/linux/input.h             | 1203 +++
 include/standard-headers/linux/pci_regs.h          |  719 ++
 include/standard-headers/linux/types.h             |    2 +
 include/standard-headers/linux/virtio_9p.h         |   44 +
 include/standard-headers/linux/virtio_balloon.h    |   84 +
 include/standard-headers/linux/virtio_blk.h        |  147 +
 include/standard-headers/linux/virtio_config.h     |   64 +
 include/standard-headers/linux/virtio_console.h    |   78 +
 include/standard-headers/linux/virtio_gpu.h        |  206 +
 include/standard-headers/linux/virtio_ids.h        |   45 +
 include/standard-headers/linux/virtio_input.h      |   76 +
 include/standard-headers/linux/virtio_net.h        |  245 +
 include/standard-headers/linux/virtio_pci.h        |  199 +
 include/standard-headers/linux/virtio_ring.h       |  171 +
 include/standard-headers/linux/virtio_rng.h        |    8 +
 include/standard-headers/linux/virtio_scsi.h       |  172 +
 include/standard-headers/linux/virtio_types.h      |   46 +
 include/sysemu/arch_init.h                         |    1 -
 include/sysemu/balloon.h                           |    1 -
 include/sysemu/block-backend.h                     |   33 +-
 include/sysemu/blockdev.h                          |    6 +-
 include/sysemu/device_tree.h                       |    9 +
 include/sysemu/dma.h                               |    3 +-
 include/sysemu/iothread.h                          |    1 -
 include/sysemu/kvm.h                               |   45 +-
 include/sysemu/kvm_int.h                           |   39 +
 include/sysemu/numa.h                              |   36 +
 include/sysemu/os-win32.h                          |    4 -
 include/sysemu/sysemu.h                            |   62 +-
 include/sysemu/tpm.h                               |   19 +-
 include/sysemu/tpm_backend.h                       |   25 +-
 include/sysemu/tpm_backend_int.h                   |    2 -
 include/ui/console.h                               |   73 +-
 include/ui/egl-helpers.h                           |   16 +
 include/ui/gtk.h                                   |   99 +
 include/ui/qemu-pixman.h                           |   20 +
 include/ui/qemu-spice.h                            |   22 +-
 include/ui/sdl2.h                                  |   51 +
 include/ui/shader.h                                |   13 +
 include/ui/spice-display.h                         |    6 +-
 iohandler.c                                        |   21 +-
 ioport.c                                           |   46 +-
 iothread.c                                         |   21 +-
 kvm-all.c                                          |  509 +-
 kvm-stub.c                                         |    8 +-
 libcacard/cac.c                                    |    5 +-
 libcacard/card_7816.c                              |    4 +-
 libcacard/event.c                                  |    2 +-
 libcacard/libcacard.pc.in                          |    2 +-
 libcacard/vcard.c                                  |    4 +-
 libcacard/vcard_emul_nss.c                         |    4 +-
 libcacard/vcardt.c                                 |    4 +-
 libcacard/vreader.c                                |    4 +-
 libcacard/vscclient.c                              |    8 +-
 libdecnumber/dpd/decimal128Local.h                 |   42 -
 linux-headers/asm-arm/kvm.h                        |   11 +-
 linux-headers/asm-arm64/kvm.h                      |   18 +-
 linux-headers/asm-mips/kvm.h                       |  164 +-
 linux-headers/asm-s390/kvm.h                       |   41 +
 linux-headers/asm-x86/hyperv.h                     |   24 +
 linux-headers/asm-x86/kvm.h                        |   14 +-
 linux-headers/linux/kvm.h                          |   95 +-
 linux-headers/linux/vfio.h                         |  105 +-
 linux-headers/linux/vhost.h                        |   14 +
 linux-headers/linux/virtio_config.h                |   58 +-
 linux-headers/linux/virtio_ring.h                  |  164 +-
 linux-user/aarch64/target_cpu.h                    |    2 +-
 linux-user/alpha/syscall_nr.h                      |    4 +
 linux-user/arm/nwfpe/fpopcode.c                    |   22 -
 linux-user/arm/syscall_nr.h                        |    2 +-
 linux-user/arm/target_cpu.h                        |   15 +-
 linux-user/elfload.c                               |   42 +-
 linux-user/main.c                                  |  161 +-
 linux-user/mips64/target_signal.h                  |    2 +-
 linux-user/mmap.c                                  |    7 +-
 linux-user/signal.c                                |   65 +-
 linux-user/syscall.c                               |  157 +-
 linux-user/syscall_defs.h                          |   95 +-
 linux-user/vm86.c                                  |   57 +-
 main-loop.c                                        |   14 +-
 memory.c                                           |  487 +-
 memory_mapping.c                                   |    2 +-
 migration-exec.c                                   |   69 -
 migration-fd.c                                     |   68 -
 migration-rdma.c                                   | 3438 --------
 migration-tcp.c                                    |  103 -
 migration-unix.c                                   |  103 -
 migration.c                                        |  700 --
 migration/Makefile.objs                            |   10 +
 migration/block.c                                  |  895 ++
 migration/exec.c                                   |   69 +
 migration/fd.c                                     |   88 +
 migration/migration.c                              | 1054 +++
 migration/qemu-file-buf.c                          |  462 +
 migration/qemu-file-internal.h                     |   53 +
 migration/qemu-file-stdio.c                        |  194 +
 migration/qemu-file-unix.c                         |  238 +
 migration/qemu-file.c                              |  613 ++
 migration/ram.c                                    | 1670 ++++
 migration/rdma.c                                   | 3516 ++++++++
 migration/savevm.c                                 | 1605 ++++
 migration/tcp.c                                    |  103 +
 migration/unix.c                                   |  103 +
 migration/vmstate.c                                |  890 ++
 migration/xbzrle.c                                 |  175 +
 monitor.c                                          |  990 +--
 nbd.c                                              |  287 +-
 net/clients.h                                      |   20 +-
 net/dump.c                                         |   13 +-
 net/hub.c                                          |   13 +-
 net/l2tpv3.c                                       |   32 +-
 net/net.c                                          |  288 +-
 net/netmap.c                                       |   23 +-
 net/queue.c                                        |    2 +-
 net/slirp.c                                        |   19 +-
 net/socket.c                                       |   44 +-
 net/tap-aix.c                                      |   17 +-
 net/tap-bsd.c                                      |   48 +-
 net/tap-haiku.c                                    |   17 +-
 net/tap-linux.c                                    |   58 +-
 net/tap-linux.h                                    |    2 +
 net/tap-solaris.c                                  |   73 +-
 net/tap-win32.c                                    |   13 +-
 net/tap.c                                          |  251 +-
 net/tap_int.h                                      |    6 +-
 net/vde.c                                          |    3 +-
 net/vhost-user.c                                   |   52 +-
 numa.c                                             |  204 +-
 os-posix.c                                         |    2 +
 page_cache.c                                       |   43 +-
 pc-bios/README                                     |    2 +-
 pc-bios/bios-256k.bin                              |  Bin 262144 -> 262144 bytes
 pc-bios/bios.bin                                   |  Bin 131072 -> 131072 bytes
 pc-bios/keymaps/ru                                 |    2 +-
 pc-bios/openbios-ppc                               |  Bin 746588 -> 746588 bytes
 pc-bios/openbios-sparc32                           |  Bin 381512 -> 381512 bytes
 pc-bios/openbios-sparc64                           |  Bin 1616768 -> 1616768 bytes
 pc-bios/qemu.rsrc                                  | 1504 ++++
 pc-bios/s390-ccw.img                               |  Bin 17752 -> 13784 bytes
 pc-bios/s390-ccw/Makefile                          |   11 +-
 pc-bios/s390-ccw/bootmap.c                         |    4 +-
 pc-bios/s390-ccw/bootmap.h                         |    2 +-
 pc-bios/s390-ccw/main.c                            |    3 +-
 pc-bios/s390-ccw/s390-ccw.h                        |    4 +
 pc-bios/s390-ccw/sclp-ascii.c                      |    1 +
 pc-bios/s390-ccw/start.S                           |   32 +
 pc-bios/s390-ccw/virtio.c                          |    7 +-
 pc-bios/slof.bin                                   |  Bin 923896 -> 912720 bytes
 pc-bios/u-boot.e500                                |  Bin 330260 -> 347788 bytes
 pc-bios/vgabios-cirrus.bin                         |  Bin 37376 -> 38400 bytes
 pc-bios/vgabios-qxl.bin                            |  Bin 37376 -> 38400 bytes
 pc-bios/vgabios-stdvga.bin                         |  Bin 37376 -> 38400 bytes
 pc-bios/vgabios-virtio.bin                         |  Bin 0 -> 38400 bytes
 pc-bios/vgabios-vmware.bin                         |  Bin 37376 -> 38400 bytes
 pc-bios/vgabios.bin                                |  Bin 37376 -> 38400 bytes
 qapi-schema.json                                   |  539 +-
 qapi/block-core.json                               |  389 +-
 qapi/block.json                                    |    2 +-
 qapi/common.json                                   |   30 +-
 qapi/event.json                                    |   26 +
 qapi/opts-visitor.c                                |   24 +-
 qapi/qapi-dealloc-visitor.c                        |    3 +-
 qapi/qapi-util.c                                   |    2 +-
 qapi/qapi-visit-core.c                             |   34 +-
 qapi/qmp-dispatch.c                                |   15 +-
 qapi/qmp-input-visitor.c                           |   30 +-
 qapi/qmp-output-visitor.c                          |    3 +-
 qapi/rocker.json                                   |  286 +
 qapi/string-input-visitor.c                        |   24 +-
 qapi/string-output-visitor.c                       |    1 -
 qapi/trace.json                                    |    2 +-
 qdev-monitor.c                                     |  267 +-
 qemu-char.c                                        |  122 +-
 qemu-coroutine-io.c                                |    2 +-
 qemu-coroutine-lock.c                              |    2 +-
 qemu-coroutine.c                                   |  135 +-
 qemu-doc.texi                                      |   31 +-
 qemu-file-stdio.c                                  |  194 -
 qemu-file-unix.c                                   |  223 -
 qemu-file.c                                        |  995 ---
 qemu-img.c                                         |  864 +-
 qemu-io-cmds.c                                     |  309 +-
 qemu-io.c                                          |   94 +-
 qemu-log.c                                         |    4 +-
 qemu-nbd.c                                         |  107 +-
 qemu-options.hx                                    |  410 +-
 qemu-seccomp.c                                     |    4 +-
 qemu-tech.texi                                     |    2 +-
 qemu-timer.c                                       |   34 +-
 qga/channel-win32.c                                |    2 +-
 qga/commands-posix.c                               |  564 ++-
 qga/commands-win32.c                               |  930 ++-
 qga/installer/qemu-ga.wxs                          |  145 +
 qga/main.c                                         |   16 +-
 qga/qapi-schema.json                               |  233 +-
 qga/vss-win32/Makefile.objs                        |    2 +-
 qjson.c                                            |  129 +
 qmp-commands.hx                                    |  493 +-
 qmp.c                                              |  184 +-
 qobject/Makefile.objs                              |    3 +-
 qobject/json-parser.c                              |    9 +-
 qobject/qbool.c                                    |    8 +-
 qobject/qdict.c                                    |  119 +-
 qobject/qerror.c                                   |  148 -
 qobject/qjson.c                                    |   21 +-
 qobject/qnull.c                                    |   29 +
 qom/cpu.c                                          |   15 +-
 qom/object.c                                       |  364 +-
 qom/object_interfaces.c                            |   12 +
 qtest.c                                            |  149 +-
 roms/Makefile                                      |    7 +-
 roms/SLOF                                          |    2 +-
 roms/config.seabios-128k                           |    1 +
 roms/config.vga-virtio                             |    6 +
 roms/openbios                                      |    2 +-
 roms/seabios                                       |    2 +-
 rules.mak                                          |   27 +-
 savevm.c                                           | 1353 ---
 scripts/analyze-migration.py                       |  597 ++
 scripts/checkpatch.pl                              |   24 +-
 scripts/coverity-model.c                           |  242 +-
 scripts/dump-guest-memory.py                       |   10 +-
 scripts/get_maintainer.pl                          |   45 +-
 scripts/kvm/kvm_stat                               |   69 +-
 scripts/kvm/kvm_stat.texi                          |   55 +
 scripts/make_device_config.sh                      |   18 +-
 scripts/qapi-commands.py                           |  277 +-
 scripts/qapi-event.py                              |  129 +-
 scripts/qapi-types.py                              |  268 +-
 scripts/qapi-visit.py                              |  291 +-
 scripts/qapi.py                                    |  892 ++-
 scripts/qemu-gdb.py                                |   75 +
 scripts/qmp/qmp-shell                              |  147 +-
 scripts/qmp/qmp.py                                 |   95 +-
 scripts/qmp/qom-tree                               |   75 +
 scripts/qtest.py                                   |   71 +
 scripts/shaderinclude.pl                           |   16 +
 scripts/tracetool/backend/stderr.py                |   10 +-
 scripts/tracetool/format/d.py                      |   26 +-
 scripts/update-linux-headers.sh                    |   56 +-
 scripts/vmstate-static-checker.py                  |    2 +
 slirp/misc.c                                       |    1 +
 slirp/tcp_input.c                                  |    8 +-
 softmmu_template.h                                 |  178 +-
 spice-qemu-char.c                                  |   14 +-
 stubs/Makefile.objs                                |    2 -
 stubs/arch-query-cpu-def.c                         |    2 +-
 stubs/dump.c                                       |    1 -
 stubs/iothread-lock.c                              |    5 +
 stubs/mon-is-qmp.c                                 |    6 +-
 stubs/mon-set-error.c                              |    8 -
 stubs/pci-drive-hot-add.c                          |   10 -
 stubs/qmp_pc_dimm_device_list.c                    |    5 +
 stubs/qtest.c                                      |    2 +-
 stubs/set-fd-handler.c                             |    3 +-
 target-alpha/Makefile.objs                         |    2 +-
 target-alpha/cpu.c                                 |    9 +-
 target-alpha/cpu.h                                 |  108 +-
 target-alpha/fpu_helper.c                          |  530 +-
 target-alpha/helper.c                              |  132 +-
 target-alpha/helper.h                              |   14 +-
 target-alpha/int_helper.c                          |   89 +-
 target-alpha/mem_helper.c                          |    9 +-
 target-alpha/sys_helper.c                          |    2 +-
 target-alpha/translate.c                           |  297 +-
 target-alpha/vax_helper.c                          |  353 +
 target-arm/arm-semi.c                              |   30 +-
 target-arm/cpu-qom.h                               |   12 +
 target-arm/cpu.c                                   |  316 +-
 target-arm/cpu.h                                   |  722 ++-
 target-arm/cpu64.c                                 |  104 +-
 target-arm/crypto_helper.c                         |  116 +-
 target-arm/helper-a64.c                            |   29 +-
 target-arm/helper.c                                | 2678 +++++--
 target-arm/helper.h                                |    3 +-
 target-arm/internals.h                             |   21 +-
 target-arm/kvm-consts.h                            |    4 +
 target-arm/kvm-stub.c                              |    2 +-
 target-arm/kvm.c                                   |  174 +-
 target-arm/kvm32.c                                 |  133 +-
 target-arm/kvm64.c                                 |  232 +-
 target-arm/kvm_arm.h                               |   51 +-
 target-arm/machine.c                               |   88 +-
 target-arm/op_helper.c                             |  233 +-
 target-arm/psci.c                                  |   19 +-
 target-arm/translate-a64.c                         |  162 +-
 target-arm/translate.c                             |  355 +-
 target-arm/translate.h                             |   34 +-
 target-cris/cpu.c                                  |   25 +-
 target-cris/cpu.h                                  |   13 +-
 target-cris/helper.c                               |   11 +-
 target-cris/opcode-cris.h                          |   10 -
 target-cris/translate.c                            |   42 +-
 target-cris/translate_v10.c                        |    6 +-
 target-i386/Makefile.objs                          |    2 -
 target-i386/arch_dump.c                            |   16 +-
 target-i386/arch_memory_mapping.c                  |   15 +-
 target-i386/cpu-qom.h                              |    4 +
 target-i386/cpu.c                                  |  603 +-
 target-i386/cpu.h                                  |  145 +-
 target-i386/fpu_helper.c                           |   21 +-
 target-i386/helper.c                               |  150 +-
 target-i386/helper.h                               |   12 +-
 target-i386/ioport-user.c                          |   60 -
 target-i386/kvm-stub.c                             |    5 +
 target-i386/kvm.c                                  |  300 +-
 target-i386/kvm_i386.h                             |    1 +
 target-i386/machine.c                              |  172 +-
 target-i386/misc_helper.c                          |   59 +-
 target-i386/ops_sse.h                              |   18 +-
 target-i386/seg_helper.c                           |   32 +-
 target-i386/smm_helper.c                           |  333 +-
 target-i386/svm_helper.c                           |  230 +-
 target-i386/topology.h                             |  134 -
 target-i386/translate.c                            |  146 +-
 target-lm32/cpu.c                                  |    9 +-
 target-lm32/cpu.h                                  |   13 +-
 target-lm32/helper.c                               |    3 +-
 target-lm32/translate.c                            |   48 +-
 target-m68k/cpu.c                                  |    9 +-
 target-m68k/cpu.h                                  |   13 +-
 target-m68k/m68k-qreg.h                            |   11 -
 target-m68k/op_helper.c                            |   12 +-
 target-m68k/translate.c                            |   44 +-
 target-microblaze/cpu-qom.h                        |   14 +-
 target-microblaze/cpu.c                            |  145 +-
 target-microblaze/cpu.h                            |   60 +-
 target-microblaze/helper.c                         |   22 +-
 target-microblaze/mmu.h                            |    1 -
 target-microblaze/op_helper.c                      |   10 +-
 target-microblaze/translate.c                      |   52 +-
 target-mips/Makefile.objs                          |    2 +-
 target-mips/cpu-qom.h                              |    4 +
 target-mips/cpu.c                                  |   10 +-
 target-mips/cpu.h                                  |  207 +-
 target-mips/dsp_helper.c                           |    2 +-
 target-mips/gdbstub.c                              |   56 +-
 target-mips/helper.c                               |   69 +-
 target-mips/helper.h                               |   14 +-
 target-mips/kvm.c                                  |   59 +-
 target-mips/machine.c                              |  573 +-
 target-mips/mips-defs.h                            |    6 +-
 target-mips/mips-semi.c                            |  373 +
 target-mips/msa_helper.c                           |  161 +-
 target-mips/op_helper.c                            |  698 +-
 target-mips/translate.c                            | 3082 +++++---
 target-mips/translate_init.c                       |  224 +-
 target-moxie/cpu.c                                 |    9 +-
 target-moxie/cpu.h                                 |   13 +-
 target-moxie/machine.c                             |    1 +
 target-moxie/mmu.h                                 |   10 +-
 target-moxie/translate.c                           |   14 +-
 target-openrisc/cpu.c                              |    9 +-
 target-openrisc/cpu.h                              |   16 +-
 target-openrisc/translate.c                        |   55 +-
 target-ppc/cpu-models.c                            |   10 +-
 target-ppc/cpu-models.h                            |    3 +-
 target-ppc/cpu.h                                   |   58 +-
 target-ppc/fpu_helper.c                            |   85 +-
 target-ppc/helper.h                                |    4 +-
 target-ppc/int_helper.c                            |   21 +-
 target-ppc/kvm.c                                   |  122 +-
 target-ppc/kvm_ppc.h                               |    5 +
 target-ppc/machine.c                               |   70 +-
 target-ppc/mem_helper.c                            |   22 +
 target-ppc/misc_helper.c                           |    7 +-
 target-ppc/mmu-hash32.c                            |   18 +-
 target-ppc/mmu-hash64.c                            |   60 +-
 target-ppc/mmu-hash64.h                            |    3 +
 target-ppc/mmu_helper.c                            |   61 +-
 target-ppc/translate.c                             |  435 +-
 target-ppc/translate_init.c                        |  298 +-
 target-s390x/Makefile.objs                         |    2 +-
 target-s390x/arch_dump.c                           |   42 +-
 target-s390x/cc_helper.c                           |   22 +-
 target-s390x/cpu-qom.h                             |    4 +
 target-s390x/cpu.c                                 |   39 +-
 target-s390x/cpu.h                                 |  351 +-
 target-s390x/fpu_helper.c                          |   43 +-
 target-s390x/gdbstub.c                             |   51 +-
 target-s390x/helper.c                              |  511 +-
 target-s390x/helper.h                              |   28 +-
 target-s390x/insn-data.def                         |  168 +-
 target-s390x/int_helper.c                          |   51 +-
 target-s390x/ioinst.c                              |  250 +-
 target-s390x/ioinst.h                              |    7 +-
 target-s390x/kvm.c                                 | 1154 +++-
 target-s390x/machine.c                             |  134 +-
 target-s390x/mem_helper.c                          |  347 +-
 target-s390x/misc_helper.c                         |  227 +-
 target-s390x/mmu_helper.c                          |  480 ++
 target-s390x/translate.c                           |  719 ++-
 target-sh4/cpu.c                                   |   12 +-
 target-sh4/cpu.h                                   |   62 +-
 target-sh4/gdbstub.c                               |    8 +-
 target-sh4/helper.c                                |   29 +-
 target-sh4/helper.h                                |    1 -
 target-sh4/op_helper.c                             |  148 +-
 target-sh4/translate.c                             |  361 +-
 target-sparc/cpu.c                                 |   12 +-
 target-sparc/cpu.h                                 |   13 +-
 target-sparc/ldst_helper.c                         |   34 +-
 target-sparc/mmu_helper.c                          |    7 +-
 target-sparc/translate.c                           |   51 +-
 target-tricore/cpu.c                               |   35 +-
 target-tricore/cpu.h                               |   26 +-
 target-tricore/csfr.def                            |  124 +
 target-tricore/helper.h                            |  109 +
 target-tricore/op_helper.c                         | 2295 +++++-
 target-tricore/translate.c                         | 8830 ++++++++++++++++----
 target-tricore/tricore-opcodes.h                   |  129 +-
 target-unicore32/cpu.c                             |    9 +-
 target-unicore32/cpu.h                             |    9 +-
 target-unicore32/helper.c                          |   10 +-
 target-unicore32/translate.c                       |   20 +-
 target-xtensa/core-dc232b.c                        |    2 +-
 target-xtensa/core-dc233c.c                        |    2 +-
 target-xtensa/core-fsf.c                           |    7 +-
 target-xtensa/cpu-qom.h                            |    3 +
 target-xtensa/cpu.c                                |   10 +-
 target-xtensa/cpu.h                                |   44 +-
 target-xtensa/gdbstub.c                            |   25 +-
 target-xtensa/helper.c                             |   14 +
 target-xtensa/helper.h                             |    2 +-
 target-xtensa/import_core.sh                       |    6 +-
 target-xtensa/op_helper.c                          |   43 +-
 target-xtensa/overlay_tool.h                       |    4 +-
 target-xtensa/translate.c                          |  703 +-
 tcg/aarch64/tcg-target.c                           |  145 +-
 tcg/aarch64/tcg-target.h                           |    1 +
 tcg/arm/tcg-target.c                               |   59 +-
 tcg/arm/tcg-target.h                               |    1 +
 tcg/i386/tcg-target.c                              |  239 +-
 tcg/i386/tcg-target.h                              |    1 +
 tcg/ia64/tcg-target.c                              |   51 +-
 tcg/ia64/tcg-target.h                              |    2 +
 tcg/mips/tcg-target.c                              |   90 +-
 tcg/mips/tcg-target.h                              |    1 +
 tcg/optimize.c                                     |  388 +-
 tcg/ppc/tcg-target.c                               |   66 +-
 tcg/ppc/tcg-target.h                               |    1 +
 tcg/s390/tcg-target.c                              |   86 +-
 tcg/s390/tcg-target.h                              |    1 +
 tcg/sparc/tcg-target.c                             |   72 +-
 tcg/sparc/tcg-target.h                             |    1 +
 tcg/tcg-be-ldst.h                                  |   29 +-
 tcg/tcg-op.c                                       | 1945 +++++
 tcg/tcg-op.h                                       | 2484 +-----
 tcg/tcg-opc.h                                      |   17 +-
 tcg/tcg.c                                          |  638 +-
 tcg/tcg.h                                          |  230 +-
 tcg/tci/tcg-target.c                               |   25 +-
 tcg/tci/tcg-target.h                               |    4 +-
 tci.c                                              |   60 +-
 tests/.gitignore                                   |    6 +
 tests/Makefile                                     |  142 +-
 tests/acpi-test-data/pc/DSDT                       |  Bin 3621 -> 3028 bytes
 tests/acpi-test-data/pc/SSDT                       |  Bin 2279 -> 2486 bytes
 tests/acpi-test-data/pc/SSDT.bridge                |  Bin 0 -> 4345 bytes
 tests/acpi-test-data/q35/DSDT                      |  Bin 8211 -> 7666 bytes
 tests/acpi-test-data/q35/SSDT                      |  Bin 560 -> 691 bytes
 tests/acpi-test-data/q35/SSDT.bridge               |  Bin 0 -> 708 bytes
 tests/ahci-test.c                                  | 1827 +++--
 tests/bios-tables-test.c                           |  135 +-
 tests/check-qdict.c                                |   67 +
 tests/check-qjson.c                                |   26 +-
 tests/check-qom-proplist.c                         |  302 +
 tests/device-introspect-test.c                     |  158 +
 tests/display-vga-test.c                           |   18 +
 tests/drive_del-test.c                             |   24 +-
 tests/e1000-test.c                                 |    4 +-
 tests/eepro100-test.c                              |    5 +-
 tests/endianness-test.c                            |   20 +-
 tests/fdc-test.c                                   |   36 +-
 tests/fw_cfg-test.c                                |   26 +-
 tests/hd-geo-test.c                                |    4 +-
 tests/i440fx-test.c                                |   17 +-
 tests/ide-test.c                                   |   98 +-
 tests/libqos/ahci.c                                |  962 +++
 tests/libqos/ahci.h                                |  586 ++
 tests/libqos/libqos-pc.c                           |   29 +
 tests/libqos/libqos-pc.h                           |   10 +
 tests/libqos/libqos.c                              |  214 +
 tests/libqos/libqos.h                              |   38 +
 tests/libqos/malloc-generic.c                      |   39 +
 tests/libqos/malloc-generic.h                      |   21 +
 tests/libqos/malloc-pc.c                           |  296 +-
 tests/libqos/malloc-pc.h                           |   11 +-
 tests/libqos/malloc.c                              |  374 +
 tests/libqos/malloc.h                              |   32 +-
 tests/libqos/virtio-mmio.c                         |  198 +
 tests/libqos/virtio-mmio.h                         |   46 +
 tests/libqos/virtio-pci.c                          |   66 +-
 tests/libqos/virtio-pci.h                          |   24 +-
 tests/libqos/virtio.c                              |    8 +-
 tests/libqos/virtio.h                              |   26 +-
 tests/libqtest.c                                   |  138 +-
 tests/libqtest.h                                   |  161 +
 tests/multiboot/Makefile                           |    5 +-
 tests/multiboot/libc.c                             |   12 +
 tests/multiboot/libc.h                             |    1 +
 tests/multiboot/mmap.out                           |   37 +-
 tests/multiboot/module.txt                         |    1 +
 tests/multiboot/modules.c                          |   55 +
 tests/multiboot/modules.out                        |   38 +
 tests/multiboot/run_test.sh                        |    9 +-
 tests/nvme-test.c                                  |    2 +-
 tests/pc-cpu-test.c                                |  146 +
 tests/q35-test.c                                   |   91 +
 tests/qapi-schema/alternate-array.err              |    1 +
 tests/qapi-schema/alternate-array.exit             |    1 +
 tests/qapi-schema/alternate-array.json             |    7 +
 tests/qapi-schema/alternate-base.err               |    1 +
 tests/qapi-schema/alternate-base.exit              |    1 +
 tests/qapi-schema/alternate-base.json              |    6 +
 tests/qapi-schema/alternate-clash.err              |    1 +
 tests/qapi-schema/alternate-clash.exit             |    1 +
 tests/qapi-schema/alternate-clash.json             |    3 +
 tests/qapi-schema/alternate-conflict-dict.err      |    1 +
 tests/qapi-schema/alternate-conflict-dict.exit     |    1 +
 tests/qapi-schema/alternate-conflict-dict.json     |    8 +
 tests/qapi-schema/alternate-conflict-string.err    |    1 +
 tests/qapi-schema/alternate-conflict-string.exit   |    1 +
 tests/qapi-schema/alternate-conflict-string.json   |    6 +
 tests/qapi-schema/alternate-good.exit              |    1 +
 tests/qapi-schema/alternate-good.json              |    9 +
 tests/qapi-schema/alternate-good.out               |    6 +
 tests/qapi-schema/alternate-nested.err             |    1 +
 tests/qapi-schema/alternate-nested.exit            |    1 +
 tests/qapi-schema/alternate-nested.json            |    5 +
 tests/qapi-schema/alternate-unknown.err            |    1 +
 tests/qapi-schema/alternate-unknown.exit           |    1 +
 tests/qapi-schema/alternate-unknown.json           |    3 +
 tests/qapi-schema/bad-base.err                     |    1 +
 tests/qapi-schema/bad-base.exit                    |    1 +
 tests/qapi-schema/bad-base.json                    |    3 +
 tests/qapi-schema/bad-data.err                     |    1 +
 tests/qapi-schema/bad-data.exit                    |    1 +
 tests/qapi-schema/bad-data.json                    |    2 +
 tests/qapi-schema/bad-ident.err                    |    1 +
 tests/qapi-schema/bad-ident.exit                   |    1 +
 tests/qapi-schema/bad-ident.json                   |    2 +
 tests/qapi-schema/bad-type-bool.err                |    1 +
 tests/qapi-schema/bad-type-bool.exit               |    1 +
 tests/qapi-schema/bad-type-bool.json               |    2 +
 tests/qapi-schema/bad-type-dict.err                |    1 +
 tests/qapi-schema/bad-type-dict.exit               |    1 +
 tests/qapi-schema/bad-type-dict.json               |    2 +
 tests/qapi-schema/bad-type-int.err                 |    1 +
 tests/qapi-schema/bad-type-int.exit                |    1 +
 tests/qapi-schema/bad-type-int.json                |    3 +
 tests/qapi-schema/command-int.err                  |    1 +
 tests/qapi-schema/command-int.exit                 |    1 +
 tests/qapi-schema/command-int.json                 |    3 +
 tests/qapi-schema/data-array-empty.err             |    1 +
 tests/qapi-schema/data-array-empty.exit            |    1 +
 tests/qapi-schema/data-array-empty.json            |    2 +
 tests/qapi-schema/data-array-unknown.err           |    1 +
 tests/qapi-schema/data-array-unknown.exit          |    1 +
 tests/qapi-schema/data-array-unknown.json          |    2 +
 tests/qapi-schema/data-int.err                     |    1 +
 tests/qapi-schema/data-int.exit                    |    1 +
 tests/qapi-schema/data-int.json                    |    2 +
 tests/qapi-schema/data-member-array-bad.err        |    1 +
 tests/qapi-schema/data-member-array-bad.exit       |    1 +
 tests/qapi-schema/data-member-array-bad.json       |    2 +
 tests/qapi-schema/data-member-array.exit           |    1 +
 tests/qapi-schema/data-member-array.json           |    4 +
 tests/qapi-schema/data-member-array.out            |    5 +
 tests/qapi-schema/data-member-unknown.err          |    1 +
 tests/qapi-schema/data-member-unknown.exit         |    1 +
 tests/qapi-schema/data-member-unknown.json         |    2 +
 tests/qapi-schema/data-unknown.err                 |    1 +
 tests/qapi-schema/data-unknown.exit                |    1 +
 tests/qapi-schema/data-unknown.json                |    2 +
 tests/qapi-schema/double-data.err                  |    1 +
 tests/qapi-schema/double-data.exit                 |    1 +
 tests/qapi-schema/double-data.json                 |    2 +
 tests/qapi-schema/double-type.err                  |    1 +
 tests/qapi-schema/double-type.exit                 |    1 +
 tests/qapi-schema/double-type.json                 |    2 +
 tests/qapi-schema/enum-bad-name.err                |    1 +
 tests/qapi-schema/enum-bad-name.exit               |    1 +
 tests/qapi-schema/enum-bad-name.json               |    2 +
 tests/qapi-schema/enum-clash-member.err            |    1 +
 tests/qapi-schema/enum-clash-member.exit           |    1 +
 tests/qapi-schema/enum-clash-member.json           |    2 +
 tests/qapi-schema/enum-dict-member.err             |    1 +
 tests/qapi-schema/enum-dict-member.exit            |    1 +
 tests/qapi-schema/enum-dict-member.json            |    2 +
 tests/qapi-schema/enum-empty.exit                  |    1 +
 tests/qapi-schema/enum-empty.json                  |    2 +
 tests/qapi-schema/enum-empty.out                   |    3 +
 tests/qapi-schema/enum-int-member.err              |    1 +
 tests/qapi-schema/enum-int-member.exit             |    1 +
 tests/qapi-schema/enum-int-member.json             |    3 +
 tests/qapi-schema/enum-max-member.err              |    1 +
 tests/qapi-schema/enum-max-member.exit             |    1 +
 tests/qapi-schema/enum-max-member.json             |    3 +
 tests/qapi-schema/enum-missing-data.err            |    1 +
 tests/qapi-schema/enum-missing-data.exit           |    1 +
 tests/qapi-schema/enum-missing-data.json           |    2 +
 tests/qapi-schema/enum-union-clash.err             |    1 +
 tests/qapi-schema/enum-union-clash.exit            |    1 +
 tests/qapi-schema/enum-union-clash.json            |    4 +
 tests/qapi-schema/enum-wrong-data.err              |    1 +
 tests/qapi-schema/enum-wrong-data.exit             |    1 +
 tests/qapi-schema/enum-wrong-data.json             |    2 +
 tests/qapi-schema/escape-outside-string.err        |    1 +
 tests/qapi-schema/escape-outside-string.exit       |    1 +
 tests/qapi-schema/escape-outside-string.json       |    3 +
 tests/qapi-schema/escape-too-big.err               |    1 +
 tests/qapi-schema/escape-too-big.exit              |    1 +
 tests/qapi-schema/escape-too-big.json              |    3 +
 tests/qapi-schema/escape-too-short.err             |    1 +
 tests/qapi-schema/escape-too-short.exit            |    1 +
 tests/qapi-schema/escape-too-short.json            |    3 +
 tests/qapi-schema/event-case.exit                  |    1 +
 tests/qapi-schema/event-case.json                  |    3 +
 tests/qapi-schema/event-case.out                   |    3 +
 tests/qapi-schema/event-max.err                    |    1 +
 tests/qapi-schema/event-max.exit                   |    1 +
 tests/qapi-schema/event-max.json                   |    2 +
 tests/qapi-schema/event-nest-struct.err            |    2 +-
 tests/qapi-schema/flat-union-array-branch.err      |    1 +
 tests/qapi-schema/flat-union-array-branch.exit     |    1 +
 tests/qapi-schema/flat-union-array-branch.json     |   12 +
 tests/qapi-schema/flat-union-bad-base.err          |    1 +
 tests/qapi-schema/flat-union-bad-base.exit         |    1 +
 tests/qapi-schema/flat-union-bad-base.json         |   13 +
 tests/qapi-schema/flat-union-bad-discriminator.err |    1 +
 .../qapi-schema/flat-union-bad-discriminator.exit  |    1 +
 .../qapi-schema/flat-union-bad-discriminator.json  |   15 +
 tests/qapi-schema/flat-union-base-star.err         |    1 +
 tests/qapi-schema/flat-union-base-star.exit        |    1 +
 tests/qapi-schema/flat-union-base-star.json        |   12 +
 tests/qapi-schema/flat-union-base-union.err        |    1 +
 tests/qapi-schema/flat-union-base-union.exit       |    1 +
 tests/qapi-schema/flat-union-base-union.json       |   15 +
 tests/qapi-schema/flat-union-branch-clash.err      |    1 +
 tests/qapi-schema/flat-union-branch-clash.exit     |    1 +
 tests/qapi-schema/flat-union-branch-clash.json     |   14 +
 tests/qapi-schema/flat-union-inline.err            |    1 +
 tests/qapi-schema/flat-union-inline.exit           |    1 +
 tests/qapi-schema/flat-union-inline.json           |   11 +
 tests/qapi-schema/flat-union-int-branch.err        |    1 +
 tests/qapi-schema/flat-union-int-branch.exit       |    1 +
 tests/qapi-schema/flat-union-int-branch.json       |   12 +
 .../qapi-schema/flat-union-invalid-branch-key.json |    6 +-
 .../flat-union-invalid-discriminator.err           |    2 +-
 .../flat-union-invalid-discriminator.json          |    6 +-
 tests/qapi-schema/flat-union-no-base.err           |    2 +-
 tests/qapi-schema/flat-union-no-base.json          |   12 +-
 .../flat-union-optional-discriminator.err          |    1 +
 .../flat-union-optional-discriminator.exit         |    1 +
 .../flat-union-optional-discriminator.json         |   10 +
 tests/qapi-schema/flat-union-reverse-define.json   |    6 +-
 tests/qapi-schema/flat-union-reverse-define.out    |   12 +-
 .../flat-union-string-discriminator.json           |    6 +-
 tests/qapi-schema/ident-with-escape.exit           |    1 +
 tests/qapi-schema/ident-with-escape.json           |    4 +
 tests/qapi-schema/ident-with-escape.out            |    3 +
 tests/qapi-schema/include-cycle.err                |    4 +-
 tests/qapi-schema/include-nested-err.err           |    2 +-
 tests/qapi-schema/indented-expr.json               |    4 +-
 tests/qapi-schema/indented-expr.out                |    2 +-
 tests/qapi-schema/missing-type.err                 |    1 +
 tests/qapi-schema/missing-type.exit                |    1 +
 tests/qapi-schema/missing-type.json                |    2 +
 tests/qapi-schema/nested-struct-data.err           |    1 +
 tests/qapi-schema/nested-struct-data.exit          |    1 +
 tests/qapi-schema/nested-struct-data.json          |    4 +
 tests/qapi-schema/nested-struct-returns.err        |    1 +
 tests/qapi-schema/nested-struct-returns.exit       |    1 +
 tests/qapi-schema/nested-struct-returns.json       |    3 +
 tests/qapi-schema/qapi-schema-test.json            |   66 +-
 tests/qapi-schema/qapi-schema-test.out             |   73 +-
 tests/qapi-schema/redefined-builtin.err            |    1 +
 tests/qapi-schema/redefined-builtin.exit           |    1 +
 tests/qapi-schema/redefined-builtin.json           |    2 +
 tests/qapi-schema/redefined-command.err            |    1 +
 tests/qapi-schema/redefined-command.exit           |    1 +
 tests/qapi-schema/redefined-command.json           |    3 +
 tests/qapi-schema/redefined-event.err              |    1 +
 tests/qapi-schema/redefined-event.exit             |    1 +
 tests/qapi-schema/redefined-event.json             |    3 +
 tests/qapi-schema/redefined-type.err               |    1 +
 tests/qapi-schema/redefined-type.exit              |    1 +
 tests/qapi-schema/redefined-type.json              |    3 +
 tests/qapi-schema/returns-alternate.err            |    1 +
 tests/qapi-schema/returns-alternate.exit           |    1 +
 tests/qapi-schema/returns-alternate.json           |    3 +
 tests/qapi-schema/returns-array-bad.err            |    1 +
 tests/qapi-schema/returns-array-bad.exit           |    1 +
 tests/qapi-schema/returns-array-bad.json           |    2 +
 tests/qapi-schema/returns-int.exit                 |    1 +
 tests/qapi-schema/returns-int.json                 |    3 +
 tests/qapi-schema/returns-int.out                  |    3 +
 tests/qapi-schema/returns-unknown.err              |    1 +
 tests/qapi-schema/returns-unknown.exit             |    1 +
 tests/qapi-schema/returns-unknown.json             |    2 +
 tests/qapi-schema/returns-whitelist.err            |    1 +
 tests/qapi-schema/returns-whitelist.exit           |    1 +
 tests/qapi-schema/returns-whitelist.json           |   11 +
 tests/qapi-schema/struct-base-clash-deep.err       |    1 +
 tests/qapi-schema/struct-base-clash-deep.exit      |    1 +
 tests/qapi-schema/struct-base-clash-deep.json      |    9 +
 tests/qapi-schema/struct-base-clash.err            |    1 +
 tests/qapi-schema/struct-base-clash.exit           |    1 +
 tests/qapi-schema/struct-base-clash.json           |    6 +
 tests/qapi-schema/type-bypass-bad-gen.err          |    1 +
 tests/qapi-schema/type-bypass-bad-gen.exit         |    1 +
 tests/qapi-schema/type-bypass-bad-gen.json         |    2 +
 tests/qapi-schema/type-bypass-no-gen.err           |    1 +
 tests/qapi-schema/type-bypass-no-gen.exit          |    1 +
 tests/qapi-schema/type-bypass-no-gen.json          |    2 +
 tests/qapi-schema/type-bypass.exit                 |    1 +
 tests/qapi-schema/type-bypass.json                 |    2 +
 tests/qapi-schema/type-bypass.out                  |    3 +
 tests/qapi-schema/unicode-str.err                  |    1 +
 tests/qapi-schema/unicode-str.exit                 |    1 +
 tests/qapi-schema/unicode-str.json                 |    2 +
 tests/qapi-schema/union-bad-branch.err             |    1 +
 tests/qapi-schema/union-bad-branch.exit            |    1 +
 tests/qapi-schema/union-bad-branch.json            |    8 +
 tests/qapi-schema/union-base-no-discriminator.err  |    1 +
 tests/qapi-schema/union-base-no-discriminator.exit |    1 +
 tests/qapi-schema/union-base-no-discriminator.json |   14 +
 tests/qapi-schema/union-invalid-base.err           |    2 +-
 tests/qapi-schema/union-invalid-base.json          |    8 +-
 tests/qapi-schema/union-max.err                    |    1 +
 tests/qapi-schema/union-max.exit                   |    1 +
 tests/qapi-schema/union-max.json                   |    3 +
 tests/qapi-schema/union-optional-branch.err        |    1 +
 tests/qapi-schema/union-optional-branch.exit       |    1 +
 tests/qapi-schema/union-optional-branch.json       |    2 +
 tests/qapi-schema/union-unknown.err                |    1 +
 tests/qapi-schema/union-unknown.exit               |    1 +
 tests/qapi-schema/union-unknown.json               |    3 +
 tests/qapi-schema/unknown-escape.err               |    1 +
 tests/qapi-schema/unknown-escape.exit              |    1 +
 tests/qapi-schema/unknown-escape.json              |    3 +
 tests/qapi-schema/unknown-expr-key.err             |    1 +
 tests/qapi-schema/unknown-expr-key.exit            |    1 +
 tests/qapi-schema/unknown-expr-key.json            |    2 +
 tests/qemu-iotests-quick.sh                        |    2 +-
 tests/qemu-iotests/.gitignore                      |    1 +
 tests/qemu-iotests/001.out                         |    2 +-
 tests/qemu-iotests/002.out                         |    2 +-
 tests/qemu-iotests/003.out                         |    2 +-
 tests/qemu-iotests/004                             |    2 +-
 tests/qemu-iotests/004.out                         |    2 +-
 tests/qemu-iotests/005.out                         |    2 +-
 tests/qemu-iotests/006                             |   54 -
 tests/qemu-iotests/006.out                         |    6 -
 tests/qemu-iotests/007                             |    3 +
 tests/qemu-iotests/007.out                         |    2 +-
 tests/qemu-iotests/008.out                         |    2 +-
 tests/qemu-iotests/009.out                         |    2 +-
 tests/qemu-iotests/010.out                         |    2 +-
 tests/qemu-iotests/011.out                         |    2 +-
 tests/qemu-iotests/012.out                         |    2 +-
 tests/qemu-iotests/013.out                         |    2 +-
 tests/qemu-iotests/014.out                         |    2 +-
 tests/qemu-iotests/015                             |    2 +
 tests/qemu-iotests/015.out                         |    2 +-
 tests/qemu-iotests/016                             |   70 -
 tests/qemu-iotests/016.out                         |   23 -
 tests/qemu-iotests/017.out                         |    2 +-
 tests/qemu-iotests/018.out                         |    2 +-
 tests/qemu-iotests/019.out                         |    4 +-
 tests/qemu-iotests/020.out                         |    4 +-
 tests/qemu-iotests/021.out                         |    2 +-
 tests/qemu-iotests/022.out                         |    2 +-
 tests/qemu-iotests/023.out                         |   16 +-
 tests/qemu-iotests/024.out                         |    6 +-
 tests/qemu-iotests/025.out                         |    2 +-
 tests/qemu-iotests/026                             |    7 +
 tests/qemu-iotests/026.out                         |  324 +-
 tests/qemu-iotests/027.out                         |    2 +-
 tests/qemu-iotests/028.out                         |    6 +-
 tests/qemu-iotests/029                             |    2 +
 tests/qemu-iotests/029.out                         |    8 +-
 tests/qemu-iotests/030                             |   22 +-
 tests/qemu-iotests/031.out                         |    4 +-
 tests/qemu-iotests/032.out                         |    2 +-
 tests/qemu-iotests/033                             |   66 +-
 tests/qemu-iotests/033.out                         |   58 +-
 tests/qemu-iotests/034.out                         |    4 +-
 tests/qemu-iotests/035.out                         |    2 +-
 tests/qemu-iotests/036.out                         |    6 +-
 tests/qemu-iotests/037.out                         |    4 +-
 tests/qemu-iotests/038.out                         |    4 +-
 tests/qemu-iotests/039                             |   18 +-
 tests/qemu-iotests/039.out                         |   18 +-
 tests/qemu-iotests/040                             |   32 +-
 tests/qemu-iotests/041                             |   66 +-
 tests/qemu-iotests/042.out                         |    2 +-
 tests/qemu-iotests/043.out                         |   52 +-
 tests/qemu-iotests/046.out                         |    4 +-
 tests/qemu-iotests/047.out                         |    2 +-
 tests/qemu-iotests/048                             |    2 +-
 tests/qemu-iotests/048.out                         |    4 +-
 tests/qemu-iotests/049.out                         |  118 +-
 tests/qemu-iotests/050.out                         |    6 +-
 tests/qemu-iotests/051                             |   11 +-
 tests/qemu-iotests/051.out                         |   96 +-
 tests/qemu-iotests/052.out                         |    2 +-
 tests/qemu-iotests/053.out                         |    2 +-
 tests/qemu-iotests/054.out                         |    4 +-
 tests/qemu-iotests/055                             |  232 +-
 tests/qemu-iotests/055.out                         |    4 +-
 tests/qemu-iotests/058                             |   14 +-
 tests/qemu-iotests/059                             |   15 +-
 tests/qemu-iotests/059.out                         |    7 +
 tests/qemu-iotests/060                             |   17 +-
 tests/qemu-iotests/060.out                         |   41 +-
 tests/qemu-iotests/061.out                         |   45 +-
 tests/qemu-iotests/062.out                         |    2 +-
 tests/qemu-iotests/064                             |   19 +-
 tests/qemu-iotests/064.out                         |   34 +-
 tests/qemu-iotests/065                             |   23 +-
 tests/qemu-iotests/066.out                         |    2 +-
 tests/qemu-iotests/067                             |    7 +-
 tests/qemu-iotests/067.out                         |  816 ++-
 tests/qemu-iotests/068.out                         |    2 +-
 tests/qemu-iotests/069.out                         |    4 +-
 tests/qemu-iotests/071                             |   12 +-
 tests/qemu-iotests/071.out                         |   22 +-
 tests/qemu-iotests/072.out                         |    2 +-
 tests/qemu-iotests/073.out                         |    4 +-
 tests/qemu-iotests/076                             |   15 +-
 tests/qemu-iotests/076.out                         |   10 +
 tests/qemu-iotests/077                             |    2 +-
 tests/qemu-iotests/077.out                         |    2 +-
 tests/qemu-iotests/079                             |   10 +-
 tests/qemu-iotests/079.out                         |   38 +-
 tests/qemu-iotests/080                             |    2 +
 tests/qemu-iotests/080.out                         |   24 +-
 tests/qemu-iotests/081                             |   10 +-
 tests/qemu-iotests/081.out                         |    8 +-
 tests/qemu-iotests/082                             |   14 +-
 tests/qemu-iotests/082.out                         |   97 +-
 tests/qemu-iotests/083                             |    3 +-
 tests/qemu-iotests/083.out                         |   81 +-
 tests/qemu-iotests/084.out                         |    4 +-
 tests/qemu-iotests/085.out                         |   38 +-
 tests/qemu-iotests/086.out                         |    2 +-
 tests/qemu-iotests/087                             |    3 +-
 tests/qemu-iotests/087.out                         |   33 +-
 tests/qemu-iotests/088.out                         |    2 +-
 tests/qemu-iotests/089                             |    8 +-
 tests/qemu-iotests/089.out                         |    6 +-
 tests/qemu-iotests/090.out                         |    2 +-
 tests/qemu-iotests/091.out                         |    2 +-
 tests/qemu-iotests/092.out                         |    8 +-
 tests/qemu-iotests/093                             |  151 +
 tests/qemu-iotests/093.out                         |    5 +
 tests/qemu-iotests/094                             |   81 +
 tests/qemu-iotests/094.out                         |   11 +
 tests/qemu-iotests/095.out                         |    6 +-
 tests/qemu-iotests/097.out                         |   24 +-
 tests/qemu-iotests/098.out                         |   16 +-
 tests/qemu-iotests/099                             |   20 +-
 tests/qemu-iotests/099.out                         |   16 +-
 tests/qemu-iotests/100                             |   12 +
 tests/qemu-iotests/100.out                         |   14 +-
 tests/qemu-iotests/103                             |   10 +
 tests/qemu-iotests/103.out                         |    7 +-
 tests/qemu-iotests/104                             |   11 +-
 tests/qemu-iotests/104.out                         |    4 +-
 tests/qemu-iotests/107.out                         |    2 +-
 tests/qemu-iotests/108                             |    2 +
 tests/qemu-iotests/108.out                         |   12 +-
 tests/qemu-iotests/109                             |  132 +
 tests/qemu-iotests/109.out                         |  231 +
 tests/qemu-iotests/110                             |   94 +
 tests/qemu-iotests/110.out                         |   19 +
 tests/qemu-iotests/112                             |  187 +
 tests/qemu-iotests/112.out                         |   84 +
 tests/qemu-iotests/115                             |   95 +
 tests/qemu-iotests/115.out                         |    8 +
 tests/qemu-iotests/116                             |   96 +
 tests/qemu-iotests/116.out                         |   37 +
 tests/qemu-iotests/119                             |   60 +
 tests/qemu-iotests/119.out                         |   11 +
 tests/qemu-iotests/120                             |   65 +
 tests/qemu-iotests/120.out                         |   15 +
 tests/qemu-iotests/121                             |  102 +
 tests/qemu-iotests/121.out                         |   23 +
 tests/qemu-iotests/122                             |  223 +
 tests/qemu-iotests/122.out                         |  209 +
 tests/qemu-iotests/123                             |   62 +
 tests/qemu-iotests/123.out                         |    9 +
 tests/qemu-iotests/124                             |  363 +
 tests/qemu-iotests/124.out                         |    5 +
 tests/qemu-iotests/128                             |   84 +
 tests/qemu-iotests/128.out                         |    5 +
 tests/qemu-iotests/129                             |   86 +
 tests/qemu-iotests/129.out                         |    5 +
 tests/qemu-iotests/130                             |   95 +
 tests/qemu-iotests/130.out                         |   43 +
 tests/qemu-iotests/131                             |   77 +
 tests/qemu-iotests/131.out                         |   41 +
 tests/qemu-iotests/132                             |   59 +
 tests/qemu-iotests/132.out                         |    5 +
 tests/qemu-iotests/134                             |   69 +
 tests/qemu-iotests/134.out                         |   46 +
 tests/qemu-iotests/135                             |   54 +
 tests/qemu-iotests/135.out                         |    5 +
 tests/qemu-iotests/check                           |   13 +-
 tests/qemu-iotests/common                          |   16 +-
 tests/qemu-iotests/common.config                   |    4 +-
 tests/qemu-iotests/common.filter                   |   13 +-
 tests/qemu-iotests/common.qemu                     |   15 +-
 tests/qemu-iotests/common.rc                       |   15 +-
 tests/qemu-iotests/group                           |   26 +-
 tests/qemu-iotests/iotests.py                      |  103 +-
 tests/qemu-iotests/sample_images/afl5.img.bz2      |  Bin 0 -> 175 bytes
 tests/qemu-iotests/sample_images/afl9.vmdk.bz2     |  Bin 0 -> 178 bytes
 tests/qemu-iotests/sample_images/grub_mbr.raw.bz2  |  Bin 0 -> 552 bytes
 tests/qom-test.c                                   |    4 +-
 tests/rcutorture.c                                 |  463 +
 tests/rocker/README                                |    5 +
 tests/rocker/all                                   |   19 +
 tests/rocker/bridge                                |   43 +
 tests/rocker/bridge-stp                            |   52 +
 tests/rocker/bridge-vlan                           |   52 +
 tests/rocker/bridge-vlan-stp                       |   64 +
 tests/rocker/port                                  |   22 +
 tests/rocker/tut.dot                               |    8 +
 tests/rtl8139-test.c                               |  181 +
 tests/tco-test.c                                   |  465 +
 tests/test-aio.c                                   |   26 +-
 tests/test-coroutine.c                             |   28 +-
 tests/test-crypto-cipher.c                         |  302 +
 tests/test-crypto-hash.c                           |  209 +
 tests/test-hbitmap.c                               |  293 +
 tests/test-opts-visitor.c                          |    3 +-
 tests/test-qemu-opts.c                             |   40 +-
 tests/test-qmp-commands.c                          |   52 +-
 tests/test-qmp-event.c                             |    4 +-
 tests/test-qmp-input-strict.c                      |   98 +-
 tests/test-qmp-input-visitor.c                     |  119 +-
 tests/test-qmp-output-visitor.c                    |  162 +-
 tests/test-rcu-list.c                              |  316 +
 tests/test-throttle.c                              |  163 +-
 tests/test-visitor-serialization.c                 |   87 +-
 tests/test-vmstate.c                               |   26 +-
 tests/test-write-threshold.c                       |  119 +
 tests/test-x86-cpuid.c                             |    2 +-
 tests/usb-hcd-ohci-test.c                          |    2 +-
 tests/usb-hcd-uhci-test.c                          |    4 +-
 tests/usb-hcd-xhci-test.c                          |    4 +-
 tests/virtio-blk-test.c                            |  331 +-
 tests/virtio-scsi-test.c                           |  201 +-
 tests/wdt_ib700-test.c                             |   15 +-
 thread-pool.c                                      |   14 +-
 thunk.c                                            |   16 +-
 tpm.c                                              |   25 +-
 trace-events                                       |  282 +-
 trace/control.c                                    |    2 +-
 translate-all.c                                    |  144 +-
 translate-all.h                                    |    8 +-
 ui/Makefile.objs                                   |   30 +-
 ui/cocoa.m                                         |  421 +-
 ui/console-gl.c                                    |  168 +
 ui/console.c                                       |  148 +-
 ui/d3des.c                                         |  424 -
 ui/d3des.h                                         |   55 -
 ui/egl-helpers.c                                   |  148 +
 ui/gtk-egl.c                                       |  141 +
 ui/gtk.c                                           |  388 +-
 ui/input-keymap.c                                  |    4 +
 ui/input-legacy.c                                  |    9 -
 ui/input.c                                         |    6 +-
 ui/keymaps.c                                       |  196 +-
 ui/qemu-pixman.c                                   |   29 +-
 ui/sdl.c                                           |   66 +-
 ui/sdl2-2d.c                                       |  147 +
 ui/sdl2-gl.c                                       |  112 +
 ui/sdl2-input.c                                    |  100 +
 ui/sdl2.c                                          |  403 +-
 ui/shader.c                                        |  114 +
 ui/shader/texture-blit.frag                        |   10 +
 ui/shader/texture-blit.vert                        |   10 +
 ui/spice-core.c                                    |   52 +-
 ui/spice-display.c                                 |  108 +-
 ui/vnc-auth-sasl.c                                 |    4 +-
 ui/vnc-auth-vencrypt.c                             |   11 +-
 ui/vnc-enc-tight.c                                 |    2 +-
 ui/vnc-jobs.c                                      |   14 +-
 ui/vnc-jobs.h                                      |    1 -
 ui/vnc-tls.c                                       |   82 +-
 ui/vnc-tls.h                                       |    7 -
 ui/vnc-ws.c                                        |  196 +-
 ui/vnc-ws.h                                        |   13 +-
 ui/vnc.c                                           | 1156 ++-
 ui/vnc.h                                           |   30 +-
 ui/vnc_keysym.h                                    |    1 +
 ui/x_keymap.c                                      |    4 +-
 user-exec.c                                        |   17 +-
 util/Makefile.objs                                 |    3 +-
 util/aes.c                                         | 1652 ----
 util/bitmap.c                                      |   83 +
 util/compatfd.c                                    |   19 -
 util/cutils.c                                      |   33 +-
 util/envlist.c                                     |   32 +-
 util/error.c                                       |   14 +-
 util/event_notifier-posix.c                        |    3 +-
 util/hbitmap.c                                     |  102 +-
 util/iov.c                                         |   18 +-
 util/osdep.c                                       |   67 +-
 util/oslib-posix.c                                 |   71 +-
 util/oslib-win32.c                                 |   24 +
 util/qemu-config.c                                 |  123 +-
 util/qemu-error.c                                  |    5 +-
 util/qemu-option.c                                 |  196 +-
 util/qemu-sockets.c                                |   98 +-
 util/qemu-thread-posix.c                           |   43 +-
 util/qemu-thread-win32.c                           |   48 +-
 util/rcu.c                                         |  330 +
 util/throttle.c                                    |   81 +-
 util/uri.c                                         |  179 +-
 vl.c                                               | 1339 ++--
 vmstate.c                                          |  687 --
 xbzrle.c                                           |  175 -
 xen-common.c                                       |    5 +
 xen-hvm-stub.c                                     |    4 -
 xen-hvm.c                                          |   22 +-
 xen-mapcache.c                                     |   94 +-
 1892 files changed, 146035 insertions(+), 66598 deletions(-)

diff --git a/.gitignore b/.gitignore
index e32a584..61bc492 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,8 @@
 /trace/generated-tcg-tracers.h
 /trace/generated-ust-provider.h
 /trace/generated-ust.c
+/ui/shader/texture-blit-frag.h
+/ui/shader/texture-blit-vert.h
 /libcacard/trace/generated-tracers.c
 *-timestamp
 /*-softmmu
@@ -37,14 +39,8 @@
 /qemu-tech.html
 /qemu-doc.info
 /qemu-tech.info
-/qemu.1
-/qemu.pod
-/qemu-img.1
-/qemu-img.pod
 /qemu-img
 /qemu-nbd
-/qemu-nbd.8
-/qemu-nbd.pod
 /qemu-options.def
 /qemu-options.texi
 /qemu-img-cmds.texi
@@ -56,8 +52,7 @@
 /qmp-commands.txt
 /vscclient
 /fsdev/virtfs-proxy-helper
-/fsdev/virtfs-proxy-helper.1
-/fsdev/virtfs-proxy-helper.pod
+*.[1-9]
 *.a
 *.aux
 *.cp
@@ -70,6 +65,7 @@
 *.ky
 *.log
 *.pdf
+*.pod
 *.cps
 *.fns
 *.kys
diff --git a/.travis.yml b/.travis.yml
index ad66e5b..0ac170b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -98,3 +98,6 @@ matrix:
           EXTRA_PKGS=3D"liblttng-ust-dev liburcu-dev"
           EXTRA_CONFIG=3D"--enable-trace-backends=3Dust"
       compiler: gcc
+    - env: TARGETS=3Di386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG=3D"--enable-modules"
+      compiler: gcc
diff --git a/LICENSE b/LICENSE
index da70e94..0e0b4b9 100644
--- a/LICENSE
+++ b/LICENSE
@@ -11,7 +11,7 @@ option) any later version.
 
 As of July 2013, contributions under version 2 of the GNU General Public
 License (and no later version) are only accepted for the following files
-or directories: bsd-user/, linux-user/, hw/misc/vfio.c, hw/xen/xen_pt*.
+or directories: bsd-user/, linux-user/, hw/vfio/, hw/xen/xen_pt*.
 
 3) The Tiny Code Generator (TCG) is released under the BSD license
    (see license headers in files).
diff --git a/MAINTAINERS b/MAINTAINERS
index bcb69e8..978b717 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -50,14 +50,12 @@ Descriptions of section entries:
 
 General Project Administration
 ------------------------------
-M: Anthony Liguori <aliguori@amazon.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 
 Responsible Disclosure, Reporting Security Issues
 ------------------------------
 W: http://wiki.qemu.org/SecurityProcess
 M: Michael S. Tsirkin <mst@redhat.com>
-M: Anthony Liguori <aliguori@amazon.com>
 L: secalert@redhat.com
 
 Guest CPU cores (TCG):
@@ -98,8 +96,12 @@ LM32
 M: Michael Walle <michael@walle.cc>
 S: Maintained
 F: target-lm32/
+F: disas/lm32.c
 F: hw/lm32/
-F: hw/char/lm32_*
+F: hw/*/lm32_*
+F: hw/*/milkymist-*
+F: include/hw/char/lm32_juart.h
+F: include/hw/lm32/
 F: tests/tcg/lm32/
 
 M68K
@@ -155,6 +157,7 @@ F: hw/sh4/
 
 SPARC
 M: Blue Swirl <blauwirbel@gmail.com>
+M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
 S: Maintained
 F: target-sparc/
 F: hw/sparc/
@@ -169,7 +172,8 @@ F: hw/unicore32/
 X86
 M: Paolo Bonzini <pbonzini@redhat.com>
 M: Richard Henderson <rth@twiddle.net>
-S: Odd Fixes
+M: Eduardo Habkost <ehabkost@redhat.com>
+S: Maintained
 F: target-i386/
 F: hw/i386/
 
@@ -352,6 +356,13 @@ F: hw/misc/zynq_slcr.c
 F: hw/*/cadence_*
 F: hw/ssi/xilinx_spips.c
 
+ARM ACPI Subsystem
+M: Shannon Zhao <zhaoshenglong@huawei.com>
+M: Shannon Zhao <shannon.zhao@linaro.org>
+S: Maintained
+F: hw/arm/virt-acpi-build.c
+F: include/hw/arm/virt-acpi-build.h
+
 CRIS Machines
 -------------
 Axis Dev88
@@ -482,7 +493,8 @@ F: hw/ppc/prep.c
 F: hw/pci-host/prep.[hc]
 F: hw/isa/pc87312.[hc]
 
-sPAPR
+sPAPR (pseries)
+M: David Gibson <david@gibson.dropbear.id.au>
 M: Alexander Graf <agraf@suse.de>
 L: qemu-ppc@nongnu.org
 S: Supported
@@ -514,11 +526,13 @@ SPARC Machines
 --------------
 Sun4m
 M: Blue Swirl <blauwirbel@gmail.com>
+M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
 S: Maintained
 F: hw/sparc/sun4m.c
 
 Sun4u
 M: Blue Swirl <blauwirbel@gmail.com>
+M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
 S: Maintained
 F: hw/sparc64/sun4u.c
 
@@ -534,6 +548,7 @@ S390 Virtio
 M: Alexander Graf <agraf@suse.de>
 S: Maintained
 F: hw/s390x/s390-*.c
+X: hw/s390x/*pci*.[hc]
 
 S390 Virtio-ccw
 M: Cornelia Huck <cornelia.huck@de.ibm.com>
@@ -544,6 +559,7 @@ F: hw/s390x/s390-virtio-ccw.c
 F: hw/s390x/css.[hc]
 F: hw/s390x/sclp*.[hc]
 F: hw/s390x/ipl*.[hc]
+F: hw/s390x/*pci*.[hc]
 F: include/hw/s390x/
 F: pc-bios/s390-ccw/
 T: git git://github.com/cohuck/qemu virtio-ccw-upstr
@@ -559,7 +575,6 @@ F: hw/unicore32/
 X86 Machines
 ------------
 PC
-M: Anthony Liguori <aliguori@amazon.com>
 M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
 F: include/hw/i386/
@@ -593,12 +608,31 @@ F: hw/net/opencores_eth.c
 
 Devices
 -------
+EDU
+M: Jiri Slaby <jslaby@suse.cz>
+S: Maintained
+F: hw/misc/edu.c
+
 IDE
-M: Kevin Wolf <kwolf@redhat.com>
-M: Stefan Hajnoczi <stefanha@redhat.com>
-S: Odd Fixes
+M: John Snow <jsnow@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
 F: include/hw/ide.h
 F: hw/ide/
+F: hw/block/block.c
+F: hw/block/cdrom.c
+F: hw/block/hd-geometry.c
+F: tests/ide-test.c
+F: tests/ahci-test.c
+T: git git://github.com/jnsnow/qemu.git ide
+
+Floppy
+M: John Snow <jsnow@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: hw/block/fdc.c
+F: include/hw/block/fdc.h
+T: git git://github.com/jnsnow/qemu.git ide
 
 OMAP
 M: Peter Maydell <peter.maydell@linaro.org>
@@ -610,7 +644,19 @@ M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
 F: include/hw/pci/*
 F: hw/pci/*
+
+ACPI
+M: Michael S. Tsirkin <mst@redhat.com>
+M: Igor Mammedov <imammedo@redhat.com>
+S: Supported
+F: include/hw/acpi/*
+F: hw/mem/*
 F: hw/acpi/*
+F: hw/i386/acpi-build.[hc]
+F: hw/i386/*dsl
+F: hw/arm/virt-acpi-build.c
+F: include/hw/arm/virt-acpi-build.h
+F: scripts/acpi*py
 
 ppc4xx
 M: Alexander Graf <agraf@suse.de>
@@ -657,7 +703,7 @@ F: hw/usb/dev-serial.c
 VFIO
 M: Alex Williamson <alex.williamson@redhat.com>
 S: Supported
-F: hw/misc/vfio.c
+F: hw/vfio/*
 
 vhost
 M: Michael S. Tsirkin <mst@redhat.com>
@@ -665,10 +711,10 @@ S: Supported
 F: hw/*/*vhost*
 
 virtio
-M: Anthony Liguori <aliguori@amazon.com>
 M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
 F: hw/*/virtio*
+F: net/vhost-user.c
 
 virtio-9p
 M: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
@@ -679,10 +725,13 @@ F: tests/virtio-9p-test.c
 T: git git://github.com/kvaneesh/QEMU.git
 
 virtio-blk
-M: Kevin Wolf <kwolf@redhat.com>
 M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: hw/block/virtio-blk.c
+F: hw/block/dataplane/*
+F: hw/virtio/dataplane/*
+T: git git://github.com/stefanha/qemu.git block
 
 virtio-ccw
 M: Cornelia Huck <cornelia.huck@de.ibm.com>
@@ -691,20 +740,36 @@ S: Supported
 F: hw/s390x/virtio-ccw.[hc]
 T: git git://github.com/cohuck/qemu virtio-ccw-upstr
 
+virtio-input
+M: Gerd Hoffmann <kraxel@redhat.com>
+S: Maintained
+F: hw/input/virtio-input*.c
+F: include/hw/virtio/virtio-input.h
+
 virtio-serial
 M: Amit Shah <amit.shah@redhat.com>
 S: Supported
 F: hw/char/virtio-serial-bus.c
 F: hw/char/virtio-console.c
+F: include/hw/virtio/virtio-serial.h
+
+virtio-rng
+M: Amit Shah <amit.shah@redhat.com>
+S: Supported
+F: hw/virtio/virtio-rng.c
+F: include/hw/virtio/virtio-rng.h
+F: backends/rng*.c
 
 nvme
 M: Keith Busch <keith.busch@intel.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: hw/block/nvme*
 F: tests/nvme-test.c
 
 megasas
 M: Hannes Reinecke <hare@suse.de>
+L: qemu-block@nongnu.org
 S: Supported
 F: hw/scsi/megasas.c
 F: hw/scsi/mfi.h
@@ -722,10 +787,15 @@ S: Maintained
 F: hw/net/vmxnet*
 F: hw/scsi/vmw_pvscsi*
 
+Rocker
+M: Scott Feldman <sfeldma@gmail.com>
+M: Jiri Pirko <jiri@resnulli.us>
+S: Maintained
+F: hw/net/rocker/
+
 Subsystems
 ----------
 Audio
-M: Vassili Karpov (malc) <av1474@comtv.ru>
 M: Gerd Hoffmann <kraxel@redhat.com>
 S: Maintained
 F: audio/
@@ -734,24 +804,50 @@ F: tests/ac97-test.c
 F: tests/es1370-test.c
 F: tests/intel-hda-test.c
 
-Block
+Block layer core
 M: Kevin Wolf <kwolf@redhat.com>
-M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
-F: async.c
-F: aio-*.c
 F: block*
 F: block/
 F: hw/block/
+F: include/block/
 F: qemu-img*
 F: qemu-io*
-F: tests/image-fuzzer/
 F: tests/qemu-iotests/
 T: git git://repo.or.cz/qemu/kevin.git block
+
+Block I/O path
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: async.c
+F: aio-*.c
+F: block/io.c
+F: migration/block*
 T: git git://github.com/stefanha/qemu.git block
 
+Block Jobs
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: blockjob.c
+F: include/block/blockjob.h
+F: block/backup.c
+F: block/commit.c
+F: block/stream.h
+F: block/mirror.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
+
+Block QAPI, monitor, command line
+M: Markus Armbruster <armbru@redhat.com>
+S: Supported
+F: blockdev.c
+F: block/qapi.c
+F: qapi/block*.json
+T: git git://repo.or.cz/qemu/armbru.git block-next
+
 Character Devices
-M: Anthony Liguori <aliguori@amazon.com>
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
 F: qemu-char.c
@@ -763,6 +859,11 @@ M: Samuel Thibault <samuel.thibault@ens-lyon.org>
 S: Maintained
 F: backends/baum.c
 
+Coverity model
+M: Markus Armbruster <armbru@redhat.com>
+S: Supported
+F: scripts/coverity-model.c
+
 CPU
 M: Andreas F=C3=A4rber <afaerber@suse.de>
 S: Supported
@@ -807,7 +908,6 @@ F: audio/spiceaudio.c
 F: hw/display/qxl*
 
 Graphics
-M: Anthony Liguori <aliguori@amazon.com>
 M: Gerd Hoffmann <kraxel@redhat.com>
 S: Odd Fixes
 F: ui/
@@ -819,7 +919,6 @@ S: Odd Fixes
 F: ui/cocoa.m
 
 Main loop
-M: Anthony Liguori <aliguori@amazon.com>
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
 F: cpus.c
@@ -836,8 +935,8 @@ F: hmp-commands.hx
 T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
 
 Network device layer
-M: Anthony Liguori <aliguori@amazon.com>
 M: Stefan Hajnoczi <stefanha@redhat.com>
+M: Jason Wang <jasowang@redhat.com>
 S: Maintained
 F: net/
 T: git git://github.com/stefanha/qemu.git net
@@ -858,21 +957,33 @@ F: nbd.*
 F: qemu-nbd.c
 T: git git://github.com/bonzini/qemu.git nbd-next
 
+NUMA
+M: Eduardo Habkost <ehabkost@redhat.com>
+S: Maintained
+F: numa.c
+F: include/sysemu/numa.h
+K: numa|NUMA
+K: srat|SRAT
+T: git git://github.com/ehabkost/qemu.git numa
+
 QAPI
-M: Luiz Capitulino <lcapitulino@redhat.com>
+M: Markus Armbruster <armbru@redhat.com>
 M: Michael Roth <mdroth@linux.vnet.ibm.com>
-S: Maintained
+S: Supported
 F: qapi/
+X: qapi/*.json
 F: tests/qapi-schema/
-T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
+F: scripts/qapi*
+F: docs/qapi*
+T: git git://repo.or.cz/qemu/armbru.git qapi-next
 
 QAPI Schema
 M: Eric Blake <eblake@redhat.com>
-M: Luiz Capitulino <lcapitulino@redhat.com>
 M: Markus Armbruster <armbru@redhat.com>
 S: Supported
 F: qapi-schema.json
-T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
+F: qapi/*.json
+T: git git://repo.or.cz/qemu/armbru.git qapi-next
 
 QObject
 M: Luiz Capitulino <lcapitulino@redhat.com>
@@ -887,7 +998,6 @@ F: qga/
 T: git git://github.com/mdroth/qemu.git qga
 
 QOM
-M: Anthony Liguori <aliguori@amazon.com>
 M: Andreas F=C3=A4rber <afaerber@suse.de>
 S: Supported
 T: git git://github.com/afaerber/qemu-cpu.git qom-next
@@ -898,13 +1008,14 @@ X: qom/cpu.c
 F: tests/qom-test.c
 
 QMP
-M: Luiz Capitulino <lcapitulino@redhat.com>
-S: Maintained
+M: Markus Armbruster <armbru@redhat.com>
+S: Supported
 F: qmp.c
 F: monitor.c
 F: qmp-commands.hx
-F: QMP/
-T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
+F: docs/qmp/
+F: scripts/qmp/
+T: git git://repo.or.cz/qemu/armbru.git qapi-next
 
 SLIRP
 M: Jan Kiszka <jan.kiszka@siemens.com>
@@ -928,12 +1039,12 @@ F: scripts/checkpatch.pl
 
 Migration
 M: Juan Quintela <quintela@redhat.com>
+M: Amit Shah <amit.shah@redhat.com>
 S: Maintained
 F: include/migration/
-F: migration*
-F: savevm.c
-F: arch_init.c
-F: vmstate.c
+F: migration/
+F: scripts/vmstate-static-checker.py
+F: tests/vmstate-static-checker-data/
 
 Seccomp
 M: Eduardo Otubo <eduardo.otubo@profitbricks.com>
@@ -941,6 +1052,13 @@ S: Supported
 F: qemu-seccomp.c
 F: include/sysemu/seccomp.h
 
+Cryptography
+M: Daniel P. Berrange <berrange@redhat.com>
+S: Maintained
+F: crypto/
+F: include/crypto/
+F: tests/test-crypto-*
+
 Usermode Emulation
 ------------------
 Overall
@@ -1046,28 +1164,38 @@ Block drivers
 -------------
 VMDK
 M: Fam Zheng <famz@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: block/vmdk.c
 
 RBD
-M: Josh Durgin <josh.durgin@inktank.com>
+M: Josh Durgin <jdurgin@redhat.com>
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: block/rbd.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
 
 Sheepdog
 M: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
 M: Liu Yuan <namei.unix@gmail.com>
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
 L: sheepdog@lists.wpkg.org
 S: Supported
 F: block/sheepdog.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
 
 VHDX
 M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: block/vhdx*
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
 
 VDI
 M: Stefan Weil <sw@weilnetz.de>
+L: qemu-block@nongnu.org
 S: Maintained
 F: block/vdi.c
 
@@ -1075,26 +1203,144 @@ iSCSI
 M: Ronnie Sahlberg <ronniesahlberg@gmail.com>
 M: Paolo Bonzini <pbonzini@redhat.com>
 M: Peter Lieven <pl@kamp.de>
+L: qemu-block@nongnu.org
 S: Supported
 F: block/iscsi.c
 
 NFS
+M: Jeff Cody <jcody@redhat.com>
 M: Peter Lieven <pl@kamp.de>
+L: qemu-block@nongnu.org
 S: Maintained
 F: block/nfs.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
 
 SSH
 M: Richard W.M. Jones <rjones@redhat.com>
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
 S: Supported
 F: block/ssh.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
 
 ARCHIPELAGO
-M: Chrysostomos Nanakos <cnanakos@grnet.gr>
 M: Chrysostomos Nanakos <chris@include.gr>
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
 S: Maintained
 F: block/archipelago.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
+
+CURL
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/curl.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
+
+GLUSTER
+M: Jeff Cody <jcody@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/gluster.c
+T: git git://github.com/codyprime/qemu-kvm-jtc.git block
+
+Null Block Driver
+M: Fam Zheng <famz@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/null.c
 
 Bootdevice
 M: Gonglei <arei.gonglei@huawei.com>
 S: Maintained
 F: bootdevice.c
+
+Quorum
+M: Alberto Garcia <berto@igalia.com>
+S: Supported
+F: block/quorum.c
+L: qemu-block@nongnu.org
+
+blkverify
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/blkverify.c
+
+bochs
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/bochs.c
+
+cloop
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/cloop.c
+
+dmg
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/dmg.c
+
+parallels
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/parallels.c
+
+qed
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/qed.c
+
+raw
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/linux-aio.c
+F: block/raw-aio.h
+F: block/raw-posix.c
+F: block/raw-win32.c
+F: block/raw_bsd.c
+F: block/win32-aio.c
+
+qcow2
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/qcow2*
+
+qcow
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/qcow.c
+
+blkdebug
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/blkdebug.c
+
+vpc
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/vpc.c
+
+vvfat
+M: Kevin Wolf <kwolf@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: block/vvfat.c
+
+Image format fuzzer
+M: Stefan Hajnoczi <stefanha@redhat.com>
+L: qemu-block@nongnu.org
+S: Supported
+F: tests/image-fuzzer/
diff --git a/Makefile b/Makefile
index f505202..340d9c8 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,11 @@
 # Always point to the root of the build tree (needs GNU make).
 BUILD_DIR=3D$(CURDIR)
 
+# Before including a proper config-host.mak, assume we are in the source tree
+SRC_PATH=3D.
+
+UNCHECKED_GOALS :=3D %clean TAGS cscope ctags
+
 # All following code might depend on configuration variables
 ifneq ($(wildcard config-host.mak),)
 # Put the all: rule here so that config-host.mak can contain dependencies.
@@ -38,7 +43,7 @@ config-host.mak: $(SRC_PATH)/configure
 	fi
 else
 config-host.mak:
-ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
+ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
 	@echo "Please call configure before running make!"
 	@exit 1
 endif
@@ -74,7 +79,7 @@ Makefile: ;
 configure: ;
 
 .PHONY: all clean cscope distclean dvi html info install install-doc \
-	pdf recurse-all speed test dist
+	pdf recurse-all speed test dist msi
 
 $(call set-vpath, $(SRC_PATH))
 
@@ -84,6 +89,9 @@ HELPERS-$(CONFIG_LINUX) =3D qemu-bridge-helper$(EXESUF)
 
 ifdef BUILD_DOCS
 DOCS=3Dqemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qmp-commands.txt
+ifdef CONFIG_LINUX
+DOCS+=3Dkvm_stat.1
+endif
 ifdef CONFIG_VIRTFS
 DOCS+=3Dfsdev/virtfs-proxy-helper.1
 endif
@@ -109,8 +117,9 @@ endif
 -include $(SUBDIR_DEVICES_MAK_DEP)
 
 %/config-devices.mak: default-configs/%.mak
-	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
-	@if test -f $@; then \
+	$(call quiet-command, \
+            $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > $@.tmp, "  GEN   $@.tmp")
+	$(call quiet-command, if test -f $@; then \
 	  if cmp -s $@.old $@; then \
 	    mv $@.tmp $@; \
 	    cp -p $@ $@.old; \
@@ -126,7 +135,7 @@ endif
 	 else \
 	  mv $@.tmp $@; \
 	  cp -p $@ $@.old; \
-	 fi
+	 fi, "  GEN   $@");
 
 defconfig:
 	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
@@ -197,9 +206,9 @@ ALL_SUBDIRS=3D$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
 
 recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
 
-$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h | $(BUILD_DIR)/version.lo
+$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc config-host.h | $(BUILD_DIR)/version.lo
 	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.o")
-$(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h
+$(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc config-host.h
 	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.lo")
 
 Makefile: $(version-obj-y) $(version-lobj-y)
@@ -239,17 +248,17 @@ qapi-py =3D $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
 qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
-		$(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
+		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
 		"  GEN   $@")
 qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
-		$(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
+		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
 		"  GEN   $@")
 qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
-		$(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
+		$(gen-out-type) -o qga/qapi-generated -p "qga-" $<, \
 		"  GEN   $@")
 
 qapi-modules =3D $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
@@ -259,22 +268,22 @@ qapi-modules =3D $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
 qapi-types.c qapi-types.h :\
 $(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
-		$(gen-out-type) -o "." -b -i $<, \
+		$(gen-out-type) -o "." -b $<, \
 		"  GEN   $@")
 qapi-visit.c qapi-visit.h :\
 $(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
-		$(gen-out-type) -o "." -b -i $<, \
+		$(gen-out-type) -o "." -b $<, \
 		"  GEN   $@")
 qapi-event.c qapi-event.h :\
 $(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
-		$(gen-out-type) -o "." -b -i $<, \
+		$(gen-out-type) -o "." $<, \
 		"  GEN   $@")
 qmp-commands.h qmp-marshal.c :\
 $(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
-		$(gen-out-type) -o "." -m -i $<, \
+		$(gen-out-type) -o "." -m $<, \
 		"  GEN   $@")
 
 QGALIB_GEN=3D$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
@@ -283,15 +292,38 @@ $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
 qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
 	$(call LINK, $^)
 
+ifdef QEMU_GA_MSI_ENABLED
+QEMU_GA_MSI=3Dqemu-ga-$(ARCH).msi
+
+msi: ${QEMU_GA_MSI}
+
+$(QEMU_GA_MSI): qemu-ga.exe
+
+ifdef QEMU_GA_MSI_WITH_VSS
+$(QEMU_GA_MSI): qga/vss-win32/qga-vss.dll
+endif
+
+$(QEMU_GA_MSI): config-host.mak
+
+$(QEMU_GA_MSI):  qga/installer/qemu-ga.wxs
+	$(call quiet-command,QEMU_GA_VERSION=3D"$(QEMU_GA_VERSION)" QEMU_GA_MANUFACTURER=3D"$(QEMU_GA_MANUFACTURER)" QEMU_GA_DISTRO=3D"$(QEMU_GA_DISTRO)" \
+	wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<, "  WIXL  $@")
+else
+msi:
+	@echo MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)
+endif
+
 clean:
 # avoid old build problems by removing potentially incorrect old files
 	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
 	rm -f qemu-options.def
+	rm -f *.msi
 	find . \( -name '*.l[oa]' -o -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
 	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
 	rm -f fsdev/*.pod
 	rm -rf .libs */.libs
 	rm -f qemu-img-cmds.h
+	rm -f ui/shader/*-vert.h ui/shader/*-frag.h
 	@# May not be present in GENERATED_HEADERS
 	rm -f trace/generated-tracers-dtrace.dtrace*
 	rm -f trace/generated-tracers-dtrace.h*
@@ -313,8 +345,8 @@ qemu-%.tar.bz2:
 
 distclean: clean
 	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
-	rm -f config-all-devices.mak config-all-disas.mak
-	rm -f po/*.mo
+	rm -f config-all-devices.mak config-all-disas.mak config.status
+	rm -f po/*.mo tests/qemu-iotests/common.env
 	rm -f roms/seabios/config.mak roms/vgabios/config.mak
 	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
 	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
@@ -327,8 +359,8 @@ distclean: clean
 	rm -rf $$d || exit 1 ; \
         done
 	rm -Rf .sdk
-	if test -f pixman/config.log; then make -C pixman distclean; fi
-	if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
+	if test -f pixman/config.log; then $(MAKE) -C pixman distclean; fi
+	if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi
 
 KEYMAPS=3Dda     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
 ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
@@ -337,7 +369,7 @@ bepo    cz
 
 ifdef INSTALL_BLOBS
 BLOBS=3Dbios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
-vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
+vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
 acpi-dsdt.aml q35-acpi-dsdt.aml \
 ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
 pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
@@ -384,13 +416,8 @@ ifneq (,$(findstring qemu-ga,$(TOOLS)))
 endif
 endif
 
-install-confdir:
-	$(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
 
-install-sysconfig: install-datadir install-confdir
-	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
-
-install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig \
+install: all $(if $(BUILD_DOCS),install-doc) \
 install-datadir install-localstatedir
 ifneq ($(TOOLS),)
 	$(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
@@ -427,15 +454,36 @@ endif
 test speed: all
 	$(MAKE) -C tests/tcg $@
 
+.PHONY: ctags
+ctags:
+	rm -f $@
+	find "$(SRC_PATH)" -name '*.[hc]' -exec ctags --append {} +
+
 .PHONY: TAGS
 TAGS:
 	rm -f $@
 	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
 
 cscope:
-	rm -f ./cscope.*
-	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
-	cscope -b
+	rm -f "$(SRC_PATH)"/cscope.*
+	find "$(SRC_PATH)/" -name "*.[chsS]" -print | sed 's,^\./,,' > "$(SRC_PATH)/cscope.files"
+	cscope -b -i"$(SRC_PATH)/cscope.files"
+
+# opengl shader programs
+ui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert $(SRC_PATH)/scripts/shaderinclude.pl
+	@mkdir -p $(dir $@)
+	$(call quiet-command,\
+		perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
+		"  VERT  $@")
+
+ui/shader/%-frag.h: $(SRC_PATH)/ui/shader/%.frag $(SRC_PATH)/scripts/shaderinclude.pl
+	@mkdir -p $(dir $@)
+	$(call quiet-command,\
+		perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
+		"  FRAG  $@")
+
+ui/console-gl.o: $(SRC_PATH)/ui/console-gl.c \
+	ui/shader/texture-blit-vert.h ui/shader/texture-blit-frag.h
 
 # documentation
 MAKEINFO=3Dmakeinfo
@@ -490,6 +538,12 @@ qemu-nbd.8: qemu-nbd.texi
 	  $(POD2MAN) --section=3D8 --center=3D" " --release=3D" " qemu-nbd.pod > $@, \
 	  "  GEN   $@")
 
+kvm_stat.1: scripts/kvm/kvm_stat.texi
+	$(call quiet-command, \
+	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< kvm_stat.pod && \
+	  $(POD2MAN) --section=3D1 --center=3D" " --release=3D" " kvm_stat.pod > $@, \
+	  "  GEN   $@")
+
 dvi: qemu-doc.dvi qemu-tech.dvi
 html: qemu-doc.html qemu-tech.html
 info: qemu-doc.info qemu-tech.info
@@ -522,7 +576,7 @@ installer: $(INSTALLER)
 INSTDIR=3D/tmp/qemu-nsis
 
 $(INSTALLER): $(SRC_PATH)/qemu.nsi
-	make install prefix=3D${INSTDIR}
+	$(MAKE) install prefix=3D${INSTDIR}
 ifdef SIGNCODE
 	(cd ${INSTDIR}; \
          for i in *.exe; do \
@@ -556,7 +610,7 @@ endif # CONFIG_WIN
 
 # Add a dependency on the generated files, so that they are always
 # rebuilt before other object files
-ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
+ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
 Makefile: $(GENERATED_HEADERS)
 endif
 
diff --git a/Makefile.objs b/Makefile.objs
index 18fd35c..f094eff 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -2,6 +2,7 @@
 # Common libraries for tools and emulators
 stub-obj-y =3D stubs/
 util-obj-y =3D util/ qobject/ qapi/ qapi-types.o qapi-visit.o qapi-event.o
+util-obj-y +=3D crypto/
 
 #######################################################################
 # block-obj-y is code used by both qemu system emulation and qemu-img
@@ -48,15 +49,10 @@ common-obj-$(CONFIG_POSIX) +=3D os-posix.o
 
 common-obj-$(CONFIG_LINUX) +=3D fsdev/
 
-common-obj-y +=3D migration.o migration-tcp.o
-common-obj-y +=3D vmstate.o
-common-obj-y +=3D qemu-file.o qemu-file-unix.o qemu-file-stdio.o
-common-obj-$(CONFIG_RDMA) +=3D migration-rdma.o
+common-obj-y +=3D migration/
 common-obj-y +=3D qemu-char.o #aio.o
-common-obj-y +=3D block-migration.o
-common-obj-y +=3D page_cache.o xbzrle.o
-
-common-obj-$(CONFIG_POSIX) +=3D migration-exec.o migration-unix.o migration-fd.o
+common-obj-y +=3D page_cache.o
+common-obj-y +=3D qjson.o
 
 common-obj-$(CONFIG_SPICE) +=3D spice-qemu-char.o
 
@@ -81,6 +77,8 @@ common-obj-$(CONFIG_SECCOMP) +=3D qemu-seccomp.o
 
 common-obj-$(CONFIG_SMARTCARD_NSS) +=3D $(libcacard-y)
 
+common-obj-$(CONFIG_FDT) +=3D device_tree.o
+
 ######################################################################
 # qapi
 
diff --git a/Makefile.target b/Makefile.target
index e9ff1ee..3e7aafd 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -1,5 +1,7 @@
 # -*- Mode: makefile -*-
 
+BUILD_DIR=3F=3D$(CURDIR)/..
+
 include ../config-host.mak
 include config-target.mak
 include config-devices.mak
@@ -83,7 +85,7 @@ all: $(PROGS) stap
 #########################################################
 # cpu emulator library
 obj-y =3D exec.o translate-all.o cpu-exec.o
-obj-y +=3D tcg/tcg.o tcg/optimize.o
+obj-y +=3D tcg/tcg.o tcg/tcg-op.o tcg/optimize.o
 obj-$(CONFIG_TCG_INTERPRETER) +=3D tci.o
 obj-$(CONFIG_TCG_INTERPRETER) +=3D disas/tci.o
 obj-y +=3D fpu/softfloat.o
@@ -129,12 +131,12 @@ ifdef CONFIG_SOFTMMU
 obj-y +=3D arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o
 obj-y +=3D qtest.o bootdevice.o
 obj-y +=3D hw/
-obj-$(CONFIG_FDT) +=3D device_tree.o
 obj-$(CONFIG_KVM) +=3D kvm-all.o
-obj-y +=3D memory.o savevm.o cputlb.o
+obj-y +=3D memory.o cputlb.o
 obj-y +=3D memory_mapping.o
 obj-y +=3D dump.o
-LIBS+=3D$(libs_softmmu)
+obj-y +=3D migration/ram.o migration/savevm.o
+LIBS :=3D $(libs_softmmu) $(LIBS)
 
 # xen support
 obj-$(CONFIG_XEN) +=3D xen-common.o
@@ -175,9 +177,15 @@ all-obj-y +=3D $(common-obj-y)
 all-obj-y +=3D $(target-obj-y)
 all-obj-$(CONFIG_SOFTMMU) +=3D $(block-obj-y)
 
+$(QEMU_PROG_BUILD): config-devices.mak
+
 # build either PROG or PROGW
 $(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
-	$(call LINK,$^)
+	$(call LINK, $(filter-out %.mak, $^))
+ifdef CONFIG_DARWIN
+	$(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $@,"  REZ   $(TARGET_DIR)$@")
+	$(call quiet-command,SetFile -a C $@,"  SETFILE $(TARGET_DIR)$@")
+endif
 
 gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
 	$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
diff --git a/VERSION b/VERSION
index c043eea..005119b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.2.1
+2.4.1
diff --git a/aio-posix.c b/aio-posix.c


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

From xen-changelog-bounces@lists.xen.org Tue Nov 24 16:55:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Nov 2015 16:55: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 1a1Grz-0002Ts-11; Tue, 24 Nov 2015 16:55:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1Grx-0002TF-Va
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 16:55:06 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	E0/FF-12831-96694565; Tue, 24 Nov 2015 16:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1448384103!6213021!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12879 invoked from network); 24 Nov 2015 16:55:04 -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;
	24 Nov 2015 16:55:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1Grv-0004QM-PN
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 16:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1Gru-00079h-Lu
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 16:55:02 +0000
Date: Tue, 24 Nov 2015 16:55:02 +0000
Message-Id: <E1a1Gru-00079h-Lu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] Add a .gitignore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bccd90071e863ec22216a000f1a07035e2f226ff
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Nov 23 16:34:31 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:10:15 2015 +0000

    Add a .gitignore
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 .gitignore |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1c655a0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*~
+*.o
+*.a
+include/list.h
+mini-os
+mini-os.gz
--
generated by git-patchbot for /home/xen/git/mini-os.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 Nov 24 16:55:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Nov 2015 16:55: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 1a1Grz-0002Ts-11; Tue, 24 Nov 2015 16:55:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1Grx-0002TF-Va
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 16:55:06 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	E0/FF-12831-96694565; Tue, 24 Nov 2015 16:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1448384103!6213021!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12879 invoked from network); 24 Nov 2015 16:55:04 -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;
	24 Nov 2015 16:55:04 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1Grv-0004QM-PN
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 16:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1Gru-00079h-Lu
	for xen-changelog@lists.xensource.com; Tue, 24 Nov 2015 16:55:02 +0000
Date: Tue, 24 Nov 2015 16:55:02 +0000
Message-Id: <E1a1Gru-00079h-Lu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [mini-os master] Add a .gitignore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bccd90071e863ec22216a000f1a07035e2f226ff
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Nov 23 16:34:31 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:10:15 2015 +0000

    Add a .gitignore
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 .gitignore |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1c655a0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*~
+*.o
+*.a
+include/list.h
+mini-os
+mini-os.gz
--
generated by git-patchbot for /home/xen/git/mini-os.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 Nov 25 10:33:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:33: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 1a1XNv-000468-RH; Wed, 25 Nov 2015 10:33: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 1a1XNu-000462-1X
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:10 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	2E/82-10115-56E85565; Wed, 25 Nov 2015 10:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448447586!6148966!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20551 invoked from network); 25 Nov 2015 10:33:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Nov 2015 10:33:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XNq-0006TL-C2
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XNq-0002PG-7W
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:06 +0000
Date: Wed, 25 Nov 2015 10:33:06 +0000
Message-Id: <E1a1XNq-0002PG-7W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: always intercept #AC and #DB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bd2239d9fa975a1ee5bcd27c218ae042cd0a57bc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 10 12:03:08 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:03:08 2015 +0100

    x86/HVM: always intercept #AC and #DB
    
    Both being benign exceptions, and both being possible to get triggered
    by exception delivery, this is required to prevent a guest from locking
    up a CPU (resulting from no other VM exits occurring once getting into
    such a loop).
    
    The specific scenarios:
    
    1) #AC may be raised during exception delivery if the handler is set to
    be a ring-3 one by a 32-bit guest, and the stack is misaligned.
    
    This is CVE-2015-5307 / XSA-156.
    
    Reported-by: Benjamin Serebrin <serebrin@google.com>
    
    2) #DB may be raised during exception delivery when a breakpoint got
    placed on a data structure involved in delivering the exception. This
    can result in an endless loop when a 64-bit guest uses a non-zero IST
    for the vector 1 IDT entry, but even without use of IST the time it
    takes until a contributory fault would get raised (results depending
    on the handler) may be quite long.
    
    This is CVE-2015-8104 / XSA-156.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/svm.c    |   15 +++++++++++----
 xen/arch/x86/hvm/vmx/vmx.c    |   22 +++++++++++-----------
 xen/include/asm-x86/hvm/hvm.h |    5 ++++-
 3 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 8de41fa..364185a 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1043,10 +1043,11 @@ static void noreturn svm_do_resume(struct vcpu *v)
         unlikely(v->arch.hvm_vcpu.debug_state_latch != debug_state) )
     {
         uint32_t intercepts = vmcb_get_exception_intercepts(vmcb);
-        uint32_t mask = (1U << TRAP_debug) | (1U << TRAP_int3);
+
         v->arch.hvm_vcpu.debug_state_latch = debug_state;
         vmcb_set_exception_intercepts(
-            vmcb, debug_state ? (intercepts | mask) : (intercepts & ~mask));
+            vmcb, debug_state ? (intercepts | (1U << TRAP_int3))
+                              : (intercepts & ~(1U << TRAP_int3)));
     }
 
     if ( v->arch.hvm_svm.launch_core != smp_processor_id() )
@@ -2434,8 +2435,9 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
 
     case VMEXIT_EXCEPTION_DB:
         if ( !v->domain->debugger_attached )
-            goto unexpected_exit_type;
-        domain_pause_for_debugger();
+            hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
+        else
+            domain_pause_for_debugger();
         break;
 
     case VMEXIT_EXCEPTION_BP:
@@ -2483,6 +2485,11 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
         break;
     }
 
+    case VMEXIT_EXCEPTION_AC:
+        HVMTRACE_1D(TRAP, TRAP_alignment_check);
+        hvm_inject_hw_exception(TRAP_alignment_check, vmcb->exitinfo1);
+        break;
+
     case VMEXIT_EXCEPTION_UD:
         svm_vmexit_ud_intercept(regs);
         break;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index bbec0e8..1eb6aab 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1224,16 +1224,10 @@ static void vmx_update_host_cr3(struct vcpu *v)
 
 void vmx_update_debug_state(struct vcpu *v)
 {
-    unsigned long mask;
-
-    mask = 1u << TRAP_int3;
-    if ( !cpu_has_monitor_trap_flag )
-        mask |= 1u << TRAP_debug;
-
     if ( v->arch.hvm_vcpu.debug_state_latch )
-        v->arch.hvm_vmx.exception_bitmap |= mask;
+        v->arch.hvm_vmx.exception_bitmap |= 1U << TRAP_int3;
     else
-        v->arch.hvm_vmx.exception_bitmap &= ~mask;
+        v->arch.hvm_vmx.exception_bitmap &= ~(1U << TRAP_int3);
 
     vmx_vmcs_enter(v);
     vmx_update_exception_bitmap(v);
@@ -3060,9 +3054,10 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             __vmread(EXIT_QUALIFICATION, &exit_qualification);
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | DR_STATUS_RESERVED_ONE);
-            if ( !v->domain->debugger_attached || cpu_has_monitor_trap_flag )
-                goto exit_and_crash;
-            domain_pause_for_debugger();
+            if ( !v->domain->debugger_attached )
+                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+            else
+                domain_pause_for_debugger();
             break;
         case TRAP_int3: 
         {
@@ -3127,6 +3122,11 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
             hvm_inject_page_fault(regs->error_code, exit_qualification);
             break;
+        case TRAP_alignment_check:
+            HVMTRACE_1D(TRAP, vector);
+            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
+            hvm_inject_hw_exception(vector, ecode);
+            break;
         case TRAP_nmi:
             if ( MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) !=
                  X86_EVENTTYPE_NMI )
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 0cf7da1..60fe59e 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -385,7 +385,10 @@ static inline int hvm_event_pending(struct vcpu *v)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These exceptions must always be intercepted. */
-#define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
+#define HVM_TRAP_MASK ((1U << TRAP_debug)           | \
+                       (1U << TRAP_invalid_op)      | \
+                       (1U << TRAP_alignment_check) | \
+                       (1U << TRAP_machine_check))
 
 /*
  * x86 event types. This enumeration is valid for:
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:33:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:33: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 1a1XNv-000468-RH; Wed, 25 Nov 2015 10:33: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 1a1XNu-000462-1X
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:10 +0000
Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id
	2E/82-10115-56E85565; Wed, 25 Nov 2015 10:33:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448447586!6148966!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20551 invoked from network); 25 Nov 2015 10:33:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Nov 2015 10:33:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XNq-0006TL-C2
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XNq-0002PG-7W
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:06 +0000
Date: Wed, 25 Nov 2015 10:33:06 +0000
Message-Id: <E1a1XNq-0002PG-7W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: always intercept #AC and #DB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bd2239d9fa975a1ee5bcd27c218ae042cd0a57bc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 10 12:03:08 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:03:08 2015 +0100

    x86/HVM: always intercept #AC and #DB
    
    Both being benign exceptions, and both being possible to get triggered
    by exception delivery, this is required to prevent a guest from locking
    up a CPU (resulting from no other VM exits occurring once getting into
    such a loop).
    
    The specific scenarios:
    
    1) #AC may be raised during exception delivery if the handler is set to
    be a ring-3 one by a 32-bit guest, and the stack is misaligned.
    
    This is CVE-2015-5307 / XSA-156.
    
    Reported-by: Benjamin Serebrin <serebrin@google.com>
    
    2) #DB may be raised during exception delivery when a breakpoint got
    placed on a data structure involved in delivering the exception. This
    can result in an endless loop when a 64-bit guest uses a non-zero IST
    for the vector 1 IDT entry, but even without use of IST the time it
    takes until a contributory fault would get raised (results depending
    on the handler) may be quite long.
    
    This is CVE-2015-8104 / XSA-156.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/svm.c    |   15 +++++++++++----
 xen/arch/x86/hvm/vmx/vmx.c    |   22 +++++++++++-----------
 xen/include/asm-x86/hvm/hvm.h |    5 ++++-
 3 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 8de41fa..364185a 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1043,10 +1043,11 @@ static void noreturn svm_do_resume(struct vcpu *v)
         unlikely(v->arch.hvm_vcpu.debug_state_latch != debug_state) )
     {
         uint32_t intercepts = vmcb_get_exception_intercepts(vmcb);
-        uint32_t mask = (1U << TRAP_debug) | (1U << TRAP_int3);
+
         v->arch.hvm_vcpu.debug_state_latch = debug_state;
         vmcb_set_exception_intercepts(
-            vmcb, debug_state ? (intercepts | mask) : (intercepts & ~mask));
+            vmcb, debug_state ? (intercepts | (1U << TRAP_int3))
+                              : (intercepts & ~(1U << TRAP_int3)));
     }
 
     if ( v->arch.hvm_svm.launch_core != smp_processor_id() )
@@ -2434,8 +2435,9 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
 
     case VMEXIT_EXCEPTION_DB:
         if ( !v->domain->debugger_attached )
-            goto unexpected_exit_type;
-        domain_pause_for_debugger();
+            hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
+        else
+            domain_pause_for_debugger();
         break;
 
     case VMEXIT_EXCEPTION_BP:
@@ -2483,6 +2485,11 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
         break;
     }
 
+    case VMEXIT_EXCEPTION_AC:
+        HVMTRACE_1D(TRAP, TRAP_alignment_check);
+        hvm_inject_hw_exception(TRAP_alignment_check, vmcb->exitinfo1);
+        break;
+
     case VMEXIT_EXCEPTION_UD:
         svm_vmexit_ud_intercept(regs);
         break;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index bbec0e8..1eb6aab 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1224,16 +1224,10 @@ static void vmx_update_host_cr3(struct vcpu *v)
 
 void vmx_update_debug_state(struct vcpu *v)
 {
-    unsigned long mask;
-
-    mask = 1u << TRAP_int3;
-    if ( !cpu_has_monitor_trap_flag )
-        mask |= 1u << TRAP_debug;
-
     if ( v->arch.hvm_vcpu.debug_state_latch )
-        v->arch.hvm_vmx.exception_bitmap |= mask;
+        v->arch.hvm_vmx.exception_bitmap |= 1U << TRAP_int3;
     else
-        v->arch.hvm_vmx.exception_bitmap &= ~mask;
+        v->arch.hvm_vmx.exception_bitmap &= ~(1U << TRAP_int3);
 
     vmx_vmcs_enter(v);
     vmx_update_exception_bitmap(v);
@@ -3060,9 +3054,10 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             __vmread(EXIT_QUALIFICATION, &exit_qualification);
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
             write_debugreg(6, exit_qualification | DR_STATUS_RESERVED_ONE);
-            if ( !v->domain->debugger_attached || cpu_has_monitor_trap_flag )
-                goto exit_and_crash;
-            domain_pause_for_debugger();
+            if ( !v->domain->debugger_attached )
+                hvm_inject_hw_exception(vector, HVM_DELIVER_NO_ERROR_CODE);
+            else
+                domain_pause_for_debugger();
             break;
         case TRAP_int3: 
         {
@@ -3127,6 +3122,11 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
             hvm_inject_page_fault(regs->error_code, exit_qualification);
             break;
+        case TRAP_alignment_check:
+            HVMTRACE_1D(TRAP, vector);
+            __vmread(VM_EXIT_INTR_ERROR_CODE, &ecode);
+            hvm_inject_hw_exception(vector, ecode);
+            break;
         case TRAP_nmi:
             if ( MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) !=
                  X86_EVENTTYPE_NMI )
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 0cf7da1..60fe59e 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -385,7 +385,10 @@ static inline int hvm_event_pending(struct vcpu *v)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These exceptions must always be intercepted. */
-#define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
+#define HVM_TRAP_MASK ((1U << TRAP_debug)           | \
+                       (1U << TRAP_invalid_op)      | \
+                       (1U << TRAP_alignment_check) | \
+                       (1U << TRAP_machine_check))
 
 /*
  * x86 event types. This enumeration is valid for:
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:33:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XO4-00047J-VE; Wed, 25 Nov 2015 10:33:20 +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 1a1XO3-000471-Jz
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:19 +0000
Content-Length: 7934
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	90/57-12889-E6E85565; Wed, 25 Nov 2015 10:33:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1448447597!6144623!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35158 invoked from network); 25 Nov 2015 10:33:18 -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;
	25 Nov 2015 10:33:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XO0-0006TT-RG
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XO0-0002Pi-Ml
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:16 +0000
Date: Wed, 25 Nov 2015 10:33:16 +0000
Message-Id: <E1a1XO0-0002Pi-Ml@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: add bitmap of enabled emulated
	devices
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5049742935855920622=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5049742935855920622==
Content-Length: 7664
Content-Transfer-Encoding: quoted-printable

commit 171946abce06541c1d7465376c05eacb22158437
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:04:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:04:04 2015 +0100

    x86: add bitmap of enabled emulated devices
    
    Introduce a bitmap in x86 xen_arch_domainconfig that allows enabling or
    disabling specific devices emulated inside of Xen for HVM guests.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_x86.c           |    5 ++++-
 xen/arch/x86/domain.c             |   27 +++++++++++++++++++++++++++
 xen/arch/x86/setup.c              |    3 ++-
 xen/common/schedule.c             |    1 -
 xen/include/asm-x86/domain.h      |   13 +++++++++++++
 xen/include/public/arch-x86/xen.h |   26 +++++++++++++++++++++++++-
 6 files changed, 71 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index c992261..183b6c2 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -7,7 +7,10 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
                                       libxl_domain_config *d_config,
                                       xc_domain_configuration_t *xc_config)
 {
-    /* No specific configuration right now */
+    if (d_config->c_info.type =3D=3D LIBXL_DOMAIN_TYPE_HVM)
+        xc_config->emulation_flags =3D XEN_X86_EMU_ALL;
+    else
+        xc_config->emulation_flags =3D 0;
 
     return 0;
 }
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index fe3be30..3f9e5d2 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -496,6 +496,9 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
     int i, paging_initialised =3D 0;
     int rc =3D -ENOMEM;
 
+    if ( config =3D=3D NULL && !is_idle_domain(d) )
+        return -EINVAL;
+
     d->arch.s3_integrity =3D !!(domcr_flags & DOMCRF_s3_integrity);
 
     INIT_LIST_HEAD(&d->arch.pdev_list);
@@ -517,6 +520,30 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
                d->domain_id);
     }
 
+    if ( is_idle_domain(d) )
+    {
+        d->arch.emulation_flags =3D 0;
+    }
+    else
+    {
+        if ( (config->emulation_flags & ~XEN_X86_EMU_ALL) !=3D 0 )
+        {
+            printk(XENLOG_G_ERR "d%d: Invalid emulation bitmap: %#x\n",
+                   d->domain_id, config->emulation_flags);
+            return -EINVAL;
+        }
+        if ( is_hvm_domain(d) =3F (config->emulation_flags !=3D XEN_X86_EMU_ALL)
+                              : (config->emulation_flags !=3D 0) )
+        {
+            printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation "
+                   "with the current selection of emulators: %#x\n",
+                   d->domain_id, is_hvm_domain(d) =3F "HVM" : "PV",
+                   config->emulation_flags);
+            return -EOPNOTSUPP;
+        }
+        d->arch.emulation_flags =3D config->emulation_flags;
+    }
+
     if ( has_hvm_container_domain(d) )
     {
         d->arch.hvm_domain.hap_enabled =3D
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 4ed0110..6714473 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -582,6 +582,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         .parity    =3D 'n',
         .stop_bits =3D 1
     };
+    struct xen_arch_domainconfig config =3D { .emulation_flags =3D 0 };
 
     /* Critical region without IDT or TSS.  Any fault is deadly! */
 
@@ -1390,7 +1391,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
      * x86 doesn't support arch-configuration. So it's fine to pass
      * NULL.
      */
-    dom0 =3D domain_create(0, domcr_flags, 0, NULL);
+    dom0 =3D domain_create(0, domcr_flags, 0, &config);
     if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) =3D=3D NULL) )
         panic("Error creating domain 0");
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 292e9a0..20f5f56 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1474,7 +1474,6 @@ void __init scheduler_init(void)
         sched_ratelimit_us =3D SCHED_DEFAULT_RATELIMIT_US;
     }
 
-    /* There is no need of arch-specific configuration for an idle domain */
     idle_domain =3D domain_create(DOMID_IDLE, 0, 0, NULL);
     BUG_ON(IS_ERR(idle_domain));
     idle_domain->vcpu =3D idle_vcpu;
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index f1d7ed6..c825975 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -387,8 +387,21 @@ struct arch_domain
     /* Mem_access emulation control */
     bool_t mem_access_emulate_enabled;
     bool_t mem_access_emulate_each_rep;
+
+    /* Emulated devices enabled bitmap. */
+    uint32_t emulation_flags;
 } __cacheline_aligned;
 
+#define has_vlapic(d)      (!!((d)->arch.emulation_flags & XEN_X86_EMU_LAPIC))
+#define has_vhpet(d)       (!!((d)->arch.emulation_flags & XEN_X86_EMU_HPET))
+#define has_vpm(d)         (!!((d)->arch.emulation_flags & XEN_X86_EMU_PM))
+#define has_vrtc(d)        (!!((d)->arch.emulation_flags & XEN_X86_EMU_RTC))
+#define has_vioapic(d)     (!!((d)->arch.emulation_flags & XEN_X86_EMU_IOAPIC))
+#define has_vpic(d)        (!!((d)->arch.emulation_flags & XEN_X86_EMU_PIC))
+#define has_vvga(d)        (!!((d)->arch.emulation_flags & XEN_X86_EMU_VGA))
+#define has_viommu(d)      (!!((d)->arch.emulation_flags & XEN_X86_EMU_IOMMU))
+#define has_vpit(d)        (!!((d)->arch.emulation_flags & XEN_X86_EMU_PIT))
+
 #define has_arch_pdevs(d)    (!list_empty(&(d)->arch.pdev_list))
 
 #define gdt_ldt_pt_idx(v) \
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 5187560..cdd93c1 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -265,7 +265,31 @@ typedef struct arch_shared_info arch_shared_info_t;
  * XEN_DOMCTL_INTERFACE_VERSION.
  */
 struct xen_arch_domainconfig {
-    char dummy;
+#define _XEN_X86_EMU_LAPIC          0
+#define XEN_X86_EMU_LAPIC           (1U<<_XEN_X86_EMU_LAPIC)
+#define _XEN_X86_EMU_HPET           1
+#define XEN_X86_EMU_HPET            (1U<<_XEN_X86_EMU_HPET)
+#define _XEN_X86_EMU_PM             2
+#define XEN_X86_EMU_PM              (1U<<_XEN_X86_EMU_PM)
+#define _XEN_X86_EMU_RTC            3
+#define XEN_X86_EMU_RTC             (1U<<_XEN_X86_EMU_RTC)
+#define _XEN_X86_EMU_IOAPIC         4
+#define XEN_X86_EMU_IOAPIC          (1U<<_XEN_X86_EMU_IOAPIC)
+#define _XEN_X86_EMU_PIC            5
+#define XEN_X86_EMU_PIC             (1U<<_XEN_X86_EMU_PIC)
+#define _XEN_X86_EMU_VGA            6
+#define XEN_X86_EMU_VGA             (1U<<_XEN_X86_EMU_VGA)
+#define _XEN_X86_EMU_IOMMU          7
+#define XEN_X86_EMU_IOMMU           (1U<<_XEN_X86_EMU_IOMMU)
+#define _XEN_X86_EMU_PIT            8
+#define XEN_X86_EMU_PIT             (1U<<_XEN_X86_EMU_PIT)
+
+#define XEN_X86_EMU_ALL             (XEN_X86_EMU_LAPIC | XEN_X86_EMU_HPET |  \
+                                     XEN_X86_EMU_PM | XEN_X86_EMU_RTC |      \
+                                     XEN_X86_EMU_IOAPIC | XEN_X86_EMU_PIC |  \
+                                     XEN_X86_EMU_VGA | XEN_X86_EMU_IOMMU |   \
+                                     XEN_X86_EMU_PIT)
+    uint32_t emulation_flags;
 };
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:33:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XO4-00047J-VE; Wed, 25 Nov 2015 10:33:20 +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 1a1XO3-000471-Jz
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:19 +0000
Content-Length: 7934
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	90/57-12889-E6E85565; Wed, 25 Nov 2015 10:33:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1448447597!6144623!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35158 invoked from network); 25 Nov 2015 10:33:18 -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;
	25 Nov 2015 10:33:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XO0-0006TT-RG
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XO0-0002Pi-Ml
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:16 +0000
Date: Wed, 25 Nov 2015 10:33:16 +0000
Message-Id: <E1a1XO0-0002Pi-Ml@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: add bitmap of enabled emulated
	devices
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5049742935855920622=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5049742935855920622==
Content-Length: 7664
Content-Transfer-Encoding: quoted-printable

commit 171946abce06541c1d7465376c05eacb22158437
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:04:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:04:04 2015 +0100

    x86: add bitmap of enabled emulated devices
    
    Introduce a bitmap in x86 xen_arch_domainconfig that allows enabling or
    disabling specific devices emulated inside of Xen for HVM guests.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_x86.c           |    5 ++++-
 xen/arch/x86/domain.c             |   27 +++++++++++++++++++++++++++
 xen/arch/x86/setup.c              |    3 ++-
 xen/common/schedule.c             |    1 -
 xen/include/asm-x86/domain.h      |   13 +++++++++++++
 xen/include/public/arch-x86/xen.h |   26 +++++++++++++++++++++++++-
 6 files changed, 71 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index c992261..183b6c2 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -7,7 +7,10 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
                                       libxl_domain_config *d_config,
                                       xc_domain_configuration_t *xc_config)
 {
-    /* No specific configuration right now */
+    if (d_config->c_info.type =3D=3D LIBXL_DOMAIN_TYPE_HVM)
+        xc_config->emulation_flags =3D XEN_X86_EMU_ALL;
+    else
+        xc_config->emulation_flags =3D 0;
 
     return 0;
 }
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index fe3be30..3f9e5d2 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -496,6 +496,9 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
     int i, paging_initialised =3D 0;
     int rc =3D -ENOMEM;
 
+    if ( config =3D=3D NULL && !is_idle_domain(d) )
+        return -EINVAL;
+
     d->arch.s3_integrity =3D !!(domcr_flags & DOMCRF_s3_integrity);
 
     INIT_LIST_HEAD(&d->arch.pdev_list);
@@ -517,6 +520,30 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
                d->domain_id);
     }
 
+    if ( is_idle_domain(d) )
+    {
+        d->arch.emulation_flags =3D 0;
+    }
+    else
+    {
+        if ( (config->emulation_flags & ~XEN_X86_EMU_ALL) !=3D 0 )
+        {
+            printk(XENLOG_G_ERR "d%d: Invalid emulation bitmap: %#x\n",
+                   d->domain_id, config->emulation_flags);
+            return -EINVAL;
+        }
+        if ( is_hvm_domain(d) =3F (config->emulation_flags !=3D XEN_X86_EMU_ALL)
+                              : (config->emulation_flags !=3D 0) )
+        {
+            printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation "
+                   "with the current selection of emulators: %#x\n",
+                   d->domain_id, is_hvm_domain(d) =3F "HVM" : "PV",
+                   config->emulation_flags);
+            return -EOPNOTSUPP;
+        }
+        d->arch.emulation_flags =3D config->emulation_flags;
+    }
+
     if ( has_hvm_container_domain(d) )
     {
         d->arch.hvm_domain.hap_enabled =3D
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 4ed0110..6714473 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -582,6 +582,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         .parity    =3D 'n',
         .stop_bits =3D 1
     };
+    struct xen_arch_domainconfig config =3D { .emulation_flags =3D 0 };
 
     /* Critical region without IDT or TSS.  Any fault is deadly! */
 
@@ -1390,7 +1391,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
      * x86 doesn't support arch-configuration. So it's fine to pass
      * NULL.
      */
-    dom0 =3D domain_create(0, domcr_flags, 0, NULL);
+    dom0 =3D domain_create(0, domcr_flags, 0, &config);
     if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) =3D=3D NULL) )
         panic("Error creating domain 0");
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 292e9a0..20f5f56 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1474,7 +1474,6 @@ void __init scheduler_init(void)
         sched_ratelimit_us =3D SCHED_DEFAULT_RATELIMIT_US;
     }
 
-    /* There is no need of arch-specific configuration for an idle domain */
     idle_domain =3D domain_create(DOMID_IDLE, 0, 0, NULL);
     BUG_ON(IS_ERR(idle_domain));
     idle_domain->vcpu =3D idle_vcpu;
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index f1d7ed6..c825975 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -387,8 +387,21 @@ struct arch_domain
     /* Mem_access emulation control */
     bool_t mem_access_emulate_enabled;
     bool_t mem_access_emulate_each_rep;
+
+    /* Emulated devices enabled bitmap. */
+    uint32_t emulation_flags;
 } __cacheline_aligned;
 
+#define has_vlapic(d)      (!!((d)->arch.emulation_flags & XEN_X86_EMU_LAPIC))
+#define has_vhpet(d)       (!!((d)->arch.emulation_flags & XEN_X86_EMU_HPET))
+#define has_vpm(d)         (!!((d)->arch.emulation_flags & XEN_X86_EMU_PM))
+#define has_vrtc(d)        (!!((d)->arch.emulation_flags & XEN_X86_EMU_RTC))
+#define has_vioapic(d)     (!!((d)->arch.emulation_flags & XEN_X86_EMU_IOAPIC))
+#define has_vpic(d)        (!!((d)->arch.emulation_flags & XEN_X86_EMU_PIC))
+#define has_vvga(d)        (!!((d)->arch.emulation_flags & XEN_X86_EMU_VGA))
+#define has_viommu(d)      (!!((d)->arch.emulation_flags & XEN_X86_EMU_IOMMU))
+#define has_vpit(d)        (!!((d)->arch.emulation_flags & XEN_X86_EMU_PIT))
+
 #define has_arch_pdevs(d)    (!list_empty(&(d)->arch.pdev_list))
 
 #define gdt_ldt_pt_idx(v) \
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 5187560..cdd93c1 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -265,7 +265,31 @@ typedef struct arch_shared_info arch_shared_info_t;
  * XEN_DOMCTL_INTERFACE_VERSION.
  */
 struct xen_arch_domainconfig {
-    char dummy;
+#define _XEN_X86_EMU_LAPIC          0
+#define XEN_X86_EMU_LAPIC           (1U<<_XEN_X86_EMU_LAPIC)
+#define _XEN_X86_EMU_HPET           1
+#define XEN_X86_EMU_HPET            (1U<<_XEN_X86_EMU_HPET)
+#define _XEN_X86_EMU_PM             2
+#define XEN_X86_EMU_PM              (1U<<_XEN_X86_EMU_PM)
+#define _XEN_X86_EMU_RTC            3
+#define XEN_X86_EMU_RTC             (1U<<_XEN_X86_EMU_RTC)
+#define _XEN_X86_EMU_IOAPIC         4
+#define XEN_X86_EMU_IOAPIC          (1U<<_XEN_X86_EMU_IOAPIC)
+#define _XEN_X86_EMU_PIC            5
+#define XEN_X86_EMU_PIC             (1U<<_XEN_X86_EMU_PIC)
+#define _XEN_X86_EMU_VGA            6
+#define XEN_X86_EMU_VGA             (1U<<_XEN_X86_EMU_VGA)
+#define _XEN_X86_EMU_IOMMU          7
+#define XEN_X86_EMU_IOMMU           (1U<<_XEN_X86_EMU_IOMMU)
+#define _XEN_X86_EMU_PIT            8
+#define XEN_X86_EMU_PIT             (1U<<_XEN_X86_EMU_PIT)
+
+#define XEN_X86_EMU_ALL             (XEN_X86_EMU_LAPIC | XEN_X86_EMU_HPET |  \
+                                     XEN_X86_EMU_PM | XEN_X86_EMU_RTC |      \
+                                     XEN_X86_EMU_IOAPIC | XEN_X86_EMU_PIC |  \
+                                     XEN_X86_EMU_VGA | XEN_X86_EMU_IOMMU |   \
+                                     XEN_X86_EMU_PIT)
+    uint32_t emulation_flags;
 };
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:33:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XOG-00049g-49; Wed, 25 Nov 2015 10:33: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 1a1XOE-00049P-2i
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:30 +0000
Content-Length: 2825
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	CD/85-09834-97E85565; Wed, 25 Nov 2015 10:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448447607!6149087!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23138 invoked from network); 25 Nov 2015 10:33:28 -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;
	25 Nov 2015 10:33:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOB-0006Tb-7Z
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOB-0002QC-2q
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:27 +0000
Date: Wed, 25 Nov 2015 10:33:27 +0000
Message-Id: <E1a1XOB-0002QC-2q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated HPET
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2591430000182287840=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2591430000182287840==
Content-Length: 2454
Content-Transfer-Encoding: quoted-printable

commit 4647f50592f0b13e1b2b28dedb922ac033754664
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:04:57 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:04:57 2015 +0100

    x86: allow disabling the emulated HPET
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hpet.c |   13 +++++++++++++
 xen/arch/x86/hvm/hvm.c  |    1 -
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index facab83..5e020ae 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -517,6 +517,9 @@ static int hpet_save(struct domain *d, hvm_domain_context_t *h)
     int rc;
     uint64_t guest_time;
 
+    if ( !has_vhpet(d) )
+        return 0;
+
     write_lock(&hp->lock);
     guest_time =3D (v->arch.hvm_vcpu.guest_time =3F: hvm_get_guest_time(v)) /
                  STIME_PER_HPET_TICK;
@@ -577,6 +580,9 @@ static int hpet_load(struct domain *d, hvm_domain_context_t *h)
     uint64_t guest_time;
     int i;
 
+    if ( !has_vhpet(d) )
+        return -ENODEV;
+
     write_lock(&hp->lock);
 
     /* Reload the HPET registers */
@@ -635,6 +641,9 @@ void hpet_init(struct domain *d)
     HPETState *h =3D domain_vhpet(d);
     int i;
 
+    if ( !has_vhpet(d) )
+        return;
+
     memset(h, 0, sizeof(HPETState));
 
     rwlock_init(&h->lock);
@@ -662,6 +671,7 @@ void hpet_init(struct domain *d)
     }
 
     register_mmio_handler(d, &hpet_mmio_ops);
+    d->arch.hvm_domain.params[HVM_PARAM_HPET_ENABLED] =3D 1;
 }
 
 void hpet_deinit(struct domain *d)
@@ -669,6 +679,9 @@ void hpet_deinit(struct domain *d)
     int i;
     HPETState *h =3D domain_vhpet(d);
 
+    if ( !has_vhpet(d) )
+        return;
+
     write_lock(&h->lock);
 
     if ( hpet_enabled(h) )
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 21f42a7..4490e9d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1605,7 +1605,6 @@ int hvm_domain_initialise(struct domain *d)
 
     hvm_init_guest_time(d);
 
-    d->arch.hvm_domain.params[HVM_PARAM_HPET_ENABLED] =3D 1;
     d->arch.hvm_domain.params[HVM_PARAM_TRIPLE_FAULT_REASON] =3D SHUTDOWN_reboot;
 
     vpic_init(d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:33:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XOG-00049g-49; Wed, 25 Nov 2015 10:33: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 1a1XOE-00049P-2i
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:30 +0000
Content-Length: 2825
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	CD/85-09834-97E85565; Wed, 25 Nov 2015 10:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448447607!6149087!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23138 invoked from network); 25 Nov 2015 10:33:28 -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;
	25 Nov 2015 10:33:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOB-0006Tb-7Z
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOB-0002QC-2q
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:27 +0000
Date: Wed, 25 Nov 2015 10:33:27 +0000
Message-Id: <E1a1XOB-0002QC-2q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated HPET
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2591430000182287840=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2591430000182287840==
Content-Length: 2454
Content-Transfer-Encoding: quoted-printable

commit 4647f50592f0b13e1b2b28dedb922ac033754664
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:04:57 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:04:57 2015 +0100

    x86: allow disabling the emulated HPET
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hpet.c |   13 +++++++++++++
 xen/arch/x86/hvm/hvm.c  |    1 -
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index facab83..5e020ae 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -517,6 +517,9 @@ static int hpet_save(struct domain *d, hvm_domain_context_t *h)
     int rc;
     uint64_t guest_time;
 
+    if ( !has_vhpet(d) )
+        return 0;
+
     write_lock(&hp->lock);
     guest_time =3D (v->arch.hvm_vcpu.guest_time =3F: hvm_get_guest_time(v)) /
                  STIME_PER_HPET_TICK;
@@ -577,6 +580,9 @@ static int hpet_load(struct domain *d, hvm_domain_context_t *h)
     uint64_t guest_time;
     int i;
 
+    if ( !has_vhpet(d) )
+        return -ENODEV;
+
     write_lock(&hp->lock);
 
     /* Reload the HPET registers */
@@ -635,6 +641,9 @@ void hpet_init(struct domain *d)
     HPETState *h =3D domain_vhpet(d);
     int i;
 
+    if ( !has_vhpet(d) )
+        return;
+
     memset(h, 0, sizeof(HPETState));
 
     rwlock_init(&h->lock);
@@ -662,6 +671,7 @@ void hpet_init(struct domain *d)
     }
 
     register_mmio_handler(d, &hpet_mmio_ops);
+    d->arch.hvm_domain.params[HVM_PARAM_HPET_ENABLED] =3D 1;
 }
 
 void hpet_deinit(struct domain *d)
@@ -669,6 +679,9 @@ void hpet_deinit(struct domain *d)
     int i;
     HPETState *h =3D domain_vhpet(d);
 
+    if ( !has_vhpet(d) )
+        return;
+
     write_lock(&h->lock);
 
     if ( hpet_enabled(h) )
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 21f42a7..4490e9d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1605,7 +1605,6 @@ int hvm_domain_initialise(struct domain *d)
 
     hvm_init_guest_time(d);
 
-    d->arch.hvm_domain.params[HVM_PARAM_HPET_ENABLED] =3D 1;
     d->arch.hvm_domain.params[HVM_PARAM_TRIPLE_FAULT_REASON] =3D SHUTDOWN_reboot;
 
     vpic_init(d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:33:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:33: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 1a1XOQ-0004Ba-9r; Wed, 25 Nov 2015 10:33:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOO-0004BC-7h
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:40 +0000
Content-Length: 3205
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	D3/1F-14900-38E85565; Wed, 25 Nov 2015 10:33:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1448447617!6338388!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48915 invoked from network); 25 Nov 2015 10:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Nov 2015 10:33:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOL-0006Tj-HC
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOL-0002QZ-FE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:37 +0000
Date: Wed, 25 Nov 2015 10:33:37 +0000
Message-Id: <E1a1XOL-0002QZ-FE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated IO
	APIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3035058126409293756=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3035058126409293756==
Content-Length: 2842
Content-Transfer-Encoding: quoted-printable

commit bacf1ddc8d66e73a1e2aec878f706d42d7bff629
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:05:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:05:18 2015 +0100

    x86: allow disabling the emulated IO APIC
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vioapic.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index d348235..611be87 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -365,6 +365,8 @@ void vioapic_irq_positive_edge(struct domain *d, unsigned int irq)
     struct hvm_hw_vioapic *vioapic =3D domain_vioapic(d);
     union vioapic_redir_entry *ent;
 
+    ASSERT(has_vioapic(d));
+
     HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "irq %x", irq);
 
     ASSERT(irq < VIOAPIC_NUM_PINS);
@@ -392,6 +394,8 @@ void vioapic_update_EOI(struct domain *d, u8 vector)
     union vioapic_redir_entry *ent;
     int gsi;
 
+    ASSERT(has_vioapic(d));
+
     spin_lock(&d->arch.hvm_domain.irq_lock);
 
     for ( gsi =3D 0; gsi < VIOAPIC_NUM_PINS; gsi++ )
@@ -424,12 +428,20 @@ void vioapic_update_EOI(struct domain *d, u8 vector)
 static int ioapic_save(struct domain *d, hvm_domain_context_t *h)
 {
     struct hvm_hw_vioapic *s =3D domain_vioapic(d);
+
+    if ( !has_vioapic(d) )
+        return 0;
+
     return hvm_save_entry(IOAPIC, 0, h, s);
 }
 
 static int ioapic_load(struct domain *d, hvm_domain_context_t *h)
 {
     struct hvm_hw_vioapic *s =3D domain_vioapic(d);
+
+    if ( !has_vioapic(d) )
+        return -ENODEV;
+
     return hvm_load_entry(IOAPIC, h, s);
 }
 
@@ -440,6 +452,9 @@ void vioapic_reset(struct domain *d)
     struct hvm_vioapic *vioapic =3D d->arch.hvm_domain.vioapic;
     int i;
 
+    if ( !has_vioapic(d) )
+        return;
+
     memset(&vioapic->hvm_hw_vioapic, 0, sizeof(vioapic->hvm_hw_vioapic));
     for ( i =3D 0; i < VIOAPIC_NUM_PINS; i++ )
         vioapic->hvm_hw_vioapic.redirtbl[i].fields.mask =3D 1;
@@ -448,6 +463,9 @@ void vioapic_reset(struct domain *d)
 
 int vioapic_init(struct domain *d)
 {
+    if ( !has_vioapic(d) )
+        return 0;
+
     if ( (d->arch.hvm_domain.vioapic =3D=3D NULL) &&
          ((d->arch.hvm_domain.vioapic =3D xmalloc(struct hvm_vioapic)) =3D=3D NULL) )
         return -ENOMEM;
@@ -462,6 +480,9 @@ int vioapic_init(struct domain *d)
 
 void vioapic_deinit(struct domain *d)
 {
+    if ( !has_vioapic(d) )
+        return;
+
     xfree(d->arch.hvm_domain.vioapic);
     d->arch.hvm_domain.vioapic =3D NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:33:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:33: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 1a1XOQ-0004Ba-9r; Wed, 25 Nov 2015 10:33:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOO-0004BC-7h
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:40 +0000
Content-Length: 3205
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	D3/1F-14900-38E85565; Wed, 25 Nov 2015 10:33:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1448447617!6338388!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48915 invoked from network); 25 Nov 2015 10:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Nov 2015 10:33:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOL-0006Tj-HC
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOL-0002QZ-FE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:37 +0000
Date: Wed, 25 Nov 2015 10:33:37 +0000
Message-Id: <E1a1XOL-0002QZ-FE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated IO
	APIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3035058126409293756=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3035058126409293756==
Content-Length: 2842
Content-Transfer-Encoding: quoted-printable

commit bacf1ddc8d66e73a1e2aec878f706d42d7bff629
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:05:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:05:18 2015 +0100

    x86: allow disabling the emulated IO APIC
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vioapic.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index d348235..611be87 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -365,6 +365,8 @@ void vioapic_irq_positive_edge(struct domain *d, unsigned int irq)
     struct hvm_hw_vioapic *vioapic =3D domain_vioapic(d);
     union vioapic_redir_entry *ent;
 
+    ASSERT(has_vioapic(d));
+
     HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "irq %x", irq);
 
     ASSERT(irq < VIOAPIC_NUM_PINS);
@@ -392,6 +394,8 @@ void vioapic_update_EOI(struct domain *d, u8 vector)
     union vioapic_redir_entry *ent;
     int gsi;
 
+    ASSERT(has_vioapic(d));
+
     spin_lock(&d->arch.hvm_domain.irq_lock);
 
     for ( gsi =3D 0; gsi < VIOAPIC_NUM_PINS; gsi++ )
@@ -424,12 +428,20 @@ void vioapic_update_EOI(struct domain *d, u8 vector)
 static int ioapic_save(struct domain *d, hvm_domain_context_t *h)
 {
     struct hvm_hw_vioapic *s =3D domain_vioapic(d);
+
+    if ( !has_vioapic(d) )
+        return 0;
+
     return hvm_save_entry(IOAPIC, 0, h, s);
 }
 
 static int ioapic_load(struct domain *d, hvm_domain_context_t *h)
 {
     struct hvm_hw_vioapic *s =3D domain_vioapic(d);
+
+    if ( !has_vioapic(d) )
+        return -ENODEV;
+
     return hvm_load_entry(IOAPIC, h, s);
 }
 
@@ -440,6 +452,9 @@ void vioapic_reset(struct domain *d)
     struct hvm_vioapic *vioapic =3D d->arch.hvm_domain.vioapic;
     int i;
 
+    if ( !has_vioapic(d) )
+        return;
+
     memset(&vioapic->hvm_hw_vioapic, 0, sizeof(vioapic->hvm_hw_vioapic));
     for ( i =3D 0; i < VIOAPIC_NUM_PINS; i++ )
         vioapic->hvm_hw_vioapic.redirtbl[i].fields.mask =3D 1;
@@ -448,6 +463,9 @@ void vioapic_reset(struct domain *d)
 
 int vioapic_init(struct domain *d)
 {
+    if ( !has_vioapic(d) )
+        return 0;
+
     if ( (d->arch.hvm_domain.vioapic =3D=3D NULL) &&
          ((d->arch.hvm_domain.vioapic =3D xmalloc(struct hvm_vioapic)) =3D=3D NULL) )
         return -ENOMEM;
@@ -462,6 +480,9 @@ int vioapic_init(struct domain *d)
 
 void vioapic_deinit(struct domain *d)
 {
+    if ( !has_vioapic(d) )
+        return;
+
     xfree(d->arch.hvm_domain.vioapic);
     d->arch.hvm_domain.vioapic =3D NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:33:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:33: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 1a1XOZ-0004DU-F2; Wed, 25 Nov 2015 10:33:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOY-0004DF-CA
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:50 +0000
Content-Length: 1698
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	63/87-02940-D8E85565; Wed, 25 Nov 2015 10:33:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448447628!6474741!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62564 invoked from network); 25 Nov 2015 10:33:49 -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;
	25 Nov 2015 10:33:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOV-0006Tv-PZ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOV-0002R1-NL
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:47 +0000
Date: Wed, 25 Nov 2015 10:33:47 +0000
Message-Id: <E1a1XOV-0002R1-NL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated IOMMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0470758436379100315=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0470758436379100315==
Content-Length: 1277
Content-Transfer-Encoding: quoted-printable

commit 7ee5a150fc508785070087fc0ddcfc2f9771ea89
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:05:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:05:35 2015 +0100

    x86: allow disabling the emulated IOMMU
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
---
 xen/drivers/passthrough/amd/iommu_guest.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
index e74f469..b4e75ac 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -887,7 +887,8 @@ int guest_iommu_init(struct domain* d)
     struct guest_iommu *iommu;
     struct hvm_iommu *hd  =3D domain_hvm_iommu(d);
 
-    if ( !is_hvm_domain(d) || !iommu_enabled || !iommuv2_enabled )
+    if ( !is_hvm_domain(d) || !iommu_enabled || !iommuv2_enabled ||
+         !has_viommu(d) )
         return 0;
 
     iommu =3D xzalloc(struct guest_iommu);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:33:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:33: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 1a1XOZ-0004DU-F2; Wed, 25 Nov 2015 10:33:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOY-0004DF-CA
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:50 +0000
Content-Length: 1698
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	63/87-02940-D8E85565; Wed, 25 Nov 2015 10:33:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448447628!6474741!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62564 invoked from network); 25 Nov 2015 10:33:49 -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;
	25 Nov 2015 10:33:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOV-0006Tv-PZ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOV-0002R1-NL
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:47 +0000
Date: Wed, 25 Nov 2015 10:33:47 +0000
Message-Id: <E1a1XOV-0002R1-NL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated IOMMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0470758436379100315=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0470758436379100315==
Content-Length: 1277
Content-Transfer-Encoding: quoted-printable

commit 7ee5a150fc508785070087fc0ddcfc2f9771ea89
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:05:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:05:35 2015 +0100

    x86: allow disabling the emulated IOMMU
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
---
 xen/drivers/passthrough/amd/iommu_guest.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c b/xen/drivers/passthrough/amd/iommu_guest.c
index e74f469..b4e75ac 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -887,7 +887,8 @@ int guest_iommu_init(struct domain* d)
     struct guest_iommu *iommu;
     struct hvm_iommu *hd  =3D domain_hvm_iommu(d);
 
-    if ( !is_hvm_domain(d) || !iommu_enabled || !iommuv2_enabled )
+    if ( !is_hvm_domain(d) || !iommu_enabled || !iommuv2_enabled ||
+         !has_viommu(d) )
         return 0;
 
     iommu =3D xzalloc(struct guest_iommu);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:34:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XOk-0004Gy-Df; Wed, 25 Nov 2015 10:34:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOi-0004GN-RA
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:00 +0000
Content-Length: 3082
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	B3/33-29649-79E85565; Wed, 25 Nov 2015 10:33:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448447638!6470018!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40187 invoked from network); 25 Nov 2015 10:33:59 -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;
	25 Nov 2015 10:33:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOg-0006U7-4F
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOf-0002SQ-Vy
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:58 +0000
Date: Wed, 25 Nov 2015 10:33:57 +0000
Message-Id: <E1a1XOf-0002SQ-Vy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated PIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2689864824518333211=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2689864824518333211==
Content-Length: 2717
Content-Transfer-Encoding: quoted-printable

commit afa14d87bdc7a1cb4ab3f77c54425a6cf6beab4e
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:06:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:06:09 2015 +0100

    x86: allow disabling the emulated PIC
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vpic.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index 7c2edc8..6a2e87b 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -377,6 +377,9 @@ static int vpic_save(struct domain *d, hvm_domain_context_t *h)
     struct hvm_hw_vpic *s;
     int i;
 
+    if ( !has_vpic(d) )
+        return 0;
+
     /* Save the state of both PICs */
     for ( i =3D 0; i < 2 ; i++ )
     {
@@ -392,7 +395,10 @@ static int vpic_load(struct domain *d, hvm_domain_context_t *h)
 {
     struct hvm_hw_vpic *s;
     uint16_t inst;
-    
+
+    if ( !has_vpic(d) )
+        return -ENODEV;
+
     /* Which PIC is this=3F */
     inst =3D hvm_load_instance(h);
     if ( inst > 1 )
@@ -412,6 +418,9 @@ void vpic_reset(struct domain *d)
 {
     struct hvm_hw_vpic *vpic;
 
+    if ( !has_vpic(d) )
+        return;
+
     /* Master PIC. */
     vpic =3D &d->arch.hvm_domain.vpic[0];
     memset(vpic, 0, sizeof(*vpic));
@@ -425,6 +434,9 @@ void vpic_reset(struct domain *d)
 
 void vpic_init(struct domain *d)
 {
+    if ( !has_vpic(d) )
+        return;
+
     vpic_reset(d);
 
     register_portio_handler(d, 0x20, 2, vpic_intercept_pic_io);
@@ -439,6 +451,7 @@ void vpic_irq_positive_edge(struct domain *d, int irq)
     struct hvm_hw_vpic *vpic =3D &d->arch.hvm_domain.vpic[irq >> 3];
     uint8_t mask =3D 1 << (irq & 7);
 
+    ASSERT(has_vpic(d));
     ASSERT(irq <=3D 15);
     ASSERT(vpic_is_locked(vpic));
 
@@ -456,6 +469,7 @@ void vpic_irq_negative_edge(struct domain *d, int irq)
     struct hvm_hw_vpic *vpic =3D &d->arch.hvm_domain.vpic[irq >> 3];
     uint8_t mask =3D 1 << (irq & 7);
 
+    ASSERT(has_vpic(d));
     ASSERT(irq <=3D 15);
     ASSERT(vpic_is_locked(vpic));
 
@@ -473,6 +487,8 @@ int vpic_ack_pending_irq(struct vcpu *v)
     int irq, vector;
     struct hvm_hw_vpic *vpic =3D &v->domain->arch.hvm_domain.vpic[0];
 
+    ASSERT(has_vpic(v->domain));
+
     TRACE_2D(TRC_HVM_EMUL_PIC_PEND_IRQ_CALL, vlapic_accept_pic_intr(v),
              vpic->int_output);
     if ( !vlapic_accept_pic_intr(v) || !vpic->int_output )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:34:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XOk-0004Gy-Df; Wed, 25 Nov 2015 10:34:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOi-0004GN-RA
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:00 +0000
Content-Length: 3082
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	B3/33-29649-79E85565; Wed, 25 Nov 2015 10:33:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448447638!6470018!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 40187 invoked from network); 25 Nov 2015 10:33:59 -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;
	25 Nov 2015 10:33:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOg-0006U7-4F
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOf-0002SQ-Vy
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:33:58 +0000
Date: Wed, 25 Nov 2015 10:33:57 +0000
Message-Id: <E1a1XOf-0002SQ-Vy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated PIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============2689864824518333211=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2689864824518333211==
Content-Length: 2717
Content-Transfer-Encoding: quoted-printable

commit afa14d87bdc7a1cb4ab3f77c54425a6cf6beab4e
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:06:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:06:09 2015 +0100

    x86: allow disabling the emulated PIC
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vpic.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index 7c2edc8..6a2e87b 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -377,6 +377,9 @@ static int vpic_save(struct domain *d, hvm_domain_context_t *h)
     struct hvm_hw_vpic *s;
     int i;
 
+    if ( !has_vpic(d) )
+        return 0;
+
     /* Save the state of both PICs */
     for ( i =3D 0; i < 2 ; i++ )
     {
@@ -392,7 +395,10 @@ static int vpic_load(struct domain *d, hvm_domain_context_t *h)
 {
     struct hvm_hw_vpic *s;
     uint16_t inst;
-    
+
+    if ( !has_vpic(d) )
+        return -ENODEV;
+
     /* Which PIC is this=3F */
     inst =3D hvm_load_instance(h);
     if ( inst > 1 )
@@ -412,6 +418,9 @@ void vpic_reset(struct domain *d)
 {
     struct hvm_hw_vpic *vpic;
 
+    if ( !has_vpic(d) )
+        return;
+
     /* Master PIC. */
     vpic =3D &d->arch.hvm_domain.vpic[0];
     memset(vpic, 0, sizeof(*vpic));
@@ -425,6 +434,9 @@ void vpic_reset(struct domain *d)
 
 void vpic_init(struct domain *d)
 {
+    if ( !has_vpic(d) )
+        return;
+
     vpic_reset(d);
 
     register_portio_handler(d, 0x20, 2, vpic_intercept_pic_io);
@@ -439,6 +451,7 @@ void vpic_irq_positive_edge(struct domain *d, int irq)
     struct hvm_hw_vpic *vpic =3D &d->arch.hvm_domain.vpic[irq >> 3];
     uint8_t mask =3D 1 << (irq & 7);
 
+    ASSERT(has_vpic(d));
     ASSERT(irq <=3D 15);
     ASSERT(vpic_is_locked(vpic));
 
@@ -456,6 +469,7 @@ void vpic_irq_negative_edge(struct domain *d, int irq)
     struct hvm_hw_vpic *vpic =3D &d->arch.hvm_domain.vpic[irq >> 3];
     uint8_t mask =3D 1 << (irq & 7);
 
+    ASSERT(has_vpic(d));
     ASSERT(irq <=3D 15);
     ASSERT(vpic_is_locked(vpic));
 
@@ -473,6 +487,8 @@ int vpic_ack_pending_irq(struct vcpu *v)
     int irq, vector;
     struct hvm_hw_vpic *vpic =3D &v->domain->arch.hvm_domain.vpic[0];
 
+    ASSERT(has_vpic(v->domain));
+
     TRACE_2D(TRC_HVM_EMUL_PIC_PEND_IRQ_CALL, vlapic_accept_pic_intr(v),
              vpic->int_output);
     if ( !vlapic_accept_pic_intr(v) || !vpic->int_output )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:34:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34: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 1a1XOv-0004KK-I6; Wed, 25 Nov 2015 10:34: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 1a1XOu-0004K1-CD
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:12 +0000
Content-Length: 2790
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	36/20-32615-3AE85565; Wed, 25 Nov 2015 10:34:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1448447648!6341403!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 938 invoked from network); 25 Nov 2015 10:34:11 -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;
	25 Nov 2015 10:34:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOq-0006Uj-CL
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOq-0002TA-A2
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:08 +0000
Date: Wed, 25 Nov 2015 10:34:08 +0000
Message-Id: <E1a1XOq-0002TA-A2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated PIT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5581022607364065067=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5581022607364065067==
Content-Length: 2419
Content-Transfer-Encoding: quoted-printable

commit c55f69e5c4e490071075b3a8f53188d7ac25df26
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:06:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:06:28 2015 +0100

    x86: allow disabling the emulated PIT
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reported by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/i8254.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/i8254.c b/xen/arch/x86/hvm/i8254.c
index 8a93c88..b517cd6 100644
--- a/xen/arch/x86/hvm/i8254.c
+++ b/xen/arch/x86/hvm/i8254.c
@@ -382,6 +382,9 @@ static uint32_t pit_ioport_read(struct PITState *pit, uint32_t addr)
 
 void pit_stop_channel0_irq(PITState *pit)
 {
+    if ( !has_vpit(current->domain) )
+        return;
+
     TRACE_0D(TRC_HVM_EMUL_PIT_STOP_TIMER);
     spin_lock(&pit->lock);
     destroy_periodic_time(&pit->pt0);
@@ -393,6 +396,9 @@ static int pit_save(struct domain *d, hvm_domain_context_t *h)
     PITState *pit =3D domain_vpit(d);
     int rc;
 
+    if ( !has_vpit(d) )
+        return 0;
+
     spin_lock(&pit->lock);
     
     rc =3D hvm_save_entry(PIT, 0, h, &pit->hw);
@@ -407,6 +413,9 @@ static int pit_load(struct domain *d, hvm_domain_context_t *h)
     PITState *pit =3D domain_vpit(d);
     int i;
 
+    if ( !has_vpit(d) )
+        return -ENODEV;
+
     spin_lock(&pit->lock);
 
     if ( hvm_load_entry(PIT, h, &pit->hw) )
@@ -437,6 +446,9 @@ void pit_reset(struct domain *d)
     struct hvm_hw_pit_channel *s;
     int i;
 
+    if ( !has_vpit(d) )
+        return;
+
     TRACE_0D(TRC_HVM_EMUL_PIT_STOP_TIMER);
     destroy_periodic_time(&pit->pt0);
     pit->pt0.source =3D PTSRC_isa;
@@ -458,6 +470,9 @@ void pit_init(struct domain *d, unsigned long cpu_khz)
 {
     PITState *pit =3D domain_vpit(d);
 
+    if ( !has_vpit(d) )
+        return;
+
     spin_lock_init(&pit->lock);
 
     if ( is_hvm_domain(d) )
@@ -473,6 +488,9 @@ void pit_deinit(struct domain *d)
 {
     PITState *pit =3D domain_vpit(d);
 
+    if ( !has_vpit(d) )
+        return;
+
     TRACE_0D(TRC_HVM_EMUL_PIT_STOP_TIMER);
     destroy_periodic_time(&pit->pt0);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:34:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34: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 1a1XOv-0004KK-I6; Wed, 25 Nov 2015 10:34: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 1a1XOu-0004K1-CD
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:12 +0000
Content-Length: 2790
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	36/20-32615-3AE85565; Wed, 25 Nov 2015 10:34:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1448447648!6341403!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 938 invoked from network); 25 Nov 2015 10:34:11 -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;
	25 Nov 2015 10:34:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOq-0006Uj-CL
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XOq-0002TA-A2
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:08 +0000
Date: Wed, 25 Nov 2015 10:34:08 +0000
Message-Id: <E1a1XOq-0002TA-A2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated PIT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============5581022607364065067=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5581022607364065067==
Content-Length: 2419
Content-Transfer-Encoding: quoted-printable

commit c55f69e5c4e490071075b3a8f53188d7ac25df26
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:06:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:06:28 2015 +0100

    x86: allow disabling the emulated PIT
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reported by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/i8254.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/i8254.c b/xen/arch/x86/hvm/i8254.c
index 8a93c88..b517cd6 100644
--- a/xen/arch/x86/hvm/i8254.c
+++ b/xen/arch/x86/hvm/i8254.c
@@ -382,6 +382,9 @@ static uint32_t pit_ioport_read(struct PITState *pit, uint32_t addr)
 
 void pit_stop_channel0_irq(PITState *pit)
 {
+    if ( !has_vpit(current->domain) )
+        return;
+
     TRACE_0D(TRC_HVM_EMUL_PIT_STOP_TIMER);
     spin_lock(&pit->lock);
     destroy_periodic_time(&pit->pt0);
@@ -393,6 +396,9 @@ static int pit_save(struct domain *d, hvm_domain_context_t *h)
     PITState *pit =3D domain_vpit(d);
     int rc;
 
+    if ( !has_vpit(d) )
+        return 0;
+
     spin_lock(&pit->lock);
     
     rc =3D hvm_save_entry(PIT, 0, h, &pit->hw);
@@ -407,6 +413,9 @@ static int pit_load(struct domain *d, hvm_domain_context_t *h)
     PITState *pit =3D domain_vpit(d);
     int i;
 
+    if ( !has_vpit(d) )
+        return -ENODEV;
+
     spin_lock(&pit->lock);
 
     if ( hvm_load_entry(PIT, h, &pit->hw) )
@@ -437,6 +446,9 @@ void pit_reset(struct domain *d)
     struct hvm_hw_pit_channel *s;
     int i;
 
+    if ( !has_vpit(d) )
+        return;
+
     TRACE_0D(TRC_HVM_EMUL_PIT_STOP_TIMER);
     destroy_periodic_time(&pit->pt0);
     pit->pt0.source =3D PTSRC_isa;
@@ -458,6 +470,9 @@ void pit_init(struct domain *d, unsigned long cpu_khz)
 {
     PITState *pit =3D domain_vpit(d);
 
+    if ( !has_vpit(d) )
+        return;
+
     spin_lock_init(&pit->lock);
 
     if ( is_hvm_domain(d) )
@@ -473,6 +488,9 @@ void pit_deinit(struct domain *d)
 {
     PITState *pit =3D domain_vpit(d);
 
+    if ( !has_vpit(d) )
+        return;
+
     TRACE_0D(TRC_HVM_EMUL_PIT_STOP_TIMER);
     destroy_periodic_time(&pit->pt0);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:34:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34: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 1a1XP4-0004Mp-N6; Wed, 25 Nov 2015 10:34: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 1a1XP2-0004MI-V3
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:21 +0000
Content-Length: 3312
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	6A/3F-16870-CAE85565; Wed, 25 Nov 2015 10:34:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1448447658!6339375!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 59906 invoked from network); 25 Nov 2015 10:34:19 -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;
	25 Nov 2015 10:34:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XP0-0006Uv-Ji
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XP0-0002Tq-Gs
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:18 +0000
Date: Wed, 25 Nov 2015 10:34:18 +0000
Message-Id: <E1a1XP0-0002Tq-Gs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling power 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: multipart/mixed; boundary="===============1146719304590480795=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1146719304590480795==
Content-Length: 2961
Content-Transfer-Encoding: quoted-printable

commit b953524f1a88ad31987fa84cc8bcf6b195257554
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:06:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:06:48 2015 +0100

    x86: allow disabling power management
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/pmtimer.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index c8229e0..9c2e4bd 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -67,6 +67,10 @@ static void pmt_update_sci(PMTState *s)
 void hvm_acpi_power_button(struct domain *d)
 {
     PMTState *s =3D &d->arch.hvm_domain.pl_time.vpmt;
+
+    if ( !has_vpm(d) )
+        return;
+
     spin_lock(&s->lock);
     s->pm.pm1a_sts |=3D PWRBTN_STS;
     pmt_update_sci(s);
@@ -76,6 +80,10 @@ void hvm_acpi_power_button(struct domain *d)
 void hvm_acpi_sleep_button(struct domain *d)
 {
     PMTState *s =3D &d->arch.hvm_domain.pl_time.vpmt;
+
+    if ( !has_vpm(d) )
+        return;
+
     spin_lock(&s->lock);
     s->pm.pm1a_sts |=3D SLPBTN_STS;
     pmt_update_sci(s);
@@ -247,6 +255,9 @@ static int pmtimer_save(struct domain *d, hvm_domain_context_t *h)
     uint32_t x, msb =3D s->pm.tmr_val & TMR_VAL_MSB;
     int rc;
 
+    if ( !has_vpm(d) )
+        return 0;
+
     spin_lock(&s->lock);
 
     /*
@@ -273,6 +284,9 @@ static int pmtimer_load(struct domain *d, hvm_domain_context_t *h)
 {
     PMTState *s =3D &d->arch.hvm_domain.pl_time.vpmt;
 
+    if ( !has_vpm(d) )
+        return -ENODEV;
+
     spin_lock(&s->lock);
 
     /* Reload the registers */
@@ -301,6 +315,9 @@ int pmtimer_change_ioport(struct domain *d, unsigned int version)
 {
     unsigned int old_version;
 
+    if ( !has_vpm(d) )
+        return -ENODEV;
+
     /* Check that version is changing. */
     old_version =3D d->arch.hvm_domain.params[HVM_PARAM_ACPI_IOPORTS_LOCATION];
     if ( version =3D=3D old_version )
@@ -330,6 +347,9 @@ void pmtimer_init(struct vcpu *v)
 {
     PMTState *s =3D &v->domain->arch.hvm_domain.pl_time.vpmt;
 
+    if ( !has_vpm(v->domain) )
+        return;
+
     spin_lock_init(&s->lock);
 
     s->scale =3D ((uint64_t)FREQUENCE_PMTIMER << 32) / SYSTEM_TIME_HZ;
@@ -350,11 +370,18 @@ void pmtimer_init(struct vcpu *v)
 void pmtimer_deinit(struct domain *d)
 {
     PMTState *s =3D &d->arch.hvm_domain.pl_time.vpmt;
+
+    if ( !has_vpm(d) )
+        return;
+
     kill_timer(&s->timer);
 }
 
 void pmtimer_reset(struct domain *d)
 {
+    if ( !has_vpm(d) )
+        return;
+
     /* Reset the counter. */
     d->arch.hvm_domain.pl_time.vpmt.pm.tmr_val =3D 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:34:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34: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 1a1XP4-0004Mp-N6; Wed, 25 Nov 2015 10:34: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 1a1XP2-0004MI-V3
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:21 +0000
Content-Length: 3312
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	6A/3F-16870-CAE85565; Wed, 25 Nov 2015 10:34:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1448447658!6339375!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 59906 invoked from network); 25 Nov 2015 10:34:19 -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;
	25 Nov 2015 10:34:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XP0-0006Uv-Ji
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XP0-0002Tq-Gs
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:18 +0000
Date: Wed, 25 Nov 2015 10:34:18 +0000
Message-Id: <E1a1XP0-0002Tq-Gs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling power 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: multipart/mixed; boundary="===============1146719304590480795=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1146719304590480795==
Content-Length: 2961
Content-Transfer-Encoding: quoted-printable

commit b953524f1a88ad31987fa84cc8bcf6b195257554
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:06:48 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:06:48 2015 +0100

    x86: allow disabling power management
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/pmtimer.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index c8229e0..9c2e4bd 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -67,6 +67,10 @@ static void pmt_update_sci(PMTState *s)
 void hvm_acpi_power_button(struct domain *d)
 {
     PMTState *s =3D &d->arch.hvm_domain.pl_time.vpmt;
+
+    if ( !has_vpm(d) )
+        return;
+
     spin_lock(&s->lock);
     s->pm.pm1a_sts |=3D PWRBTN_STS;
     pmt_update_sci(s);
@@ -76,6 +80,10 @@ void hvm_acpi_power_button(struct domain *d)
 void hvm_acpi_sleep_button(struct domain *d)
 {
     PMTState *s =3D &d->arch.hvm_domain.pl_time.vpmt;
+
+    if ( !has_vpm(d) )
+        return;
+
     spin_lock(&s->lock);
     s->pm.pm1a_sts |=3D SLPBTN_STS;
     pmt_update_sci(s);
@@ -247,6 +255,9 @@ static int pmtimer_save(struct domain *d, hvm_domain_context_t *h)
     uint32_t x, msb =3D s->pm.tmr_val & TMR_VAL_MSB;
     int rc;
 
+    if ( !has_vpm(d) )
+        return 0;
+
     spin_lock(&s->lock);
 
     /*
@@ -273,6 +284,9 @@ static int pmtimer_load(struct domain *d, hvm_domain_context_t *h)
 {
     PMTState *s =3D &d->arch.hvm_domain.pl_time.vpmt;
 
+    if ( !has_vpm(d) )
+        return -ENODEV;
+
     spin_lock(&s->lock);
 
     /* Reload the registers */
@@ -301,6 +315,9 @@ int pmtimer_change_ioport(struct domain *d, unsigned int version)
 {
     unsigned int old_version;
 
+    if ( !has_vpm(d) )
+        return -ENODEV;
+
     /* Check that version is changing. */
     old_version =3D d->arch.hvm_domain.params[HVM_PARAM_ACPI_IOPORTS_LOCATION];
     if ( version =3D=3D old_version )
@@ -330,6 +347,9 @@ void pmtimer_init(struct vcpu *v)
 {
     PMTState *s =3D &v->domain->arch.hvm_domain.pl_time.vpmt;
 
+    if ( !has_vpm(v->domain) )
+        return;
+
     spin_lock_init(&s->lock);
 
     s->scale =3D ((uint64_t)FREQUENCE_PMTIMER << 32) / SYSTEM_TIME_HZ;
@@ -350,11 +370,18 @@ void pmtimer_init(struct vcpu *v)
 void pmtimer_deinit(struct domain *d)
 {
     PMTState *s =3D &d->arch.hvm_domain.pl_time.vpmt;
+
+    if ( !has_vpm(d) )
+        return;
+
     kill_timer(&s->timer);
 }
 
 void pmtimer_reset(struct domain *d)
 {
+    if ( !has_vpm(d) )
+        return;
+
     /* Reset the counter. */
     d->arch.hvm_domain.pl_time.vpmt.pm.tmr_val =3D 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:34:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XPE-0004PV-T6; Wed, 25 Nov 2015 10:34:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPC-0004P1-UG
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:31 +0000
Content-Length: 2901
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	65/B1-14900-6BE85565; Wed, 25 Nov 2015 10:34:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1448447669!5853862!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6727 invoked from network); 25 Nov 2015 10:34:29 -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;
	25 Nov 2015 10:34:29 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPA-0006V0-Qk
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPA-0002Uj-PJ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:28 +0000
Date: Wed, 25 Nov 2015 10:34:28 +0000
Message-Id: <E1a1XPA-0002Uj-PJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated RTC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============8818645067879917893=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8818645067879917893==
Content-Length: 2540
Content-Transfer-Encoding: quoted-printable

commit c603463ddbf2728d4eb82ecd7f435b5f642e11f8
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:07:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:07:03 2015 +0100

    x86: allow disabling the emulated RTC
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/rtc.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index a9efeaf..d391e38 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -726,6 +726,9 @@ void rtc_migrate_timers(struct vcpu *v)
 {
     RTCState *s =3D vcpu_vrtc(v);
 
+    if ( !has_vrtc(v->domain) )
+        return;
+
     if ( v->vcpu_id =3D=3D 0 )
     {
         migrate_timer(&s->update_timer, v->processor);;
@@ -739,6 +742,10 @@ static int rtc_save(struct domain *d, hvm_domain_context_t *h)
 {
     RTCState *s =3D domain_vrtc(d);
     int rc;
+
+    if ( !has_vrtc(d) )
+        return 0;
+
     spin_lock(&s->lock);
     rc =3D hvm_save_entry(RTC, 0, h, &s->hw);
     spin_unlock(&s->lock);
@@ -750,6 +757,9 @@ static int rtc_load(struct domain *d, hvm_domain_context_t *h)
 {
     RTCState *s =3D domain_vrtc(d);
 
+    if ( !has_vrtc(d) )
+        return -ENODEV;
+
     spin_lock(&s->lock);
 
     /* Restore the registers */
@@ -780,6 +790,9 @@ void rtc_reset(struct domain *d)
 {
     RTCState *s =3D domain_vrtc(d);
 
+    if ( !has_vrtc(d) )
+        return;
+
     TRACE_0D(TRC_HVM_EMUL_RTC_STOP_TIMER);
     destroy_periodic_time(&s->pt);
     s->period =3D 0;
@@ -790,6 +803,9 @@ void rtc_init(struct domain *d)
 {
     RTCState *s =3D domain_vrtc(d);
 
+    if ( !has_vrtc(d) )
+        return;
+
     spin_lock_init(&s->lock);
 
     init_timer(&s->update_timer, rtc_update_timer, s, smp_processor_id());
@@ -820,6 +836,9 @@ void rtc_deinit(struct domain *d)
 {
     RTCState *s =3D domain_vrtc(d);
 
+    if ( !has_vrtc(d) )
+        return;
+
     spin_barrier(&s->lock);
 
     TRACE_0D(TRC_HVM_EMUL_RTC_STOP_TIMER);
@@ -833,6 +852,9 @@ void rtc_update_clock(struct domain *d)
 {
     RTCState *s =3D domain_vrtc(d);
 
+    if ( !has_vrtc(d) )
+        return;
+
     spin_lock(&s->lock);
     s->current_tm =3D gmtime(get_localtime(d));
     spin_unlock(&s->lock);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:34:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XPE-0004PV-T6; Wed, 25 Nov 2015 10:34:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPC-0004P1-UG
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:31 +0000
Content-Length: 2901
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	65/B1-14900-6BE85565; Wed, 25 Nov 2015 10:34:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1448447669!5853862!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6727 invoked from network); 25 Nov 2015 10:34:29 -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;
	25 Nov 2015 10:34:29 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPA-0006V0-Qk
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPA-0002Uj-PJ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:28 +0000
Date: Wed, 25 Nov 2015 10:34:28 +0000
Message-Id: <E1a1XPA-0002Uj-PJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated RTC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============8818645067879917893=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8818645067879917893==
Content-Length: 2540
Content-Transfer-Encoding: quoted-printable

commit c603463ddbf2728d4eb82ecd7f435b5f642e11f8
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:07:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:07:03 2015 +0100

    x86: allow disabling the emulated RTC
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/rtc.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index a9efeaf..d391e38 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -726,6 +726,9 @@ void rtc_migrate_timers(struct vcpu *v)
 {
     RTCState *s =3D vcpu_vrtc(v);
 
+    if ( !has_vrtc(v->domain) )
+        return;
+
     if ( v->vcpu_id =3D=3D 0 )
     {
         migrate_timer(&s->update_timer, v->processor);;
@@ -739,6 +742,10 @@ static int rtc_save(struct domain *d, hvm_domain_context_t *h)
 {
     RTCState *s =3D domain_vrtc(d);
     int rc;
+
+    if ( !has_vrtc(d) )
+        return 0;
+
     spin_lock(&s->lock);
     rc =3D hvm_save_entry(RTC, 0, h, &s->hw);
     spin_unlock(&s->lock);
@@ -750,6 +757,9 @@ static int rtc_load(struct domain *d, hvm_domain_context_t *h)
 {
     RTCState *s =3D domain_vrtc(d);
 
+    if ( !has_vrtc(d) )
+        return -ENODEV;
+
     spin_lock(&s->lock);
 
     /* Restore the registers */
@@ -780,6 +790,9 @@ void rtc_reset(struct domain *d)
 {
     RTCState *s =3D domain_vrtc(d);
 
+    if ( !has_vrtc(d) )
+        return;
+
     TRACE_0D(TRC_HVM_EMUL_RTC_STOP_TIMER);
     destroy_periodic_time(&s->pt);
     s->period =3D 0;
@@ -790,6 +803,9 @@ void rtc_init(struct domain *d)
 {
     RTCState *s =3D domain_vrtc(d);
 
+    if ( !has_vrtc(d) )
+        return;
+
     spin_lock_init(&s->lock);
 
     init_timer(&s->update_timer, rtc_update_timer, s, smp_processor_id());
@@ -820,6 +836,9 @@ void rtc_deinit(struct domain *d)
 {
     RTCState *s =3D domain_vrtc(d);
 
+    if ( !has_vrtc(d) )
+        return;
+
     spin_barrier(&s->lock);
 
     TRACE_0D(TRC_HVM_EMUL_RTC_STOP_TIMER);
@@ -833,6 +852,9 @@ void rtc_update_clock(struct domain *d)
 {
     RTCState *s =3D domain_vrtc(d);
 
+    if ( !has_vrtc(d) )
+        return;
+
     spin_lock(&s->lock);
     s->current_tm =3D gmtime(get_localtime(d));
     spin_unlock(&s->lock);
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:34:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34: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 1a1XPP-0004Ri-1P; Wed, 25 Nov 2015 10:34: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 1a1XPN-0004RP-Mh
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:41 +0000
Content-Length: 1678
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	F0/37-22142-0CE85565; Wed, 25 Nov 2015 10:34:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1448447679!6346304!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14014 invoked from network); 25 Nov 2015 10:34:40 -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;
	25 Nov 2015 10:34:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPL-0006VB-36
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPL-0002Wp-1L
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:39 +0000
Date: Wed, 25 Nov 2015 10:34:39 +0000
Message-Id: <E1a1XPL-0002Wp-1L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated VGA
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0100310847419055451=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0100310847419055451==
Content-Length: 1266
Content-Transfer-Encoding: quoted-printable

commit 4d81504ff449010daf69d930ebcd2d23b19a1cda
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:07:32 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:07:32 2015 +0100

    x86: allow disabling the emulated VGA
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/stdvga.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 86c94d2..bd23b52 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -578,6 +578,9 @@ void stdvga_init(struct domain *d)
     struct page_info *pg;
     unsigned int i;
 
+    if ( !has_vvga(d) )
+        return;
+
     memset(s, 0, sizeof(*s));
     spin_lock_init(&s->lock);
     
@@ -615,6 +618,9 @@ void stdvga_deinit(struct domain *d)
     struct hvm_hw_stdvga *s =3D &d->arch.hvm_domain.stdvga;
     int i;
 
+    if ( !has_vvga(d) )
+        return;
+
     for ( i =3D 0; i !=3D ARRAY_SIZE(s->vram_page); i++ )
     {
         if ( s->vram_page[i] =3D=3D NULL )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:34:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34: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 1a1XPP-0004Ri-1P; Wed, 25 Nov 2015 10:34: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 1a1XPN-0004RP-Mh
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:41 +0000
Content-Length: 1678
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	F0/37-22142-0CE85565; Wed, 25 Nov 2015 10:34:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1448447679!6346304!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14014 invoked from network); 25 Nov 2015 10:34:40 -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;
	25 Nov 2015 10:34:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPL-0006VB-36
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPL-0002Wp-1L
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:39 +0000
Date: Wed, 25 Nov 2015 10:34:39 +0000
Message-Id: <E1a1XPL-0002Wp-1L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow disabling the emulated VGA
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============0100310847419055451=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0100310847419055451==
Content-Length: 1266
Content-Transfer-Encoding: quoted-printable

commit 4d81504ff449010daf69d930ebcd2d23b19a1cda
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Nov 10 12:07:32 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:07:32 2015 +0100

    x86: allow disabling the emulated VGA
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/stdvga.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/stdvga.c b/xen/arch/x86/hvm/stdvga.c
index 86c94d2..bd23b52 100644
--- a/xen/arch/x86/hvm/stdvga.c
+++ b/xen/arch/x86/hvm/stdvga.c
@@ -578,6 +578,9 @@ void stdvga_init(struct domain *d)
     struct page_info *pg;
     unsigned int i;
 
+    if ( !has_vvga(d) )
+        return;
+
     memset(s, 0, sizeof(*s));
     spin_lock_init(&s->lock);
     
@@ -615,6 +618,9 @@ void stdvga_deinit(struct domain *d)
     struct hvm_hw_stdvga *s =3D &d->arch.hvm_domain.stdvga;
     int i;
 
+    if ( !has_vvga(d) )
+        return;
+
     for ( i =3D 0; i !=3D ARRAY_SIZE(s->vram_page); i++ )
     {
         if ( s->vram_page[i] =3D=3D NULL )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:34:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34: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 1a1XPZ-0004To-5f; Wed, 25 Nov 2015 10:34:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPX-0004TR-OC
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:51 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	EB/0E-13487-ACE85565; Wed, 25 Nov 2015 10:34:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1448447689!6337941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1251 invoked from network); 25 Nov 2015 10:34:50 -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;
	25 Nov 2015 10:34:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPV-0006VJ-CD
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPV-0002XQ-Ap
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:49 +0000
Date: Wed, 25 Nov 2015 10:34:49 +0000
Message-Id: <E1a1XPV-0002XQ-Ap@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] symbols.c: avoid warn_unused_result
	build failure on fgets()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85ad62ecb8c2b31bf13b5e88696ec1d42c7031e4
Author:     Riku Voipio <riku.voipio@linaro.org>
AuthorDate: Tue Nov 10 12:07:55 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:07:55 2015 +0100

    symbols.c: avoid warn_unused_result build failure on fgets()
    
    In commit:
    
    d37d63d symbols: prefix static symbols with their source file names
    
    An unchecked fgets was added. This causes a compile error at least
    on ubuntu utopic:
    
    symbols.c: In function 'read_symbol':
    symbols.c:181:3: error: ignoring return value of 'fgets', declared with
    attribute warn_unused_result [-Werror=unused-result]
       fgets(str, 500, in); /* discard rest of line */
       ^
    
    Paper over the warning by checking the return value in the if statement.
    
    Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/tools/symbols.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index dbf6a1a..1abdf08 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -177,8 +177,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 	rc = 0;
 
  skip_tail:
-	if (input_format == fmt_sysv)
-		fgets(str, 500, in); /* discard rest of line */
+	if ((input_format == fmt_sysv) && fgets(str, 500, in) == NULL)
+		/* ignore errors while discarding rest of line */;
 
 	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 Nov 25 10:34:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:34: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 1a1XPZ-0004To-5f; Wed, 25 Nov 2015 10:34:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPX-0004TR-OC
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:51 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	EB/0E-13487-ACE85565; Wed, 25 Nov 2015 10:34:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1448447689!6337941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1251 invoked from network); 25 Nov 2015 10:34:50 -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;
	25 Nov 2015 10:34:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPV-0006VJ-CD
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPV-0002XQ-Ap
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:49 +0000
Date: Wed, 25 Nov 2015 10:34:49 +0000
Message-Id: <E1a1XPV-0002XQ-Ap@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] symbols.c: avoid warn_unused_result
	build failure on fgets()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85ad62ecb8c2b31bf13b5e88696ec1d42c7031e4
Author:     Riku Voipio <riku.voipio@linaro.org>
AuthorDate: Tue Nov 10 12:07:55 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:07:55 2015 +0100

    symbols.c: avoid warn_unused_result build failure on fgets()
    
    In commit:
    
    d37d63d symbols: prefix static symbols with their source file names
    
    An unchecked fgets was added. This causes a compile error at least
    on ubuntu utopic:
    
    symbols.c: In function 'read_symbol':
    symbols.c:181:3: error: ignoring return value of 'fgets', declared with
    attribute warn_unused_result [-Werror=unused-result]
       fgets(str, 500, in); /* discard rest of line */
       ^
    
    Paper over the warning by checking the return value in the if statement.
    
    Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/tools/symbols.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index dbf6a1a..1abdf08 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -177,8 +177,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 	rc = 0;
 
  skip_tail:
-	if (input_format == fmt_sysv)
-		fgets(str, 500, in); /* discard rest of line */
+	if ((input_format == fmt_sysv) && fgets(str, 500, in) == NULL)
+		/* ignore errors while discarding rest of line */;
 
 	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 Nov 25 10:35:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35: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 1a1XPj-0004WU-9j; Wed, 25 Nov 2015 10:35:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPi-0004W8-0h
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:02 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	06/BA-02940-5DE85565; Wed, 25 Nov 2015 10:35:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1448447699!5866911!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8558 invoked from network); 25 Nov 2015 10:35:00 -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;
	25 Nov 2015 10:35:00 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPf-0006VR-LE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPf-0002Yz-I8
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:59 +0000
Date: Wed, 25 Nov 2015 10:34:59 +0000
Message-Id: <E1a1XPf-0002Yz-I8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: fix booting failure with UEFI on
	ARM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fa72bd15564c59cbd54d4db31a3060293e782ca
Author:     Shannon Zhao <shannon.zhao@linaro.org>
AuthorDate: Tue Nov 10 12:08:29 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:08:29 2015 +0100

    efi: fix booting failure with UEFI on ARM
    
    Commit 9fd08b4 (efi: split out efi_get_gop()) splits out the
    codes getting the pointer to GOP as efi_get_gop(), but it doesn't
    initialize the variable handles and gop to NULL like what the original
    codes do. This will cause booting failure on ARM while printing below
    logs:
    	Xen 4.7-unstable (c/s Tue Oct 13 14:40:28 2015 +0100 git:7a92036) EFI loader
    	Synchronous Exception at 0x00000000FECB021C
    
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 xen/common/efi/boot.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 005bb2b..53c7452 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -635,8 +635,8 @@ static void __init efi_console_set_mode(void)
 static EFI_GRAPHICS_OUTPUT_PROTOCOL __init *efi_get_gop(void)
 {
     EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
-    EFI_GRAPHICS_OUTPUT_PROTOCOL *gop;
-    EFI_HANDLE *handles;
+    EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
+    EFI_HANDLE *handles = NULL;
     EFI_STATUS status;
     UINTN info_size, size = 0;
     static EFI_GUID __initdata gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:35:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35: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 1a1XPj-0004WU-9j; Wed, 25 Nov 2015 10:35:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPi-0004W8-0h
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:02 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	06/BA-02940-5DE85565; Wed, 25 Nov 2015 10:35:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1448447699!5866911!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8558 invoked from network); 25 Nov 2015 10:35:00 -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;
	25 Nov 2015 10:35:00 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPf-0006VR-LE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPf-0002Yz-I8
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:34:59 +0000
Date: Wed, 25 Nov 2015 10:34:59 +0000
Message-Id: <E1a1XPf-0002Yz-I8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] efi: fix booting failure with UEFI on
	ARM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fa72bd15564c59cbd54d4db31a3060293e782ca
Author:     Shannon Zhao <shannon.zhao@linaro.org>
AuthorDate: Tue Nov 10 12:08:29 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 10 12:08:29 2015 +0100

    efi: fix booting failure with UEFI on ARM
    
    Commit 9fd08b4 (efi: split out efi_get_gop()) splits out the
    codes getting the pointer to GOP as efi_get_gop(), but it doesn't
    initialize the variable handles and gop to NULL like what the original
    codes do. This will cause booting failure on ARM while printing below
    logs:
    	Xen 4.7-unstable (c/s Tue Oct 13 14:40:28 2015 +0100 git:7a92036) EFI loader
    	Synchronous Exception at 0x00000000FECB021C
    
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 xen/common/efi/boot.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 005bb2b..53c7452 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -635,8 +635,8 @@ static void __init efi_console_set_mode(void)
 static EFI_GRAPHICS_OUTPUT_PROTOCOL __init *efi_get_gop(void)
 {
     EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
-    EFI_GRAPHICS_OUTPUT_PROTOCOL *gop;
-    EFI_HANDLE *handles;
+    EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
+    EFI_HANDLE *handles = NULL;
     EFI_STATUS status;
     UINTN info_size, size = 0;
     static EFI_GUID __initdata gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:35:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35: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 1a1XPt-0004Yf-EA; Wed, 25 Nov 2015 10:35:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPs-0004YK-B8
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:12 +0000
Content-Length: 3544
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	13/10-01753-FDE85565; Wed, 25 Nov 2015 10:35:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1448447710!5854106!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17757 invoked from network); 25 Nov 2015 10:35:10 -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;
	25 Nov 2015 10:35:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPp-0006W1-TP
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPp-0002Zs-RX
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:09 +0000
Date: Wed, 25 Nov 2015 10:35:09 +0000
Message-Id: <E1a1XPp-0002Zs-RX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] elfnotes: intorduce a new PHYS_ENTRY
	elfnote
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============6951775731266653707=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6951775731266653707==
Content-Length: 3176
Content-Transfer-Encoding: quoted-printable

commit a1b2d39f071f1e85d0adb2e041f4a8a9aa9a88a8
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Thu Nov 12 16:58:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 16:58:07 2015 +0100

    elfnotes: intorduce a new PHYS_ENTRY elfnote
    
    This new elfnote contains the 32bit entry point into the kernel. Xen will
    use this entry point in order to launch the guest kernel in 32bit protected
    mode with paging disabled.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/xcutils/readnotes.c          |    3 +++
 xen/common/libelf/libelf-dominfo.c |    4 ++++
 xen/include/public/elfnote.h       |   12 +++++++++++-
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/tools/xcutils/readnotes.c b/tools/xcutils/readnotes.c
index 5fa445e..e682dd1 100644
--- a/tools/xcutils/readnotes.c
+++ b/tools/xcutils/readnotes.c
@@ -159,6 +159,9 @@ static unsigned print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) st
 		case XEN_ELFNOTE_L1_MFN_VALID:
 			print_l1_mfn_valid_note("L1_MFN_VALID", elf , note);
 			break;
+		case XEN_ELFNOTE_PHYS32_ENTRY:
+			print_numeric_note("PHYS32_ENTRY", elf , note);
+			break;
 		default:
 			printf("unknown note type %#x\n",
 			       (unsigned)elf_uval(elf, note, type));
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 3de1c23..dacd4ba 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -119,6 +119,7 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
         [XEN_ELFNOTE_BSD_SYMTAB] =3D { "BSD_SYMTAB", 1},
         [XEN_ELFNOTE_SUSPEND_CANCEL] =3D { "SUSPEND_CANCEL", 0 },
         [XEN_ELFNOTE_MOD_START_PFN] =3D { "MOD_START_PFN", 0 },
+        [XEN_ELFNOTE_PHYS32_ENTRY] =3D { "PHYS32_ENTRY", 0 },
     };
 /* *INDENT-ON* */
 
@@ -212,6 +213,9 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
                 elf, note, sizeof(*parms->f_supported), i);
         break;
 
+    case XEN_ELFNOTE_PHYS32_ENTRY:
+        parms->phys_entry =3D val;
+        break;
     }
     return 0;
 }
diff --git a/xen/include/public/elfnote.h b/xen/include/public/elfnote.h
index 3824a94..353985f 100644
--- a/xen/include/public/elfnote.h
+++ b/xen/include/public/elfnote.h
@@ -200,9 +200,19 @@
 #define XEN_ELFNOTE_SUPPORTED_FEATURES 17
 
 /*
+ * Physical entry point into the kernel.
+ *
+ * 32bit entry point into the kernel. When requested to launch the
+ * guest kernel in a HVM container, Xen will use this entry point to
+ * launch the guest in 32bit protected mode with paging disabled.
+ * Ignored otherwise.
+ */
+#define XEN_ELFNOTE_PHYS32_ENTRY 18
+
+/*
  * The number of the highest elfnote defined.
  */
-#define XEN_ELFNOTE_MAX XEN_ELFNOTE_SUPPORTED_FEATURES
+#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY
 
 /*
  * System information exported through crash notes.
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:35:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35: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 1a1XPt-0004Yf-EA; Wed, 25 Nov 2015 10:35:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPs-0004YK-B8
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:12 +0000
Content-Length: 3544
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	13/10-01753-FDE85565; Wed, 25 Nov 2015 10:35:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1448447710!5854106!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17757 invoked from network); 25 Nov 2015 10:35:10 -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;
	25 Nov 2015 10:35:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPp-0006W1-TP
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XPp-0002Zs-RX
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:09 +0000
Date: Wed, 25 Nov 2015 10:35:09 +0000
Message-Id: <E1a1XPp-0002Zs-RX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] elfnotes: intorduce a new PHYS_ENTRY
	elfnote
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============6951775731266653707=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6951775731266653707==
Content-Length: 3176
Content-Transfer-Encoding: quoted-printable

commit a1b2d39f071f1e85d0adb2e041f4a8a9aa9a88a8
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Thu Nov 12 16:58:07 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 16:58:07 2015 +0100

    elfnotes: intorduce a new PHYS_ENTRY elfnote
    
    This new elfnote contains the 32bit entry point into the kernel. Xen will
    use this entry point in order to launch the guest kernel in 32bit protected
    mode with paging disabled.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/xcutils/readnotes.c          |    3 +++
 xen/common/libelf/libelf-dominfo.c |    4 ++++
 xen/include/public/elfnote.h       |   12 +++++++++++-
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/tools/xcutils/readnotes.c b/tools/xcutils/readnotes.c
index 5fa445e..e682dd1 100644
--- a/tools/xcutils/readnotes.c
+++ b/tools/xcutils/readnotes.c
@@ -159,6 +159,9 @@ static unsigned print_notes(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) st
 		case XEN_ELFNOTE_L1_MFN_VALID:
 			print_l1_mfn_valid_note("L1_MFN_VALID", elf , note);
 			break;
+		case XEN_ELFNOTE_PHYS32_ENTRY:
+			print_numeric_note("PHYS32_ENTRY", elf , note);
+			break;
 		default:
 			printf("unknown note type %#x\n",
 			       (unsigned)elf_uval(elf, note, type));
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index 3de1c23..dacd4ba 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -119,6 +119,7 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
         [XEN_ELFNOTE_BSD_SYMTAB] =3D { "BSD_SYMTAB", 1},
         [XEN_ELFNOTE_SUSPEND_CANCEL] =3D { "SUSPEND_CANCEL", 0 },
         [XEN_ELFNOTE_MOD_START_PFN] =3D { "MOD_START_PFN", 0 },
+        [XEN_ELFNOTE_PHYS32_ENTRY] =3D { "PHYS32_ENTRY", 0 },
     };
 /* *INDENT-ON* */
 
@@ -212,6 +213,9 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
                 elf, note, sizeof(*parms->f_supported), i);
         break;
 
+    case XEN_ELFNOTE_PHYS32_ENTRY:
+        parms->phys_entry =3D val;
+        break;
     }
     return 0;
 }
diff --git a/xen/include/public/elfnote.h b/xen/include/public/elfnote.h
index 3824a94..353985f 100644
--- a/xen/include/public/elfnote.h
+++ b/xen/include/public/elfnote.h
@@ -200,9 +200,19 @@
 #define XEN_ELFNOTE_SUPPORTED_FEATURES 17
 
 /*
+ * Physical entry point into the kernel.
+ *
+ * 32bit entry point into the kernel. When requested to launch the
+ * guest kernel in a HVM container, Xen will use this entry point to
+ * launch the guest in 32bit protected mode with paging disabled.
+ * Ignored otherwise.
+ */
+#define XEN_ELFNOTE_PHYS32_ENTRY 18
+
+/*
  * The number of the highest elfnote defined.
  */
-#define XEN_ELFNOTE_MAX XEN_ELFNOTE_SUPPORTED_FEATURES
+#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY
 
 /*
  * System information exported through crash notes.
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:35:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35: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 1a1XQB-0004ct-M9; Wed, 25 Nov 2015 10:35: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 1a1XQA-0004ci-HE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:30 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	37/6D-31450-1FE85565; Wed, 25 Nov 2015 10:35:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1448447720!6335799!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3684 invoked from network); 25 Nov 2015 10:35:21 -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;
	25 Nov 2015 10:35:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQ0-0006W9-6W
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQ0-0002aT-51
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:20 +0000
Date: Wed, 25 Nov 2015 10:35:20 +0000
Message-Id: <E1a1XQ0-0002aT-51@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: don't inject #DB with error
	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 057e0e72d2a5d598087c5f167ec6a13203a3cf65
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 16:59:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 16:59:18 2015 +0100

    x86/HVM: don't inject #DB with error code
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@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 4490e9d..2074a41 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4132,7 +4132,7 @@ void hvm_task_switch(
         goto out;
 
     if ( (tss.trace & 1) && !exn_raised )
-        hvm_inject_hw_exception(TRAP_debug, tss_sel & 0xfff8);
+        hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
 
     tr.attr.fields.type = 0xb; /* busy 32-bit tss */
     hvm_set_segment_register(v, x86_seg_tr, &tr);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:35:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35: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 1a1XQB-0004ct-M9; Wed, 25 Nov 2015 10:35: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 1a1XQA-0004ci-HE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:30 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	37/6D-31450-1FE85565; Wed, 25 Nov 2015 10:35:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1448447720!6335799!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3684 invoked from network); 25 Nov 2015 10:35:21 -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;
	25 Nov 2015 10:35:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQ0-0006W9-6W
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQ0-0002aT-51
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:20 +0000
Date: Wed, 25 Nov 2015 10:35:20 +0000
Message-Id: <E1a1XQ0-0002aT-51@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: don't inject #DB with error
	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 057e0e72d2a5d598087c5f167ec6a13203a3cf65
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 16:59:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 16:59:18 2015 +0100

    x86/HVM: don't inject #DB with error code
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@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 4490e9d..2074a41 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4132,7 +4132,7 @@ void hvm_task_switch(
         goto out;
 
     if ( (tss.trace & 1) && !exn_raised )
-        hvm_inject_hw_exception(TRAP_debug, tss_sel & 0xfff8);
+        hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
 
     tr.attr.fields.type = 0xb; /* busy 32-bit tss */
     hvm_set_segment_register(v, x86_seg_tr, &tr);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:35:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35: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 1a1XQE-0004dm-Pz; Wed, 25 Nov 2015 10:35:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQD-0004dP-3z
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:33 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	94/F9-18107-4FE85565; Wed, 25 Nov 2015 10:35:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1448447730!6338174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10293 invoked from network); 25 Nov 2015 10:35:31 -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;
	25 Nov 2015 10:35:31 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQA-0006WD-IM
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQA-0002b5-Ep
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:30 +0000
Date: Wed, 25 Nov 2015 10:35:30 +0000
Message-Id: <E1a1XQA-0002b5-Ep@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: unify and fix #UD intercept
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4f7da683718768041b26f2b526879477cf7b5d76
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:00:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:00:31 2015 +0100

    x86/HVM: unify and fix #UD intercept
    
    The SVM and VMX versions really were identical, so instead of fixing
    the same issue in two places, fold them at once. The issue fixed is the
    missing seg:off -> linear translation of the current code address.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c            |   50 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/hvm/svm/svm.c        |   39 +----------------------------
 xen/arch/x86/hvm/vmx/vmx.c        |   39 +----------------------------
 xen/include/asm-x86/hvm/hvm.h     |    7 -----
 xen/include/asm-x86/hvm/support.h |    1 +
 5 files changed, 51 insertions(+), 85 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2074a41..2ded97d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -92,9 +92,12 @@ unsigned long __section(".bss.page_aligned")
 static bool_t __initdata opt_hap_enabled = 1;
 boolean_param("hap", opt_hap_enabled);
 
-#ifndef opt_hvm_fep
-bool_t opt_hvm_fep;
+#ifndef NDEBUG
+/* Permit use of the Forced Emulation Prefix in HVM guests */
+static bool_t opt_hvm_fep;
 boolean_param("hvm_fep", opt_hvm_fep);
+#else
+#define opt_hvm_fep 0
 #endif
 
 /* Xen command-line option to enable altp2m */
@@ -4930,6 +4933,49 @@ gp_fault:
     return X86EMUL_EXCEPTION;
 }
 
+void hvm_ud_intercept(struct cpu_user_regs *regs)
+{
+    struct hvm_emulate_ctxt ctxt;
+
+    if ( opt_hvm_fep )
+    {
+        struct vcpu *cur = current;
+        struct segment_register cs;
+        unsigned long addr;
+        char sig[5]; /* ud2; .ascii "xen" */
+
+        hvm_get_segment_register(cur, x86_seg_cs, &cs);
+        if ( hvm_virtual_to_linear_addr(x86_seg_cs, &cs, regs->eip,
+                                        sizeof(sig), hvm_access_insn_fetch,
+                                        (hvm_long_mode_enabled(cur) &&
+                                         cs.attr.fields.l) ? 64 :
+                                        cs.attr.fields.db ? 32 : 16, &addr) &&
+             (hvm_fetch_from_guest_virt_nofault(sig, addr, sizeof(sig),
+                                                0) == HVMCOPY_okay) &&
+             (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
+        {
+            regs->eip += sizeof(sig);
+            regs->eflags &= ~X86_EFLAGS_RF;
+        }
+    }
+
+    hvm_emulate_prepare(&ctxt, regs);
+
+    switch ( hvm_emulate_one(&ctxt) )
+    {
+    case X86EMUL_UNHANDLEABLE:
+        hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
+        break;
+    case X86EMUL_EXCEPTION:
+        if ( ctxt.exn_pending )
+            hvm_inject_trap(&ctxt.trap);
+        /* fall through */
+    default:
+        hvm_emulate_writeback(&ctxt);
+        break;
+    }
+}
+
 enum hvm_intblk hvm_interrupt_blocked(struct vcpu *v, struct hvm_intack intack)
 {
     unsigned long intr_shadow;
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 364185a..d9bd97e 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2123,43 +2123,6 @@ svm_vmexit_do_vmsave(struct vmcb_struct *vmcb,
     return;
 }
 
-static void svm_vmexit_ud_intercept(struct cpu_user_regs *regs)
-{
-    struct hvm_emulate_ctxt ctxt;
-    int rc;
-
-    if ( opt_hvm_fep )
-    {
-        char sig[5]; /* ud2; .ascii "xen" */
-
-        if ( (hvm_fetch_from_guest_virt_nofault(
-                  sig, regs->eip, sizeof(sig), 0) == HVMCOPY_okay) &&
-             (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
-        {
-            regs->eip += sizeof(sig);
-            regs->eflags &= ~X86_EFLAGS_RF;
-        }
-    }
-
-    hvm_emulate_prepare(&ctxt, regs);
-
-    rc = hvm_emulate_one(&ctxt);
-
-    switch ( rc )
-    {
-    case X86EMUL_UNHANDLEABLE:
-        hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
-        break;
-    case X86EMUL_EXCEPTION:
-        if ( ctxt.exn_pending )
-            hvm_inject_trap(&ctxt.trap);
-        /* fall through */
-    default:
-        hvm_emulate_writeback(&ctxt);
-        break;
-    }
-}
-
 static int svm_is_erratum_383(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
@@ -2491,7 +2454,7 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
         break;
 
     case VMEXIT_EXCEPTION_UD:
-        svm_vmexit_ud_intercept(regs);
+        hvm_ud_intercept(regs);
         break;
 
     /* Asynchronous event, handled when we STGI'd after the VMEXIT. */
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 1eb6aab..eb6248e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2749,43 +2749,6 @@ void vmx_enter_realmode(struct cpu_user_regs *regs)
     regs->eflags |= (X86_EFLAGS_VM | X86_EFLAGS_IOPL);
 }
 
-static void vmx_vmexit_ud_intercept(struct cpu_user_regs *regs)
-{
-    struct hvm_emulate_ctxt ctxt;
-    int rc;
-
-    if ( opt_hvm_fep )
-    {
-        char sig[5]; /* ud2; .ascii "xen" */
-
-        if ( (hvm_fetch_from_guest_virt_nofault(
-                  sig, regs->eip, sizeof(sig), 0) == HVMCOPY_okay) &&
-             (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
-        {
-            regs->eip += sizeof(sig);
-            regs->eflags &= ~X86_EFLAGS_RF;
-        }
-    }
-
-    hvm_emulate_prepare(&ctxt, regs);
-
-    rc = hvm_emulate_one(&ctxt);
-
-    switch ( rc )
-    {
-    case X86EMUL_UNHANDLEABLE:
-        hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
-        break;
-    case X86EMUL_EXCEPTION:
-        if ( ctxt.exn_pending )
-            hvm_inject_trap(&ctxt.trap);
-        /* fall through */
-    default:
-        hvm_emulate_writeback(&ctxt);
-        break;
-    }
-}
-
 static int vmx_handle_eoi_write(void)
 {
     unsigned long exit_qualification;
@@ -3140,7 +3103,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_invalid_op:
             HVMTRACE_1D(TRAP, vector);
-            vmx_vmexit_ud_intercept(regs);
+            hvm_ud_intercept(regs);
             break;
         default:
             HVMTRACE_1D(TRAP, vector);
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 60fe59e..da799a0 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -551,13 +551,6 @@ static inline bool_t hvm_altp2m_supported(void)
     return hvm_funcs.altp2m_supported;
 }
 
-#ifndef NDEBUG
-/* Permit use of the Forced Emulation Prefix in HVM guests */
-extern bool_t opt_hvm_fep;
-#else
-#define opt_hvm_fep 0
-#endif
-
 /* updates the current hardware p2m */
 void altp2m_vcpu_update_p2m(struct vcpu *v);
 
diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h
index 4a1f0ad..2d51186 100644
--- a/xen/include/asm-x86/hvm/support.h
+++ b/xen/include/asm-x86/hvm/support.h
@@ -131,6 +131,7 @@ int hvm_msr_write_intercept(
     unsigned int msr, uint64_t msr_content, bool_t may_defer);
 int hvm_mov_to_cr(unsigned int cr, unsigned int gpr);
 int hvm_mov_from_cr(unsigned int cr, unsigned int gpr);
+void hvm_ud_intercept(struct cpu_user_regs *);
 
 #endif /* __ASM_X86_HVM_SUPPORT_H__ */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:35:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35: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 1a1XQE-0004dm-Pz; Wed, 25 Nov 2015 10:35:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQD-0004dP-3z
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:33 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	94/F9-18107-4FE85565; Wed, 25 Nov 2015 10:35:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1448447730!6338174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10293 invoked from network); 25 Nov 2015 10:35:31 -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;
	25 Nov 2015 10:35:31 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQA-0006WD-IM
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQA-0002b5-Ep
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:30 +0000
Date: Wed, 25 Nov 2015 10:35:30 +0000
Message-Id: <E1a1XQA-0002b5-Ep@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: unify and fix #UD intercept
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4f7da683718768041b26f2b526879477cf7b5d76
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:00:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:00:31 2015 +0100

    x86/HVM: unify and fix #UD intercept
    
    The SVM and VMX versions really were identical, so instead of fixing
    the same issue in two places, fold them at once. The issue fixed is the
    missing seg:off -> linear translation of the current code address.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c            |   50 +++++++++++++++++++++++++++++++++++-
 xen/arch/x86/hvm/svm/svm.c        |   39 +----------------------------
 xen/arch/x86/hvm/vmx/vmx.c        |   39 +----------------------------
 xen/include/asm-x86/hvm/hvm.h     |    7 -----
 xen/include/asm-x86/hvm/support.h |    1 +
 5 files changed, 51 insertions(+), 85 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2074a41..2ded97d 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -92,9 +92,12 @@ unsigned long __section(".bss.page_aligned")
 static bool_t __initdata opt_hap_enabled = 1;
 boolean_param("hap", opt_hap_enabled);
 
-#ifndef opt_hvm_fep
-bool_t opt_hvm_fep;
+#ifndef NDEBUG
+/* Permit use of the Forced Emulation Prefix in HVM guests */
+static bool_t opt_hvm_fep;
 boolean_param("hvm_fep", opt_hvm_fep);
+#else
+#define opt_hvm_fep 0
 #endif
 
 /* Xen command-line option to enable altp2m */
@@ -4930,6 +4933,49 @@ gp_fault:
     return X86EMUL_EXCEPTION;
 }
 
+void hvm_ud_intercept(struct cpu_user_regs *regs)
+{
+    struct hvm_emulate_ctxt ctxt;
+
+    if ( opt_hvm_fep )
+    {
+        struct vcpu *cur = current;
+        struct segment_register cs;
+        unsigned long addr;
+        char sig[5]; /* ud2; .ascii "xen" */
+
+        hvm_get_segment_register(cur, x86_seg_cs, &cs);
+        if ( hvm_virtual_to_linear_addr(x86_seg_cs, &cs, regs->eip,
+                                        sizeof(sig), hvm_access_insn_fetch,
+                                        (hvm_long_mode_enabled(cur) &&
+                                         cs.attr.fields.l) ? 64 :
+                                        cs.attr.fields.db ? 32 : 16, &addr) &&
+             (hvm_fetch_from_guest_virt_nofault(sig, addr, sizeof(sig),
+                                                0) == HVMCOPY_okay) &&
+             (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
+        {
+            regs->eip += sizeof(sig);
+            regs->eflags &= ~X86_EFLAGS_RF;
+        }
+    }
+
+    hvm_emulate_prepare(&ctxt, regs);
+
+    switch ( hvm_emulate_one(&ctxt) )
+    {
+    case X86EMUL_UNHANDLEABLE:
+        hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
+        break;
+    case X86EMUL_EXCEPTION:
+        if ( ctxt.exn_pending )
+            hvm_inject_trap(&ctxt.trap);
+        /* fall through */
+    default:
+        hvm_emulate_writeback(&ctxt);
+        break;
+    }
+}
+
 enum hvm_intblk hvm_interrupt_blocked(struct vcpu *v, struct hvm_intack intack)
 {
     unsigned long intr_shadow;
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 364185a..d9bd97e 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2123,43 +2123,6 @@ svm_vmexit_do_vmsave(struct vmcb_struct *vmcb,
     return;
 }
 
-static void svm_vmexit_ud_intercept(struct cpu_user_regs *regs)
-{
-    struct hvm_emulate_ctxt ctxt;
-    int rc;
-
-    if ( opt_hvm_fep )
-    {
-        char sig[5]; /* ud2; .ascii "xen" */
-
-        if ( (hvm_fetch_from_guest_virt_nofault(
-                  sig, regs->eip, sizeof(sig), 0) == HVMCOPY_okay) &&
-             (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
-        {
-            regs->eip += sizeof(sig);
-            regs->eflags &= ~X86_EFLAGS_RF;
-        }
-    }
-
-    hvm_emulate_prepare(&ctxt, regs);
-
-    rc = hvm_emulate_one(&ctxt);
-
-    switch ( rc )
-    {
-    case X86EMUL_UNHANDLEABLE:
-        hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
-        break;
-    case X86EMUL_EXCEPTION:
-        if ( ctxt.exn_pending )
-            hvm_inject_trap(&ctxt.trap);
-        /* fall through */
-    default:
-        hvm_emulate_writeback(&ctxt);
-        break;
-    }
-}
-
 static int svm_is_erratum_383(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
@@ -2491,7 +2454,7 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
         break;
 
     case VMEXIT_EXCEPTION_UD:
-        svm_vmexit_ud_intercept(regs);
+        hvm_ud_intercept(regs);
         break;
 
     /* Asynchronous event, handled when we STGI'd after the VMEXIT. */
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 1eb6aab..eb6248e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2749,43 +2749,6 @@ void vmx_enter_realmode(struct cpu_user_regs *regs)
     regs->eflags |= (X86_EFLAGS_VM | X86_EFLAGS_IOPL);
 }
 
-static void vmx_vmexit_ud_intercept(struct cpu_user_regs *regs)
-{
-    struct hvm_emulate_ctxt ctxt;
-    int rc;
-
-    if ( opt_hvm_fep )
-    {
-        char sig[5]; /* ud2; .ascii "xen" */
-
-        if ( (hvm_fetch_from_guest_virt_nofault(
-                  sig, regs->eip, sizeof(sig), 0) == HVMCOPY_okay) &&
-             (memcmp(sig, "\xf\xbxen", sizeof(sig)) == 0) )
-        {
-            regs->eip += sizeof(sig);
-            regs->eflags &= ~X86_EFLAGS_RF;
-        }
-    }
-
-    hvm_emulate_prepare(&ctxt, regs);
-
-    rc = hvm_emulate_one(&ctxt);
-
-    switch ( rc )
-    {
-    case X86EMUL_UNHANDLEABLE:
-        hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE);
-        break;
-    case X86EMUL_EXCEPTION:
-        if ( ctxt.exn_pending )
-            hvm_inject_trap(&ctxt.trap);
-        /* fall through */
-    default:
-        hvm_emulate_writeback(&ctxt);
-        break;
-    }
-}
-
 static int vmx_handle_eoi_write(void)
 {
     unsigned long exit_qualification;
@@ -3140,7 +3103,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
             break;
         case TRAP_invalid_op:
             HVMTRACE_1D(TRAP, vector);
-            vmx_vmexit_ud_intercept(regs);
+            hvm_ud_intercept(regs);
             break;
         default:
             HVMTRACE_1D(TRAP, vector);
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 60fe59e..da799a0 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -551,13 +551,6 @@ static inline bool_t hvm_altp2m_supported(void)
     return hvm_funcs.altp2m_supported;
 }
 
-#ifndef NDEBUG
-/* Permit use of the Forced Emulation Prefix in HVM guests */
-extern bool_t opt_hvm_fep;
-#else
-#define opt_hvm_fep 0
-#endif
-
 /* updates the current hardware p2m */
 void altp2m_vcpu_update_p2m(struct vcpu *v);
 
diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h
index 4a1f0ad..2d51186 100644
--- a/xen/include/asm-x86/hvm/support.h
+++ b/xen/include/asm-x86/hvm/support.h
@@ -131,6 +131,7 @@ int hvm_msr_write_intercept(
     unsigned int msr, uint64_t msr_content, bool_t may_defer);
 int hvm_mov_to_cr(unsigned int cr, unsigned int gpr);
 int hvm_mov_from_cr(unsigned int cr, unsigned int gpr);
+void hvm_ud_intercept(struct cpu_user_regs *);
 
 #endif /* __ASM_X86_HVM_SUPPORT_H__ */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:35:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XQP-0004g8-VB; Wed, 25 Nov 2015 10:35:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQO-0004fp-Pv
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:45 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	D9/15-14900-00F85565; Wed, 25 Nov 2015 10:35:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1448447741!6403174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38689 invoked from network); 25 Nov 2015 10:35:43 -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;
	25 Nov 2015 10:35:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQK-0006WP-RT
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQK-0002bb-P0
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:40 +0000
Date: Wed, 25 Nov 2015 10:35:40 +0000
Message-Id: <E1a1XQK-0002bb-P0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/SVM: don't exceed segment limit
	when fetching instruction bytes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 723742d9c73d0ad21b01d66f07726ee7a4c3125b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:01:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:01:04 2015 +0100

    x86/SVM: don't exceed segment limit when fetching instruction bytes
    
    Also consistently use the vmcb local variable whenever possible.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/emulate.c     |   52 ++++++++++++++++++++----------------
 xen/include/asm-x86/hvm/svm/vmcb.h |    2 +-
 2 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/emulate.c b/xen/arch/x86/hvm/svm/emulate.c
index e3eb714..b0aaf1e 100644
--- a/xen/arch/x86/hvm/svm/emulate.c
+++ b/xen/arch/x86/hvm/svm/emulate.c
@@ -47,12 +47,17 @@ static unsigned int is_prefix(u8 opc)
     return 0;
 }
 
-static unsigned long svm_rip2pointer(struct vcpu *v)
+static unsigned long svm_rip2pointer(struct vcpu *v, unsigned long *limit)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
-    unsigned long p = vmcb->cs.base + guest_cpu_user_regs()->eip;
+    unsigned long p = vmcb->cs.base + vmcb->rip;
+
     if ( !(vmcb->cs.attr.fields.l && hvm_long_mode_enabled(v)) )
+    {
+        *limit = vmcb->cs.limit;
         return (u32)p; /* mask to 32 bits */
+    }
+    *limit = ~0UL;
     return p;
 }
 
@@ -125,11 +130,10 @@ static const u8 *const opc_bytes[INSTR_MAX_COUNT] =
     [INSTR_INVLPGA] = OPCODE_INVLPGA,
 };
 
-static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len)
+static bool_t fetch(const struct vmcb_struct *vmcb, u8 *buf,
+                    unsigned long addr, unsigned int len)
 {
-    uint32_t pfec;
-
-    pfec = (vmcb_get_cpl(v->arch.hvm_svm.vmcb) == 3) ? PFEC_user_mode : 0;
+    uint32_t pfec = (vmcb_get_cpl(vmcb) == 3) ? PFEC_user_mode : 0;
 
     switch ( hvm_fetch_from_guest_virt(buf, addr, len, pfec) )
     {
@@ -141,7 +145,7 @@ static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len)
     default:
         /* Not OK: fetches from non-RAM pages are not supportable. */
         gdprintk(XENLOG_WARNING, "Bad instruction fetch at %#lx (%#lx)\n",
-                 (unsigned long) guest_cpu_user_regs()->eip, addr);
+                 vmcb->rip, addr);
         hvm_inject_hw_exception(TRAP_gp_fault, 0);
         return 0;
     }
@@ -156,8 +160,8 @@ int __get_instruction_length_from_list(struct vcpu *v,
     enum instruction_index instr = 0;
     u8 buf[MAX_INST_LEN];
     const u8 *opcode = NULL;
-    unsigned long fetch_addr;
-    unsigned int fetch_len;
+    unsigned long fetch_addr, fetch_limit;
+    unsigned int fetch_len, max_len;
 
     if ( (inst_len = svm_nextrip_insn_length(v)) != 0 )
         return inst_len;
@@ -167,21 +171,24 @@ int __get_instruction_length_from_list(struct vcpu *v,
 
     /* Fetch up to the next page break; we'll fetch from the next page
      * later if we have to. */
-    fetch_addr = svm_rip2pointer(v);
-    fetch_len = min_t(unsigned int, MAX_INST_LEN,
+    fetch_addr = svm_rip2pointer(v, &fetch_limit);
+    if ( vmcb->rip > fetch_limit )
+        return 0;
+    max_len = min(fetch_limit - vmcb->rip + 1, MAX_INST_LEN + 0UL);
+    fetch_len = min_t(unsigned int, max_len,
                       PAGE_SIZE - (fetch_addr & ~PAGE_MASK));
-    if ( !fetch(v, buf, fetch_addr, fetch_len) )
+    if ( !fetch(vmcb, buf, fetch_addr, fetch_len) )
         return 0;
 
-    while ( (inst_len < MAX_INST_LEN) && is_prefix(buf[inst_len]) )
+    while ( (inst_len < max_len) && is_prefix(buf[inst_len]) )
     {
         inst_len++;
         if ( inst_len >= fetch_len )
         {
-            if ( !fetch(v, buf + fetch_len, fetch_addr + fetch_len,
-                        MAX_INST_LEN - fetch_len) )
+            if ( !fetch(vmcb, buf + fetch_len, fetch_addr + fetch_len,
+                        max_len - fetch_len) )
                 return 0;
-            fetch_len = MAX_INST_LEN;
+            fetch_len = max_len;
         }
     }
 
@@ -190,15 +197,14 @@ int __get_instruction_length_from_list(struct vcpu *v,
         instr = list[j];
         opcode = opc_bytes[instr];
 
-        for ( i = 0; (i < opcode[0]) && ((inst_len + i) < MAX_INST_LEN); i++ )
+        for ( i = 0; (i < opcode[0]) && ((inst_len + i) < max_len); i++ )
         {
             if ( (inst_len + i) >= fetch_len ) 
-            { 
-                if ( !fetch(v, buf + fetch_len, 
-                            fetch_addr + fetch_len, 
-                            MAX_INST_LEN - fetch_len) ) 
+            {
+                if ( !fetch(vmcb, buf + fetch_len, fetch_addr + fetch_len,
+                            max_len - fetch_len) )
                     return 0;
-                fetch_len = MAX_INST_LEN;
+                fetch_len = max_len;
             }
 
             if ( buf[inst_len+i] != opcode[i+1] )
@@ -216,7 +222,7 @@ int __get_instruction_length_from_list(struct vcpu *v,
 
  done:
     inst_len += opcode[0];
-    ASSERT(inst_len <= MAX_INST_LEN);
+    ASSERT(inst_len <= max_len);
     return inst_len;
 }
 
diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h b/xen/include/asm-x86/hvm/svm/vmcb.h
index ec47e2d..bad2382 100644
--- a/xen/include/asm-x86/hvm/svm/vmcb.h
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h
@@ -551,7 +551,7 @@ static inline void vmcb_set_##_name(struct vmcb_struct *vmcb, _type value)  \
     vmcb->_##_name = value;                                                 \
     vmcb->cleanbits.fields._cleanbit = 0;                                   \
 }                                                                           \
-static inline _type vmcb_get_##_name(struct vmcb_struct *vmcb)              \
+static inline _type vmcb_get_##_name(const struct vmcb_struct *vmcb)        \
 {                                                                           \
     return vmcb->_##_name;                                                  \
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:35:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XQP-0004g8-VB; Wed, 25 Nov 2015 10:35:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQO-0004fp-Pv
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:45 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	D9/15-14900-00F85565; Wed, 25 Nov 2015 10:35:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1448447741!6403174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38689 invoked from network); 25 Nov 2015 10:35:43 -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;
	25 Nov 2015 10:35:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQK-0006WP-RT
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQK-0002bb-P0
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:40 +0000
Date: Wed, 25 Nov 2015 10:35:40 +0000
Message-Id: <E1a1XQK-0002bb-P0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/SVM: don't exceed segment limit
	when fetching instruction bytes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 723742d9c73d0ad21b01d66f07726ee7a4c3125b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:01:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:01:04 2015 +0100

    x86/SVM: don't exceed segment limit when fetching instruction bytes
    
    Also consistently use the vmcb local variable whenever possible.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/emulate.c     |   52 ++++++++++++++++++++----------------
 xen/include/asm-x86/hvm/svm/vmcb.h |    2 +-
 2 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/emulate.c b/xen/arch/x86/hvm/svm/emulate.c
index e3eb714..b0aaf1e 100644
--- a/xen/arch/x86/hvm/svm/emulate.c
+++ b/xen/arch/x86/hvm/svm/emulate.c
@@ -47,12 +47,17 @@ static unsigned int is_prefix(u8 opc)
     return 0;
 }
 
-static unsigned long svm_rip2pointer(struct vcpu *v)
+static unsigned long svm_rip2pointer(struct vcpu *v, unsigned long *limit)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
-    unsigned long p = vmcb->cs.base + guest_cpu_user_regs()->eip;
+    unsigned long p = vmcb->cs.base + vmcb->rip;
+
     if ( !(vmcb->cs.attr.fields.l && hvm_long_mode_enabled(v)) )
+    {
+        *limit = vmcb->cs.limit;
         return (u32)p; /* mask to 32 bits */
+    }
+    *limit = ~0UL;
     return p;
 }
 
@@ -125,11 +130,10 @@ static const u8 *const opc_bytes[INSTR_MAX_COUNT] =
     [INSTR_INVLPGA] = OPCODE_INVLPGA,
 };
 
-static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len)
+static bool_t fetch(const struct vmcb_struct *vmcb, u8 *buf,
+                    unsigned long addr, unsigned int len)
 {
-    uint32_t pfec;
-
-    pfec = (vmcb_get_cpl(v->arch.hvm_svm.vmcb) == 3) ? PFEC_user_mode : 0;
+    uint32_t pfec = (vmcb_get_cpl(vmcb) == 3) ? PFEC_user_mode : 0;
 
     switch ( hvm_fetch_from_guest_virt(buf, addr, len, pfec) )
     {
@@ -141,7 +145,7 @@ static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len)
     default:
         /* Not OK: fetches from non-RAM pages are not supportable. */
         gdprintk(XENLOG_WARNING, "Bad instruction fetch at %#lx (%#lx)\n",
-                 (unsigned long) guest_cpu_user_regs()->eip, addr);
+                 vmcb->rip, addr);
         hvm_inject_hw_exception(TRAP_gp_fault, 0);
         return 0;
     }
@@ -156,8 +160,8 @@ int __get_instruction_length_from_list(struct vcpu *v,
     enum instruction_index instr = 0;
     u8 buf[MAX_INST_LEN];
     const u8 *opcode = NULL;
-    unsigned long fetch_addr;
-    unsigned int fetch_len;
+    unsigned long fetch_addr, fetch_limit;
+    unsigned int fetch_len, max_len;
 
     if ( (inst_len = svm_nextrip_insn_length(v)) != 0 )
         return inst_len;
@@ -167,21 +171,24 @@ int __get_instruction_length_from_list(struct vcpu *v,
 
     /* Fetch up to the next page break; we'll fetch from the next page
      * later if we have to. */
-    fetch_addr = svm_rip2pointer(v);
-    fetch_len = min_t(unsigned int, MAX_INST_LEN,
+    fetch_addr = svm_rip2pointer(v, &fetch_limit);
+    if ( vmcb->rip > fetch_limit )
+        return 0;
+    max_len = min(fetch_limit - vmcb->rip + 1, MAX_INST_LEN + 0UL);
+    fetch_len = min_t(unsigned int, max_len,
                       PAGE_SIZE - (fetch_addr & ~PAGE_MASK));
-    if ( !fetch(v, buf, fetch_addr, fetch_len) )
+    if ( !fetch(vmcb, buf, fetch_addr, fetch_len) )
         return 0;
 
-    while ( (inst_len < MAX_INST_LEN) && is_prefix(buf[inst_len]) )
+    while ( (inst_len < max_len) && is_prefix(buf[inst_len]) )
     {
         inst_len++;
         if ( inst_len >= fetch_len )
         {
-            if ( !fetch(v, buf + fetch_len, fetch_addr + fetch_len,
-                        MAX_INST_LEN - fetch_len) )
+            if ( !fetch(vmcb, buf + fetch_len, fetch_addr + fetch_len,
+                        max_len - fetch_len) )
                 return 0;
-            fetch_len = MAX_INST_LEN;
+            fetch_len = max_len;
         }
     }
 
@@ -190,15 +197,14 @@ int __get_instruction_length_from_list(struct vcpu *v,
         instr = list[j];
         opcode = opc_bytes[instr];
 
-        for ( i = 0; (i < opcode[0]) && ((inst_len + i) < MAX_INST_LEN); i++ )
+        for ( i = 0; (i < opcode[0]) && ((inst_len + i) < max_len); i++ )
         {
             if ( (inst_len + i) >= fetch_len ) 
-            { 
-                if ( !fetch(v, buf + fetch_len, 
-                            fetch_addr + fetch_len, 
-                            MAX_INST_LEN - fetch_len) ) 
+            {
+                if ( !fetch(vmcb, buf + fetch_len, fetch_addr + fetch_len,
+                            max_len - fetch_len) )
                     return 0;
-                fetch_len = MAX_INST_LEN;
+                fetch_len = max_len;
             }
 
             if ( buf[inst_len+i] != opcode[i+1] )
@@ -216,7 +222,7 @@ int __get_instruction_length_from_list(struct vcpu *v,
 
  done:
     inst_len += opcode[0];
-    ASSERT(inst_len <= MAX_INST_LEN);
+    ASSERT(inst_len <= max_len);
     return inst_len;
 }
 
diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h b/xen/include/asm-x86/hvm/svm/vmcb.h
index ec47e2d..bad2382 100644
--- a/xen/include/asm-x86/hvm/svm/vmcb.h
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h
@@ -551,7 +551,7 @@ static inline void vmcb_set_##_name(struct vmcb_struct *vmcb, _type value)  \
     vmcb->_##_name = value;                                                 \
     vmcb->cleanbits.fields._cleanbit = 0;                                   \
 }                                                                           \
-static inline _type vmcb_get_##_name(struct vmcb_struct *vmcb)              \
+static inline _type vmcb_get_##_name(const struct vmcb_struct *vmcb)        \
 {                                                                           \
     return vmcb->_##_name;                                                  \
 }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:35:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XQa-0004iF-2s; Wed, 25 Nov 2015 10:35:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQY-0004hr-2Z
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:54 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	C0/8D-13905-90F85565; Wed, 25 Nov 2015 10:35:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1448447751!6326080!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46576 invoked from network); 25 Nov 2015 10:35:52 -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;
	25 Nov 2015 10:35:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQV-0006WX-4u
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQV-0002cC-2o
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:51 +0000
Date: Wed, 25 Nov 2015 10:35:51 +0000
Message-Id: <E1a1XQV-0002cC-2o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: honor EXT bit in error codes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84064d11a40a6d6b55de8a97049042fc6d67dbb3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:01:53 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:01:53 2015 +0100

    x86/traps: honor EXT bit in error codes
    
    The specification does not explicitly limit the use of this bit to
    exceptions that can have selector style error codes, so to be on the
    safe side we should deal with it being set even on error codes formally
    documented to be always zero (if they're indeed always zero, the change
    is simply dead code in those cases).
    
    Introduce and use (where suitable) X86_XEC_* constants to make the code
    easier to read.
    
    To match the placement of the "hardware_trap" label, the "hardware_gp"
    one gets moved slightly too.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c            |   18 ++++++++++++------
 xen/arch/x86/x86_64/entry.S     |    2 +-
 xen/include/asm-x86/processor.h |    5 +++++
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index b32f696..e21fb78 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -615,6 +615,9 @@ static void do_trap(struct cpu_user_regs *regs, int use_error_code)
     unsigned int trapnr = regs->entry_vector;
     unsigned long fixup;
 
+    if ( regs->error_code & X86_XEC_EXT )
+        goto hardware_trap;
+
     DEBUGGER_trap_entry(trapnr, regs);
 
     if ( guest_mode(regs) )
@@ -641,6 +644,7 @@ static void do_trap(struct cpu_user_regs *regs, int use_error_code)
         return;
     }
 
+ hardware_trap:
     DEBUGGER_trap_fatal(trapnr, regs);
 
     show_execution_state(regs);
@@ -1262,13 +1266,14 @@ static int handle_gdt_ldt_mapping_fault(
             tb = propagate_page_fault(curr->arch.pv_vcpu.ldt_base + offset,
                                       regs->error_code);
             if ( tb )
-                tb->error_code = ((u16)offset & ~3) | 4;
+                tb->error_code = (offset & ~(X86_XEC_EXT | X86_XEC_IDT)) |
+                                 X86_XEC_TI;
         }
     }
     else
     {
         /* GDT fault: handle the fault as #GP(selector). */
-        regs->error_code = (u16)offset & ~7;
+        regs->error_code = offset & ~(X86_XEC_EXT | X86_XEC_IDT | X86_XEC_TI);
         (void)do_general_protection(regs);
     }
 
@@ -3221,7 +3226,7 @@ void do_general_protection(struct cpu_user_regs *regs)
 
     DEBUGGER_trap_entry(TRAP_gp_fault, regs);
 
-    if ( regs->error_code & 1 )
+    if ( regs->error_code & X86_XEC_EXT )
         goto hardware_gp;
 
     if ( !guest_mode(regs) )
@@ -3240,14 +3245,15 @@ void do_general_protection(struct cpu_user_regs *regs)
      * 
      * Instead, a GPF occurs with the faulting IDT vector in the error code.
      * Bit 1 is set to indicate that an IDT entry caused the fault. Bit 0 is 
-     * clear to indicate that it's a software fault, not hardware.
+     * clear (which got already checked above) to indicate that it's a software
+     * fault, not a hardware one.
      * 
      * NOTE: Vectors 3 and 4 are dealt with from their own handler. This is
      * okay because they can only be triggered by an explicit DPL-checked
      * instruction. The DPL specified by the guest OS for these vectors is NOT
      * CHECKED!!
      */
-    if ( (regs->error_code & 3) == 2 )
+    if ( regs->error_code & X86_XEC_IDT )
     {
         /* This fault must be due to <INT n> instruction. */
         const struct trap_info *ti;
@@ -3289,9 +3295,9 @@ void do_general_protection(struct cpu_user_regs *regs)
         return;
     }
 
+ hardware_gp:
     DEBUGGER_trap_fatal(TRAP_gp_fault, regs);
 
- hardware_gp:
     show_execution_state(regs);
     panic("GENERAL PROTECTION FAULT\n[error_code=%04x]", regs->error_code);
 }
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index d4dd8e8..94a54aa 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -338,7 +338,7 @@ int80_slow_path:
          * Setup entry vector and error code as if this was a GPF caused by an
          * IDT entry with DPL==0.
          */
-        movl  $((0x80 << 3) | 0x2),UREGS_error_code(%rsp)
+        movl  $((0x80 << 3) | X86_XEC_IDT),UREGS_error_code(%rsp)
         SAVE_PRESERVED
         movl  $TRAP_gp_fault,UREGS_entry_vector(%rsp)
         /* A GPF wouldn't have incremented the instruction pointer. */
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index fcfa7dd..a40c18e 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -143,6 +143,11 @@
 #define PFEC_page_paged     (1U<<5)
 #define PFEC_page_shared    (1U<<6)
 
+/* Other exception error code values. */
+#define X86_XEC_EXT         (_AC(1,U) << 0)
+#define X86_XEC_IDT         (_AC(1,U) << 1)
+#define X86_XEC_TI          (_AC(1,U) << 2)
+
 #define XEN_MINIMAL_CR4 (X86_CR4_PGE | X86_CR4_PAE)
 
 #define XEN_SYSCALL_MASK (X86_EFLAGS_AC|X86_EFLAGS_VM|X86_EFLAGS_RF|    \
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:35:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:35:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XQa-0004iF-2s; Wed, 25 Nov 2015 10:35:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQY-0004hr-2Z
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:54 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	C0/8D-13905-90F85565; Wed, 25 Nov 2015 10:35:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1448447751!6326080!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46576 invoked from network); 25 Nov 2015 10:35:52 -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;
	25 Nov 2015 10:35:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQV-0006WX-4u
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQV-0002cC-2o
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:35:51 +0000
Date: Wed, 25 Nov 2015 10:35:51 +0000
Message-Id: <E1a1XQV-0002cC-2o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: honor EXT bit in error codes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84064d11a40a6d6b55de8a97049042fc6d67dbb3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:01:53 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:01:53 2015 +0100

    x86/traps: honor EXT bit in error codes
    
    The specification does not explicitly limit the use of this bit to
    exceptions that can have selector style error codes, so to be on the
    safe side we should deal with it being set even on error codes formally
    documented to be always zero (if they're indeed always zero, the change
    is simply dead code in those cases).
    
    Introduce and use (where suitable) X86_XEC_* constants to make the code
    easier to read.
    
    To match the placement of the "hardware_trap" label, the "hardware_gp"
    one gets moved slightly too.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c            |   18 ++++++++++++------
 xen/arch/x86/x86_64/entry.S     |    2 +-
 xen/include/asm-x86/processor.h |    5 +++++
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index b32f696..e21fb78 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -615,6 +615,9 @@ static void do_trap(struct cpu_user_regs *regs, int use_error_code)
     unsigned int trapnr = regs->entry_vector;
     unsigned long fixup;
 
+    if ( regs->error_code & X86_XEC_EXT )
+        goto hardware_trap;
+
     DEBUGGER_trap_entry(trapnr, regs);
 
     if ( guest_mode(regs) )
@@ -641,6 +644,7 @@ static void do_trap(struct cpu_user_regs *regs, int use_error_code)
         return;
     }
 
+ hardware_trap:
     DEBUGGER_trap_fatal(trapnr, regs);
 
     show_execution_state(regs);
@@ -1262,13 +1266,14 @@ static int handle_gdt_ldt_mapping_fault(
             tb = propagate_page_fault(curr->arch.pv_vcpu.ldt_base + offset,
                                       regs->error_code);
             if ( tb )
-                tb->error_code = ((u16)offset & ~3) | 4;
+                tb->error_code = (offset & ~(X86_XEC_EXT | X86_XEC_IDT)) |
+                                 X86_XEC_TI;
         }
     }
     else
     {
         /* GDT fault: handle the fault as #GP(selector). */
-        regs->error_code = (u16)offset & ~7;
+        regs->error_code = offset & ~(X86_XEC_EXT | X86_XEC_IDT | X86_XEC_TI);
         (void)do_general_protection(regs);
     }
 
@@ -3221,7 +3226,7 @@ void do_general_protection(struct cpu_user_regs *regs)
 
     DEBUGGER_trap_entry(TRAP_gp_fault, regs);
 
-    if ( regs->error_code & 1 )
+    if ( regs->error_code & X86_XEC_EXT )
         goto hardware_gp;
 
     if ( !guest_mode(regs) )
@@ -3240,14 +3245,15 @@ void do_general_protection(struct cpu_user_regs *regs)
      * 
      * Instead, a GPF occurs with the faulting IDT vector in the error code.
      * Bit 1 is set to indicate that an IDT entry caused the fault. Bit 0 is 
-     * clear to indicate that it's a software fault, not hardware.
+     * clear (which got already checked above) to indicate that it's a software
+     * fault, not a hardware one.
      * 
      * NOTE: Vectors 3 and 4 are dealt with from their own handler. This is
      * okay because they can only be triggered by an explicit DPL-checked
      * instruction. The DPL specified by the guest OS for these vectors is NOT
      * CHECKED!!
      */
-    if ( (regs->error_code & 3) == 2 )
+    if ( regs->error_code & X86_XEC_IDT )
     {
         /* This fault must be due to <INT n> instruction. */
         const struct trap_info *ti;
@@ -3289,9 +3295,9 @@ void do_general_protection(struct cpu_user_regs *regs)
         return;
     }
 
+ hardware_gp:
     DEBUGGER_trap_fatal(TRAP_gp_fault, regs);
 
- hardware_gp:
     show_execution_state(regs);
     panic("GENERAL PROTECTION FAULT\n[error_code=%04x]", regs->error_code);
 }
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index d4dd8e8..94a54aa 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -338,7 +338,7 @@ int80_slow_path:
          * Setup entry vector and error code as if this was a GPF caused by an
          * IDT entry with DPL==0.
          */
-        movl  $((0x80 << 3) | 0x2),UREGS_error_code(%rsp)
+        movl  $((0x80 << 3) | X86_XEC_IDT),UREGS_error_code(%rsp)
         SAVE_PRESERVED
         movl  $TRAP_gp_fault,UREGS_entry_vector(%rsp)
         /* A GPF wouldn't have incremented the instruction pointer. */
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index fcfa7dd..a40c18e 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -143,6 +143,11 @@
 #define PFEC_page_paged     (1U<<5)
 #define PFEC_page_shared    (1U<<6)
 
+/* Other exception error code values. */
+#define X86_XEC_EXT         (_AC(1,U) << 0)
+#define X86_XEC_IDT         (_AC(1,U) << 1)
+#define X86_XEC_TI          (_AC(1,U) << 2)
+
 #define XEN_MINIMAL_CR4 (X86_CR4_PGE | X86_CR4_PAE)
 
 #define XEN_SYSCALL_MASK (X86_EFLAGS_AC|X86_EFLAGS_VM|X86_EFLAGS_RF|    \
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:36:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36: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 1a1XQj-0004k8-74; Wed, 25 Nov 2015 10:36:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQh-0004js-Vv
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:04 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	AD/B4-16870-31F85565; Wed, 25 Nov 2015 10:36:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1448447761!6346806!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38776 invoked from network); 25 Nov 2015 10:36:02 -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;
	25 Nov 2015 10:36:02 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQf-0006Wk-K0
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQf-0002da-Am
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:01 +0000
Date: Wed, 25 Nov 2015 10:36:01 +0000
Message-Id: <E1a1XQf-0002da-Am@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: #PF error code adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0b52ed063d6731b53eaf976cfa9c51906e50e370
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:02:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:02:35 2015 +0100

    x86: #PF error code adjustments
    
    Add a definition for the (for now unused) protection key related error
    code bit, moving our own custom ones out of the way. In the course of
    checking the uses of the latter I realized that while right now they
    can only get set on their own, callers would better not depend on that
    property and check just for the bit rather than matching the entire
    value.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/emulate.c      |    4 ++--
 xen/arch/x86/hvm/hvm.c          |   10 +++++-----
 xen/include/asm-x86/processor.h |    6 ++++--
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index eeb5963..e1017b5 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -447,7 +447,7 @@ static int hvmemul_linear_to_phys(
     }
     else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == INVALID_GFN )
     {
-        if ( pfec == PFEC_page_paged || pfec == PFEC_page_shared )
+        if ( pfec & (PFEC_page_paged | PFEC_page_shared) )
             return X86EMUL_RETRY;
         hvm_inject_page_fault(pfec, addr);
         return X86EMUL_EXCEPTION;
@@ -464,7 +464,7 @@ static int hvmemul_linear_to_phys(
         /* Is it contiguous with the preceding PFNs? If not then we're done. */
         if ( (npfn == INVALID_GFN) || (npfn != (pfn + (reverse ? -i : i))) )
         {
-            if ( pfec == PFEC_page_paged || pfec == PFEC_page_shared )
+            if ( pfec & (PFEC_page_paged | PFEC_page_shared) )
                 return X86EMUL_RETRY;
             done /= bytes_per_rep;
             if ( done == 0 )
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2ded97d..ea982e2 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3820,7 +3820,7 @@ static void *hvm_map_entry(unsigned long va, bool_t *writable)
      */
     pfec = PFEC_page_present;
     gfn = paging_gva_to_gfn(current, va, &pfec);
-    if ( (pfec == PFEC_page_paged) || (pfec == PFEC_page_shared) )
+    if ( pfec & (PFEC_page_paged | PFEC_page_shared) )
         goto fail;
 
     v = hvm_map_guest_frame_rw(gfn, 0, writable);
@@ -4211,9 +4211,9 @@ static enum hvm_copy_result __hvm_copy(
             gfn = paging_gva_to_gfn(curr, addr, &pfec);
             if ( gfn == INVALID_GFN )
             {
-                if ( pfec == PFEC_page_paged )
+                if ( pfec & PFEC_page_paged )
                     return HVMCOPY_gfn_paged_out;
-                if ( pfec == PFEC_page_shared )
+                if ( pfec & PFEC_page_shared )
                     return HVMCOPY_gfn_shared;
                 if ( flags & HVMCOPY_fault )
                     hvm_inject_page_fault(pfec, addr);
@@ -4326,9 +4326,9 @@ static enum hvm_copy_result __hvm_clear(paddr_t addr, int size)
         gfn = paging_gva_to_gfn(curr, addr, &pfec);
         if ( gfn == INVALID_GFN )
         {
-            if ( pfec == PFEC_page_paged )
+            if ( pfec & PFEC_page_paged )
                 return HVMCOPY_gfn_paged_out;
-            if ( pfec == PFEC_page_shared )
+            if ( pfec & PFEC_page_shared )
                 return HVMCOPY_gfn_shared;
             return HVMCOPY_bad_gva_to_gfn;
         }
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index a40c18e..3f8411f 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -140,8 +140,10 @@
 #define PFEC_user_mode      (1U<<2)
 #define PFEC_reserved_bit   (1U<<3)
 #define PFEC_insn_fetch     (1U<<4)
-#define PFEC_page_paged     (1U<<5)
-#define PFEC_page_shared    (1U<<6)
+#define PFEC_prot_key       (1U<<5)
+/* Internally used only flags. */
+#define PFEC_page_paged     (1U<<16)
+#define PFEC_page_shared    (1U<<17)
 
 /* Other exception error code values. */
 #define X86_XEC_EXT         (_AC(1,U) << 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 Nov 25 10:36:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36: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 1a1XQj-0004k8-74; Wed, 25 Nov 2015 10:36:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQh-0004js-Vv
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:04 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	AD/B4-16870-31F85565; Wed, 25 Nov 2015 10:36:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1448447761!6346806!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38776 invoked from network); 25 Nov 2015 10:36:02 -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;
	25 Nov 2015 10:36:02 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQf-0006Wk-K0
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQf-0002da-Am
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:01 +0000
Date: Wed, 25 Nov 2015 10:36:01 +0000
Message-Id: <E1a1XQf-0002da-Am@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: #PF error code adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0b52ed063d6731b53eaf976cfa9c51906e50e370
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:02:35 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:02:35 2015 +0100

    x86: #PF error code adjustments
    
    Add a definition for the (for now unused) protection key related error
    code bit, moving our own custom ones out of the way. In the course of
    checking the uses of the latter I realized that while right now they
    can only get set on their own, callers would better not depend on that
    property and check just for the bit rather than matching the entire
    value.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/emulate.c      |    4 ++--
 xen/arch/x86/hvm/hvm.c          |   10 +++++-----
 xen/include/asm-x86/processor.h |    6 ++++--
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index eeb5963..e1017b5 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -447,7 +447,7 @@ static int hvmemul_linear_to_phys(
     }
     else if ( (pfn = paging_gva_to_gfn(curr, addr, &pfec)) == INVALID_GFN )
     {
-        if ( pfec == PFEC_page_paged || pfec == PFEC_page_shared )
+        if ( pfec & (PFEC_page_paged | PFEC_page_shared) )
             return X86EMUL_RETRY;
         hvm_inject_page_fault(pfec, addr);
         return X86EMUL_EXCEPTION;
@@ -464,7 +464,7 @@ static int hvmemul_linear_to_phys(
         /* Is it contiguous with the preceding PFNs? If not then we're done. */
         if ( (npfn == INVALID_GFN) || (npfn != (pfn + (reverse ? -i : i))) )
         {
-            if ( pfec == PFEC_page_paged || pfec == PFEC_page_shared )
+            if ( pfec & (PFEC_page_paged | PFEC_page_shared) )
                 return X86EMUL_RETRY;
             done /= bytes_per_rep;
             if ( done == 0 )
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2ded97d..ea982e2 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3820,7 +3820,7 @@ static void *hvm_map_entry(unsigned long va, bool_t *writable)
      */
     pfec = PFEC_page_present;
     gfn = paging_gva_to_gfn(current, va, &pfec);
-    if ( (pfec == PFEC_page_paged) || (pfec == PFEC_page_shared) )
+    if ( pfec & (PFEC_page_paged | PFEC_page_shared) )
         goto fail;
 
     v = hvm_map_guest_frame_rw(gfn, 0, writable);
@@ -4211,9 +4211,9 @@ static enum hvm_copy_result __hvm_copy(
             gfn = paging_gva_to_gfn(curr, addr, &pfec);
             if ( gfn == INVALID_GFN )
             {
-                if ( pfec == PFEC_page_paged )
+                if ( pfec & PFEC_page_paged )
                     return HVMCOPY_gfn_paged_out;
-                if ( pfec == PFEC_page_shared )
+                if ( pfec & PFEC_page_shared )
                     return HVMCOPY_gfn_shared;
                 if ( flags & HVMCOPY_fault )
                     hvm_inject_page_fault(pfec, addr);
@@ -4326,9 +4326,9 @@ static enum hvm_copy_result __hvm_clear(paddr_t addr, int size)
         gfn = paging_gva_to_gfn(curr, addr, &pfec);
         if ( gfn == INVALID_GFN )
         {
-            if ( pfec == PFEC_page_paged )
+            if ( pfec & PFEC_page_paged )
                 return HVMCOPY_gfn_paged_out;
-            if ( pfec == PFEC_page_shared )
+            if ( pfec & PFEC_page_shared )
                 return HVMCOPY_gfn_shared;
             return HVMCOPY_bad_gva_to_gfn;
         }
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index a40c18e..3f8411f 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -140,8 +140,10 @@
 #define PFEC_user_mode      (1U<<2)
 #define PFEC_reserved_bit   (1U<<3)
 #define PFEC_insn_fetch     (1U<<4)
-#define PFEC_page_paged     (1U<<5)
-#define PFEC_page_shared    (1U<<6)
+#define PFEC_prot_key       (1U<<5)
+/* Internally used only flags. */
+#define PFEC_page_paged     (1U<<16)
+#define PFEC_page_shared    (1U<<17)
 
 /* Other exception error code values. */
 #define X86_XEC_EXT         (_AC(1,U) << 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 Nov 25 10:36:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36: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 1a1XQu-0004mM-Ev; Wed, 25 Nov 2015 10:36:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQs-0004m4-Ac
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:14 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	2C/6E-02940-D1F85565; Wed, 25 Nov 2015 10:36:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1448447772!5867385!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34410 invoked from network); 25 Nov 2015 10:36:12 -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;
	25 Nov 2015 10:36:12 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQp-0006XL-Sx
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQp-0002eL-R3
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:11 +0000
Date: Wed, 25 Nov 2015 10:36:11 +0000
Message-Id: <E1a1XQp-0002eL-R3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/event: correct debug event
	generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ab6654cf0f2a90b23d5ab714fa49ae038d21e17
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:03:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:03:20 2015 +0100

    x86/event: correct debug event generation
    
    RIP is not a linear address, and hence should not on its own be subject
    to GVA -> GFN translation. Once at it, move all of the (perhaps
    expensive) operations in the two functions into their main if()'s body,
    and improve the error code passed to the translation function.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/event.c        |   51 ++++++++++++++++++++++++++++----------
 xen/include/asm-x86/hvm/event.h |    4 +-
 2 files changed, 39 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/event.c b/xen/arch/x86/hvm/event.c
index 4097af0..73c8f14 100644
--- a/xen/arch/x86/hvm/event.c
+++ b/xen/arch/x86/hvm/event.c
@@ -144,36 +144,59 @@ void hvm_event_guest_request(void)
     }
 }
 
-int hvm_event_int3(unsigned long gla)
+int hvm_event_int3(unsigned long rip)
 {
     int rc = 0;
-    uint32_t pfec = PFEC_page_present;
     struct vcpu *curr = current;
-    vm_event_request_t req = {
-        .reason = VM_EVENT_REASON_SOFTWARE_BREAKPOINT,
-        .vcpu_id = curr->vcpu_id,
-        .u.software_breakpoint.gfn = paging_gva_to_gfn(curr, gla, &pfec)
-    };
 
     if ( curr->domain->arch.monitor.software_breakpoint_enabled )
+    {
+        struct segment_register sreg;
+        uint32_t pfec = PFEC_page_present | PFEC_insn_fetch;
+        vm_event_request_t req = {
+            .reason = VM_EVENT_REASON_SOFTWARE_BREAKPOINT,
+            .vcpu_id = curr->vcpu_id,
+        };
+
+        hvm_get_segment_register(curr, x86_seg_ss, &sreg);
+        if ( sreg.attr.fields.dpl == 3 )
+            pfec |= PFEC_user_mode;
+
+        hvm_get_segment_register(curr, x86_seg_cs, &sreg);
+        req.u.software_breakpoint.gfn = paging_gva_to_gfn(curr,
+                                                          sreg.base + rip,
+                                                          &pfec);
+
         rc = hvm_event_traps(1, &req);
+    }
 
     return rc;
 }
 
-int hvm_event_single_step(unsigned long gla)
+int hvm_event_single_step(unsigned long rip)
 {
     int rc = 0;
-    uint32_t pfec = PFEC_page_present;
     struct vcpu *curr = current;
-    vm_event_request_t req = {
-        .reason = VM_EVENT_REASON_SINGLESTEP,
-        .vcpu_id = curr->vcpu_id,
-        .u.singlestep.gfn = paging_gva_to_gfn(curr, gla, &pfec)
-    };
 
     if ( curr->domain->arch.monitor.singlestep_enabled )
+    {
+        struct segment_register sreg;
+        uint32_t pfec = PFEC_page_present | PFEC_insn_fetch;
+        vm_event_request_t req = {
+            .reason = VM_EVENT_REASON_SINGLESTEP,
+            .vcpu_id = curr->vcpu_id,
+        };
+
+        hvm_get_segment_register(curr, x86_seg_ss, &sreg);
+        if ( sreg.attr.fields.dpl == 3 )
+            pfec |= PFEC_user_mode;
+
+        hvm_get_segment_register(curr, x86_seg_cs, &sreg);
+        req.u.singlestep.gfn = paging_gva_to_gfn(curr, sreg.base + rip,
+                                                 &pfec);
+
         rc = hvm_event_traps(1, &req);
+    }
 
     return rc;
 }
diff --git a/xen/include/asm-x86/hvm/event.h b/xen/include/asm-x86/hvm/event.h
index e07f329..11eb1fe 100644
--- a/xen/include/asm-x86/hvm/event.h
+++ b/xen/include/asm-x86/hvm/event.h
@@ -28,8 +28,8 @@ bool_t hvm_event_cr(unsigned int index, unsigned long value,
     hvm_event_cr(VM_EVENT_X86_##what, new, old)
 void hvm_event_msr(unsigned int msr, uint64_t value);
 /* Called for current VCPU: returns -1 if no listener */
-int hvm_event_int3(unsigned long gla);
-int hvm_event_single_step(unsigned long gla);
+int hvm_event_int3(unsigned long rip);
+int hvm_event_single_step(unsigned long rip);
 void hvm_event_guest_request(void);
 
 #endif /* __ASM_X86_HVM_EVENT_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:36:16 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36: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 1a1XQu-0004mM-Ev; Wed, 25 Nov 2015 10:36:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQs-0004m4-Ac
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:14 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	2C/6E-02940-D1F85565; Wed, 25 Nov 2015 10:36:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1448447772!5867385!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34410 invoked from network); 25 Nov 2015 10:36:12 -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;
	25 Nov 2015 10:36:12 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQp-0006XL-Sx
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XQp-0002eL-R3
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:11 +0000
Date: Wed, 25 Nov 2015 10:36:11 +0000
Message-Id: <E1a1XQp-0002eL-R3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/event: correct debug event
	generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ab6654cf0f2a90b23d5ab714fa49ae038d21e17
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:03:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:03:20 2015 +0100

    x86/event: correct debug event generation
    
    RIP is not a linear address, and hence should not on its own be subject
    to GVA -> GFN translation. Once at it, move all of the (perhaps
    expensive) operations in the two functions into their main if()'s body,
    and improve the error code passed to the translation function.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/event.c        |   51 ++++++++++++++++++++++++++++----------
 xen/include/asm-x86/hvm/event.h |    4 +-
 2 files changed, 39 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/event.c b/xen/arch/x86/hvm/event.c
index 4097af0..73c8f14 100644
--- a/xen/arch/x86/hvm/event.c
+++ b/xen/arch/x86/hvm/event.c
@@ -144,36 +144,59 @@ void hvm_event_guest_request(void)
     }
 }
 
-int hvm_event_int3(unsigned long gla)
+int hvm_event_int3(unsigned long rip)
 {
     int rc = 0;
-    uint32_t pfec = PFEC_page_present;
     struct vcpu *curr = current;
-    vm_event_request_t req = {
-        .reason = VM_EVENT_REASON_SOFTWARE_BREAKPOINT,
-        .vcpu_id = curr->vcpu_id,
-        .u.software_breakpoint.gfn = paging_gva_to_gfn(curr, gla, &pfec)
-    };
 
     if ( curr->domain->arch.monitor.software_breakpoint_enabled )
+    {
+        struct segment_register sreg;
+        uint32_t pfec = PFEC_page_present | PFEC_insn_fetch;
+        vm_event_request_t req = {
+            .reason = VM_EVENT_REASON_SOFTWARE_BREAKPOINT,
+            .vcpu_id = curr->vcpu_id,
+        };
+
+        hvm_get_segment_register(curr, x86_seg_ss, &sreg);
+        if ( sreg.attr.fields.dpl == 3 )
+            pfec |= PFEC_user_mode;
+
+        hvm_get_segment_register(curr, x86_seg_cs, &sreg);
+        req.u.software_breakpoint.gfn = paging_gva_to_gfn(curr,
+                                                          sreg.base + rip,
+                                                          &pfec);
+
         rc = hvm_event_traps(1, &req);
+    }
 
     return rc;
 }
 
-int hvm_event_single_step(unsigned long gla)
+int hvm_event_single_step(unsigned long rip)
 {
     int rc = 0;
-    uint32_t pfec = PFEC_page_present;
     struct vcpu *curr = current;
-    vm_event_request_t req = {
-        .reason = VM_EVENT_REASON_SINGLESTEP,
-        .vcpu_id = curr->vcpu_id,
-        .u.singlestep.gfn = paging_gva_to_gfn(curr, gla, &pfec)
-    };
 
     if ( curr->domain->arch.monitor.singlestep_enabled )
+    {
+        struct segment_register sreg;
+        uint32_t pfec = PFEC_page_present | PFEC_insn_fetch;
+        vm_event_request_t req = {
+            .reason = VM_EVENT_REASON_SINGLESTEP,
+            .vcpu_id = curr->vcpu_id,
+        };
+
+        hvm_get_segment_register(curr, x86_seg_ss, &sreg);
+        if ( sreg.attr.fields.dpl == 3 )
+            pfec |= PFEC_user_mode;
+
+        hvm_get_segment_register(curr, x86_seg_cs, &sreg);
+        req.u.singlestep.gfn = paging_gva_to_gfn(curr, sreg.base + rip,
+                                                 &pfec);
+
         rc = hvm_event_traps(1, &req);
+    }
 
     return rc;
 }
diff --git a/xen/include/asm-x86/hvm/event.h b/xen/include/asm-x86/hvm/event.h
index e07f329..11eb1fe 100644
--- a/xen/include/asm-x86/hvm/event.h
+++ b/xen/include/asm-x86/hvm/event.h
@@ -28,8 +28,8 @@ bool_t hvm_event_cr(unsigned int index, unsigned long value,
     hvm_event_cr(VM_EVENT_X86_##what, new, old)
 void hvm_event_msr(unsigned int msr, uint64_t value);
 /* Called for current VCPU: returns -1 if no listener */
-int hvm_event_int3(unsigned long gla);
-int hvm_event_single_step(unsigned long gla);
+int hvm_event_int3(unsigned long rip);
+int hvm_event_single_step(unsigned long rip);
 void hvm_event_guest_request(void);
 
 #endif /* __ASM_X86_HVM_EVENT_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:36:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36: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 1a1XR5-0004oA-J8; Wed, 25 Nov 2015 10:36:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XR5-0004nz-3r
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:27 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	5C/1B-09834-A2F85565; Wed, 25 Nov 2015 10:36:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1448447782!6150378!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18306 invoked from network); 25 Nov 2015 10:36:25 -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;
	25 Nov 2015 10:36:25 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XR0-0006XT-5r
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XR0-0002eq-3V
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:22 +0000
Date: Wed, 25 Nov 2015 10:36:22 +0000
Message-Id: <E1a1XR0-0002eq-3V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: fix setup of Xen
	internally used 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 1126b40892ab56cb13c3cae5822bf3a18a689ffb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:04:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:04:10 2015 +0100

    x86/IO-APIC: fix setup of Xen internally used IRQs
    
    ..., i.e. namely that of a PCI serial card with an IRQ above the
    legacy range. This had got broken by the switch to cpumask_any() in
    cpu_mask_to_apicid_phys(). Fix this by allowing all CPUs for that IRQ
    (such that __setup_vector_irq() will properly update a booting CPU's
    vector_irq[], avoiding "No irq handler for vector" messages and the
    interrupt not working).
    
    While doing this I also noticed that io_apic_set_pci_routing() can't
    be quite right: It sets up the destination _before_ getting a vector
    allocated (which on other than systems using the flat APIC mode
    affects the possible destinations), and also didn't restrict affinity
    to ->arch.cpu_mask (as established by assign_irq_vector()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c |    7 +++++--
 xen/arch/x86/smpboot.c |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 1e710d6..f5b8d7d 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2201,6 +2201,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 {
     struct irq_desc *desc = irq_to_desc(irq);
     struct IO_APIC_route_entry entry;
+    cpumask_t mask;
     unsigned long flags;
     int vector;
 
@@ -2220,8 +2221,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 
     entry.delivery_mode = INT_DELIVERY_MODE;
     entry.dest_mode = INT_DEST_MODE;
-    SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
-        cpu_mask_to_apicid(TARGET_CPUS));
     entry.trigger = edge_level;
     entry.polarity = active_high_low;
     entry.mask  = 1;
@@ -2237,6 +2236,10 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
         return vector;
     entry.vector = vector;
 
+    cpumask_and(&mask, desc->arch.cpu_mask, TARGET_CPUS);
+    SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
+             cpu_mask_to_apicid(&mask));
+
     apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
 		"(%d-%d -> %#x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
 		mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index dabc929..1d884af 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1084,7 +1084,7 @@ void __init smp_intr_init(void)
         vector = alloc_hipriority_vector();
         per_cpu(vector_irq, cpu)[vector] = irq;
         irq_to_desc(irq)->arch.vector = vector;
-        cpumask_copy(irq_to_desc(irq)->arch.cpu_mask, &cpu_online_map);
+        cpumask_setall(irq_to_desc(irq)->arch.cpu_mask);
     }
 
     /* Direct IPI vectors. */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:36:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36: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 1a1XR5-0004oA-J8; Wed, 25 Nov 2015 10:36:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XR5-0004nz-3r
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:27 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	5C/1B-09834-A2F85565; Wed, 25 Nov 2015 10:36:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1448447782!6150378!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18306 invoked from network); 25 Nov 2015 10:36:25 -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;
	25 Nov 2015 10:36:25 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XR0-0006XT-5r
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XR0-0002eq-3V
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:22 +0000
Date: Wed, 25 Nov 2015 10:36:22 +0000
Message-Id: <E1a1XR0-0002eq-3V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: fix setup of Xen
	internally used 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 1126b40892ab56cb13c3cae5822bf3a18a689ffb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:04:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:04:10 2015 +0100

    x86/IO-APIC: fix setup of Xen internally used IRQs
    
    ..., i.e. namely that of a PCI serial card with an IRQ above the
    legacy range. This had got broken by the switch to cpumask_any() in
    cpu_mask_to_apicid_phys(). Fix this by allowing all CPUs for that IRQ
    (such that __setup_vector_irq() will properly update a booting CPU's
    vector_irq[], avoiding "No irq handler for vector" messages and the
    interrupt not working).
    
    While doing this I also noticed that io_apic_set_pci_routing() can't
    be quite right: It sets up the destination _before_ getting a vector
    allocated (which on other than systems using the flat APIC mode
    affects the possible destinations), and also didn't restrict affinity
    to ->arch.cpu_mask (as established by assign_irq_vector()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c |    7 +++++--
 xen/arch/x86/smpboot.c |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 1e710d6..f5b8d7d 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2201,6 +2201,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 {
     struct irq_desc *desc = irq_to_desc(irq);
     struct IO_APIC_route_entry entry;
+    cpumask_t mask;
     unsigned long flags;
     int vector;
 
@@ -2220,8 +2221,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 
     entry.delivery_mode = INT_DELIVERY_MODE;
     entry.dest_mode = INT_DEST_MODE;
-    SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
-        cpu_mask_to_apicid(TARGET_CPUS));
     entry.trigger = edge_level;
     entry.polarity = active_high_low;
     entry.mask  = 1;
@@ -2237,6 +2236,10 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
         return vector;
     entry.vector = vector;
 
+    cpumask_and(&mask, desc->arch.cpu_mask, TARGET_CPUS);
+    SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
+             cpu_mask_to_apicid(&mask));
+
     apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
 		"(%d-%d -> %#x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
 		mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index dabc929..1d884af 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1084,7 +1084,7 @@ void __init smp_intr_init(void)
         vector = alloc_hipriority_vector();
         per_cpu(vector_irq, cpu)[vector] = irq;
         irq_to_desc(irq)->arch.vector = vector;
-        cpumask_copy(irq_to_desc(irq)->arch.cpu_mask, &cpu_online_map);
+        cpumask_setall(irq_to_desc(irq)->arch.cpu_mask);
     }
 
     /* Direct IPI vectors. */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:36:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36: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 1a1XRF-0004qB-NI; Wed, 25 Nov 2015 10:36:37 +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 1a1XRE-0004pz-NN
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:36 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	D4/BB-12371-33F85565; Wed, 25 Nov 2015 10:36:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1448447792!6147249!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28643 invoked from network); 25 Nov 2015 10:36:34 -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;
	25 Nov 2015 10:36:34 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRA-0006Xb-Dr
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRA-0002fW-CQ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:32 +0000
Date: Wed, 25 Nov 2015 10:36:32 +0000
Message-Id: <E1a1XRA-0002fW-CQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: make SET_DEST() easier to
	use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b7e7ad8795ab6d8a37e89d7188dcf14052dbdc20
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:04:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:04:31 2015 +0100

    x86/IO-APIC: make SET_DEST() easier to use
    
    There has been quite a bit of redundancy between the various use sites.
    Eliminate that. No change of generated code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index f5b8d7d..464647f 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -958,8 +958,12 @@ static hw_irq_controller ioapic_edge_type;
 #define IOAPIC_EDGE	0
 #define IOAPIC_LEVEL	1
 
-#define SET_DEST(x, y, value) \
-    do { if ( x2apic_enabled ) x = value; else y = value; } while(0)
+#define SET_DEST(ent, mode, val) do { \
+    if (x2apic_enabled) \
+        (ent).dest.dest32 = (val); \
+    else \
+        (ent).dest.mode.mode##_dest = (val); \
+} while (0)
 
 static inline void ioapic_register_intr(int irq, unsigned long trigger)
 {
@@ -1035,8 +1039,7 @@ static void __init setup_IO_APIC_irqs(void)
                 disable_8259A_irq(irq_to_desc(irq));
 
             desc = irq_to_desc(irq);
-            SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
-                     cpu_mask_to_apicid(desc->arch.cpu_mask));
+            SET_DEST(entry, logical, cpu_mask_to_apicid(desc->arch.cpu_mask));
             spin_lock_irqsave(&ioapic_lock, flags);
             __ioapic_write_entry(apic, pin, 0, entry);
             set_native_irq_info(irq, TARGET_CPUS);
@@ -1068,8 +1071,7 @@ static void __init setup_ExtINT_IRQ0_pin(unsigned int apic, unsigned int pin, in
      */
     entry.dest_mode = INT_DEST_MODE;
     entry.mask = 0;					/* unmask IRQ now */
-    SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
-        cpu_mask_to_apicid(TARGET_CPUS));
+    SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
     entry.delivery_mode = INT_DELIVERY_MODE;
     entry.polarity = 0;
     entry.trigger = 0;
@@ -1349,8 +1351,7 @@ void disable_IO_APIC(void)
         entry.dest_mode       = 0; /* Physical */
         entry.delivery_mode   = dest_ExtINT; /* ExtInt */
         entry.vector          = 0;
-        SET_DEST(entry.dest.dest32, entry.dest.physical.physical_dest,
-            get_apic_id());
+        SET_DEST(entry, physical, get_apic_id());
 
         /*
          * Add it to the IO-APIC irq-routing table:
@@ -1842,8 +1843,7 @@ static void __init unlock_ExtINT_logic(void)
 
     entry1.dest_mode = 0;			/* physical delivery */
     entry1.mask = 0;			/* unmask IRQ now */
-    SET_DEST(entry1.dest.dest32, entry1.dest.physical.physical_dest,
-        hard_smp_processor_id());
+    SET_DEST(entry1, physical, hard_smp_processor_id());
     entry1.delivery_mode = dest_ExtINT;
     entry1.polarity = entry0.polarity;
     entry1.trigger = 0;
@@ -2237,8 +2237,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
     entry.vector = vector;
 
     cpumask_and(&mask, desc->arch.cpu_mask, TARGET_CPUS);
-    SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
-             cpu_mask_to_apicid(&mask));
+    SET_DEST(entry, logical, cpu_mask_to_apicid(&mask));
 
     apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
 		"(%d-%d -> %#x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
@@ -2431,8 +2430,7 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
     /* Set the vector field to the real vector! */
     rte.vector = desc->arch.vector;
 
-    SET_DEST(rte.dest.dest32, rte.dest.logical.logical_dest,
-             cpu_mask_to_apicid(desc->arch.cpu_mask));
+    SET_DEST(rte, logical, cpu_mask_to_apicid(desc->arch.cpu_mask));
 
     __ioapic_write_entry(apic, pin, 0, rte);
     
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:36:37 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36: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 1a1XRF-0004qB-NI; Wed, 25 Nov 2015 10:36:37 +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 1a1XRE-0004pz-NN
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:36 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	D4/BB-12371-33F85565; Wed, 25 Nov 2015 10:36:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1448447792!6147249!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28643 invoked from network); 25 Nov 2015 10:36:34 -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;
	25 Nov 2015 10:36:34 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRA-0006Xb-Dr
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRA-0002fW-CQ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:32 +0000
Date: Wed, 25 Nov 2015 10:36:32 +0000
Message-Id: <E1a1XRA-0002fW-CQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: make SET_DEST() easier to
	use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b7e7ad8795ab6d8a37e89d7188dcf14052dbdc20
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 12 17:04:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 12 17:04:31 2015 +0100

    x86/IO-APIC: make SET_DEST() easier to use
    
    There has been quite a bit of redundancy between the various use sites.
    Eliminate that. No change of generated code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index f5b8d7d..464647f 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -958,8 +958,12 @@ static hw_irq_controller ioapic_edge_type;
 #define IOAPIC_EDGE	0
 #define IOAPIC_LEVEL	1
 
-#define SET_DEST(x, y, value) \
-    do { if ( x2apic_enabled ) x = value; else y = value; } while(0)
+#define SET_DEST(ent, mode, val) do { \
+    if (x2apic_enabled) \
+        (ent).dest.dest32 = (val); \
+    else \
+        (ent).dest.mode.mode##_dest = (val); \
+} while (0)
 
 static inline void ioapic_register_intr(int irq, unsigned long trigger)
 {
@@ -1035,8 +1039,7 @@ static void __init setup_IO_APIC_irqs(void)
                 disable_8259A_irq(irq_to_desc(irq));
 
             desc = irq_to_desc(irq);
-            SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
-                     cpu_mask_to_apicid(desc->arch.cpu_mask));
+            SET_DEST(entry, logical, cpu_mask_to_apicid(desc->arch.cpu_mask));
             spin_lock_irqsave(&ioapic_lock, flags);
             __ioapic_write_entry(apic, pin, 0, entry);
             set_native_irq_info(irq, TARGET_CPUS);
@@ -1068,8 +1071,7 @@ static void __init setup_ExtINT_IRQ0_pin(unsigned int apic, unsigned int pin, in
      */
     entry.dest_mode = INT_DEST_MODE;
     entry.mask = 0;					/* unmask IRQ now */
-    SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
-        cpu_mask_to_apicid(TARGET_CPUS));
+    SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
     entry.delivery_mode = INT_DELIVERY_MODE;
     entry.polarity = 0;
     entry.trigger = 0;
@@ -1349,8 +1351,7 @@ void disable_IO_APIC(void)
         entry.dest_mode       = 0; /* Physical */
         entry.delivery_mode   = dest_ExtINT; /* ExtInt */
         entry.vector          = 0;
-        SET_DEST(entry.dest.dest32, entry.dest.physical.physical_dest,
-            get_apic_id());
+        SET_DEST(entry, physical, get_apic_id());
 
         /*
          * Add it to the IO-APIC irq-routing table:
@@ -1842,8 +1843,7 @@ static void __init unlock_ExtINT_logic(void)
 
     entry1.dest_mode = 0;			/* physical delivery */
     entry1.mask = 0;			/* unmask IRQ now */
-    SET_DEST(entry1.dest.dest32, entry1.dest.physical.physical_dest,
-        hard_smp_processor_id());
+    SET_DEST(entry1, physical, hard_smp_processor_id());
     entry1.delivery_mode = dest_ExtINT;
     entry1.polarity = entry0.polarity;
     entry1.trigger = 0;
@@ -2237,8 +2237,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
     entry.vector = vector;
 
     cpumask_and(&mask, desc->arch.cpu_mask, TARGET_CPUS);
-    SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
-             cpu_mask_to_apicid(&mask));
+    SET_DEST(entry, logical, cpu_mask_to_apicid(&mask));
 
     apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
 		"(%d-%d -> %#x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
@@ -2431,8 +2430,7 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
     /* Set the vector field to the real vector! */
     rte.vector = desc->arch.vector;
 
-    SET_DEST(rte.dest.dest32, rte.dest.logical.logical_dest,
-             cpu_mask_to_apicid(desc->arch.cpu_mask));
+    SET_DEST(rte, logical, cpu_mask_to_apicid(desc->arch.cpu_mask));
 
     __ioapic_write_entry(apic, pin, 0, rte);
     
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:36:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36: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 1a1XRQ-0004ri-Rd; Wed, 25 Nov 2015 10:36:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRQ-0004rX-86
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:48 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	B8/27-13487-F3F85565; Wed, 25 Nov 2015 10:36:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1448447802!6343525!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45583 invoked from network); 25 Nov 2015 10:36:43 -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;
	25 Nov 2015 10:36:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRK-0006Xg-P2
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRK-0002g4-LT
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:42 +0000
Date: Wed, 25 Nov 2015 10:36:42 +0000
Message-Id: <E1a1XRK-0002g4-LT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "x86/IO-APIC: fix setup of Xen
	internally used 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 5ea01bf96e5072ac88e23f35cd087a2fdb9eb856
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 13 15:39:57 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 13 15:39:57 2015 +0100

    Revert "x86/IO-APIC: fix setup of Xen internally used IRQs"
    
    This reverts commit 1126b40892ab56cb13c3cae5822bf3a18a689ffb,
    as it breaks (at least) x2apic systems.
---
 xen/arch/x86/io_apic.c |    5 +----
 xen/arch/x86/smpboot.c |    2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 464647f..f8c8e55 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2201,7 +2201,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 {
     struct irq_desc *desc = irq_to_desc(irq);
     struct IO_APIC_route_entry entry;
-    cpumask_t mask;
     unsigned long flags;
     int vector;
 
@@ -2221,6 +2220,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 
     entry.delivery_mode = INT_DELIVERY_MODE;
     entry.dest_mode = INT_DEST_MODE;
+    SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
     entry.trigger = edge_level;
     entry.polarity = active_high_low;
     entry.mask  = 1;
@@ -2236,9 +2236,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
         return vector;
     entry.vector = vector;
 
-    cpumask_and(&mask, desc->arch.cpu_mask, TARGET_CPUS);
-    SET_DEST(entry, logical, cpu_mask_to_apicid(&mask));
-
     apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
 		"(%d-%d -> %#x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
 		mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 1d884af..dabc929 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1084,7 +1084,7 @@ void __init smp_intr_init(void)
         vector = alloc_hipriority_vector();
         per_cpu(vector_irq, cpu)[vector] = irq;
         irq_to_desc(irq)->arch.vector = vector;
-        cpumask_setall(irq_to_desc(irq)->arch.cpu_mask);
+        cpumask_copy(irq_to_desc(irq)->arch.cpu_mask, &cpu_online_map);
     }
 
     /* Direct IPI vectors. */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:36:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36: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 1a1XRQ-0004ri-Rd; Wed, 25 Nov 2015 10:36:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRQ-0004rX-86
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:48 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	B8/27-13487-F3F85565; Wed, 25 Nov 2015 10:36:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1448447802!6343525!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45583 invoked from network); 25 Nov 2015 10:36:43 -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;
	25 Nov 2015 10:36:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRK-0006Xg-P2
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRK-0002g4-LT
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:42 +0000
Date: Wed, 25 Nov 2015 10:36:42 +0000
Message-Id: <E1a1XRK-0002g4-LT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "x86/IO-APIC: fix setup of Xen
	internally used 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 5ea01bf96e5072ac88e23f35cd087a2fdb9eb856
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 13 15:39:57 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 13 15:39:57 2015 +0100

    Revert "x86/IO-APIC: fix setup of Xen internally used IRQs"
    
    This reverts commit 1126b40892ab56cb13c3cae5822bf3a18a689ffb,
    as it breaks (at least) x2apic systems.
---
 xen/arch/x86/io_apic.c |    5 +----
 xen/arch/x86/smpboot.c |    2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 464647f..f8c8e55 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2201,7 +2201,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 {
     struct irq_desc *desc = irq_to_desc(irq);
     struct IO_APIC_route_entry entry;
-    cpumask_t mask;
     unsigned long flags;
     int vector;
 
@@ -2221,6 +2220,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 
     entry.delivery_mode = INT_DELIVERY_MODE;
     entry.dest_mode = INT_DEST_MODE;
+    SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
     entry.trigger = edge_level;
     entry.polarity = active_high_low;
     entry.mask  = 1;
@@ -2236,9 +2236,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
         return vector;
     entry.vector = vector;
 
-    cpumask_and(&mask, desc->arch.cpu_mask, TARGET_CPUS);
-    SET_DEST(entry, logical, cpu_mask_to_apicid(&mask));
-
     apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
 		"(%d-%d -> %#x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
 		mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 1d884af..dabc929 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1084,7 +1084,7 @@ void __init smp_intr_init(void)
         vector = alloc_hipriority_vector();
         per_cpu(vector_irq, cpu)[vector] = irq;
         irq_to_desc(irq)->arch.vector = vector;
-        cpumask_setall(irq_to_desc(irq)->arch.cpu_mask);
+        cpumask_copy(irq_to_desc(irq)->arch.cpu_mask, &cpu_online_map);
     }
 
     /* Direct IPI vectors. */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:36:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XRY-0004tB-Va; Wed, 25 Nov 2015 10:36:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRX-0004su-RL
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:56 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	CD/58-12831-74F85565; Wed, 25 Nov 2015 10:36:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1448447813!6309201!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1682 invoked from network); 25 Nov 2015 10:36:54 -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;
	25 Nov 2015 10:36:54 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRV-0006Xo-2B
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRU-0002gi-WF
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:53 +0000
Date: Wed, 25 Nov 2015 10:36:52 +0000
Message-Id: <E1a1XRU-0002gi-WF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ns16550: misc minor adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cc967461e7f3b392990ca8c5ca02a435960ab0c7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 13 15:41:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 13 15:41:47 2015 +0100

    ns16550: misc minor adjustments
    
    First and foremost: fix documentation: The use of "clock_hz", when
    "base_baud" was meant, has taken me several hours (suspecting a more
    complicated problem with the PCIe card I've been trying to get
    working). At once correct the "gdb" option, which is more like
    "console", not like "com<N>".
    
    Next, fix the types of ns_{read,write}_reg(): Especially the former
    having had a signed return type so far caused quite interesting effects
    when determining to baud rate if "auto" was specified. In that same
    code, also avoid dividing by zero when in fact the baud rate was not
    previously set up.
    
    Further, accept I/O port based serial PCI cards with a port range wider
    than 8 bytes.
    
    Finally, slightly rearrange struct ns16550 to reduce holes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/xen-command-line.markdown |   11 +++++++----
 xen/drivers/char/ns16550.c          |   26 ++++++++++++++++----------
 2 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 70daa84..afb9548 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -277,13 +277,14 @@ Flag to indicate whether to probe for a CMOS Real Time Clock irrespective of
 ACPI indicating none to be there.
 
 ### com1,com2
-> `= <baud>[/<clock_hz>][,[DPS][,[<io-base>|pci|amt][,[<irq>][,[<port-bdf>][,[<bridge-bdf>]]]]]]`
+> `= <baud>[/<base-baud>][,[DPS][,[<io-base>|pci|amt][,[<irq>][,[<port-bdf>][,[<bridge-bdf>]]]]]]`
 
 Both option `com1` and `com2` follow the same format.
 
 * `<baud>` may be either an integer baud rate, or the string `auto` if
   the bootloader or other earlier firmware has already set it up.
-* Optionally, a clock speed measured in hz can be specified.
+* Optionally, the base baud rate (usually the highest baud rate the
+  device can communicate at) can be specified.
 * `DPS` represents the number of data bits, the parity, and the number
   of stop bits.
   * `D` is an integer between 5 and 8 for the number of data bits.
@@ -730,9 +731,11 @@ Controls EPT related features.
 >> Have hardware keep accessed/dirty (A/D) bits updated.
 
 ### gdb
-> `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
+> `= com1[H,L] | com2[H,L] | dbgp`
 
-Specify the serial parameters for the GDB stub.
+> Default: ``
+
+Specify which console gdbstub should use. See **console**.
 
 ### gnttab\_max\_frames
 > `= <integer>`
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index d443880..34f66f7 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -33,7 +33,7 @@
 
 /*
  * Configure serial port with a string:
- *   <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]]].
+ *   <baud>[/<base_baud>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]]].
  * The tail of the string can be omitted if platform defaults are sufficient.
  * If the baud rate is pre-configured, perhaps by a bootloader, then 'auto'
  * can be specified in place of a numeric baud rate. Polled mode is specified
@@ -66,10 +66,10 @@ static struct ns16550 {
     bool_t dw_usr_bsy;
 #ifdef HAS_PCI
     /* PCI card parameters. */
-    unsigned int pb_bdf[3]; /* pci bridge BDF */
-    unsigned int ps_bdf[3]; /* pci serial port BDF */
     bool_t pb_bdf_enable;   /* if =1, pb-bdf effective, port behind bridge */
     bool_t ps_bdf_enable;   /* if =1, ps_bdf effective, port on pci card */
+    unsigned int pb_bdf[3]; /* pci bridge BDF */
+    unsigned int ps_bdf[3]; /* pci serial port BDF */
     u32 bar;
     u32 bar64;
     u16 cr;
@@ -345,7 +345,7 @@ static const struct ns16550_config_mmio __initconst uart_config[] =
 
 static void ns16550_delayed_resume(void *data);
 
-static char ns_read_reg(struct ns16550 *uart, int reg)
+static u8 ns_read_reg(struct ns16550 *uart, unsigned int reg)
 {
     void __iomem *addr = uart->remapped_io_base + (reg << uart->reg_shift);
 #ifdef HAS_IOPORTS
@@ -363,7 +363,7 @@ static char ns_read_reg(struct ns16550 *uart, int reg)
     }
 }
 
-static void ns_write_reg(struct ns16550 *uart, int reg, char c)
+static void ns_write_reg(struct ns16550 *uart, unsigned int reg, u8 c)
 {
     void __iomem *addr = uart->remapped_io_base + (reg << uart->reg_shift);
 #ifdef HAS_IOPORTS
@@ -386,7 +386,7 @@ static void ns_write_reg(struct ns16550 *uart, int reg, char c)
 
 static int ns16550_ioport_invalid(struct ns16550 *uart)
 {
-    return (unsigned char)ns_read_reg(uart, UART_IER) == 0xff;
+    return ns_read_reg(uart, UART_IER) == 0xff;
 }
 
 static void ns16550_interrupt(
@@ -399,7 +399,8 @@ static void ns16550_interrupt(
 
     while ( !(ns_read_reg(uart, UART_IIR) & UART_IIR_NOINT) )
     {
-        char lsr = ns_read_reg(uart, UART_LSR);
+        u8 lsr = ns_read_reg(uart, UART_LSR);
+
         if ( (lsr & uart->lsr_mask) == uart->lsr_mask )
             serial_tx_interrupt(port, regs);
         if ( lsr & UART_LSR_DR )
@@ -530,7 +531,12 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
         /* Baud rate already set: read it out from the divisor latch. */
         divisor  = ns_read_reg(uart, UART_DLL);
         divisor |= ns_read_reg(uart, UART_DLM) << 8;
-        uart->baud = uart->clock_hz / (divisor << 4);
+        if ( divisor )
+            uart->baud = uart->clock_hz / (divisor << 4);
+        else
+            printk(XENLOG_ERR
+                   "Automatic baud rate determination was requested,"
+                   " but a baud rate was not set up\n");
     }
     ns_write_reg(uart, UART_LCR, lcr);
 
@@ -945,8 +951,8 @@ pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
                     size = len & PCI_BASE_ADDRESS_IO_MASK;
                     size &= -size;
 
-                    /* Not 8 bytes */
-                    if ( size != 0x8 )
+                    /* Not at least 8 bytes */
+                    if ( size < 8 )
                         continue;
 
                     uart->io_base = bar & ~PCI_BASE_ADDRESS_SPACE_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 Wed Nov 25 10:36:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:36:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XRY-0004tB-Va; Wed, 25 Nov 2015 10:36:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRX-0004su-RL
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:56 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	CD/58-12831-74F85565; Wed, 25 Nov 2015 10:36:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1448447813!6309201!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1682 invoked from network); 25 Nov 2015 10:36:54 -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;
	25 Nov 2015 10:36:54 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRV-0006Xo-2B
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRU-0002gi-WF
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:36:53 +0000
Date: Wed, 25 Nov 2015 10:36:52 +0000
Message-Id: <E1a1XRU-0002gi-WF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ns16550: misc minor adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cc967461e7f3b392990ca8c5ca02a435960ab0c7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 13 15:41:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 13 15:41:47 2015 +0100

    ns16550: misc minor adjustments
    
    First and foremost: fix documentation: The use of "clock_hz", when
    "base_baud" was meant, has taken me several hours (suspecting a more
    complicated problem with the PCIe card I've been trying to get
    working). At once correct the "gdb" option, which is more like
    "console", not like "com<N>".
    
    Next, fix the types of ns_{read,write}_reg(): Especially the former
    having had a signed return type so far caused quite interesting effects
    when determining to baud rate if "auto" was specified. In that same
    code, also avoid dividing by zero when in fact the baud rate was not
    previously set up.
    
    Further, accept I/O port based serial PCI cards with a port range wider
    than 8 bytes.
    
    Finally, slightly rearrange struct ns16550 to reduce holes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/misc/xen-command-line.markdown |   11 +++++++----
 xen/drivers/char/ns16550.c          |   26 ++++++++++++++++----------
 2 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 70daa84..afb9548 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -277,13 +277,14 @@ Flag to indicate whether to probe for a CMOS Real Time Clock irrespective of
 ACPI indicating none to be there.
 
 ### com1,com2
-> `= <baud>[/<clock_hz>][,[DPS][,[<io-base>|pci|amt][,[<irq>][,[<port-bdf>][,[<bridge-bdf>]]]]]]`
+> `= <baud>[/<base-baud>][,[DPS][,[<io-base>|pci|amt][,[<irq>][,[<port-bdf>][,[<bridge-bdf>]]]]]]`
 
 Both option `com1` and `com2` follow the same format.
 
 * `<baud>` may be either an integer baud rate, or the string `auto` if
   the bootloader or other earlier firmware has already set it up.
-* Optionally, a clock speed measured in hz can be specified.
+* Optionally, the base baud rate (usually the highest baud rate the
+  device can communicate at) can be specified.
 * `DPS` represents the number of data bits, the parity, and the number
   of stop bits.
   * `D` is an integer between 5 and 8 for the number of data bits.
@@ -730,9 +731,11 @@ Controls EPT related features.
 >> Have hardware keep accessed/dirty (A/D) bits updated.
 
 ### gdb
-> `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
+> `= com1[H,L] | com2[H,L] | dbgp`
 
-Specify the serial parameters for the GDB stub.
+> Default: ``
+
+Specify which console gdbstub should use. See **console**.
 
 ### gnttab\_max\_frames
 > `= <integer>`
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index d443880..34f66f7 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -33,7 +33,7 @@
 
 /*
  * Configure serial port with a string:
- *   <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]]].
+ *   <baud>[/<base_baud>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]]].
  * The tail of the string can be omitted if platform defaults are sufficient.
  * If the baud rate is pre-configured, perhaps by a bootloader, then 'auto'
  * can be specified in place of a numeric baud rate. Polled mode is specified
@@ -66,10 +66,10 @@ static struct ns16550 {
     bool_t dw_usr_bsy;
 #ifdef HAS_PCI
     /* PCI card parameters. */
-    unsigned int pb_bdf[3]; /* pci bridge BDF */
-    unsigned int ps_bdf[3]; /* pci serial port BDF */
     bool_t pb_bdf_enable;   /* if =1, pb-bdf effective, port behind bridge */
     bool_t ps_bdf_enable;   /* if =1, ps_bdf effective, port on pci card */
+    unsigned int pb_bdf[3]; /* pci bridge BDF */
+    unsigned int ps_bdf[3]; /* pci serial port BDF */
     u32 bar;
     u32 bar64;
     u16 cr;
@@ -345,7 +345,7 @@ static const struct ns16550_config_mmio __initconst uart_config[] =
 
 static void ns16550_delayed_resume(void *data);
 
-static char ns_read_reg(struct ns16550 *uart, int reg)
+static u8 ns_read_reg(struct ns16550 *uart, unsigned int reg)
 {
     void __iomem *addr = uart->remapped_io_base + (reg << uart->reg_shift);
 #ifdef HAS_IOPORTS
@@ -363,7 +363,7 @@ static char ns_read_reg(struct ns16550 *uart, int reg)
     }
 }
 
-static void ns_write_reg(struct ns16550 *uart, int reg, char c)
+static void ns_write_reg(struct ns16550 *uart, unsigned int reg, u8 c)
 {
     void __iomem *addr = uart->remapped_io_base + (reg << uart->reg_shift);
 #ifdef HAS_IOPORTS
@@ -386,7 +386,7 @@ static void ns_write_reg(struct ns16550 *uart, int reg, char c)
 
 static int ns16550_ioport_invalid(struct ns16550 *uart)
 {
-    return (unsigned char)ns_read_reg(uart, UART_IER) == 0xff;
+    return ns_read_reg(uart, UART_IER) == 0xff;
 }
 
 static void ns16550_interrupt(
@@ -399,7 +399,8 @@ static void ns16550_interrupt(
 
     while ( !(ns_read_reg(uart, UART_IIR) & UART_IIR_NOINT) )
     {
-        char lsr = ns_read_reg(uart, UART_LSR);
+        u8 lsr = ns_read_reg(uart, UART_LSR);
+
         if ( (lsr & uart->lsr_mask) == uart->lsr_mask )
             serial_tx_interrupt(port, regs);
         if ( lsr & UART_LSR_DR )
@@ -530,7 +531,12 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
         /* Baud rate already set: read it out from the divisor latch. */
         divisor  = ns_read_reg(uart, UART_DLL);
         divisor |= ns_read_reg(uart, UART_DLM) << 8;
-        uart->baud = uart->clock_hz / (divisor << 4);
+        if ( divisor )
+            uart->baud = uart->clock_hz / (divisor << 4);
+        else
+            printk(XENLOG_ERR
+                   "Automatic baud rate determination was requested,"
+                   " but a baud rate was not set up\n");
     }
     ns_write_reg(uart, UART_LCR, lcr);
 
@@ -945,8 +951,8 @@ pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
                     size = len & PCI_BASE_ADDRESS_IO_MASK;
                     size &= -size;
 
-                    /* Not 8 bytes */
-                    if ( size != 0x8 )
+                    /* Not at least 8 bytes */
+                    if ( size < 8 )
                         continue;
 
                     uart->io_base = bar & ~PCI_BASE_ADDRESS_SPACE_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 Wed Nov 25 10:37:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:37: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 1a1XRl-0004vj-Px; Wed, 25 Nov 2015 10:37: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 1a1XRk-0004vF-9L
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:08 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	18/D0-13905-35F85565; Wed, 25 Nov 2015 10:37:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1448447825!6336391!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34295 invoked from network); 25 Nov 2015 10:37:06 -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;
	25 Nov 2015 10:37:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRf-0006YS-AZ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRf-0002hv-7n
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:03 +0000
Date: Wed, 25 Nov 2015 10:37:03 +0000
Message-Id: <E1a1XRf-0002hv-7n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: migration: Use PRIpfn when
	printing frame numbers.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f4a9a01a21c848c9757af483376f3b8261a20b34
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 11 13:33:46 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:01:13 2015 +0000

    tools: migration: Use PRIpfn when printing frame numbers.
    
    This avoids various printf formatting warnings when building on arm32.
    
    While touching the affected lines make them consistently use %#.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxc/xc_sr_restore.c |   15 ++++++++-------
 tools/libxc/xc_sr_save.c    |    2 +-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index f48e7fc..05159bb 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -341,7 +341,7 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
         if ( map_errs[j] )
         {
             rc = -1;
-            ERROR("Mapping pfn %lx (mfn %lx, type %#x)failed with %d",
+            ERROR("Mapping pfn %#"PRIpfn" (mfn %#"PRIpfn", type %#"PRIx32") failed with %d",
                   pfns[i], mfns[j], types[i], map_errs[j]);
             goto err;
         }
@@ -350,7 +350,7 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
         rc = ctx->restore.ops.localise_page(ctx, types[i], page_data);
         if ( rc )
         {
-            ERROR("Failed to localise pfn %lx (type %#x)",
+            ERROR("Failed to localise pfn %#"PRIpfn" (type %#"PRIx32")",
                   pfns[i], types[i] >> XEN_DOMCTL_PFINFO_LTAB_SHIFT);
             goto err;
         }
@@ -359,7 +359,7 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
         {
             /* Verify mode - compare incoming data to what we already have. */
             if ( memcmp(guest_page, page_data, PAGE_SIZE) )
-                ERROR("verify pfn %lx failed (type %#x)",
+                ERROR("verify pfn %#"PRIpfn" failed (type %#"PRIx32")",
                       pfns[i], types[i] >> XEN_DOMCTL_PFINFO_LTAB_SHIFT);
         }
         else
@@ -432,7 +432,7 @@ static int handle_page_data(struct xc_sr_context *ctx, struct xc_sr_record *rec)
         pfn = pages->pfn[i] & PAGE_DATA_PFN_MASK;
         if ( !ctx->restore.ops.pfn_is_valid(ctx, pfn) )
         {
-            ERROR("pfn %#lx (index %u) outside domain maximum", pfn, i);
+            ERROR("pfn %#"PRIpfn" (index %u) outside domain maximum", pfn, i);
             goto err;
         }
 
@@ -440,7 +440,8 @@ static int handle_page_data(struct xc_sr_context *ctx, struct xc_sr_record *rec)
         if ( ((type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT) >= 5) &&
              ((type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT) <= 8) )
         {
-            ERROR("Invalid type %#x for pfn %#lx (index %u)", type, pfn, i);
+            ERROR("Invalid type %#"PRIx32" for pfn %#"PRIpfn" (index %u)",
+                  type, pfn, i);
             goto err;
         }
         else if ( type < XEN_DOMCTL_PFINFO_BROKEN )
@@ -775,12 +776,12 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
             return -1;
     }
 
-    IPRINTF("XenStore: mfn %#lx, dom %d, evt %u",
+    IPRINTF("XenStore: mfn %#"PRIpfn", dom %d, evt %u",
             ctx.restore.xenstore_gfn,
             ctx.restore.xenstore_domid,
             ctx.restore.xenstore_evtchn);
 
-    IPRINTF("Console: mfn %#lx, dom %d, evt %u",
+    IPRINTF("Console: mfn %#"PRIpfn", dom %d, evt %u",
             ctx.restore.console_gfn,
             ctx.restore.console_domid,
             ctx.restore.console_evtchn);
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index d1bdf72..0c12e56 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -174,7 +174,7 @@ static int write_batch(struct xc_sr_context *ctx)
 
             if ( errors[p] )
             {
-                ERROR("Mapping of pfn %#lx (mfn %#lx) failed %d",
+                ERROR("Mapping of pfn %#"PRIpfn" (mfn %#"PRIpfn") failed %d",
                       ctx->save.batch_pfns[i], mfns[p], errors[p]);
                 goto err;
             }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:37:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:37: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 1a1XRl-0004vj-Px; Wed, 25 Nov 2015 10:37: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 1a1XRk-0004vF-9L
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:08 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	18/D0-13905-35F85565; Wed, 25 Nov 2015 10:37:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1448447825!6336391!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34295 invoked from network); 25 Nov 2015 10:37:06 -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;
	25 Nov 2015 10:37:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRf-0006YS-AZ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRf-0002hv-7n
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:03 +0000
Date: Wed, 25 Nov 2015 10:37:03 +0000
Message-Id: <E1a1XRf-0002hv-7n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: migration: Use PRIpfn when
	printing frame numbers.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f4a9a01a21c848c9757af483376f3b8261a20b34
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 11 13:33:46 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:01:13 2015 +0000

    tools: migration: Use PRIpfn when printing frame numbers.
    
    This avoids various printf formatting warnings when building on arm32.
    
    While touching the affected lines make them consistently use %#.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxc/xc_sr_restore.c |   15 ++++++++-------
 tools/libxc/xc_sr_save.c    |    2 +-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
index f48e7fc..05159bb 100644
--- a/tools/libxc/xc_sr_restore.c
+++ b/tools/libxc/xc_sr_restore.c
@@ -341,7 +341,7 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
         if ( map_errs[j] )
         {
             rc = -1;
-            ERROR("Mapping pfn %lx (mfn %lx, type %#x)failed with %d",
+            ERROR("Mapping pfn %#"PRIpfn" (mfn %#"PRIpfn", type %#"PRIx32") failed with %d",
                   pfns[i], mfns[j], types[i], map_errs[j]);
             goto err;
         }
@@ -350,7 +350,7 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
         rc = ctx->restore.ops.localise_page(ctx, types[i], page_data);
         if ( rc )
         {
-            ERROR("Failed to localise pfn %lx (type %#x)",
+            ERROR("Failed to localise pfn %#"PRIpfn" (type %#"PRIx32")",
                   pfns[i], types[i] >> XEN_DOMCTL_PFINFO_LTAB_SHIFT);
             goto err;
         }
@@ -359,7 +359,7 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned count,
         {
             /* Verify mode - compare incoming data to what we already have. */
             if ( memcmp(guest_page, page_data, PAGE_SIZE) )
-                ERROR("verify pfn %lx failed (type %#x)",
+                ERROR("verify pfn %#"PRIpfn" failed (type %#"PRIx32")",
                       pfns[i], types[i] >> XEN_DOMCTL_PFINFO_LTAB_SHIFT);
         }
         else
@@ -432,7 +432,7 @@ static int handle_page_data(struct xc_sr_context *ctx, struct xc_sr_record *rec)
         pfn = pages->pfn[i] & PAGE_DATA_PFN_MASK;
         if ( !ctx->restore.ops.pfn_is_valid(ctx, pfn) )
         {
-            ERROR("pfn %#lx (index %u) outside domain maximum", pfn, i);
+            ERROR("pfn %#"PRIpfn" (index %u) outside domain maximum", pfn, i);
             goto err;
         }
 
@@ -440,7 +440,8 @@ static int handle_page_data(struct xc_sr_context *ctx, struct xc_sr_record *rec)
         if ( ((type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT) >= 5) &&
              ((type >> XEN_DOMCTL_PFINFO_LTAB_SHIFT) <= 8) )
         {
-            ERROR("Invalid type %#x for pfn %#lx (index %u)", type, pfn, i);
+            ERROR("Invalid type %#"PRIx32" for pfn %#"PRIpfn" (index %u)",
+                  type, pfn, i);
             goto err;
         }
         else if ( type < XEN_DOMCTL_PFINFO_BROKEN )
@@ -775,12 +776,12 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
             return -1;
     }
 
-    IPRINTF("XenStore: mfn %#lx, dom %d, evt %u",
+    IPRINTF("XenStore: mfn %#"PRIpfn", dom %d, evt %u",
             ctx.restore.xenstore_gfn,
             ctx.restore.xenstore_domid,
             ctx.restore.xenstore_evtchn);
 
-    IPRINTF("Console: mfn %#lx, dom %d, evt %u",
+    IPRINTF("Console: mfn %#"PRIpfn", dom %d, evt %u",
             ctx.restore.console_gfn,
             ctx.restore.console_domid,
             ctx.restore.console_evtchn);
diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index d1bdf72..0c12e56 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -174,7 +174,7 @@ static int write_batch(struct xc_sr_context *ctx)
 
             if ( errors[p] )
             {
-                ERROR("Mapping of pfn %#lx (mfn %#lx) failed %d",
+                ERROR("Mapping of pfn %#"PRIpfn" (mfn %#"PRIpfn") failed %d",
                       ctx->save.batch_pfns[i], mfns[p], errors[p]);
                 goto err;
             }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:37:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:37: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 1a1XS5-00050h-U9; Wed, 25 Nov 2015 10:37: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 1a1XS3-0004y9-PV
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:27 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	7C/E6-24494-D5F85565; Wed, 25 Nov 2015 10:37:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1448447836!6347220!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55384 invoked from network); 25 Nov 2015 10:37:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Nov 2015 10:37:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRs-0006Ya-A0
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRs-0002id-09
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:16 +0000
Date: Wed, 25 Nov 2015 10:37:16 +0000
Message-Id: <E1a1XRs-0002id-09@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: pygrub: if partition table is
	empty, try treating as a whole disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb31b1475f1bf179f033b8de3f0e173006fd77e9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Nov 5 14:46:12 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:01:50 2015 +0000

    tools: pygrub: if partition table is empty, try treating as a whole disk
    
    pygrub (in identify_disk_image()) detects a DOS style partition table
    via the presence of the 0xaa55 signature at the end of the first
    sector of the disk.
    
    However this signature is also present in whole-disk configurations
    when there is an MBR on the disk. Many filesystems (e.g. ext[234])
    include leading padding in their on disk format specifically to enable
    this.
    
    So if we think we have a DOS partition table but do not find any
    actual partition table entries we may as well try looking at it as a
    whole disk image. Worst case is we probe and find there isn't anything
    there.
    
    This was reported by Sjors Gielen in Debian bug #745419. The fix was
    inspired by a patch by Adi Kriegisch in
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=745419#27
    
    Tested by genext2fs'ing my /boot into a new raw image (works) and
    then:
       dd if=/usr/lib/grub/i386-pc/g2ldr.mbr of=img conv=notrunc bs=512 count=1
    
    to add an MBR (with 0xaa55 signature) to it, which after this patch
    also works.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: 745419-forwarded@bugs.debian.org
---
 tools/pygrub/src/pygrub |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index e4aedda..40f9584 100755
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -156,6 +156,11 @@ def get_partition_offsets(file):
         else:
             part_offs.append(offset)
 
+    # We thought we had a DOS partition table, but didn't find any
+    # actual valid partition entries. This can happen because an MBR
+    # (e.g. grubs) may contain the same signature.
+    if not part_offs: part_offs = [0]
+
     return part_offs
 
 class GrubLineEditor(curses.textpad.Textbox):
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:37:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:37: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 1a1XS5-00050h-U9; Wed, 25 Nov 2015 10:37: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 1a1XS3-0004y9-PV
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:27 +0000
Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id
	7C/E6-24494-D5F85565; Wed, 25 Nov 2015 10:37:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1448447836!6347220!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55384 invoked from network); 25 Nov 2015 10:37:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Nov 2015 10:37:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRs-0006Ya-A0
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XRs-0002id-09
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:16 +0000
Date: Wed, 25 Nov 2015 10:37:16 +0000
Message-Id: <E1a1XRs-0002id-09@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: pygrub: if partition table is
	empty, try treating as a whole disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb31b1475f1bf179f033b8de3f0e173006fd77e9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Nov 5 14:46:12 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:01:50 2015 +0000

    tools: pygrub: if partition table is empty, try treating as a whole disk
    
    pygrub (in identify_disk_image()) detects a DOS style partition table
    via the presence of the 0xaa55 signature at the end of the first
    sector of the disk.
    
    However this signature is also present in whole-disk configurations
    when there is an MBR on the disk. Many filesystems (e.g. ext[234])
    include leading padding in their on disk format specifically to enable
    this.
    
    So if we think we have a DOS partition table but do not find any
    actual partition table entries we may as well try looking at it as a
    whole disk image. Worst case is we probe and find there isn't anything
    there.
    
    This was reported by Sjors Gielen in Debian bug #745419. The fix was
    inspired by a patch by Adi Kriegisch in
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=745419#27
    
    Tested by genext2fs'ing my /boot into a new raw image (works) and
    then:
       dd if=/usr/lib/grub/i386-pc/g2ldr.mbr of=img conv=notrunc bs=512 count=1
    
    to add an MBR (with 0xaa55 signature) to it, which after this patch
    also works.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: 745419-forwarded@bugs.debian.org
---
 tools/pygrub/src/pygrub |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index e4aedda..40f9584 100755
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -156,6 +156,11 @@ def get_partition_offsets(file):
         else:
             part_offs.append(offset)
 
+    # We thought we had a DOS partition table, but didn't find any
+    # actual valid partition entries. This can happen because an MBR
+    # (e.g. grubs) may contain the same signature.
+    if not part_offs: part_offs = [0]
+
     return part_offs
 
 class GrubLineEditor(curses.textpad.Textbox):
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:37:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:37: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 1a1XS9-00051g-28; Wed, 25 Nov 2015 10:37: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 1a1XS6-000514-Uh
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:31 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	0D/1D-09834-96F85565; Wed, 25 Nov 2015 10:37:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1448447847!6148052!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28433 invoked from network); 25 Nov 2015 10:37:28 -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;
	25 Nov 2015 10:37:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XS2-0006Yi-Kv
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XS2-0002jB-Iq
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:26 +0000
Date: Wed, 25 Nov 2015 10:37:26 +0000
Message-Id: <E1a1XS2-0002jB-Iq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] run QEMU as non-root
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84f2fd1ba567f4cb08ed101e26d013c181ab3318
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Nov 5 12:47:26 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:09:41 2015 +0000

    run QEMU as non-root
    
    Try to use "xen-qemuuser-domid$domid" first, then
    "xen-qemuuser-shared" and root if everything else fails.
    
    The uids need to be manually created by the user or, more likely, by the
    xen package maintainer.
    
    Expose a device_model_user setting in libxl_domain_build_info, so that
    opinionated callers, such as libvirt, can set any user they like. Do not
    fall back to root if device_model_user is set. Users can also set
    device_model_user by hand in the xl domain config file.
    
    QEMU is going to setuid and setgid to the user ID and the group ID of
    the specified user, soon after initialization, before starting to deal
    with any guest IO.
    
    To actually secure QEMU when running in Dom0, we need at least to
    deprivilege the privcmd and xenstore interfaces, this is just the first
    step in that direction.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 INSTALL                        |    7 ++++
 docs/man/xl.cfg.pod.5          |    5 +++
 docs/misc/qemu-deprivilege.txt |   31 ++++++++++++++++++
 tools/libxl/libxl.h            |    6 +++
 tools/libxl/libxl_dm.c         |   67 +++++++++++++++++++++++++++++++++++++++-
 tools/libxl/libxl_internal.h   |    5 +++
 tools/libxl/libxl_types.idl    |    1 +
 tools/libxl/xl_cmdimpl.c       |    3 ++
 8 files changed, 124 insertions(+), 1 deletions(-)

diff --git a/INSTALL b/INSTALL
index 56e2950..b7e426c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -304,6 +304,13 @@ systemctl enable xendomains.service
 systemctl enable xen-watchdog.service
 
 
+QEMU Deprivilege
+================
+It is recommended to run QEMU as non-root.
+See docs/misc/qemu-deprivilege.txt for an explanation on what you need
+to do at installation time to run QEMU as a dedicated user.
+
+
 History of options
 ==================
 
diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index b63846a..2aca8dd 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1825,6 +1825,11 @@ Pass additional arbitrary options on the device-model command line for
 an HVM device model only. Each element in the list is passed as an
 option to the device-model.
 
+=item B<device_model_user="username">
+
+Run the device model as user "username", instead of
+xen-qemudepriv-domid$domid or xen-qemudepriv-shared or root.
+
 =back
 
 =head2 Keymaps
diff --git a/docs/misc/qemu-deprivilege.txt b/docs/misc/qemu-deprivilege.txt
new file mode 100644
index 0000000..dde74ab
--- /dev/null
+++ b/docs/misc/qemu-deprivilege.txt
@@ -0,0 +1,31 @@
+For security reasons, libxl tries to pass a non-root username to QEMU as
+argument. During initialization QEMU calls setuid and setgid with the
+user ID and the group ID of the user passed as argument.
+Libxl looks for the following users in this order:
+
+1) a user named "xen-qemuuser-domid$domid",
+Where $domid is the domid of the domain being created.
+This requires the reservation of 65535 uids from xen-qemuuser-domid1
+to xen-qemuuser-domid65535. To use this mechanism, you might want to
+create a large number of users at installation time. For example:
+
+for ((i=1; i<65536; i++))
+do
+    adduser --no-create-home --system xen-qemuuser-domid$i
+done
+
+You might want to consider passing --group to adduser to create a new
+group for each new user.
+
+
+2) a user named "xen-qemuuser-shared"
+As a fall back if both 1) fails, libxl will use a single user for
+all QEMU instances. The user is named xen-qemuuser-shared. This is
+less secure but still better than running QEMU as root. Using this is as
+simple as creating just one more user on your host:
+
+adduser --no-create-home --system xen-qemuuser-shared
+
+
+3) root
+As a last resort, libxl will start QEMU as root.
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 168fedd..6b73848 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -200,6 +200,12 @@
 #define LIBXL_HAVE_DEVICETREE_PASSTHROUGH 1
 
 /*
+ * libxl_domain_build_info has device_model_user to specify the user to
+ * run the device model with. See docs/misc/qemu-deprivilege.txt.
+ */
+#define LIBXL_HAVE_DEVICE_MODEL_USER 1
+
+/*
  * libxl_domain_build_info has the arm.gic_version field.
  */
 #define LIBXL_HAVE_BUILDINFO_ARM_GIC_VERSION 1
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 9c9eaa3..151b6ed 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -21,6 +21,8 @@
 
 #include <xc_dom.h>
 #include <xen/hvm/e820.h>
+#include <sys/types.h>
+#include <pwd.h>
 
 static const char *libxl_tapif_script(libxl__gc *gc)
 {
@@ -722,6 +724,36 @@ libxl__detect_gfx_passthru_kind(libxl__gc *gc,
     return LIBXL_GFX_PASSTHRU_KIND_DEFAULT;
 }
 
+/* return 1 if the user was found, 0 if it was not, -1 on error */
+static int libxl__dm_runas_helper(libxl__gc *gc, const char *username)
+{
+    struct passwd pwd, *user = NULL;
+    char *buf = NULL;
+    long buf_size;
+    int ret;
+
+    buf_size = sysconf(_SC_GETPW_R_SIZE_MAX);
+    if (buf_size < 0) {
+        LOGE(ERROR, "sysconf(_SC_GETPW_R_SIZE_MAX) returned error %ld",
+                buf_size);
+        return ERROR_FAIL;
+    }
+
+    while (1) {
+        buf = libxl__realloc(gc, buf, buf_size);
+        ret = getpwnam_r(username, &pwd, buf, buf_size, &user);
+        if (ret == ERANGE) {
+            buf_size += 128;
+            continue;
+        }
+        if (ret != 0)
+            return ERROR_FAIL;
+        if (user != NULL)
+            return 1;
+        return 0;
+    }
+}
+
 static int libxl__build_device_model_args_new(libxl__gc *gc,
                                         const char *dm, int guest_domid,
                                         const libxl_domain_config *guest_config,
@@ -740,9 +772,10 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
     const char *keymap = dm_keymap(guest_config);
     char *machinearg;
     flexarray_t *dm_args, *dm_envs;
-    int i, connection, devid;
+    int i, connection, devid, ret;
     uint64_t ram_size;
     const char *path, *chardev;
+    char *user = NULL;
 
     dm_args = flexarray_make(gc, 16, 1);
     dm_envs = flexarray_make(gc, 16, 1);
@@ -1222,6 +1255,38 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
         default:
             break;
         }
+
+        if (b_info->device_model_user) {
+            user = b_info->device_model_user;
+            goto end_search;
+        }
+
+        user = libxl__sprintf(gc, "%s%d", LIBXL_QEMU_USER_BASE, guest_domid);
+        ret = libxl__dm_runas_helper(gc, user);
+        if (ret < 0)
+            return ret;
+        if (ret > 0)
+            goto end_search;
+
+        user = LIBXL_QEMU_USER_SHARED;
+        ret = libxl__dm_runas_helper(gc, user);
+        if (ret < 0)
+            return ret;
+        if (ret > 0) {
+            LOG(WARN, "Could not find user %s%d, falling back to %s",
+                    LIBXL_QEMU_USER_BASE, guest_domid, LIBXL_QEMU_USER_SHARED);
+            goto end_search;
+        }
+
+        user = NULL;
+        LOG(WARN, "Could not find user %s, starting QEMU as root",
+            LIBXL_QEMU_USER_SHARED);
+
+end_search:
+        if (user != NULL && strcmp(user, "root")) {
+            flexarray_append(dm_args, "-runas");
+            flexarray_append(dm_args, user);
+        }
     }
     flexarray_append(dm_args, NULL);
     *args = (char **) flexarray_contents(dm_args);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index b00add0..952b668 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -4018,6 +4018,11 @@ void libxl__bitmap_copy_best_effort(libxl__gc *gc, libxl_bitmap *dptr,
                                     const libxl_bitmap *sptr);
 
 int libxl__count_physical_sockets(libxl__gc *gc, int *sockets);
+
+
+#define LIBXL_QEMU_USER_PREFIX "xen-qemuuser"
+#define LIBXL_QEMU_USER_BASE   LIBXL_QEMU_USER_PREFIX"-domid"
+#define LIBXL_QEMU_USER_SHARED LIBXL_QEMU_USER_PREFIX"-shared"
 #endif
 
 /*
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 4d78f86..6808f2b 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -440,6 +440,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("device_model",     string),
     ("device_model_ssidref", uint32),
     ("device_model_ssid_label", string),
+    ("device_model_user", string),
 
     # extra parameters pass directly to qemu, NULL terminated
     ("extra",            libxl_string_list),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 03442e1..2b6371d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2201,6 +2201,9 @@ skip_vfb:
         xlu_cfg_replace_string(config, "device_model_stubdomain_seclabel",
                                &b_info->device_model_ssid_label, 0);
 
+    xlu_cfg_replace_string(config, "device_model_user",
+                           &b_info->device_model_user, 0);
+
 #define parse_extra_args(type)                                            \
     e = xlu_cfg_get_list_as_string_list(config, "device_model_args"#type, \
                                     &b_info->extra##type, 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 Nov 25 10:37:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:37: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 1a1XS9-00051g-28; Wed, 25 Nov 2015 10:37: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 1a1XS6-000514-Uh
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:31 +0000
Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id
	0D/1D-09834-96F85565; Wed, 25 Nov 2015 10:37:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1448447847!6148052!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28433 invoked from network); 25 Nov 2015 10:37:28 -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;
	25 Nov 2015 10:37:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XS2-0006Yi-Kv
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XS2-0002jB-Iq
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:26 +0000
Date: Wed, 25 Nov 2015 10:37:26 +0000
Message-Id: <E1a1XS2-0002jB-Iq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] run QEMU as non-root
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84f2fd1ba567f4cb08ed101e26d013c181ab3318
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Nov 5 12:47:26 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:09:41 2015 +0000

    run QEMU as non-root
    
    Try to use "xen-qemuuser-domid$domid" first, then
    "xen-qemuuser-shared" and root if everything else fails.
    
    The uids need to be manually created by the user or, more likely, by the
    xen package maintainer.
    
    Expose a device_model_user setting in libxl_domain_build_info, so that
    opinionated callers, such as libvirt, can set any user they like. Do not
    fall back to root if device_model_user is set. Users can also set
    device_model_user by hand in the xl domain config file.
    
    QEMU is going to setuid and setgid to the user ID and the group ID of
    the specified user, soon after initialization, before starting to deal
    with any guest IO.
    
    To actually secure QEMU when running in Dom0, we need at least to
    deprivilege the privcmd and xenstore interfaces, this is just the first
    step in that direction.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 INSTALL                        |    7 ++++
 docs/man/xl.cfg.pod.5          |    5 +++
 docs/misc/qemu-deprivilege.txt |   31 ++++++++++++++++++
 tools/libxl/libxl.h            |    6 +++
 tools/libxl/libxl_dm.c         |   67 +++++++++++++++++++++++++++++++++++++++-
 tools/libxl/libxl_internal.h   |    5 +++
 tools/libxl/libxl_types.idl    |    1 +
 tools/libxl/xl_cmdimpl.c       |    3 ++
 8 files changed, 124 insertions(+), 1 deletions(-)

diff --git a/INSTALL b/INSTALL
index 56e2950..b7e426c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -304,6 +304,13 @@ systemctl enable xendomains.service
 systemctl enable xen-watchdog.service
 
 
+QEMU Deprivilege
+================
+It is recommended to run QEMU as non-root.
+See docs/misc/qemu-deprivilege.txt for an explanation on what you need
+to do at installation time to run QEMU as a dedicated user.
+
+
 History of options
 ==================
 
diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index b63846a..2aca8dd 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1825,6 +1825,11 @@ Pass additional arbitrary options on the device-model command line for
 an HVM device model only. Each element in the list is passed as an
 option to the device-model.
 
+=item B<device_model_user="username">
+
+Run the device model as user "username", instead of
+xen-qemudepriv-domid$domid or xen-qemudepriv-shared or root.
+
 =back
 
 =head2 Keymaps
diff --git a/docs/misc/qemu-deprivilege.txt b/docs/misc/qemu-deprivilege.txt
new file mode 100644
index 0000000..dde74ab
--- /dev/null
+++ b/docs/misc/qemu-deprivilege.txt
@@ -0,0 +1,31 @@
+For security reasons, libxl tries to pass a non-root username to QEMU as
+argument. During initialization QEMU calls setuid and setgid with the
+user ID and the group ID of the user passed as argument.
+Libxl looks for the following users in this order:
+
+1) a user named "xen-qemuuser-domid$domid",
+Where $domid is the domid of the domain being created.
+This requires the reservation of 65535 uids from xen-qemuuser-domid1
+to xen-qemuuser-domid65535. To use this mechanism, you might want to
+create a large number of users at installation time. For example:
+
+for ((i=1; i<65536; i++))
+do
+    adduser --no-create-home --system xen-qemuuser-domid$i
+done
+
+You might want to consider passing --group to adduser to create a new
+group for each new user.
+
+
+2) a user named "xen-qemuuser-shared"
+As a fall back if both 1) fails, libxl will use a single user for
+all QEMU instances. The user is named xen-qemuuser-shared. This is
+less secure but still better than running QEMU as root. Using this is as
+simple as creating just one more user on your host:
+
+adduser --no-create-home --system xen-qemuuser-shared
+
+
+3) root
+As a last resort, libxl will start QEMU as root.
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 168fedd..6b73848 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -200,6 +200,12 @@
 #define LIBXL_HAVE_DEVICETREE_PASSTHROUGH 1
 
 /*
+ * libxl_domain_build_info has device_model_user to specify the user to
+ * run the device model with. See docs/misc/qemu-deprivilege.txt.
+ */
+#define LIBXL_HAVE_DEVICE_MODEL_USER 1
+
+/*
  * libxl_domain_build_info has the arm.gic_version field.
  */
 #define LIBXL_HAVE_BUILDINFO_ARM_GIC_VERSION 1
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 9c9eaa3..151b6ed 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -21,6 +21,8 @@
 
 #include <xc_dom.h>
 #include <xen/hvm/e820.h>
+#include <sys/types.h>
+#include <pwd.h>
 
 static const char *libxl_tapif_script(libxl__gc *gc)
 {
@@ -722,6 +724,36 @@ libxl__detect_gfx_passthru_kind(libxl__gc *gc,
     return LIBXL_GFX_PASSTHRU_KIND_DEFAULT;
 }
 
+/* return 1 if the user was found, 0 if it was not, -1 on error */
+static int libxl__dm_runas_helper(libxl__gc *gc, const char *username)
+{
+    struct passwd pwd, *user = NULL;
+    char *buf = NULL;
+    long buf_size;
+    int ret;
+
+    buf_size = sysconf(_SC_GETPW_R_SIZE_MAX);
+    if (buf_size < 0) {
+        LOGE(ERROR, "sysconf(_SC_GETPW_R_SIZE_MAX) returned error %ld",
+                buf_size);
+        return ERROR_FAIL;
+    }
+
+    while (1) {
+        buf = libxl__realloc(gc, buf, buf_size);
+        ret = getpwnam_r(username, &pwd, buf, buf_size, &user);
+        if (ret == ERANGE) {
+            buf_size += 128;
+            continue;
+        }
+        if (ret != 0)
+            return ERROR_FAIL;
+        if (user != NULL)
+            return 1;
+        return 0;
+    }
+}
+
 static int libxl__build_device_model_args_new(libxl__gc *gc,
                                         const char *dm, int guest_domid,
                                         const libxl_domain_config *guest_config,
@@ -740,9 +772,10 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
     const char *keymap = dm_keymap(guest_config);
     char *machinearg;
     flexarray_t *dm_args, *dm_envs;
-    int i, connection, devid;
+    int i, connection, devid, ret;
     uint64_t ram_size;
     const char *path, *chardev;
+    char *user = NULL;
 
     dm_args = flexarray_make(gc, 16, 1);
     dm_envs = flexarray_make(gc, 16, 1);
@@ -1222,6 +1255,38 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
         default:
             break;
         }
+
+        if (b_info->device_model_user) {
+            user = b_info->device_model_user;
+            goto end_search;
+        }
+
+        user = libxl__sprintf(gc, "%s%d", LIBXL_QEMU_USER_BASE, guest_domid);
+        ret = libxl__dm_runas_helper(gc, user);
+        if (ret < 0)
+            return ret;
+        if (ret > 0)
+            goto end_search;
+
+        user = LIBXL_QEMU_USER_SHARED;
+        ret = libxl__dm_runas_helper(gc, user);
+        if (ret < 0)
+            return ret;
+        if (ret > 0) {
+            LOG(WARN, "Could not find user %s%d, falling back to %s",
+                    LIBXL_QEMU_USER_BASE, guest_domid, LIBXL_QEMU_USER_SHARED);
+            goto end_search;
+        }
+
+        user = NULL;
+        LOG(WARN, "Could not find user %s, starting QEMU as root",
+            LIBXL_QEMU_USER_SHARED);
+
+end_search:
+        if (user != NULL && strcmp(user, "root")) {
+            flexarray_append(dm_args, "-runas");
+            flexarray_append(dm_args, user);
+        }
     }
     flexarray_append(dm_args, NULL);
     *args = (char **) flexarray_contents(dm_args);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index b00add0..952b668 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -4018,6 +4018,11 @@ void libxl__bitmap_copy_best_effort(libxl__gc *gc, libxl_bitmap *dptr,
                                     const libxl_bitmap *sptr);
 
 int libxl__count_physical_sockets(libxl__gc *gc, int *sockets);
+
+
+#define LIBXL_QEMU_USER_PREFIX "xen-qemuuser"
+#define LIBXL_QEMU_USER_BASE   LIBXL_QEMU_USER_PREFIX"-domid"
+#define LIBXL_QEMU_USER_SHARED LIBXL_QEMU_USER_PREFIX"-shared"
 #endif
 
 /*
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 4d78f86..6808f2b 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -440,6 +440,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("device_model",     string),
     ("device_model_ssidref", uint32),
     ("device_model_ssid_label", string),
+    ("device_model_user", string),
 
     # extra parameters pass directly to qemu, NULL terminated
     ("extra",            libxl_string_list),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 03442e1..2b6371d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2201,6 +2201,9 @@ skip_vfb:
         xlu_cfg_replace_string(config, "device_model_stubdomain_seclabel",
                                &b_info->device_model_ssid_label, 0);
 
+    xlu_cfg_replace_string(config, "device_model_user",
+                           &b_info->device_model_user, 0);
+
 #define parse_extra_args(type)                                            \
     e = xlu_cfg_get_list_as_string_list(config, "device_model_args"#type, \
                                     &b_info->extra##type, 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 Nov 25 10:37:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:37: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 1a1XSI-00053z-6j; Wed, 25 Nov 2015 10:37:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSH-00053h-DI
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:41 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	8C/27-13183-47F85565; Wed, 25 Nov 2015 10:37:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448447857!6471279!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38955 invoked from network); 25 Nov 2015 10:37:37 -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;
	25 Nov 2015 10:37:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSC-0006Yr-UH
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSC-0002jo-S5
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:36 +0000
Date: Wed, 25 Nov 2015 10:37:36 +0000
Message-Id: <E1a1XSC-0002jo-S5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml/xc: correct shutdown_reason
	enumeration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 87a16694248e80195943741bb9f857edd6a6bf51
Author:     Simon Rowe <simon.rowe@eu.citrix.com>
AuthorDate: Thu Nov 5 11:39:05 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:10:43 2015 +0000

    ocaml/xc: correct shutdown_reason enumeration
    
    As defined by the Xen public header the fifth value of
    shutdown_reason is watchdog.
    
    Signed-off-by: Simon Rowe <simon.rowe@eu.citrix.com>
    Acked-by: David Scott <dave@recoil.org>
---
 tools/ocaml/libs/xc/xenctrl.ml  |    2 +-
 tools/ocaml/libs/xc/xenctrl.mli |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index b7ba8b7..beb95b8 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -89,7 +89,7 @@ type compile_info =
 	compile_date : string;
 }
 
-type shutdown_reason = Poweroff | Reboot | Suspend | Crash | Halt
+type shutdown_reason = Poweroff | Reboot | Suspend | Crash | Watchdog
 
 type domain_create_flag = CDF_HVM | CDF_HAP
 
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index bc4af56..8928a2e 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -61,7 +61,7 @@ type compile_info = {
   compile_domain : string;
   compile_date : string;
 }
-type shutdown_reason = Poweroff | Reboot | Suspend | Crash | Halt
+type shutdown_reason = Poweroff | Reboot | Suspend | Crash | Watchdog
 
 type domain_create_flag = CDF_HVM | CDF_HAP
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:37:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:37: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 1a1XSI-00053z-6j; Wed, 25 Nov 2015 10:37:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSH-00053h-DI
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:41 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	8C/27-13183-47F85565; Wed, 25 Nov 2015 10:37:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448447857!6471279!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38955 invoked from network); 25 Nov 2015 10:37:37 -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;
	25 Nov 2015 10:37:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSC-0006Yr-UH
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSC-0002jo-S5
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:36 +0000
Date: Wed, 25 Nov 2015 10:37:36 +0000
Message-Id: <E1a1XSC-0002jo-S5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml/xc: correct shutdown_reason
	enumeration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 87a16694248e80195943741bb9f857edd6a6bf51
Author:     Simon Rowe <simon.rowe@eu.citrix.com>
AuthorDate: Thu Nov 5 11:39:05 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:10:43 2015 +0000

    ocaml/xc: correct shutdown_reason enumeration
    
    As defined by the Xen public header the fifth value of
    shutdown_reason is watchdog.
    
    Signed-off-by: Simon Rowe <simon.rowe@eu.citrix.com>
    Acked-by: David Scott <dave@recoil.org>
---
 tools/ocaml/libs/xc/xenctrl.ml  |    2 +-
 tools/ocaml/libs/xc/xenctrl.mli |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index b7ba8b7..beb95b8 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -89,7 +89,7 @@ type compile_info =
 	compile_date : string;
 }
 
-type shutdown_reason = Poweroff | Reboot | Suspend | Crash | Halt
+type shutdown_reason = Poweroff | Reboot | Suspend | Crash | Watchdog
 
 type domain_create_flag = CDF_HVM | CDF_HAP
 
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index bc4af56..8928a2e 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -61,7 +61,7 @@ type compile_info = {
   compile_domain : string;
   compile_date : string;
 }
-type shutdown_reason = Poweroff | Reboot | Suspend | Crash | Halt
+type shutdown_reason = Poweroff | Reboot | Suspend | Crash | Watchdog
 
 type domain_create_flag = CDF_HVM | CDF_HAP
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:37:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:37: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 1a1XSR-00056A-Ax; Wed, 25 Nov 2015 10:37:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSQ-00055p-Cp
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:50 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	34/12-02940-D7F85565; Wed, 25 Nov 2015 10:37:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448447867!6471338!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44106 invoked from network); 25 Nov 2015 10:37:48 -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;
	25 Nov 2015 10:37:48 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSN-0006Z2-8Y
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSN-0002kK-67
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:47 +0000
Date: Wed, 25 Nov 2015 10:37:47 +0000
Message-Id: <E1a1XSN-0002kK-67@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/serial: Move any OMAP specific
	things to OMAP UART driver
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 961f129b5d88201c29967b202e0aa38081add1a6
Author:     Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
AuthorDate: Thu Nov 5 19:53:06 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:13:41 2015 +0000

    xen/serial: Move any OMAP specific things to OMAP UART driver
    
    The 8250-uart.h contains extra serial register definitions
    for the internal UARTs in TI OMAP SoCs which are used in
    OMAP UART driver only.
    In order to clean up code move these definitions to omap-uart.c.
    Also rename some definitions to follow to the UART_OMAP* prefix.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Julien Grall <julien.grall@citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/omap-uart.c |   25 ++++++++++++++++++++++---
 xen/include/xen/8250-uart.h  |   24 ------------------------
 2 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index d8f64ea..5e666d6 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -25,6 +25,25 @@
 
 #define REG_SHIFT 2
 
+/* Register offsets */
+#define UART_OMAP_EFR    0x02   /* Enhanced feature register */
+#define UART_OMAP_MDR1   0x08   /* Mode definition register 1 */
+#define UART_OMAP_SCR    0x10   /* Supplementary control register */
+#define UART_OMAP_SYSC   0x15   /* System configuration register */
+
+/* Enhanced feature register */
+#define UART_OMAP_EFR_ECB   0x10   /* Enhanced control bit */
+
+/* Mode definition register 1 */
+#define UART_OMAP_MDR1_16X_MODE   0x00   /* UART 16x mode           */
+#define UART_OMAP_MDR1_DISABLE    0x07   /* Disable (default state) */
+
+/* Supplementary control register bitmasks */
+#define UART_OMAP_SCR_RX_TRIG_GRANU1_MASK   (1 << 7)
+
+/* System configuration register */
+#define UART_OMAP_SYSC_DEF_CONF   0x0d   /* autoidle mode, wakeup is enabled */
+
 #define omap_read(uart, off)       readl((uart)->regs + (off<<REG_SHIFT))
 #define omap_write(uart, off, val) writel((val), (uart)->regs + (off<<REG_SHIFT))
 
@@ -146,7 +165,7 @@ static void fifo_setup(struct omap_uart *uart)
     /*
      * Load the new FIFO triggers and the new DMA mode bit.
      */
-    omap_write(uart, UART_OMAP_SCR, OMAP_UART_SCR_RX_TRIG_GRANU1_MASK);
+    omap_write(uart, UART_OMAP_SCR, UART_OMAP_SCR_RX_TRIG_GRANU1_MASK);
     /*
      * Restore the UART_OMAP_EFR[4] value.
      */
@@ -196,8 +215,8 @@ static void __init omap_uart_init_preirq(struct serial_port *port)
 
     omap_write(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_16X_MODE);
 
-    /* setup iddle mode */
-    omap_write(uart, UART_SYSC, OMAP_UART_SYSC_DEF_CONF);
+    /* setup idle mode */
+    omap_write(uart, UART_OMAP_SYSC, UART_OMAP_SYSC_DEF_CONF);
 }
 
 static void __init omap_uart_init_postirq(struct serial_port *port)
diff --git a/xen/include/xen/8250-uart.h b/xen/include/xen/8250-uart.h
index 304b9dd..c6b62c8 100644
--- a/xen/include/xen/8250-uart.h
+++ b/xen/include/xen/8250-uart.h
@@ -32,7 +32,6 @@
 #define UART_MCR          0x04    /* Modem control        */
 #define UART_LSR          0x05    /* line status          */
 #define UART_MSR          0x06    /* Modem status         */
-#define UART_SYSC         0x15    /* System configuration register */
 #define UART_USR          0x1f    /* Status register (DW) */
 #define UART_DLL          0x00    /* divisor latch (ls) (DLAB=1) */
 #define UART_DLM          0x01    /* divisor latch (ms) (DLAB=1) */
@@ -126,29 +125,6 @@
 #define RESUME_DELAY      MILLISECS(10)
 #define RESUME_RETRIES    100
 
-/* Enhanced feature register */
-#define UART_OMAP_EFR     0x02
-
-#define UART_OMAP_EFR_ECB 0x10 /* Enhanced control bit */
-
-/* Mode definition register 1 */
-#define UART_OMAP_MDR1    0x08
-
-/*
- * These are the definitions for the MDR1 register
- */
-#define UART_OMAP_MDR1_16X_MODE 0x00 /* UART 16x mode           */
-#define UART_OMAP_MDR1_DISABLE  0x07 /* Disable (default state) */
-
-/* Supplementary control register */
-#define UART_OMAP_SCR     0x10
-
-/* SCR register bitmasks */
-#define OMAP_UART_SCR_RX_TRIG_GRANU1_MASK (1 << 7)
-
-/* System configuration register */
-#define OMAP_UART_SYSC_DEF_CONF 0x0d /* autoidle mode, wakeup is enabled */
-
 #endif /* __XEN_8250_UART_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:37:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:37: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 1a1XSR-00056A-Ax; Wed, 25 Nov 2015 10:37:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSQ-00055p-Cp
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:50 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	34/12-02940-D7F85565; Wed, 25 Nov 2015 10:37:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448447867!6471338!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44106 invoked from network); 25 Nov 2015 10:37:48 -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;
	25 Nov 2015 10:37:48 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSN-0006Z2-8Y
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSN-0002kK-67
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:47 +0000
Date: Wed, 25 Nov 2015 10:37:47 +0000
Message-Id: <E1a1XSN-0002kK-67@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/serial: Move any OMAP specific
	things to OMAP UART driver
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 961f129b5d88201c29967b202e0aa38081add1a6
Author:     Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
AuthorDate: Thu Nov 5 19:53:06 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:13:41 2015 +0000

    xen/serial: Move any OMAP specific things to OMAP UART driver
    
    The 8250-uart.h contains extra serial register definitions
    for the internal UARTs in TI OMAP SoCs which are used in
    OMAP UART driver only.
    In order to clean up code move these definitions to omap-uart.c.
    Also rename some definitions to follow to the UART_OMAP* prefix.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Julien Grall <julien.grall@citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/omap-uart.c |   25 ++++++++++++++++++++++---
 xen/include/xen/8250-uart.h  |   24 ------------------------
 2 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index d8f64ea..5e666d6 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -25,6 +25,25 @@
 
 #define REG_SHIFT 2
 
+/* Register offsets */
+#define UART_OMAP_EFR    0x02   /* Enhanced feature register */
+#define UART_OMAP_MDR1   0x08   /* Mode definition register 1 */
+#define UART_OMAP_SCR    0x10   /* Supplementary control register */
+#define UART_OMAP_SYSC   0x15   /* System configuration register */
+
+/* Enhanced feature register */
+#define UART_OMAP_EFR_ECB   0x10   /* Enhanced control bit */
+
+/* Mode definition register 1 */
+#define UART_OMAP_MDR1_16X_MODE   0x00   /* UART 16x mode           */
+#define UART_OMAP_MDR1_DISABLE    0x07   /* Disable (default state) */
+
+/* Supplementary control register bitmasks */
+#define UART_OMAP_SCR_RX_TRIG_GRANU1_MASK   (1 << 7)
+
+/* System configuration register */
+#define UART_OMAP_SYSC_DEF_CONF   0x0d   /* autoidle mode, wakeup is enabled */
+
 #define omap_read(uart, off)       readl((uart)->regs + (off<<REG_SHIFT))
 #define omap_write(uart, off, val) writel((val), (uart)->regs + (off<<REG_SHIFT))
 
@@ -146,7 +165,7 @@ static void fifo_setup(struct omap_uart *uart)
     /*
      * Load the new FIFO triggers and the new DMA mode bit.
      */
-    omap_write(uart, UART_OMAP_SCR, OMAP_UART_SCR_RX_TRIG_GRANU1_MASK);
+    omap_write(uart, UART_OMAP_SCR, UART_OMAP_SCR_RX_TRIG_GRANU1_MASK);
     /*
      * Restore the UART_OMAP_EFR[4] value.
      */
@@ -196,8 +215,8 @@ static void __init omap_uart_init_preirq(struct serial_port *port)
 
     omap_write(uart, UART_OMAP_MDR1, UART_OMAP_MDR1_16X_MODE);
 
-    /* setup iddle mode */
-    omap_write(uart, UART_SYSC, OMAP_UART_SYSC_DEF_CONF);
+    /* setup idle mode */
+    omap_write(uart, UART_OMAP_SYSC, UART_OMAP_SYSC_DEF_CONF);
 }
 
 static void __init omap_uart_init_postirq(struct serial_port *port)
diff --git a/xen/include/xen/8250-uart.h b/xen/include/xen/8250-uart.h
index 304b9dd..c6b62c8 100644
--- a/xen/include/xen/8250-uart.h
+++ b/xen/include/xen/8250-uart.h
@@ -32,7 +32,6 @@
 #define UART_MCR          0x04    /* Modem control        */
 #define UART_LSR          0x05    /* line status          */
 #define UART_MSR          0x06    /* Modem status         */
-#define UART_SYSC         0x15    /* System configuration register */
 #define UART_USR          0x1f    /* Status register (DW) */
 #define UART_DLL          0x00    /* divisor latch (ls) (DLAB=1) */
 #define UART_DLM          0x01    /* divisor latch (ms) (DLAB=1) */
@@ -126,29 +125,6 @@
 #define RESUME_DELAY      MILLISECS(10)
 #define RESUME_RETRIES    100
 
-/* Enhanced feature register */
-#define UART_OMAP_EFR     0x02
-
-#define UART_OMAP_EFR_ECB 0x10 /* Enhanced control bit */
-
-/* Mode definition register 1 */
-#define UART_OMAP_MDR1    0x08
-
-/*
- * These are the definitions for the MDR1 register
- */
-#define UART_OMAP_MDR1_16X_MODE 0x00 /* UART 16x mode           */
-#define UART_OMAP_MDR1_DISABLE  0x07 /* Disable (default state) */
-
-/* Supplementary control register */
-#define UART_OMAP_SCR     0x10
-
-/* SCR register bitmasks */
-#define OMAP_UART_SCR_RX_TRIG_GRANU1_MASK (1 << 7)
-
-/* System configuration register */
-#define OMAP_UART_SYSC_DEF_CONF 0x0d /* autoidle mode, wakeup is enabled */
-
 #endif /* __XEN_8250_UART_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:38:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XSa-00058O-Kv; Wed, 25 Nov 2015 10:38: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 1a1XSZ-000588-QR
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:59 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	99/BB-14900-78F85565; Wed, 25 Nov 2015 10:37:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448447877!6391608!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58536 invoked from network); 25 Nov 2015 10:37:58 -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;
	25 Nov 2015 10:37:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSX-0006ZA-Jl
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSX-0002lh-GT
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:57 +0000
Date: Wed, 25 Nov 2015 10:37:57 +0000
Message-Id: <E1a1XSX-0002lh-GT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/serial: Return actual bytes stored
	in TX FIFO for OMAP
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 618659b38cab90e300085591b2bf398dbfc66b03
Author:     Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
AuthorDate: Thu Nov 5 19:53:07 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:13:50 2015 +0000

    xen/serial: Return actual bytes stored in TX FIFO for OMAP
    
    This is intended to decrease a time spending in transmitter
    while waiting for the free space in TX FIFO.
    And as result to reduce the impact of hvc on the entire system
    running on OMAP5/DRA7XX based platforms.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Julien Grall <julien.grall@citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/omap-uart.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index 5e666d6..e96f6f5 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -29,7 +29,9 @@
 #define UART_OMAP_EFR    0x02   /* Enhanced feature register */
 #define UART_OMAP_MDR1   0x08   /* Mode definition register 1 */
 #define UART_OMAP_SCR    0x10   /* Supplementary control register */
+#define UART_OMAP_SSR    0x11   /* Supplementary status register */
 #define UART_OMAP_SYSC   0x15   /* System configuration register */
+#define UART_OMAP_TXFIFO_LVL   0x1A   /* TX FIFO level register */
 
 /* Enhanced feature register */
 #define UART_OMAP_EFR_ECB   0x10   /* Enhanced control bit */
@@ -41,6 +43,9 @@
 /* Supplementary control register bitmasks */
 #define UART_OMAP_SCR_RX_TRIG_GRANU1_MASK   (1 << 7)
 
+/* Supplementary status register bitmasks */
+#define UART_OMAP_SSR_TX_FIFO_FULL_MASK   (1 << 0)
+
 /* System configuration register */
 #define UART_OMAP_SYSC_DEF_CONF   0x0d   /* autoidle mode, wakeup is enabled */
 
@@ -252,11 +257,20 @@ static int omap_uart_tx_ready(struct serial_port *port)
 {
     struct omap_uart *uart = port->uart;
     uint32_t reg;
+    uint8_t cnt;
 
     reg = omap_read(uart, UART_IER);
     omap_write(uart, UART_IER, reg | UART_IER_ETHREI);
 
-    return omap_read(uart, UART_LSR) & UART_LSR_THRE ? uart->fifo_size : 0;
+    /* Check for empty space in TX FIFO */
+    if ( omap_read(uart, UART_OMAP_SSR) & UART_OMAP_SSR_TX_FIFO_FULL_MASK )
+        return 0;
+
+    /* Check number of data bytes stored in TX FIFO */
+    cnt = omap_read(uart, UART_OMAP_TXFIFO_LVL);
+    ASSERT( cnt >= 0 && cnt <= uart->fifo_size );
+
+    return (uart->fifo_size - cnt);
 }
 
 static void omap_uart_putc(struct serial_port *port, char c)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:38:00 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XSa-00058O-Kv; Wed, 25 Nov 2015 10:38: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 1a1XSZ-000588-QR
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:59 +0000
Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id
	99/BB-14900-78F85565; Wed, 25 Nov 2015 10:37:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448447877!6391608!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 58536 invoked from network); 25 Nov 2015 10:37:58 -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;
	25 Nov 2015 10:37:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSX-0006ZA-Jl
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSX-0002lh-GT
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:37:57 +0000
Date: Wed, 25 Nov 2015 10:37:57 +0000
Message-Id: <E1a1XSX-0002lh-GT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/serial: Return actual bytes stored
	in TX FIFO for OMAP
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 618659b38cab90e300085591b2bf398dbfc66b03
Author:     Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
AuthorDate: Thu Nov 5 19:53:07 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:13:50 2015 +0000

    xen/serial: Return actual bytes stored in TX FIFO for OMAP
    
    This is intended to decrease a time spending in transmitter
    while waiting for the free space in TX FIFO.
    And as result to reduce the impact of hvc on the entire system
    running on OMAP5/DRA7XX based platforms.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
    CC: Ian Campbell <ian.campbell@citrix.com>
    CC: Julien Grall <julien.grall@citrix.com>
    CC: Stefano Stabellini <stefano.stabellini@citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/omap-uart.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index 5e666d6..e96f6f5 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -29,7 +29,9 @@
 #define UART_OMAP_EFR    0x02   /* Enhanced feature register */
 #define UART_OMAP_MDR1   0x08   /* Mode definition register 1 */
 #define UART_OMAP_SCR    0x10   /* Supplementary control register */
+#define UART_OMAP_SSR    0x11   /* Supplementary status register */
 #define UART_OMAP_SYSC   0x15   /* System configuration register */
+#define UART_OMAP_TXFIFO_LVL   0x1A   /* TX FIFO level register */
 
 /* Enhanced feature register */
 #define UART_OMAP_EFR_ECB   0x10   /* Enhanced control bit */
@@ -41,6 +43,9 @@
 /* Supplementary control register bitmasks */
 #define UART_OMAP_SCR_RX_TRIG_GRANU1_MASK   (1 << 7)
 
+/* Supplementary status register bitmasks */
+#define UART_OMAP_SSR_TX_FIFO_FULL_MASK   (1 << 0)
+
 /* System configuration register */
 #define UART_OMAP_SYSC_DEF_CONF   0x0d   /* autoidle mode, wakeup is enabled */
 
@@ -252,11 +257,20 @@ static int omap_uart_tx_ready(struct serial_port *port)
 {
     struct omap_uart *uart = port->uart;
     uint32_t reg;
+    uint8_t cnt;
 
     reg = omap_read(uart, UART_IER);
     omap_write(uart, UART_IER, reg | UART_IER_ETHREI);
 
-    return omap_read(uart, UART_LSR) & UART_LSR_THRE ? uart->fifo_size : 0;
+    /* Check for empty space in TX FIFO */
+    if ( omap_read(uart, UART_OMAP_SSR) & UART_OMAP_SSR_TX_FIFO_FULL_MASK )
+        return 0;
+
+    /* Check number of data bytes stored in TX FIFO */
+    cnt = omap_read(uart, UART_OMAP_TXFIFO_LVL);
+    ASSERT( cnt >= 0 && cnt <= uart->fifo_size );
+
+    return (uart->fifo_size - cnt);
 }
 
 static void omap_uart_putc(struct serial_port *port, char c)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Nov 25 10:38:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XSl-0005AN-Qh; Wed, 25 Nov 2015 10:38: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 1a1XSk-00059z-Ab
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:10 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	54/6F-01748-19F85565; Wed, 25 Nov 2015 10:38:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448447888!6391661!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 61036 invoked from network); 25 Nov 2015 10:38:08 -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;
	25 Nov 2015 10:38:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSh-0006Zl-Th
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSh-0002ml-RM
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:07 +0000
Date: Wed, 25 Nov 2015 10:38:07 +0000
Message-Id: <E1a1XSh-0002ml-RM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: Quota.merge: don't assume
	domain already exists
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 82ff7cbed64e3cc094d6812b3ad672c660649969
Author:     Jonathan Davies <jonathan.davies@citrix.com>
AuthorDate: Wed Nov 11 11:21:53 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:15:58 2015 +0000

    oxenstored: Quota.merge: don't assume domain already exists
    
    In Quota.merge, we merge two quota hashtables, orig_quota and mod_quota, putting
    the results into dest_quota. These hashtables map domids to the number of
    entries currently owned by that domain.
    
    When mod_quota contains an entry for a domid that was not present in orig_quota
    (or dest_quota), the call to get_entry caused Quota.merge to raise a Not_found
    exception. This propagates back to the client as an ENOENT error, which is not
    an appropriate return value from some operations, such as transaction_end.
    
    This situation can arise when a transaction that introduces a domain (hence
    calling Quota.add_entry) needs to be coalesced due to concurrent xenstore
    activity.
    
    This patch handles the merge in the case where mod_quota contains an entry not
    present in orig_quota (or in dest_quota) by treating that hashtable as having
    existing value 0.
    
    Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/ocaml/xenstored/quota.ml |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/quota.ml b/tools/ocaml/xenstored/quota.ml
index e6953c6..abcac91 100644
--- a/tools/ocaml/xenstored/quota.ml
+++ b/tools/ocaml/xenstored/quota.ml
@@ -83,6 +83,6 @@ let add quota diff =
 	Hashtbl.iter (fun id nb -> set_entry quota id (get_entry quota id + nb)) diff.cur
 
 let merge orig_quota mod_quota dest_quota =
-	  Hashtbl.iter (fun id nb -> let diff = nb - (get_entry orig_quota id) in
+	  Hashtbl.iter (fun id nb -> let diff = nb - (try get_entry orig_quota id with Not_found -> 0) in
 				if diff <> 0 then
-					set_entry dest_quota id ((get_entry dest_quota id) + diff)) mod_quota.cur
+					set_entry dest_quota id ((try get_entry dest_quota id with Not_found -> 0) + diff)) mod_quota.cur
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:38:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XSl-0005AN-Qh; Wed, 25 Nov 2015 10:38: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 1a1XSk-00059z-Ab
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:10 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	54/6F-01748-19F85565; Wed, 25 Nov 2015 10:38:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448447888!6391661!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 61036 invoked from network); 25 Nov 2015 10:38:08 -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;
	25 Nov 2015 10:38:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSh-0006Zl-Th
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSh-0002ml-RM
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:07 +0000
Date: Wed, 25 Nov 2015 10:38:07 +0000
Message-Id: <E1a1XSh-0002ml-RM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: Quota.merge: don't assume
	domain already exists
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 82ff7cbed64e3cc094d6812b3ad672c660649969
Author:     Jonathan Davies <jonathan.davies@citrix.com>
AuthorDate: Wed Nov 11 11:21:53 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:15:58 2015 +0000

    oxenstored: Quota.merge: don't assume domain already exists
    
    In Quota.merge, we merge two quota hashtables, orig_quota and mod_quota, putting
    the results into dest_quota. These hashtables map domids to the number of
    entries currently owned by that domain.
    
    When mod_quota contains an entry for a domid that was not present in orig_quota
    (or dest_quota), the call to get_entry caused Quota.merge to raise a Not_found
    exception. This propagates back to the client as an ENOENT error, which is not
    an appropriate return value from some operations, such as transaction_end.
    
    This situation can arise when a transaction that introduces a domain (hence
    calling Quota.add_entry) needs to be coalesced due to concurrent xenstore
    activity.
    
    This patch handles the merge in the case where mod_quota contains an entry not
    present in orig_quota (or in dest_quota) by treating that hashtable as having
    existing value 0.
    
    Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/ocaml/xenstored/quota.ml |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/quota.ml b/tools/ocaml/xenstored/quota.ml
index e6953c6..abcac91 100644
--- a/tools/ocaml/xenstored/quota.ml
+++ b/tools/ocaml/xenstored/quota.ml
@@ -83,6 +83,6 @@ let add quota diff =
 	Hashtbl.iter (fun id nb -> set_entry quota id (get_entry quota id + nb)) diff.cur
 
 let merge orig_quota mod_quota dest_quota =
-	  Hashtbl.iter (fun id nb -> let diff = nb - (get_entry orig_quota id) in
+	  Hashtbl.iter (fun id nb -> let diff = nb - (try get_entry orig_quota id with Not_found -> 0) in
 				if diff <> 0 then
-					set_entry dest_quota id ((get_entry dest_quota id) + diff)) mod_quota.cur
+					set_entry dest_quota id ((try get_entry dest_quota id with Not_found -> 0) + diff)) mod_quota.cur
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:38:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XSv-0005CO-Ul; Wed, 25 Nov 2015 10:38:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSu-0005C4-Td
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:21 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	67/99-13183-C9F85565; Wed, 25 Nov 2015 10:38:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1448447898!6542574!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45746 invoked from network); 25 Nov 2015 10:38:19 -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;
	25 Nov 2015 10:38:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSs-0006Zt-H1
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSs-0002nP-4p
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:18 +0000
Date: Wed, 25 Nov 2015 10:38:18 +0000
Message-Id: <E1a1XSs-0002nP-4p@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 f046e501bbca1c8a46853b2e1f1b587e228c73de
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Nov 12 10:06:58 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:18:36 2015 +0000

    Config.mk: update OVMF changeset
    
    The new osstest tested head contains a fix for gcc-4.4 toolchain.
    
    Signed-off-by: Wei Liu <wei.liu2@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 5db7ca5..1392575 100644
--- a/Config.mk
+++ b/Config.mk
@@ -253,7 +253,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= af9785a9ed61daea52b47f0bf448f1f228beee1e
+OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
 MINIOS_UPSTREAM_REVISION ?= 256035e01a1aa5739e34f245f3b1e9e8ee204210
 # Thu Jul 23 11:08:38 2015 +0100
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:38:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XSv-0005CO-Ul; Wed, 25 Nov 2015 10:38:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSu-0005C4-Td
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:21 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	67/99-13183-C9F85565; Wed, 25 Nov 2015 10:38:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1448447898!6542574!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45746 invoked from network); 25 Nov 2015 10:38:19 -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;
	25 Nov 2015 10:38:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSs-0006Zt-H1
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XSs-0002nP-4p
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:18 +0000
Date: Wed, 25 Nov 2015 10:38:18 +0000
Message-Id: <E1a1XSs-0002nP-4p@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 f046e501bbca1c8a46853b2e1f1b587e228c73de
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Thu Nov 12 10:06:58 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:18:36 2015 +0000

    Config.mk: update OVMF changeset
    
    The new osstest tested head contains a fix for gcc-4.4 toolchain.
    
    Signed-off-by: Wei Liu <wei.liu2@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 5db7ca5..1392575 100644
--- a/Config.mk
+++ b/Config.mk
@@ -253,7 +253,7 @@ QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-traditional.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
-OVMF_UPSTREAM_REVISION ?= af9785a9ed61daea52b47f0bf448f1f228beee1e
+OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
 MINIOS_UPSTREAM_REVISION ?= 256035e01a1aa5739e34f245f3b1e9e8ee204210
 # Thu Jul 23 11:08:38 2015 +0100
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:38:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XT8-0005F8-30; Wed, 25 Nov 2015 10:38: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 1a1XT6-0005Eu-Sm
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:33 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	1C/E5-28221-8AF85565; Wed, 25 Nov 2015 10:38:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448447909!6150908!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39430 invoked from network); 25 Nov 2015 10:38:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Nov 2015 10:38:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XT2-0006a1-Ri
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XT2-0002ny-OC
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:28 +0000
Date: Wed, 25 Nov 2015 10:38:28 +0000
Message-Id: <E1a1XT2-0002ny-OC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove most of
	tools/libxc/xc_dom_compat_linux.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 512d4d960507def70329acb9bfa0da325d9b4e03
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 23 15:05:00 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:21:13 2015 +0000

    libxc: remove most of tools/libxc/xc_dom_compat_linux.c
    
    In tools/libxc/xc_dom_compat_linux.c xc_linux_build() is the only
    domain building function used by an in-tree component (qemu-xen) which
    is really necessary.
    
    Remove the other domain building functions and the unused python
    wrapper xc.linux_build() referencing one of the to be removed
    functions.
    
    Suggested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xc_dom.h      |    5 ++
 tools/libxc/include/xenguest.h    |   48 -------------
 tools/libxc/xc_dom_compat_linux.c |  141 ++++++++-----------------------------
 tools/libxl/libxl_internal.h      |    1 +
 tools/python/xen/lowlevel/xc/xc.c |   98 -------------------------
 5 files changed, 36 insertions(+), 257 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index ccc5926..6c15589 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -13,6 +13,9 @@
  * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifndef _XC_DOM_H
+#define _XC_DOM_H
+
 #include <xen/libelf/libelf.h>
 #include <xenguest.h>
 
@@ -406,6 +409,8 @@ static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
     return dom->p2m_host[pfn - dom->rambase_pfn];
 }
 
+#endif /* _XC_DOM_H */
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index ec67fbd..a9fa32c 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -151,54 +151,6 @@ int xc_linux_build(xc_interface *xch,
                    unsigned int console_evtchn,
                    unsigned long *console_mfn);
 
-/** The same interface, but the dom structure is managed by the caller */
-struct xc_dom_image;
-int xc_dom_linux_build(xc_interface *xch,
-		       struct xc_dom_image *dom,
-		       uint32_t domid,
-		       unsigned int mem_mb,
-		       const char *image_name,
-		       const char *ramdisk_name,
-		       unsigned long flags,
-		       unsigned int store_evtchn,
-		       unsigned long *store_mfn,
-		       unsigned int console_evtchn,
-		       unsigned long *console_mfn);
-
-/**
- * This function will create a domain for a paravirtualized Linux
- * using buffers for kernel and initrd
- *
- * @parm xch a handle to an open hypervisor interface
- * @parm domid the id of the domain
- * @parm mem_mb memory size in megabytes
- * @parm image_buffer buffer containing kernel image
- * @parm image_size size of the kernel image buffer
- * @parm initrd_buffer name of the ramdisk image file
- * @parm initrd_size size of the ramdisk buffer
- * @parm cmdline command line string
- * @parm flags domain creation flags
- * @parm store_evtchn the store event channel for this domain to use
- * @parm store_mfn returned with the mfn of the store page
- * @parm console_evtchn the console event channel for this domain to use
- * @parm conole_mfn returned with the mfn of the console page
- * @return 0 on success, -1 on failure
- */
-int xc_linux_build_mem(xc_interface *xch,
-                       uint32_t domid,
-                       unsigned int mem_mb,
-                       const char *image_buffer,
-                       unsigned long image_size,
-                       const char *initrd_buffer,
-                       unsigned long initrd_size,
-                       const char *cmdline,
-                       const char *features,
-                       unsigned long flags,
-                       unsigned int store_evtchn,
-                       unsigned long *store_mfn,
-                       unsigned int console_evtchn,
-                       unsigned long *console_mfn);
-
 struct xc_hvm_firmware_module {
     uint8_t  *data;
     uint32_t  length;
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index 5c1f043..20521cf 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -34,74 +34,26 @@
 
 /* ------------------------------------------------------------------------ */
 
-static int xc_linux_build_internal(struct xc_dom_image *dom,
-                                   xc_interface *xch, uint32_t domid,
-                                   unsigned int mem_mb,
-                                   unsigned long flags,
-                                   unsigned int store_evtchn,
-                                   unsigned long *store_mfn,
-                                   unsigned int console_evtchn,
-                                   unsigned long *console_mfn)
-{
-    int rc;
-
-    dom->flags = flags;
-    dom->console_evtchn = console_evtchn;
-    dom->xenstore_evtchn = store_evtchn;
-
-    if ( (rc = xc_dom_boot_xen_init(dom, xch, domid)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_parse_image(dom)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_mem_init(dom, mem_mb)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_boot_mem_init(dom)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_build_image(dom)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_boot_image(dom)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_gnttab_init(dom)) != 0)
-        goto out;
-
-    *console_mfn = xc_dom_p2m(dom, dom->console_pfn);
-    *store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);
-
- out:
-    return rc;
-}
-
-int xc_linux_build_mem(xc_interface *xch, uint32_t domid,
-                       unsigned int mem_mb,
-                       const char *image_buffer,
-                       unsigned long image_size,
-                       const char *initrd,
-                       unsigned long initrd_len,
-                       const char *cmdline,
-                       const char *features,
-                       unsigned long flags,
-                       unsigned int store_evtchn,
-                       unsigned long *store_mfn,
-                       unsigned int console_evtchn,
-                       unsigned long *console_mfn)
+int xc_get_bit_size(xc_interface *xch,
+                    const char *image_name, const char *cmdline,
+                    const char *features, int *bit_size)
 {
     struct xc_dom_image *dom;
     int rc;
-
-    xc_dom_loginit(xch);
+    *bit_size = 0;
     dom = xc_dom_allocate(xch, cmdline, features);
     if (dom == NULL)
         return -1;
-    if ( (rc = xc_dom_kernel_mem(dom, image_buffer, image_size)) != 0 )
+    if ( (rc = xc_dom_kernel_file(dom, image_name)) != 0 )
         goto out;
-    if ( initrd && ((rc = xc_dom_ramdisk_mem(dom, initrd, initrd_len)) != 0) )
+    if ( (rc = xc_dom_parse_image(dom)) != 0 )
         goto out;
-
-    rc = xc_linux_build_internal(dom, xch, domid,
-                                 mem_mb, flags,
-                                 store_evtchn, store_mfn,
-                                 console_evtchn, console_mfn);
-
+    if( dom->guest_type != NULL){
+        if(strstr(dom->guest_type, "x86_64") != NULL)
+            *bit_size = X86_64_B_SIZE; //64bit Guest
+        if(strstr(dom->guest_type, "x86_32") != NULL)
+            *bit_size = X86_32_B_SIZE; //32bit Guest
+    }
  out:
     xc_dom_release(dom);
     return rc;
@@ -132,66 +84,33 @@ int xc_linux_build(xc_interface *xch, uint32_t domid,
          ((rc = xc_dom_ramdisk_file(dom, initrd_name)) != 0) )
         goto out;
 
-    rc = xc_linux_build_internal(dom, xch, domid,
-                                 mem_mb, flags,
-                                 store_evtchn, store_mfn,
-                                 console_evtchn, console_mfn);
+    dom->flags = flags;
+    dom->console_evtchn = console_evtchn;
+    dom->xenstore_evtchn = store_evtchn;
 
- out:
-    xc_dom_release(dom);
-    return rc;
-}
-int xc_get_bit_size(xc_interface *xch,
-                    const char *image_name, const char *cmdline, 
-                    const char *features, int *bit_size)
-{
-    struct xc_dom_image *dom;
-    int rc;
-    *bit_size = 0;
-    dom = xc_dom_allocate(xch, cmdline, features);
-    if (dom == NULL)
-        return -1;
-    if ( (rc = xc_dom_kernel_file(dom, image_name)) != 0 )
+    if ( (rc = xc_dom_boot_xen_init(dom, xch, domid)) != 0 )
         goto out;
     if ( (rc = xc_dom_parse_image(dom)) != 0 )
         goto out;
-    if( dom->guest_type != NULL){
-        if(strstr(dom->guest_type, "x86_64") != NULL)
-            *bit_size = X86_64_B_SIZE; //64bit Guest 
-        if(strstr(dom->guest_type, "x86_32") != NULL)
-            *bit_size = X86_32_B_SIZE; //32bit Guest
-    }
+    if ( (rc = xc_dom_mem_init(dom, mem_mb)) != 0 )
+        goto out;
+    if ( (rc = xc_dom_boot_mem_init(dom)) != 0 )
+        goto out;
+    if ( (rc = xc_dom_build_image(dom)) != 0 )
+        goto out;
+    if ( (rc = xc_dom_boot_image(dom)) != 0 )
+        goto out;
+    if ( (rc = xc_dom_gnttab_init(dom)) != 0)
+        goto out;
+
+    *console_mfn = xc_dom_p2m(dom, dom->console_pfn);
+    *store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);
 
-out:
+ out:
     xc_dom_release(dom);
     return rc;
 }
 
-int xc_dom_linux_build(xc_interface *xch,
-                       struct xc_dom_image *dom,
-                       uint32_t domid,
-                       unsigned int mem_mb,
-                       const char *image_name,
-                       const char *initrd_name,
-                       unsigned long flags,
-                       unsigned int store_evtchn,
-                       unsigned long *store_mfn,
-                       unsigned int console_evtchn, unsigned long *console_mfn)
-{
-    int rc;
-
-    if ( (rc = xc_dom_kernel_file(dom, image_name)) != 0 )
-        return rc;
-    if ( initrd_name && strlen(initrd_name) &&
-         ((rc = xc_dom_ramdisk_file(dom, initrd_name)) != 0) )
-        return rc;
-
-    return xc_linux_build_internal(dom, xch, domid,
-                                   mem_mb, flags,
-                                   store_evtchn, store_mfn,
-                                   console_evtchn, console_mfn);
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 952b668..590870a 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -51,6 +51,7 @@
 #include <xenstore.h>
 #include <xenctrl.h>
 #include <xenguest.h>
+#include <xc_dom.h>
 
 #include "xentoollog.h"
 
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 26290a3..94f0a13 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -7,7 +7,6 @@
 #include <Python.h>
 #include <xenctrl.h>
 #include <xenguest.h>
-#include <zlib.h>
 #include <fcntl.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
@@ -17,8 +16,6 @@
 #include <netdb.h>
 #include <arpa/inet.h>
 
-#include "xenctrl.h"
-#include <xen/elfnote.h>
 #include <xen/tmem.h>
 #include "xc_dom.h"
 #include <xen/hvm/hvm_info_table.h>
@@ -454,90 +451,6 @@ static PyObject *pyxc_getBitSize(XcObject *self,
     return info_type;
 }
 
-static PyObject *pyxc_linux_build(XcObject *self,
-                                  PyObject *args,
-                                  PyObject *kwds)
-{
-    uint32_t domid;
-    struct xc_dom_image *dom;
-    char *image, *ramdisk = NULL, *cmdline = "", *features = NULL;
-    int flags = 0;
-    int store_evtchn, console_evtchn;
-    unsigned int mem_mb;
-    unsigned long store_mfn = 0;
-    unsigned long console_mfn = 0;
-    PyObject* elfnote_dict;
-    PyObject* elfnote = NULL;
-    PyObject* ret;
-    int i;
-
-    static char *kwd_list[] = { "domid", "store_evtchn", "memsize",
-                                "console_evtchn", "image",
-                                /* optional */
-                                "ramdisk", "cmdline", "flags",
-                                "features", NULL };
-
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssis", kwd_list,
-                                      &domid, &store_evtchn, &mem_mb,
-                                      &console_evtchn, &image,
-                                      /* optional */
-                                      &ramdisk, &cmdline, &flags, &features) )
-        return NULL;
-
-    xc_dom_loginit(self->xc_handle);
-    if (!(dom = xc_dom_allocate(self->xc_handle, cmdline, features)))
-        return pyxc_error_to_exception(self->xc_handle);
-
-    if ( xc_dom_linux_build(self->xc_handle, dom, domid, mem_mb, image,
-                            ramdisk, flags, store_evtchn, &store_mfn,
-                            console_evtchn, &console_mfn) != 0 ) {
-        goto out;
-    }
-
-    if ( !(elfnote_dict = PyDict_New()) )
-        goto out;
-    
-    for ( i = 0; i < ARRAY_SIZE(dom->parms.elf_notes); i++ )
-    {
-        switch ( dom->parms.elf_notes[i].type )
-        {
-        case XEN_ENT_NONE:
-            continue;
-        case XEN_ENT_LONG:
-            elfnote = Py_BuildValue("k", dom->parms.elf_notes[i].data.num);
-            break;
-        case XEN_ENT_STR:
-            elfnote = Py_BuildValue("s", dom->parms.elf_notes[i].data.str);
-            break;
-        }
-        PyDict_SetItemString(elfnote_dict,
-                             dom->parms.elf_notes[i].name,
-                             elfnote);
-        Py_DECREF(elfnote);
-    }
-
-    ret = Py_BuildValue("{s:i,s:i,s:N}",
-                        "store_mfn", store_mfn,
-                        "console_mfn", console_mfn,
-                        "notes", elfnote_dict);
-
-    if ( dom->arch_hooks->native_protocol )
-    {
-        PyObject *native_protocol =
-            Py_BuildValue("s", dom->arch_hooks->native_protocol);
-        PyDict_SetItemString(ret, "native_protocol", native_protocol);
-        Py_DECREF(native_protocol);
-    }
-
-    xc_dom_release(dom);
-
-    return ret;
-
-  out:
-    xc_dom_release(dom);
-    return pyxc_error_to_exception(self->xc_handle);
-}
-
 static PyObject *pyxc_hvm_param_get(XcObject *self,
                                     PyObject *args,
                                     PyObject *kwds)
@@ -2269,17 +2182,6 @@ static PyMethodDef pyxc_methods[] = {
       " cpumap   [int]:  Bitmap of CPUs this VCPU can run on\n"
       " cpu      [int]:  CPU that this VCPU is currently bound to\n" },
 
-    { "linux_build", 
-      (PyCFunction)pyxc_linux_build, 
-      METH_VARARGS | METH_KEYWORDS, "\n"
-      "Build a new Linux guest OS.\n"
-      " dom     [int]:      Identifier of domain to build into.\n"
-      " image   [str]:      Name of kernel image file. May be gzipped.\n"
-      " ramdisk [str, n/a]: Name of ramdisk file, if any.\n"
-      " cmdline [str, n/a]: Kernel parameters, if any.\n\n"
-      " vcpus   [int, 1]:   Number of Virtual CPUS in domain.\n\n"
-      "Returns: [int] 0 on success; -1 on error.\n" },
-
     {"getBitSize",
       (PyCFunction)pyxc_getBitSize,
       METH_VARARGS | METH_KEYWORDS, "\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 Nov 25 10:38:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XT8-0005F8-30; Wed, 25 Nov 2015 10:38: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 1a1XT6-0005Eu-Sm
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:33 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	1C/E5-28221-8AF85565; Wed, 25 Nov 2015 10:38:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448447909!6150908!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39430 invoked from network); 25 Nov 2015 10:38:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Nov 2015 10:38:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XT2-0006a1-Ri
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XT2-0002ny-OC
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:28 +0000
Date: Wed, 25 Nov 2015 10:38:28 +0000
Message-Id: <E1a1XT2-0002ny-OC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove most of
	tools/libxc/xc_dom_compat_linux.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 512d4d960507def70329acb9bfa0da325d9b4e03
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 23 15:05:00 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:21:13 2015 +0000

    libxc: remove most of tools/libxc/xc_dom_compat_linux.c
    
    In tools/libxc/xc_dom_compat_linux.c xc_linux_build() is the only
    domain building function used by an in-tree component (qemu-xen) which
    is really necessary.
    
    Remove the other domain building functions and the unused python
    wrapper xc.linux_build() referencing one of the to be removed
    functions.
    
    Suggested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xc_dom.h      |    5 ++
 tools/libxc/include/xenguest.h    |   48 -------------
 tools/libxc/xc_dom_compat_linux.c |  141 ++++++++-----------------------------
 tools/libxl/libxl_internal.h      |    1 +
 tools/python/xen/lowlevel/xc/xc.c |   98 -------------------------
 5 files changed, 36 insertions(+), 257 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index ccc5926..6c15589 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -13,6 +13,9 @@
  * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifndef _XC_DOM_H
+#define _XC_DOM_H
+
 #include <xen/libelf/libelf.h>
 #include <xenguest.h>
 
@@ -406,6 +409,8 @@ static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
     return dom->p2m_host[pfn - dom->rambase_pfn];
 }
 
+#endif /* _XC_DOM_H */
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index ec67fbd..a9fa32c 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -151,54 +151,6 @@ int xc_linux_build(xc_interface *xch,
                    unsigned int console_evtchn,
                    unsigned long *console_mfn);
 
-/** The same interface, but the dom structure is managed by the caller */
-struct xc_dom_image;
-int xc_dom_linux_build(xc_interface *xch,
-		       struct xc_dom_image *dom,
-		       uint32_t domid,
-		       unsigned int mem_mb,
-		       const char *image_name,
-		       const char *ramdisk_name,
-		       unsigned long flags,
-		       unsigned int store_evtchn,
-		       unsigned long *store_mfn,
-		       unsigned int console_evtchn,
-		       unsigned long *console_mfn);
-
-/**
- * This function will create a domain for a paravirtualized Linux
- * using buffers for kernel and initrd
- *
- * @parm xch a handle to an open hypervisor interface
- * @parm domid the id of the domain
- * @parm mem_mb memory size in megabytes
- * @parm image_buffer buffer containing kernel image
- * @parm image_size size of the kernel image buffer
- * @parm initrd_buffer name of the ramdisk image file
- * @parm initrd_size size of the ramdisk buffer
- * @parm cmdline command line string
- * @parm flags domain creation flags
- * @parm store_evtchn the store event channel for this domain to use
- * @parm store_mfn returned with the mfn of the store page
- * @parm console_evtchn the console event channel for this domain to use
- * @parm conole_mfn returned with the mfn of the console page
- * @return 0 on success, -1 on failure
- */
-int xc_linux_build_mem(xc_interface *xch,
-                       uint32_t domid,
-                       unsigned int mem_mb,
-                       const char *image_buffer,
-                       unsigned long image_size,
-                       const char *initrd_buffer,
-                       unsigned long initrd_size,
-                       const char *cmdline,
-                       const char *features,
-                       unsigned long flags,
-                       unsigned int store_evtchn,
-                       unsigned long *store_mfn,
-                       unsigned int console_evtchn,
-                       unsigned long *console_mfn);
-
 struct xc_hvm_firmware_module {
     uint8_t  *data;
     uint32_t  length;
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index 5c1f043..20521cf 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -34,74 +34,26 @@
 
 /* ------------------------------------------------------------------------ */
 
-static int xc_linux_build_internal(struct xc_dom_image *dom,
-                                   xc_interface *xch, uint32_t domid,
-                                   unsigned int mem_mb,
-                                   unsigned long flags,
-                                   unsigned int store_evtchn,
-                                   unsigned long *store_mfn,
-                                   unsigned int console_evtchn,
-                                   unsigned long *console_mfn)
-{
-    int rc;
-
-    dom->flags = flags;
-    dom->console_evtchn = console_evtchn;
-    dom->xenstore_evtchn = store_evtchn;
-
-    if ( (rc = xc_dom_boot_xen_init(dom, xch, domid)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_parse_image(dom)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_mem_init(dom, mem_mb)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_boot_mem_init(dom)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_build_image(dom)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_boot_image(dom)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_gnttab_init(dom)) != 0)
-        goto out;
-
-    *console_mfn = xc_dom_p2m(dom, dom->console_pfn);
-    *store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);
-
- out:
-    return rc;
-}
-
-int xc_linux_build_mem(xc_interface *xch, uint32_t domid,
-                       unsigned int mem_mb,
-                       const char *image_buffer,
-                       unsigned long image_size,
-                       const char *initrd,
-                       unsigned long initrd_len,
-                       const char *cmdline,
-                       const char *features,
-                       unsigned long flags,
-                       unsigned int store_evtchn,
-                       unsigned long *store_mfn,
-                       unsigned int console_evtchn,
-                       unsigned long *console_mfn)
+int xc_get_bit_size(xc_interface *xch,
+                    const char *image_name, const char *cmdline,
+                    const char *features, int *bit_size)
 {
     struct xc_dom_image *dom;
     int rc;
-
-    xc_dom_loginit(xch);
+    *bit_size = 0;
     dom = xc_dom_allocate(xch, cmdline, features);
     if (dom == NULL)
         return -1;
-    if ( (rc = xc_dom_kernel_mem(dom, image_buffer, image_size)) != 0 )
+    if ( (rc = xc_dom_kernel_file(dom, image_name)) != 0 )
         goto out;
-    if ( initrd && ((rc = xc_dom_ramdisk_mem(dom, initrd, initrd_len)) != 0) )
+    if ( (rc = xc_dom_parse_image(dom)) != 0 )
         goto out;
-
-    rc = xc_linux_build_internal(dom, xch, domid,
-                                 mem_mb, flags,
-                                 store_evtchn, store_mfn,
-                                 console_evtchn, console_mfn);
-
+    if( dom->guest_type != NULL){
+        if(strstr(dom->guest_type, "x86_64") != NULL)
+            *bit_size = X86_64_B_SIZE; //64bit Guest
+        if(strstr(dom->guest_type, "x86_32") != NULL)
+            *bit_size = X86_32_B_SIZE; //32bit Guest
+    }
  out:
     xc_dom_release(dom);
     return rc;
@@ -132,66 +84,33 @@ int xc_linux_build(xc_interface *xch, uint32_t domid,
          ((rc = xc_dom_ramdisk_file(dom, initrd_name)) != 0) )
         goto out;
 
-    rc = xc_linux_build_internal(dom, xch, domid,
-                                 mem_mb, flags,
-                                 store_evtchn, store_mfn,
-                                 console_evtchn, console_mfn);
+    dom->flags = flags;
+    dom->console_evtchn = console_evtchn;
+    dom->xenstore_evtchn = store_evtchn;
 
- out:
-    xc_dom_release(dom);
-    return rc;
-}
-int xc_get_bit_size(xc_interface *xch,
-                    const char *image_name, const char *cmdline, 
-                    const char *features, int *bit_size)
-{
-    struct xc_dom_image *dom;
-    int rc;
-    *bit_size = 0;
-    dom = xc_dom_allocate(xch, cmdline, features);
-    if (dom == NULL)
-        return -1;
-    if ( (rc = xc_dom_kernel_file(dom, image_name)) != 0 )
+    if ( (rc = xc_dom_boot_xen_init(dom, xch, domid)) != 0 )
         goto out;
     if ( (rc = xc_dom_parse_image(dom)) != 0 )
         goto out;
-    if( dom->guest_type != NULL){
-        if(strstr(dom->guest_type, "x86_64") != NULL)
-            *bit_size = X86_64_B_SIZE; //64bit Guest 
-        if(strstr(dom->guest_type, "x86_32") != NULL)
-            *bit_size = X86_32_B_SIZE; //32bit Guest
-    }
+    if ( (rc = xc_dom_mem_init(dom, mem_mb)) != 0 )
+        goto out;
+    if ( (rc = xc_dom_boot_mem_init(dom)) != 0 )
+        goto out;
+    if ( (rc = xc_dom_build_image(dom)) != 0 )
+        goto out;
+    if ( (rc = xc_dom_boot_image(dom)) != 0 )
+        goto out;
+    if ( (rc = xc_dom_gnttab_init(dom)) != 0)
+        goto out;
+
+    *console_mfn = xc_dom_p2m(dom, dom->console_pfn);
+    *store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);
 
-out:
+ out:
     xc_dom_release(dom);
     return rc;
 }
 
-int xc_dom_linux_build(xc_interface *xch,
-                       struct xc_dom_image *dom,
-                       uint32_t domid,
-                       unsigned int mem_mb,
-                       const char *image_name,
-                       const char *initrd_name,
-                       unsigned long flags,
-                       unsigned int store_evtchn,
-                       unsigned long *store_mfn,
-                       unsigned int console_evtchn, unsigned long *console_mfn)
-{
-    int rc;
-
-    if ( (rc = xc_dom_kernel_file(dom, image_name)) != 0 )
-        return rc;
-    if ( initrd_name && strlen(initrd_name) &&
-         ((rc = xc_dom_ramdisk_file(dom, initrd_name)) != 0) )
-        return rc;
-
-    return xc_linux_build_internal(dom, xch, domid,
-                                   mem_mb, flags,
-                                   store_evtchn, store_mfn,
-                                   console_evtchn, console_mfn);
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 952b668..590870a 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -51,6 +51,7 @@
 #include <xenstore.h>
 #include <xenctrl.h>
 #include <xenguest.h>
+#include <xc_dom.h>
 
 #include "xentoollog.h"
 
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 26290a3..94f0a13 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -7,7 +7,6 @@
 #include <Python.h>
 #include <xenctrl.h>
 #include <xenguest.h>
-#include <zlib.h>
 #include <fcntl.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
@@ -17,8 +16,6 @@
 #include <netdb.h>
 #include <arpa/inet.h>
 
-#include "xenctrl.h"
-#include <xen/elfnote.h>
 #include <xen/tmem.h>
 #include "xc_dom.h"
 #include <xen/hvm/hvm_info_table.h>
@@ -454,90 +451,6 @@ static PyObject *pyxc_getBitSize(XcObject *self,
     return info_type;
 }
 
-static PyObject *pyxc_linux_build(XcObject *self,
-                                  PyObject *args,
-                                  PyObject *kwds)
-{
-    uint32_t domid;
-    struct xc_dom_image *dom;
-    char *image, *ramdisk = NULL, *cmdline = "", *features = NULL;
-    int flags = 0;
-    int store_evtchn, console_evtchn;
-    unsigned int mem_mb;
-    unsigned long store_mfn = 0;
-    unsigned long console_mfn = 0;
-    PyObject* elfnote_dict;
-    PyObject* elfnote = NULL;
-    PyObject* ret;
-    int i;
-
-    static char *kwd_list[] = { "domid", "store_evtchn", "memsize",
-                                "console_evtchn", "image",
-                                /* optional */
-                                "ramdisk", "cmdline", "flags",
-                                "features", NULL };
-
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssis", kwd_list,
-                                      &domid, &store_evtchn, &mem_mb,
-                                      &console_evtchn, &image,
-                                      /* optional */
-                                      &ramdisk, &cmdline, &flags, &features) )
-        return NULL;
-
-    xc_dom_loginit(self->xc_handle);
-    if (!(dom = xc_dom_allocate(self->xc_handle, cmdline, features)))
-        return pyxc_error_to_exception(self->xc_handle);
-
-    if ( xc_dom_linux_build(self->xc_handle, dom, domid, mem_mb, image,
-                            ramdisk, flags, store_evtchn, &store_mfn,
-                            console_evtchn, &console_mfn) != 0 ) {
-        goto out;
-    }
-
-    if ( !(elfnote_dict = PyDict_New()) )
-        goto out;
-    
-    for ( i = 0; i < ARRAY_SIZE(dom->parms.elf_notes); i++ )
-    {
-        switch ( dom->parms.elf_notes[i].type )
-        {
-        case XEN_ENT_NONE:
-            continue;
-        case XEN_ENT_LONG:
-            elfnote = Py_BuildValue("k", dom->parms.elf_notes[i].data.num);
-            break;
-        case XEN_ENT_STR:
-            elfnote = Py_BuildValue("s", dom->parms.elf_notes[i].data.str);
-            break;
-        }
-        PyDict_SetItemString(elfnote_dict,
-                             dom->parms.elf_notes[i].name,
-                             elfnote);
-        Py_DECREF(elfnote);
-    }
-
-    ret = Py_BuildValue("{s:i,s:i,s:N}",
-                        "store_mfn", store_mfn,
-                        "console_mfn", console_mfn,
-                        "notes", elfnote_dict);
-
-    if ( dom->arch_hooks->native_protocol )
-    {
-        PyObject *native_protocol =
-            Py_BuildValue("s", dom->arch_hooks->native_protocol);
-        PyDict_SetItemString(ret, "native_protocol", native_protocol);
-        Py_DECREF(native_protocol);
-    }
-
-    xc_dom_release(dom);
-
-    return ret;
-
-  out:
-    xc_dom_release(dom);
-    return pyxc_error_to_exception(self->xc_handle);
-}
-
 static PyObject *pyxc_hvm_param_get(XcObject *self,
                                     PyObject *args,
                                     PyObject *kwds)
@@ -2269,17 +2182,6 @@ static PyMethodDef pyxc_methods[] = {
       " cpumap   [int]:  Bitmap of CPUs this VCPU can run on\n"
       " cpu      [int]:  CPU that this VCPU is currently bound to\n" },
 
-    { "linux_build", 
-      (PyCFunction)pyxc_linux_build, 
-      METH_VARARGS | METH_KEYWORDS, "\n"
-      "Build a new Linux guest OS.\n"
-      " dom     [int]:      Identifier of domain to build into.\n"
-      " image   [str]:      Name of kernel image file. May be gzipped.\n"
-      " ramdisk [str, n/a]: Name of ramdisk file, if any.\n"
-      " cmdline [str, n/a]: Kernel parameters, if any.\n\n"
-      " vcpus   [int, 1]:   Number of Virtual CPUS in domain.\n\n"
-      "Returns: [int] 0 on success; -1 on error.\n" },
-
     {"getBitSize",
       (PyCFunction)pyxc_getBitSize,
       METH_VARARGS | METH_KEYWORDS, "\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 Nov 25 10:38:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XTH-0005H1-7W; Wed, 25 Nov 2015 10:38: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 1a1XTF-0005Gj-DF
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:41 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	B3/3E-29649-0BF85565; Wed, 25 Nov 2015 10:38:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1448447919!6394569!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 59677 invoked from network); 25 Nov 2015 10:38:40 -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;
	25 Nov 2015 10:38:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTD-0006a9-3a
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTD-0002oZ-1u
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:39 +0000
Date: Wed, 25 Nov 2015 10:38:39 +0000
Message-Id: <E1a1XTD-0002oZ-1u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove xc_get_bit_size() from
	tools/libxc/xc_dom_compat_linux.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 2e5ed3456a017452824b1def76afbf6494ddfc7f
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 23 15:05:01 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:21:20 2015 +0000

    libxc: remove xc_get_bit_size() from tools/libxc/xc_dom_compat_linux.c
    
    xc_get_bit_size() is being used by the unused python wrapper
    xc.getBitSize() only. Remove the wrapper and xc_get_bit_size().
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xenguest.h    |    4 ----
 tools/libxc/xc_dom_compat_linux.c |   25 -------------------------
 tools/python/xen/lowlevel/xc/xc.c |   28 ----------------------------
 3 files changed, 0 insertions(+), 57 deletions(-)

diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index a9fa32c..8f918b1 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -184,10 +184,6 @@ int xc_await_suspend(xc_interface *xch, xc_evtchn *xce, int suspend_evtchn);
 int xc_suspend_evtchn_init_sane(xc_interface *xch, xc_evtchn *xce,
                                 int domid, int port, int *lockfd);
 
-int xc_get_bit_size(xc_interface *xch,
-                    const char *image_name, const char *cmdline,
-                    const char *features, int *type);
-
 int xc_mark_page_online(xc_interface *xch, unsigned long start,
                         unsigned long end, uint32_t *status);
 
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index 20521cf..abbc09f 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -34,31 +34,6 @@
 
 /* ------------------------------------------------------------------------ */
 
-int xc_get_bit_size(xc_interface *xch,
-                    const char *image_name, const char *cmdline,
-                    const char *features, int *bit_size)
-{
-    struct xc_dom_image *dom;
-    int rc;
-    *bit_size = 0;
-    dom = xc_dom_allocate(xch, cmdline, features);
-    if (dom == NULL)
-        return -1;
-    if ( (rc = xc_dom_kernel_file(dom, image_name)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_parse_image(dom)) != 0 )
-        goto out;
-    if( dom->guest_type != NULL){
-        if(strstr(dom->guest_type, "x86_64") != NULL)
-            *bit_size = X86_64_B_SIZE; //64bit Guest
-        if(strstr(dom->guest_type, "x86_32") != NULL)
-            *bit_size = X86_32_B_SIZE; //32bit Guest
-    }
- out:
-    xc_dom_release(dom);
-    return rc;
-}
-
 int xc_linux_build(xc_interface *xch, uint32_t domid,
                    unsigned int mem_mb,
                    const char *image_name,
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 94f0a13..d75f98c 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -6,7 +6,6 @@
 
 #include <Python.h>
 #include <xenctrl.h>
-#include <xenguest.h>
 #include <fcntl.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
@@ -431,26 +430,6 @@ static PyObject *pyxc_vcpu_getinfo(XcObject *self,
     return info_dict;
 }
 
-static PyObject *pyxc_getBitSize(XcObject *self,
-                                    PyObject *args,
-                                    PyObject *kwds)
-{
-    PyObject *info_type;
-    char *image = NULL, *cmdline = "", *features = NULL;
-    int type = 0;
-    static char *kwd_list[] = { "image", "cmdline", "features", NULL };
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "sss", kwd_list,
-                                      &image, &cmdline, &features) )
-        return NULL;
-
-    xc_get_bit_size(self->xc_handle, image, cmdline, features, &type);
-    if (type < 0)
-        return pyxc_error_to_exception(self->xc_handle);
-    info_type = Py_BuildValue("{s:i}",
-                              "type", type);
-    return info_type;
-}
-
 static PyObject *pyxc_hvm_param_get(XcObject *self,
                                     PyObject *args,
                                     PyObject *kwds)
@@ -2182,13 +2161,6 @@ static PyMethodDef pyxc_methods[] = {
       " cpumap   [int]:  Bitmap of CPUs this VCPU can run on\n"
       " cpu      [int]:  CPU that this VCPU is currently bound to\n" },
 
-    {"getBitSize",
-      (PyCFunction)pyxc_getBitSize,
-      METH_VARARGS | METH_KEYWORDS, "\n"
-      "Get the bitsize of a guest OS.\n"
-      " image   [str]:      Name of kernel image file. May be gzipped.\n"
-      " cmdline [str, n/a]: Kernel parameters, if any.\n\n"},
-
     { "gnttab_hvm_seed",
       (PyCFunction)pyxc_gnttab_hvm_seed,
       METH_KEYWORDS, "\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 Nov 25 10:38:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XTH-0005H1-7W; Wed, 25 Nov 2015 10:38: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 1a1XTF-0005Gj-DF
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:41 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	B3/3E-29649-0BF85565; Wed, 25 Nov 2015 10:38:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1448447919!6394569!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 59677 invoked from network); 25 Nov 2015 10:38:40 -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;
	25 Nov 2015 10:38:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTD-0006a9-3a
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTD-0002oZ-1u
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:39 +0000
Date: Wed, 25 Nov 2015 10:38:39 +0000
Message-Id: <E1a1XTD-0002oZ-1u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove xc_get_bit_size() from
	tools/libxc/xc_dom_compat_linux.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 2e5ed3456a017452824b1def76afbf6494ddfc7f
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 23 15:05:01 2015 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:21:20 2015 +0000

    libxc: remove xc_get_bit_size() from tools/libxc/xc_dom_compat_linux.c
    
    xc_get_bit_size() is being used by the unused python wrapper
    xc.getBitSize() only. Remove the wrapper and xc_get_bit_size().
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/include/xenguest.h    |    4 ----
 tools/libxc/xc_dom_compat_linux.c |   25 -------------------------
 tools/python/xen/lowlevel/xc/xc.c |   28 ----------------------------
 3 files changed, 0 insertions(+), 57 deletions(-)

diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index a9fa32c..8f918b1 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -184,10 +184,6 @@ int xc_await_suspend(xc_interface *xch, xc_evtchn *xce, int suspend_evtchn);
 int xc_suspend_evtchn_init_sane(xc_interface *xch, xc_evtchn *xce,
                                 int domid, int port, int *lockfd);
 
-int xc_get_bit_size(xc_interface *xch,
-                    const char *image_name, const char *cmdline,
-                    const char *features, int *type);
-
 int xc_mark_page_online(xc_interface *xch, unsigned long start,
                         unsigned long end, uint32_t *status);
 
diff --git a/tools/libxc/xc_dom_compat_linux.c b/tools/libxc/xc_dom_compat_linux.c
index 20521cf..abbc09f 100644
--- a/tools/libxc/xc_dom_compat_linux.c
+++ b/tools/libxc/xc_dom_compat_linux.c
@@ -34,31 +34,6 @@
 
 /* ------------------------------------------------------------------------ */
 
-int xc_get_bit_size(xc_interface *xch,
-                    const char *image_name, const char *cmdline,
-                    const char *features, int *bit_size)
-{
-    struct xc_dom_image *dom;
-    int rc;
-    *bit_size = 0;
-    dom = xc_dom_allocate(xch, cmdline, features);
-    if (dom == NULL)
-        return -1;
-    if ( (rc = xc_dom_kernel_file(dom, image_name)) != 0 )
-        goto out;
-    if ( (rc = xc_dom_parse_image(dom)) != 0 )
-        goto out;
-    if( dom->guest_type != NULL){
-        if(strstr(dom->guest_type, "x86_64") != NULL)
-            *bit_size = X86_64_B_SIZE; //64bit Guest
-        if(strstr(dom->guest_type, "x86_32") != NULL)
-            *bit_size = X86_32_B_SIZE; //32bit Guest
-    }
- out:
-    xc_dom_release(dom);
-    return rc;
-}
-
 int xc_linux_build(xc_interface *xch, uint32_t domid,
                    unsigned int mem_mb,
                    const char *image_name,
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 94f0a13..d75f98c 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -6,7 +6,6 @@
 
 #include <Python.h>
 #include <xenctrl.h>
-#include <xenguest.h>
 #include <fcntl.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
@@ -431,26 +430,6 @@ static PyObject *pyxc_vcpu_getinfo(XcObject *self,
     return info_dict;
 }
 
-static PyObject *pyxc_getBitSize(XcObject *self,
-                                    PyObject *args,
-                                    PyObject *kwds)
-{
-    PyObject *info_type;
-    char *image = NULL, *cmdline = "", *features = NULL;
-    int type = 0;
-    static char *kwd_list[] = { "image", "cmdline", "features", NULL };
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "sss", kwd_list,
-                                      &image, &cmdline, &features) )
-        return NULL;
-
-    xc_get_bit_size(self->xc_handle, image, cmdline, features, &type);
-    if (type < 0)
-        return pyxc_error_to_exception(self->xc_handle);
-    info_type = Py_BuildValue("{s:i}",
-                              "type", type);
-    return info_type;
-}
-
 static PyObject *pyxc_hvm_param_get(XcObject *self,
                                     PyObject *args,
                                     PyObject *kwds)
@@ -2182,13 +2161,6 @@ static PyMethodDef pyxc_methods[] = {
       " cpumap   [int]:  Bitmap of CPUs this VCPU can run on\n"
       " cpu      [int]:  CPU that this VCPU is currently bound to\n" },
 
-    {"getBitSize",
-      (PyCFunction)pyxc_getBitSize,
-      METH_VARARGS | METH_KEYWORDS, "\n"
-      "Get the bitsize of a guest OS.\n"
-      " image   [str]:      Name of kernel image file. May be gzipped.\n"
-      " cmdline [str, n/a]: Kernel parameters, if any.\n\n"},
-
     { "gnttab_hvm_seed",
       (PyCFunction)pyxc_gnttab_hvm_seed,
       METH_KEYWORDS, "\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 Nov 25 10:38:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XTS-0005JF-GR; Wed, 25 Nov 2015 10:38: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 1a1XTQ-0005Ir-9Q
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:52 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	F7/F2-12946-BBF85565; Wed, 25 Nov 2015 10:38:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448447929!6471717!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60272 invoked from network); 25 Nov 2015 10:38:50 -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;
	25 Nov 2015 10:38:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTN-0006aE-CE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTN-0002pC-9k
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:49 +0000
Date: Wed, 25 Nov 2015 10:38:49 +0000
Message-Id: <E1a1XTN-0002pC-9k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: relax readonly check introduced
	by XSA-142 fix
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef6cb76026628e26e3d1ae53c50ccde1c3c78b1b
Author:     Jim Fehlig <jfehlig@suse.com>
AuthorDate: Thu Nov 12 19:40:46 2015 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:23:42 2015 +0000

    libxl: relax readonly check introduced by XSA-142 fix
    
    The fix for XSA-142 is quite a big hammer, rejecting readonly
    disk configuration even when the requested backend is known to
    support readonly. While it is true that qemu doesn't support
    readonly for emulated IDE or AHCI disks
    
    $ /usr/lib/xen/bin/qemu-system-i386 \
     -drive file=/tmp/disk.raw,if=ide,media=disk,format=raw,readonly=on
    qemu-system-i386: Can't use a read-only drive
    
    $ /usr/lib/xen/bin/qemu-system-i386 -device ahci,id=ahci0 \
     -drive file=/tmp/disk.raw,if=none,id=ahcidisk-0,format=raw,readonly=on \
     -device ide-hd,bus=ahci0.0,unit=0,drive=ahcidisk-0
    qemu-system-i386: -device ide-hd,bus=ahci0.0,unit=0,drive=ahcidisk-0:
    Can't use a read-only drive
    
    It does support readonly SCSI disks
    
    $ /usr/lib/xen/bin/qemu-system-i386 \
     -drive file=/tmp/disk.raw,if=scsi,media=disk,format=raw,readonly=on
    [ok]
    
    Inside a guest using such a disk, the SCSI kernel driver sees write
    protect on
    
    [   7.339232] sd 2:0:1:0: [sdb] Write Protect is on
    
    Also, PV drivers support readonly, but the patch rejects such
    configuration even when PV drivers (vdev=xvd*) have been explicitly
    specified and creation of an emulated twin is skiped.
    
    This follow-up patch loosens the restriction to reject readonly when
    creating an emulated IDE or AHCI disk, but allows it when the backend
    is known to support readonly.
    
    Signed-off-by: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 151b6ed..175accd 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1185,12 +1185,6 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                         (gc, "file=%s,if=ide,index=%d,readonly=%s,media=cdrom,format=%s,cache=writeback,id=ide-%i",
                          disks[i].pdev_path, disk, disks[i].readwrite ? "off" : "on", format, dev_number);
             } else {
-                if (!disks[i].readwrite) {
-                    LOG(ERROR,
-                        "qemu-xen doesn't support read-only disk drivers");
-                    return ERROR_INVAL;
-                }
-
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
                     LOG(WARN, "cannot support"" empty disk format for %s",
                         disks[i].vdev);
@@ -1218,29 +1212,38 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                  * For other disks we translate devices 0..3 into
                  * hd[a-d] and ignore the rest.
                  */
-                if (strncmp(disks[i].vdev, "sd", 2) == 0)
+                if (strncmp(disks[i].vdev, "sd", 2) == 0) {
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s,cache=writeback",
-                         pdev_path, disk, format);
-                else if (strncmp(disks[i].vdev, "xvd", 3) == 0)
+                        (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s,readonly=%s,cache=writeback",
+                         pdev_path, disk, format, disks[i].readwrite ? "off" : "on");
+                } else if (strncmp(disks[i].vdev, "xvd", 3) == 0) {
                     /*
                      * Do not add any emulated disk when PV disk are
                      * explicitly asked for.
                      */
                     continue;
-                else if (disk < 6 && b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI) {
+                } else if (disk < 6 && b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI) {
+                    if (!disks[i].readwrite) {
+                        LOG(ERROR, "qemu-xen doesn't support read-only AHCI disk drivers");
+                        return ERROR_INVAL;
+                    }
                     flexarray_vappend(dm_args, "-drive",
                         GCSPRINTF("file=%s,if=none,id=ahcidisk-%d,format=%s,cache=writeback",
                         pdev_path, disk, format),
                         "-device", GCSPRINTF("ide-hd,bus=ahci0.%d,unit=0,drive=ahcidisk-%d",
                         disk, disk), NULL);
                     continue;
-                } else if (disk < 4)
+                } else if (disk < 4) {
+                    if (!disks[i].readwrite) {
+                        LOG(ERROR, "qemu-xen doesn't support read-only IDE disk drivers");
+                        return ERROR_INVAL;
+                    }
                     drive = libxl__sprintf
                         (gc, "file=%s,if=ide,index=%d,media=disk,format=%s,cache=writeback",
                          pdev_path, disk, format);
-                else
+                } else {
                     continue; /* Do not emulate this disk */
+                }
             }
 
             flexarray_append(dm_args, "-drive");
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:38:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:38: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 1a1XTS-0005JF-GR; Wed, 25 Nov 2015 10:38: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 1a1XTQ-0005Ir-9Q
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:52 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	F7/F2-12946-BBF85565; Wed, 25 Nov 2015 10:38:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448447929!6471717!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60272 invoked from network); 25 Nov 2015 10:38:50 -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;
	25 Nov 2015 10:38:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTN-0006aE-CE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTN-0002pC-9k
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:49 +0000
Date: Wed, 25 Nov 2015 10:38:49 +0000
Message-Id: <E1a1XTN-0002pC-9k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: relax readonly check introduced
	by XSA-142 fix
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef6cb76026628e26e3d1ae53c50ccde1c3c78b1b
Author:     Jim Fehlig <jfehlig@suse.com>
AuthorDate: Thu Nov 12 19:40:46 2015 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:23:42 2015 +0000

    libxl: relax readonly check introduced by XSA-142 fix
    
    The fix for XSA-142 is quite a big hammer, rejecting readonly
    disk configuration even when the requested backend is known to
    support readonly. While it is true that qemu doesn't support
    readonly for emulated IDE or AHCI disks
    
    $ /usr/lib/xen/bin/qemu-system-i386 \
     -drive file=/tmp/disk.raw,if=ide,media=disk,format=raw,readonly=on
    qemu-system-i386: Can't use a read-only drive
    
    $ /usr/lib/xen/bin/qemu-system-i386 -device ahci,id=ahci0 \
     -drive file=/tmp/disk.raw,if=none,id=ahcidisk-0,format=raw,readonly=on \
     -device ide-hd,bus=ahci0.0,unit=0,drive=ahcidisk-0
    qemu-system-i386: -device ide-hd,bus=ahci0.0,unit=0,drive=ahcidisk-0:
    Can't use a read-only drive
    
    It does support readonly SCSI disks
    
    $ /usr/lib/xen/bin/qemu-system-i386 \
     -drive file=/tmp/disk.raw,if=scsi,media=disk,format=raw,readonly=on
    [ok]
    
    Inside a guest using such a disk, the SCSI kernel driver sees write
    protect on
    
    [   7.339232] sd 2:0:1:0: [sdb] Write Protect is on
    
    Also, PV drivers support readonly, but the patch rejects such
    configuration even when PV drivers (vdev=xvd*) have been explicitly
    specified and creation of an emulated twin is skiped.
    
    This follow-up patch loosens the restriction to reject readonly when
    creating an emulated IDE or AHCI disk, but allows it when the backend
    is known to support readonly.
    
    Signed-off-by: Jim Fehlig <jfehlig@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_dm.c |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 151b6ed..175accd 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1185,12 +1185,6 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                         (gc, "file=%s,if=ide,index=%d,readonly=%s,media=cdrom,format=%s,cache=writeback,id=ide-%i",
                          disks[i].pdev_path, disk, disks[i].readwrite ? "off" : "on", format, dev_number);
             } else {
-                if (!disks[i].readwrite) {
-                    LOG(ERROR,
-                        "qemu-xen doesn't support read-only disk drivers");
-                    return ERROR_INVAL;
-                }
-
                 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) {
                     LOG(WARN, "cannot support"" empty disk format for %s",
                         disks[i].vdev);
@@ -1218,29 +1212,38 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                  * For other disks we translate devices 0..3 into
                  * hd[a-d] and ignore the rest.
                  */
-                if (strncmp(disks[i].vdev, "sd", 2) == 0)
+                if (strncmp(disks[i].vdev, "sd", 2) == 0) {
                     drive = libxl__sprintf
-                        (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s,cache=writeback",
-                         pdev_path, disk, format);
-                else if (strncmp(disks[i].vdev, "xvd", 3) == 0)
+                        (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s,readonly=%s,cache=writeback",
+                         pdev_path, disk, format, disks[i].readwrite ? "off" : "on");
+                } else if (strncmp(disks[i].vdev, "xvd", 3) == 0) {
                     /*
                      * Do not add any emulated disk when PV disk are
                      * explicitly asked for.
                      */
                     continue;
-                else if (disk < 6 && b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI) {
+                } else if (disk < 6 && b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI) {
+                    if (!disks[i].readwrite) {
+                        LOG(ERROR, "qemu-xen doesn't support read-only AHCI disk drivers");
+                        return ERROR_INVAL;
+                    }
                     flexarray_vappend(dm_args, "-drive",
                         GCSPRINTF("file=%s,if=none,id=ahcidisk-%d,format=%s,cache=writeback",
                         pdev_path, disk, format),
                         "-device", GCSPRINTF("ide-hd,bus=ahci0.%d,unit=0,drive=ahcidisk-%d",
                         disk, disk), NULL);
                     continue;
-                } else if (disk < 4)
+                } else if (disk < 4) {
+                    if (!disks[i].readwrite) {
+                        LOG(ERROR, "qemu-xen doesn't support read-only IDE disk drivers");
+                        return ERROR_INVAL;
+                    }
                     drive = libxl__sprintf
                         (gc, "file=%s,if=ide,index=%d,media=disk,format=%s,cache=writeback",
                          pdev_path, disk, format);
-                else
+                } else {
                     continue; /* Do not emulate this disk */
+                }
             }
 
             flexarray_append(dm_args, "-drive");
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:39:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39: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 1a1XTb-0005L3-LO; Wed, 25 Nov 2015 10:39:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTa-0005Kh-5M
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:02 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	BE/06-02940-5CF85565; Wed, 25 Nov 2015 10:39:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1448447939!6471959!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23084 invoked from network); 25 Nov 2015 10:39:00 -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;
	25 Nov 2015 10:39:00 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTX-0006aM-Mj
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTX-0002qG-IV
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:59 +0000
Date: Wed, 25 Nov 2015 10:38:59 +0000
Message-Id: <E1a1XTX-0002qG-IV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml/xb: Correct calculations
	of data/space the ring
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a2c11f876e6cf9c74f2bcaed5a997adc57da888
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 10 10:46:44 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:24:47 2015 +0000

    tools/ocaml/xb: Correct calculations of data/space the ring
    
    ml_interface_{read,write}() would miscalculate the quantity of
    data/space in the ring if it crossed the ring boundary, and incorrectly
    return a short read/write.
    
    This causes a protocol stall, as either side of the ring ends up waiting
    for what they believe to be the other side needing to take the next
    action.
    
    Correct the calculations to cope with crossing the ring boundary.
    
    In addition, correct the error detection.  It is a hard error if the
    producer index gets more than a ring size ahead of the consumer, or if
    the consumer ever overtakes the producer.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Reviewed-by: David Scott <dave@recoil.org>
---
 tools/ocaml/libs/xb/xs_ring_stubs.c |   64 ++++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index fd561a2..4737870 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -50,7 +50,7 @@ CAMLprim value ml_interface_read(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod; /* offsets only */
-	int to_read;
+	int total_data, data;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->req_cons;
@@ -65,19 +65,28 @@ CAMLprim value ml_interface_read(value ml_interface,
 	if ((prod - cons) > XENSTORE_RING_SIZE)
 		caml_failwith("bad connection");
 
-	if (prod == cons) {
+	/* Check for any pending data at all. */
+	total_data = prod - cons;
+	if (total_data == 0) {
+		/* No pending data at all. */
 		result = 0;
 		goto exit;
 	}
-	cons = MASK_XENSTORE_IDX(cons);
-	prod = MASK_XENSTORE_IDX(prod);
-	if (prod > cons)
-		to_read = prod - cons;
-	else
-		to_read = XENSTORE_RING_SIZE - cons;
-	if (to_read < len)
-		len = to_read;
-	memcpy(buffer, intf->req + cons, len);
+	else if (total_data < len)
+		/* Some data - make a partial read. */
+		len = total_data;
+
+	/* Check whether data crosses the end of the ring. */
+	data = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(cons);
+	if (len < data)
+		/* Data within the remaining part of the ring. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), len);
+	else {
+		/* Data crosses the ring boundary. Read both halves. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), data);
+		memcpy(buffer + data, intf->req, len - data);
+	}
+
 	xen_mb();
 	intf->req_cons += len;
 	result = len;
@@ -100,7 +109,7 @@ CAMLprim value ml_interface_write(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod;
-	int can_write;
+	int total_space, space;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->rsp_cons;
@@ -111,17 +120,32 @@ CAMLprim value ml_interface_write(value ml_interface,
 		caml_raise_constant(*caml_named_value("Xb.Reconnect"));
 
 	xen_mb();
-	if ( (prod - cons) >= XENSTORE_RING_SIZE ) {
+
+	if ((prod - cons) > XENSTORE_RING_SIZE)
+		caml_failwith("bad connection");
+
+	/* Check for space to write the full message. */
+	total_space = XENSTORE_RING_SIZE - (prod - cons);
+	if (total_space == 0) {
+		/* No space at all - exit having done nothing. */
 		result = 0;
 		goto exit;
 	}
-	if (MASK_XENSTORE_IDX(prod) >= MASK_XENSTORE_IDX(cons))
-		can_write = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
-	else 
-		can_write = MASK_XENSTORE_IDX(cons) - MASK_XENSTORE_IDX(prod);
-	if (can_write < len)
-		len = can_write;
-	memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else if (total_space < len)
+		/* Some space - make a partial write. */
+		len = total_space;
+
+	/* Check for space until the ring wraps. */
+	space = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
+	if (len < space)
+		/* Message fits inside the remaining part of the ring. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else {
+		/* Message wraps around the end of the ring. Write both halves. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, space);
+		memcpy(intf->rsp, buffer + space, len - space);
+	}
+
 	xen_mb();
 	intf->rsp_prod += len;
 	result = 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 Nov 25 10:39:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39: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 1a1XTb-0005L3-LO; Wed, 25 Nov 2015 10:39:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTa-0005Kh-5M
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:02 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	BE/06-02940-5CF85565; Wed, 25 Nov 2015 10:39:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1448447939!6471959!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23084 invoked from network); 25 Nov 2015 10:39:00 -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;
	25 Nov 2015 10:39:00 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTX-0006aM-Mj
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTX-0002qG-IV
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:38:59 +0000
Date: Wed, 25 Nov 2015 10:38:59 +0000
Message-Id: <E1a1XTX-0002qG-IV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml/xb: Correct calculations
	of data/space the ring
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8a2c11f876e6cf9c74f2bcaed5a997adc57da888
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 10 10:46:44 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:24:47 2015 +0000

    tools/ocaml/xb: Correct calculations of data/space the ring
    
    ml_interface_{read,write}() would miscalculate the quantity of
    data/space in the ring if it crossed the ring boundary, and incorrectly
    return a short read/write.
    
    This causes a protocol stall, as either side of the ring ends up waiting
    for what they believe to be the other side needing to take the next
    action.
    
    Correct the calculations to cope with crossing the ring boundary.
    
    In addition, correct the error detection.  It is a hard error if the
    producer index gets more than a ring size ahead of the consumer, or if
    the consumer ever overtakes the producer.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Reviewed-by: David Scott <dave@recoil.org>
---
 tools/ocaml/libs/xb/xs_ring_stubs.c |   64 ++++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/tools/ocaml/libs/xb/xs_ring_stubs.c b/tools/ocaml/libs/xb/xs_ring_stubs.c
index fd561a2..4737870 100644
--- a/tools/ocaml/libs/xb/xs_ring_stubs.c
+++ b/tools/ocaml/libs/xb/xs_ring_stubs.c
@@ -50,7 +50,7 @@ CAMLprim value ml_interface_read(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod; /* offsets only */
-	int to_read;
+	int total_data, data;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->req_cons;
@@ -65,19 +65,28 @@ CAMLprim value ml_interface_read(value ml_interface,
 	if ((prod - cons) > XENSTORE_RING_SIZE)
 		caml_failwith("bad connection");
 
-	if (prod == cons) {
+	/* Check for any pending data at all. */
+	total_data = prod - cons;
+	if (total_data == 0) {
+		/* No pending data at all. */
 		result = 0;
 		goto exit;
 	}
-	cons = MASK_XENSTORE_IDX(cons);
-	prod = MASK_XENSTORE_IDX(prod);
-	if (prod > cons)
-		to_read = prod - cons;
-	else
-		to_read = XENSTORE_RING_SIZE - cons;
-	if (to_read < len)
-		len = to_read;
-	memcpy(buffer, intf->req + cons, len);
+	else if (total_data < len)
+		/* Some data - make a partial read. */
+		len = total_data;
+
+	/* Check whether data crosses the end of the ring. */
+	data = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(cons);
+	if (len < data)
+		/* Data within the remaining part of the ring. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), len);
+	else {
+		/* Data crosses the ring boundary. Read both halves. */
+		memcpy(buffer, intf->req + MASK_XENSTORE_IDX(cons), data);
+		memcpy(buffer + data, intf->req, len - data);
+	}
+
 	xen_mb();
 	intf->req_cons += len;
 	result = len;
@@ -100,7 +109,7 @@ CAMLprim value ml_interface_write(value ml_interface,
 
 	struct xenstore_domain_interface *intf = interface->addr;
 	XENSTORE_RING_IDX cons, prod;
-	int can_write;
+	int total_space, space;
 	uint32_t connection;
 
 	cons = *(volatile uint32_t*)&intf->rsp_cons;
@@ -111,17 +120,32 @@ CAMLprim value ml_interface_write(value ml_interface,
 		caml_raise_constant(*caml_named_value("Xb.Reconnect"));
 
 	xen_mb();
-	if ( (prod - cons) >= XENSTORE_RING_SIZE ) {
+
+	if ((prod - cons) > XENSTORE_RING_SIZE)
+		caml_failwith("bad connection");
+
+	/* Check for space to write the full message. */
+	total_space = XENSTORE_RING_SIZE - (prod - cons);
+	if (total_space == 0) {
+		/* No space at all - exit having done nothing. */
 		result = 0;
 		goto exit;
 	}
-	if (MASK_XENSTORE_IDX(prod) >= MASK_XENSTORE_IDX(cons))
-		can_write = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
-	else 
-		can_write = MASK_XENSTORE_IDX(cons) - MASK_XENSTORE_IDX(prod);
-	if (can_write < len)
-		len = can_write;
-	memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else if (total_space < len)
+		/* Some space - make a partial write. */
+		len = total_space;
+
+	/* Check for space until the ring wraps. */
+	space = XENSTORE_RING_SIZE - MASK_XENSTORE_IDX(prod);
+	if (len < space)
+		/* Message fits inside the remaining part of the ring. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, len);
+	else {
+		/* Message wraps around the end of the ring. Write both halves. */
+		memcpy(intf->rsp + MASK_XENSTORE_IDX(prod), buffer, space);
+		memcpy(intf->rsp, buffer + space, len - space);
+	}
+
 	xen_mb();
 	intf->rsp_prod += len;
 	result = 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 Nov 25 10:39:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39: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 1a1XTk-0005Mi-Pt; Wed, 25 Nov 2015 10:39: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 1a1XTk-0005MZ-3b
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:12 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	A1/B1-30270-FCF85565; Wed, 25 Nov 2015 10:39:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448447950!6350173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6748 invoked from network); 25 Nov 2015 10:39:10 -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;
	25 Nov 2015 10:39:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTh-0006b3-Sz
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTh-0002qu-Rt
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:09 +0000
Date: Wed, 25 Nov 2015 10:39:09 +0000
Message-Id: <E1a1XTh-0002qu-Rt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MINIOS_UPSTREAM_REVISION 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 6853c9bf9ff06f7e24830ae91ca95af5f1642ca5
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Nov 16 11:29:45 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:29:45 2015 +0000

    MINIOS_UPSTREAM_REVISION Update
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1392575..76bdc88 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= 256035e01a1aa5739e34f245f3b1e9e8ee204210
-# Thu Jul 23 11:08:38 2015 +0100
-# arm: interrupt controller
+MINIOS_UPSTREAM_REVISION ?= 22d01aab99180539b38b13ba30f0e1cd62b72147
+# Tue Oct 27 15:43:28 2015 +0000
+# xenbus: notify the other end when necessary
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 # Tue Mar 17 10:52:16 2015 -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 Wed Nov 25 10:39:12 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39: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 1a1XTk-0005Mi-Pt; Wed, 25 Nov 2015 10:39: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 1a1XTk-0005MZ-3b
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:12 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	A1/B1-30270-FCF85565; Wed, 25 Nov 2015 10:39:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448447950!6350173!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6748 invoked from network); 25 Nov 2015 10:39:10 -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;
	25 Nov 2015 10:39:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTh-0006b3-Sz
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTh-0002qu-Rt
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:09 +0000
Date: Wed, 25 Nov 2015 10:39:09 +0000
Message-Id: <E1a1XTh-0002qu-Rt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MINIOS_UPSTREAM_REVISION 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 6853c9bf9ff06f7e24830ae91ca95af5f1642ca5
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Nov 16 11:29:45 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 11:29:45 2015 +0000

    MINIOS_UPSTREAM_REVISION Update
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1392575..76bdc88 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= 256035e01a1aa5739e34f245f3b1e9e8ee204210
-# Thu Jul 23 11:08:38 2015 +0100
-# arm: interrupt controller
+MINIOS_UPSTREAM_REVISION ?= 22d01aab99180539b38b13ba30f0e1cd62b72147
+# Tue Oct 27 15:43:28 2015 +0000
+# xenbus: notify the other end when necessary
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 # Tue Mar 17 10:52:16 2015 -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 Wed Nov 25 10:39:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39: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 1a1XTv-0005OX-U2; Wed, 25 Nov 2015 10:39: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 1a1XTu-0005OM-OT
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:22 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	23/73-18107-ADF85565; Wed, 25 Nov 2015 10:39:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1448447960!6346217!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1863 invoked from network); 25 Nov 2015 10:39:21 -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;
	25 Nov 2015 10:39:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTs-0006bB-4V
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTs-0002rW-2f
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:20 +0000
Date: Wed, 25 Nov 2015 10:39:20 +0000
Message-Id: <E1a1XTs-0002rW-2f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: reorganize domain builder guest
	memory allocator
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea7c8a3d0e823d4122dbe4aef40496f9f97c1449
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:28 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:51 2015 +0000

    libxc: reorganize domain builder guest memory allocator
    
    Guest memory allocation in the domain builder of libxc is done via
    virtual addresses only. In order to be able to support preallocated
    areas not virtually mapped reorganize the memory allocator to keep
    track of allocated pages globally and in allocated segments.
    
    This requires an interface change of the allocate callback of the
    domain builder which currently is using the last mapped virtual
    address as a parameter. This is no problem as the only user of this
    callback is stubdom/grub/kexec.c using this virtual address to
    calculate the last used pfn.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 stubdom/grub/kexec.c         |    6 +--
 tools/libxc/include/xc_dom.h |   13 ++---
 tools/libxc/xc_dom_core.c    |  107 ++++++++++++++++++++++++++++--------------
 3 files changed, 79 insertions(+), 47 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index 0b2f4f3..2300318 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -100,9 +100,9 @@ static void do_exchange(struct xc_dom_image *dom, xen_pfn_t target_pfn, xen_pfn_
     dom->p2m_host[target_pfn] = source_mfn;
 }
 
-int kexec_allocate(struct xc_dom_image *dom, xen_vaddr_t up_to)
+int kexec_allocate(struct xc_dom_image *dom)
 {
-    unsigned long new_allocated = (up_to - dom->parms.virt_base) / PAGE_SIZE;
+    unsigned long new_allocated = dom->pfn_alloc_end - dom->rambase_pfn;
     unsigned long i;
 
     pages = realloc(pages, new_allocated * sizeof(*pages));
@@ -319,8 +319,6 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
 
     /* Make sure the bootstrap page table does not RW-map any of our current
      * page table frames */
-    kexec_allocate(dom, dom->virt_pgtab_end);
-
     if ( (rc = xc_dom_update_guest_p2m(dom))) {
         grub_printf("xc_dom_update_guest_p2m returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 6c15589..3a0aa49 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -32,6 +32,7 @@ struct xc_dom_seg {
     xen_vaddr_t vstart;
     xen_vaddr_t vend;
     xen_pfn_t pfn;
+    xen_pfn_t pages;
 };
 
 struct xc_dom_mem {
@@ -93,6 +94,7 @@ struct xc_dom_image {
     xen_pfn_t xenstore_pfn;
     xen_pfn_t shared_info_pfn;
     xen_pfn_t bootstack_pfn;
+    xen_pfn_t pfn_alloc_end;
     xen_vaddr_t virt_alloc_end;
     xen_vaddr_t bsd_symtab_start;
 
@@ -178,8 +180,8 @@ struct xc_dom_image {
 
     /* kernel loader */
     struct xc_dom_arch *arch_hooks;
-    /* allocate up to virt_alloc_end */
-    int (*allocate) (struct xc_dom_image * dom, xen_vaddr_t up_to);
+    /* allocate up to pfn_alloc_end */
+    int (*allocate) (struct xc_dom_image * dom);
 
     /* Container type (HVM or PV). */
     enum {
@@ -363,14 +365,11 @@ static inline void *xc_dom_seg_to_ptr_pages(struct xc_dom_image *dom,
                                       struct xc_dom_seg *seg,
                                       xen_pfn_t *pages_out)
 {
-    xen_vaddr_t segsize = seg->vend - seg->vstart;
-    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
-    xen_pfn_t pages = (segsize + page_size - 1) / page_size;
     void *retval;
 
-    retval = xc_dom_pfn_to_ptr(dom, seg->pfn, pages);
+    retval = xc_dom_pfn_to_ptr(dom, seg->pfn, seg->pages);
 
-    *pages_out = retval ? pages : 0;
+    *pages_out = retval ? seg->pages : 0;
     return retval;
 }
 
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index fbe4464..a14d477 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -535,56 +535,75 @@ void *xc_dom_pfn_to_ptr_retcount(struct xc_dom_image *dom, xen_pfn_t pfn,
     return phys->ptr;
 }
 
-int xc_dom_alloc_segment(struct xc_dom_image *dom,
-                         struct xc_dom_seg *seg, char *name,
-                         xen_vaddr_t start, xen_vaddr_t size)
+static int xc_dom_chk_alloc_pages(struct xc_dom_image *dom, char *name,
+                                  xen_pfn_t pages)
 {
     unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
-    xen_pfn_t pages = (size + page_size - 1) / page_size;
-    xen_pfn_t pfn;
-    void *ptr;
 
-    if ( start == 0 )
-        start = dom->virt_alloc_end;
+    if ( pages > dom->total_pages || /* multiple test avoids overflow probs */
+         dom->pfn_alloc_end - dom->rambase_pfn > dom->total_pages ||
+         pages > dom->total_pages - dom->pfn_alloc_end + dom->rambase_pfn )
+    {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "%s: segment %s too large (0x%"PRIpfn" > "
+                     "0x%"PRIpfn" - 0x%"PRIpfn" pages)", __FUNCTION__, name,
+                     pages, dom->total_pages,
+                     dom->pfn_alloc_end - dom->rambase_pfn);
+        return -1;
+    }
+
+    dom->pfn_alloc_end += pages;
+    dom->virt_alloc_end += pages * page_size;
+
+    return 0;
+}
 
-    if ( start & (page_size - 1) )
+static int xc_dom_alloc_pad(struct xc_dom_image *dom, xen_vaddr_t boundary)
+{
+    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
+    xen_pfn_t pages;
+
+    if ( boundary & (page_size - 1) )
     {
         xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                     "%s: segment start isn't page aligned (0x%" PRIx64 ")",
-                     __FUNCTION__, start);
+                     "%s: segment boundary isn't page aligned (0x%" PRIx64 ")",
+                     __FUNCTION__, boundary);
         return -1;
     }
-    if ( start < dom->virt_alloc_end )
+    if ( boundary < dom->virt_alloc_end )
     {
         xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                     "%s: segment start too low (0x%" PRIx64 " < 0x%" PRIx64
-                     ")", __FUNCTION__, start, dom->virt_alloc_end);
+                     "%s: segment boundary too low (0x%" PRIx64 " < 0x%" PRIx64
+                     ")", __FUNCTION__, boundary, dom->virt_alloc_end);
         return -1;
     }
+    pages = (boundary - dom->virt_alloc_end) / page_size;
 
-    seg->vstart = start;
-    pfn = (seg->vstart - dom->parms.virt_base) / page_size;
-    seg->pfn = pfn + dom->rambase_pfn;
+    return xc_dom_chk_alloc_pages(dom, "padding", pages);
+}
 
-    if ( pages > dom->total_pages || /* multiple test avoids overflow probs */
-         pfn > dom->total_pages ||
-         pages > dom->total_pages - pfn)
-    {
-        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
-                     "%s: segment %s too large (0x%"PRIpfn" > "
-                     "0x%"PRIpfn" - 0x%"PRIpfn" pages)",
-                     __FUNCTION__, name, pages, dom->total_pages, pfn);
+int xc_dom_alloc_segment(struct xc_dom_image *dom,
+                         struct xc_dom_seg *seg, char *name,
+                         xen_vaddr_t start, xen_vaddr_t size)
+{
+    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
+    xen_pfn_t pages;
+    void *ptr;
+
+    if ( start && xc_dom_alloc_pad(dom, start) )
         return -1;
-    }
 
-    seg->vend = start + pages * page_size;
-    dom->virt_alloc_end = seg->vend;
-    if (dom->allocate)
-        dom->allocate(dom, dom->virt_alloc_end);
+    pages = (size + page_size - 1) / page_size;
+    start = dom->virt_alloc_end;
 
-    DOMPRINTF("%-20s:   %-12s : 0x%" PRIx64 " -> 0x%" PRIx64
-              "  (pfn 0x%" PRIpfn " + 0x%" PRIpfn " pages)",
-              __FUNCTION__, name, seg->vstart, seg->vend, seg->pfn, pages);
+    seg->pfn = dom->pfn_alloc_end;
+    seg->pages = pages;
+
+    if ( xc_dom_chk_alloc_pages(dom, name, pages) )
+        return -1;
+
+    if (dom->allocate)
+        dom->allocate(dom);
 
     /* map and clear pages */
     ptr = xc_dom_seg_to_ptr(dom, seg);
@@ -592,6 +611,13 @@ int xc_dom_alloc_segment(struct xc_dom_image *dom,
         return -1;
     memset(ptr, 0, pages * page_size);
 
+    seg->vstart = start;
+    seg->vend = dom->virt_alloc_end;
+
+    DOMPRINTF("%-20s:   %-12s : 0x%" PRIx64 " -> 0x%" PRIx64
+              "  (pfn 0x%" PRIpfn " + 0x%" PRIpfn " pages)",
+              __FUNCTION__, name, seg->vstart, seg->vend, seg->pfn, pages);
+
     return 0;
 }
 
@@ -602,10 +628,11 @@ int xc_dom_alloc_page(struct xc_dom_image *dom, char *name)
     xen_pfn_t pfn;
 
     start = dom->virt_alloc_end;
+    pfn = dom->pfn_alloc_end - dom->rambase_pfn;
     dom->virt_alloc_end += page_size;
-    if (dom->allocate)
-        dom->allocate(dom, dom->virt_alloc_end);
-    pfn = (start - dom->parms.virt_base) / page_size;
+    dom->pfn_alloc_end++;
+    if ( dom->allocate )
+        dom->allocate(dom);
 
     DOMPRINTF("%-20s:   %-12s : 0x%" PRIx64 " (pfn 0x%" PRIpfn ")",
               __FUNCTION__, name, start, pfn);
@@ -886,6 +913,7 @@ int xc_dom_parse_image(struct xc_dom_image *dom)
 int xc_dom_rambase_init(struct xc_dom_image *dom, uint64_t rambase)
 {
     dom->rambase_pfn = rambase >> XC_PAGE_SHIFT;
+    dom->pfn_alloc_end = dom->rambase_pfn;
     DOMPRINTF("%s: RAM starts at %"PRI_xen_pfn,
               __FUNCTION__, dom->rambase_pfn);
     return 0;
@@ -1013,6 +1041,8 @@ int xc_dom_build_image(struct xc_dom_image *dom)
         goto err;
     }
     page_size = XC_DOM_PAGE_SIZE(dom);
+    if ( dom->parms.virt_base != UNSET_ADDR )
+        dom->virt_alloc_end = dom->parms.virt_base;
 
     /* load kernel */
     if ( xc_dom_alloc_segment(dom, &dom->kernel_seg, "kernel",
@@ -1067,6 +1097,11 @@ int xc_dom_build_image(struct xc_dom_image *dom)
               __FUNCTION__, dom->virt_alloc_end);
     DOMPRINTF("%-20s: virt_pgtab_end : 0x%" PRIx64 "",
               __FUNCTION__, dom->virt_pgtab_end);
+
+    /* Make sure all memory mapped by initial page tables is available */
+    if ( dom->virt_pgtab_end && xc_dom_alloc_pad(dom, dom->virt_pgtab_end) )
+        return -1;
+
     return 0;
 
  err:
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:39:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39: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 1a1XTv-0005OX-U2; Wed, 25 Nov 2015 10:39: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 1a1XTu-0005OM-OT
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:22 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	23/73-18107-ADF85565; Wed, 25 Nov 2015 10:39:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1448447960!6346217!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1863 invoked from network); 25 Nov 2015 10:39:21 -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;
	25 Nov 2015 10:39:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTs-0006bB-4V
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XTs-0002rW-2f
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:20 +0000
Date: Wed, 25 Nov 2015 10:39:20 +0000
Message-Id: <E1a1XTs-0002rW-2f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: reorganize domain builder guest
	memory allocator
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea7c8a3d0e823d4122dbe4aef40496f9f97c1449
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:28 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:51 2015 +0000

    libxc: reorganize domain builder guest memory allocator
    
    Guest memory allocation in the domain builder of libxc is done via
    virtual addresses only. In order to be able to support preallocated
    areas not virtually mapped reorganize the memory allocator to keep
    track of allocated pages globally and in allocated segments.
    
    This requires an interface change of the allocate callback of the
    domain builder which currently is using the last mapped virtual
    address as a parameter. This is no problem as the only user of this
    callback is stubdom/grub/kexec.c using this virtual address to
    calculate the last used pfn.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 stubdom/grub/kexec.c         |    6 +--
 tools/libxc/include/xc_dom.h |   13 ++---
 tools/libxc/xc_dom_core.c    |  107 ++++++++++++++++++++++++++++--------------
 3 files changed, 79 insertions(+), 47 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index 0b2f4f3..2300318 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -100,9 +100,9 @@ static void do_exchange(struct xc_dom_image *dom, xen_pfn_t target_pfn, xen_pfn_
     dom->p2m_host[target_pfn] = source_mfn;
 }
 
-int kexec_allocate(struct xc_dom_image *dom, xen_vaddr_t up_to)
+int kexec_allocate(struct xc_dom_image *dom)
 {
-    unsigned long new_allocated = (up_to - dom->parms.virt_base) / PAGE_SIZE;
+    unsigned long new_allocated = dom->pfn_alloc_end - dom->rambase_pfn;
     unsigned long i;
 
     pages = realloc(pages, new_allocated * sizeof(*pages));
@@ -319,8 +319,6 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
 
     /* Make sure the bootstrap page table does not RW-map any of our current
      * page table frames */
-    kexec_allocate(dom, dom->virt_pgtab_end);
-
     if ( (rc = xc_dom_update_guest_p2m(dom))) {
         grub_printf("xc_dom_update_guest_p2m returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 6c15589..3a0aa49 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -32,6 +32,7 @@ struct xc_dom_seg {
     xen_vaddr_t vstart;
     xen_vaddr_t vend;
     xen_pfn_t pfn;
+    xen_pfn_t pages;
 };
 
 struct xc_dom_mem {
@@ -93,6 +94,7 @@ struct xc_dom_image {
     xen_pfn_t xenstore_pfn;
     xen_pfn_t shared_info_pfn;
     xen_pfn_t bootstack_pfn;
+    xen_pfn_t pfn_alloc_end;
     xen_vaddr_t virt_alloc_end;
     xen_vaddr_t bsd_symtab_start;
 
@@ -178,8 +180,8 @@ struct xc_dom_image {
 
     /* kernel loader */
     struct xc_dom_arch *arch_hooks;
-    /* allocate up to virt_alloc_end */
-    int (*allocate) (struct xc_dom_image * dom, xen_vaddr_t up_to);
+    /* allocate up to pfn_alloc_end */
+    int (*allocate) (struct xc_dom_image * dom);
 
     /* Container type (HVM or PV). */
     enum {
@@ -363,14 +365,11 @@ static inline void *xc_dom_seg_to_ptr_pages(struct xc_dom_image *dom,
                                       struct xc_dom_seg *seg,
                                       xen_pfn_t *pages_out)
 {
-    xen_vaddr_t segsize = seg->vend - seg->vstart;
-    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
-    xen_pfn_t pages = (segsize + page_size - 1) / page_size;
     void *retval;
 
-    retval = xc_dom_pfn_to_ptr(dom, seg->pfn, pages);
+    retval = xc_dom_pfn_to_ptr(dom, seg->pfn, seg->pages);
 
-    *pages_out = retval ? pages : 0;
+    *pages_out = retval ? seg->pages : 0;
     return retval;
 }
 
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index fbe4464..a14d477 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -535,56 +535,75 @@ void *xc_dom_pfn_to_ptr_retcount(struct xc_dom_image *dom, xen_pfn_t pfn,
     return phys->ptr;
 }
 
-int xc_dom_alloc_segment(struct xc_dom_image *dom,
-                         struct xc_dom_seg *seg, char *name,
-                         xen_vaddr_t start, xen_vaddr_t size)
+static int xc_dom_chk_alloc_pages(struct xc_dom_image *dom, char *name,
+                                  xen_pfn_t pages)
 {
     unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
-    xen_pfn_t pages = (size + page_size - 1) / page_size;
-    xen_pfn_t pfn;
-    void *ptr;
 
-    if ( start == 0 )
-        start = dom->virt_alloc_end;
+    if ( pages > dom->total_pages || /* multiple test avoids overflow probs */
+         dom->pfn_alloc_end - dom->rambase_pfn > dom->total_pages ||
+         pages > dom->total_pages - dom->pfn_alloc_end + dom->rambase_pfn )
+    {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "%s: segment %s too large (0x%"PRIpfn" > "
+                     "0x%"PRIpfn" - 0x%"PRIpfn" pages)", __FUNCTION__, name,
+                     pages, dom->total_pages,
+                     dom->pfn_alloc_end - dom->rambase_pfn);
+        return -1;
+    }
+
+    dom->pfn_alloc_end += pages;
+    dom->virt_alloc_end += pages * page_size;
+
+    return 0;
+}
 
-    if ( start & (page_size - 1) )
+static int xc_dom_alloc_pad(struct xc_dom_image *dom, xen_vaddr_t boundary)
+{
+    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
+    xen_pfn_t pages;
+
+    if ( boundary & (page_size - 1) )
     {
         xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                     "%s: segment start isn't page aligned (0x%" PRIx64 ")",
-                     __FUNCTION__, start);
+                     "%s: segment boundary isn't page aligned (0x%" PRIx64 ")",
+                     __FUNCTION__, boundary);
         return -1;
     }
-    if ( start < dom->virt_alloc_end )
+    if ( boundary < dom->virt_alloc_end )
     {
         xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                     "%s: segment start too low (0x%" PRIx64 " < 0x%" PRIx64
-                     ")", __FUNCTION__, start, dom->virt_alloc_end);
+                     "%s: segment boundary too low (0x%" PRIx64 " < 0x%" PRIx64
+                     ")", __FUNCTION__, boundary, dom->virt_alloc_end);
         return -1;
     }
+    pages = (boundary - dom->virt_alloc_end) / page_size;
 
-    seg->vstart = start;
-    pfn = (seg->vstart - dom->parms.virt_base) / page_size;
-    seg->pfn = pfn + dom->rambase_pfn;
+    return xc_dom_chk_alloc_pages(dom, "padding", pages);
+}
 
-    if ( pages > dom->total_pages || /* multiple test avoids overflow probs */
-         pfn > dom->total_pages ||
-         pages > dom->total_pages - pfn)
-    {
-        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
-                     "%s: segment %s too large (0x%"PRIpfn" > "
-                     "0x%"PRIpfn" - 0x%"PRIpfn" pages)",
-                     __FUNCTION__, name, pages, dom->total_pages, pfn);
+int xc_dom_alloc_segment(struct xc_dom_image *dom,
+                         struct xc_dom_seg *seg, char *name,
+                         xen_vaddr_t start, xen_vaddr_t size)
+{
+    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
+    xen_pfn_t pages;
+    void *ptr;
+
+    if ( start && xc_dom_alloc_pad(dom, start) )
         return -1;
-    }
 
-    seg->vend = start + pages * page_size;
-    dom->virt_alloc_end = seg->vend;
-    if (dom->allocate)
-        dom->allocate(dom, dom->virt_alloc_end);
+    pages = (size + page_size - 1) / page_size;
+    start = dom->virt_alloc_end;
 
-    DOMPRINTF("%-20s:   %-12s : 0x%" PRIx64 " -> 0x%" PRIx64
-              "  (pfn 0x%" PRIpfn " + 0x%" PRIpfn " pages)",
-              __FUNCTION__, name, seg->vstart, seg->vend, seg->pfn, pages);
+    seg->pfn = dom->pfn_alloc_end;
+    seg->pages = pages;
+
+    if ( xc_dom_chk_alloc_pages(dom, name, pages) )
+        return -1;
+
+    if (dom->allocate)
+        dom->allocate(dom);
 
     /* map and clear pages */
     ptr = xc_dom_seg_to_ptr(dom, seg);
@@ -592,6 +611,13 @@ int xc_dom_alloc_segment(struct xc_dom_image *dom,
         return -1;
     memset(ptr, 0, pages * page_size);
 
+    seg->vstart = start;
+    seg->vend = dom->virt_alloc_end;
+
+    DOMPRINTF("%-20s:   %-12s : 0x%" PRIx64 " -> 0x%" PRIx64
+              "  (pfn 0x%" PRIpfn " + 0x%" PRIpfn " pages)",
+              __FUNCTION__, name, seg->vstart, seg->vend, seg->pfn, pages);
+
     return 0;
 }
 
@@ -602,10 +628,11 @@ int xc_dom_alloc_page(struct xc_dom_image *dom, char *name)
     xen_pfn_t pfn;
 
     start = dom->virt_alloc_end;
+    pfn = dom->pfn_alloc_end - dom->rambase_pfn;
     dom->virt_alloc_end += page_size;
-    if (dom->allocate)
-        dom->allocate(dom, dom->virt_alloc_end);
-    pfn = (start - dom->parms.virt_base) / page_size;
+    dom->pfn_alloc_end++;
+    if ( dom->allocate )
+        dom->allocate(dom);
 
     DOMPRINTF("%-20s:   %-12s : 0x%" PRIx64 " (pfn 0x%" PRIpfn ")",
               __FUNCTION__, name, start, pfn);
@@ -886,6 +913,7 @@ int xc_dom_parse_image(struct xc_dom_image *dom)
 int xc_dom_rambase_init(struct xc_dom_image *dom, uint64_t rambase)
 {
     dom->rambase_pfn = rambase >> XC_PAGE_SHIFT;
+    dom->pfn_alloc_end = dom->rambase_pfn;
     DOMPRINTF("%s: RAM starts at %"PRI_xen_pfn,
               __FUNCTION__, dom->rambase_pfn);
     return 0;
@@ -1013,6 +1041,8 @@ int xc_dom_build_image(struct xc_dom_image *dom)
         goto err;
     }
     page_size = XC_DOM_PAGE_SIZE(dom);
+    if ( dom->parms.virt_base != UNSET_ADDR )
+        dom->virt_alloc_end = dom->parms.virt_base;
 
     /* load kernel */
     if ( xc_dom_alloc_segment(dom, &dom->kernel_seg, "kernel",
@@ -1067,6 +1097,11 @@ int xc_dom_build_image(struct xc_dom_image *dom)
               __FUNCTION__, dom->virt_alloc_end);
     DOMPRINTF("%-20s: virt_pgtab_end : 0x%" PRIx64 "",
               __FUNCTION__, dom->virt_pgtab_end);
+
+    /* Make sure all memory mapped by initial page tables is available */
+    if ( dom->virt_pgtab_end && xc_dom_alloc_pad(dom, dom->virt_pgtab_end) )
+        return -1;
+
     return 0;
 
  err:
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:39:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39: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 1a1XU6-0005R8-3j; Wed, 25 Nov 2015 10:39: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 1a1XU4-0005Qv-OM
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:32 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	D4/3F-13183-4EF85565; Wed, 25 Nov 2015 10:39:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1448447970!6413039!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13829 invoked from network); 25 Nov 2015 10:39:31 -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;
	25 Nov 2015 10:39:31 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XU2-0006bS-Dl
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XU2-0002s5-B5
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:30 +0000
Date: Wed, 25 Nov 2015 10:39:30 +0000
Message-Id: <E1a1XU2-0002s5-B5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: add generic flag to elf_dom_parms
	indicating support of unmapped initrd
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 06954411ee1410e34719bdb5df71f71d0ac11be0
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:29 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:55 2015 +0000

    xen: add generic flag to elf_dom_parms indicating support of unmapped initrd
    
    Support of an unmapped initrd is indicated by the kernel of the domain
    via elf notes. In order not to have to use raw elf data in the tools
    for support of an unmapped initrd add a flag to the parsed data area
    to indicate the kernel supporting this feature.
    
    Switch using this flag in the hypervisor domain builder.
    
    Cc: andrew.cooper3@citrix.com
    Cc: jbeulich@suse.com
    Cc: keir@xen.org
    Suggested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain_build.c        |    4 ++--
 xen/common/libelf/libelf-dominfo.c |    3 +++
 xen/include/xen/libelf.h           |    1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index c2ef87a..d02dc4b 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -353,7 +353,7 @@ static unsigned long __init compute_dom0_nr_pages(
 
         vstart = parms->virt_base;
         vend = round_pgup(parms->virt_kend);
-        if ( !parms->elf_notes[XEN_ELFNOTE_MOD_START_PFN].data.num )
+        if ( !parms->unmapped_initrd )
             vend += round_pgup(initrd_len);
         end = vend + nr_pages * sizeof_long;
 
@@ -1037,7 +1037,7 @@ int __init construct_dom0(
     v_start          = parms.virt_base;
     vkern_start      = parms.virt_kstart;
     vkern_end        = parms.virt_kend;
-    if ( parms.elf_notes[XEN_ELFNOTE_MOD_START_PFN].data.num )
+    if ( parms.unmapped_initrd )
     {
         vinitrd_start  = vinitrd_end = 0;
         vphysmap_start = round_pgup(vkern_end);
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index dacd4ba..02d6cfb 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -191,6 +191,9 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
     case XEN_ELFNOTE_INIT_P2M:
         parms->p2m_base = val;
         break;
+    case XEN_ELFNOTE_MOD_START_PFN:
+        parms->unmapped_initrd = !!val;
+        break;
     case XEN_ELFNOTE_PADDR_OFFSET:
         parms->elf_paddr_offset = val;
         break;
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index de788c7..6da4cc0 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -423,6 +423,7 @@ struct elf_dom_parms {
     char loader[16];
     enum xen_pae_type pae;
     bool bsd_symtab;
+    bool unmapped_initrd;
     uint64_t virt_base;
     uint64_t virt_entry;
     uint64_t virt_hypercall;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:39:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39: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 1a1XU6-0005R8-3j; Wed, 25 Nov 2015 10:39: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 1a1XU4-0005Qv-OM
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:32 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	D4/3F-13183-4EF85565; Wed, 25 Nov 2015 10:39:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1448447970!6413039!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13829 invoked from network); 25 Nov 2015 10:39:31 -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;
	25 Nov 2015 10:39:31 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XU2-0006bS-Dl
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XU2-0002s5-B5
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:30 +0000
Date: Wed, 25 Nov 2015 10:39:30 +0000
Message-Id: <E1a1XU2-0002s5-B5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: add generic flag to elf_dom_parms
	indicating support of unmapped initrd
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 06954411ee1410e34719bdb5df71f71d0ac11be0
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:29 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:55 2015 +0000

    xen: add generic flag to elf_dom_parms indicating support of unmapped initrd
    
    Support of an unmapped initrd is indicated by the kernel of the domain
    via elf notes. In order not to have to use raw elf data in the tools
    for support of an unmapped initrd add a flag to the parsed data area
    to indicate the kernel supporting this feature.
    
    Switch using this flag in the hypervisor domain builder.
    
    Cc: andrew.cooper3@citrix.com
    Cc: jbeulich@suse.com
    Cc: keir@xen.org
    Suggested-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain_build.c        |    4 ++--
 xen/common/libelf/libelf-dominfo.c |    3 +++
 xen/include/xen/libelf.h           |    1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index c2ef87a..d02dc4b 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -353,7 +353,7 @@ static unsigned long __init compute_dom0_nr_pages(
 
         vstart = parms->virt_base;
         vend = round_pgup(parms->virt_kend);
-        if ( !parms->elf_notes[XEN_ELFNOTE_MOD_START_PFN].data.num )
+        if ( !parms->unmapped_initrd )
             vend += round_pgup(initrd_len);
         end = vend + nr_pages * sizeof_long;
 
@@ -1037,7 +1037,7 @@ int __init construct_dom0(
     v_start          = parms.virt_base;
     vkern_start      = parms.virt_kstart;
     vkern_end        = parms.virt_kend;
-    if ( parms.elf_notes[XEN_ELFNOTE_MOD_START_PFN].data.num )
+    if ( parms.unmapped_initrd )
     {
         vinitrd_start  = vinitrd_end = 0;
         vphysmap_start = round_pgup(vkern_end);
diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c
index dacd4ba..02d6cfb 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -191,6 +191,9 @@ elf_errorstatus elf_xen_parse_note(struct elf_binary *elf,
     case XEN_ELFNOTE_INIT_P2M:
         parms->p2m_base = val;
         break;
+    case XEN_ELFNOTE_MOD_START_PFN:
+        parms->unmapped_initrd = !!val;
+        break;
     case XEN_ELFNOTE_PADDR_OFFSET:
         parms->elf_paddr_offset = val;
         break;
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index de788c7..6da4cc0 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -423,6 +423,7 @@ struct elf_dom_parms {
     char loader[16];
     enum xen_pae_type pae;
     bool bsd_symtab;
+    bool unmapped_initrd;
     uint64_t virt_base;
     uint64_t virt_entry;
     uint64_t virt_hypercall;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:39:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39: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 1a1XUG-0005St-Bt; Wed, 25 Nov 2015 10:39: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 1a1XUF-0005Sh-4c
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:43 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	56/67-22142-EEF85565; Wed, 25 Nov 2015 10:39:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448447980!6343750!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22732 invoked from network); 25 Nov 2015 10:39:41 -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;
	25 Nov 2015 10:39:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUC-0006ba-Op
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUC-0002si-Li
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:40 +0000
Date: Wed, 25 Nov 2015 10:39:40 +0000
Message-Id: <E1a1XUC-0002si-Li@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: rename domain builder
	count_pgtables to alloc_pgtables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ddb13e70225b8cd25ce6943f75f8ce928d37159c
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:30 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:55 2015 +0000

    libxc: rename domain builder count_pgtables to alloc_pgtables
    
    Rename the count_pgtables hook of the domain builder to alloc_pgtables
    and do the allocation of the guest memory for page tables inside this
    hook. This will remove the need for accessing the x86 specific pgtables
    member of struct xc_dom_image in the generic domain builder code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    2 +-
 tools/libxc/xc_dom_arm.c     |    6 +++---
 tools/libxc/xc_dom_core.c    |   11 ++---------
 tools/libxc/xc_dom_x86.c     |   26 +++++++++++++++++---------
 4 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 3a0aa49..89aaa82 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -223,7 +223,7 @@ void xc_dom_register_loader(struct xc_dom_loader *loader);
 struct xc_dom_arch {
     /* pagetable setup */
     int (*alloc_magic_pages) (struct xc_dom_image * dom);
-    int (*count_pgtables) (struct xc_dom_image * dom);
+    int (*alloc_pgtables) (struct xc_dom_image * dom);
     int (*setup_pgtables) (struct xc_dom_image * dom);
 
     /* arch-specific data structs setup */
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 397eef0..d9a6371 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -49,7 +49,7 @@ const char *xc_domain_get_native_protocol(xc_interface *xch,
  * arm guests are hybrid and start off with paging disabled, therefore no
  * pagetables and nothing to do here.
  */
-static int count_pgtables_arm(struct xc_dom_image *dom)
+static int alloc_pgtables_arm(struct xc_dom_image *dom)
 {
     DOMPRINTF_CALLED(dom->xch);
     return 0;
@@ -534,7 +534,7 @@ static struct xc_dom_arch xc_dom_32 = {
     .page_shift = PAGE_SHIFT_ARM,
     .sizeof_pfn = 8,
     .alloc_magic_pages = alloc_magic_pages,
-    .count_pgtables = count_pgtables_arm,
+    .alloc_pgtables = alloc_pgtables_arm,
     .setup_pgtables = setup_pgtables_arm,
     .start_info = start_info_arm,
     .shared_info = shared_info_arm,
@@ -550,7 +550,7 @@ static struct xc_dom_arch xc_dom_64 = {
     .page_shift = PAGE_SHIFT_ARM,
     .sizeof_pfn = 8,
     .alloc_magic_pages = alloc_magic_pages,
-    .count_pgtables = count_pgtables_arm,
+    .alloc_pgtables = alloc_pgtables_arm,
     .setup_pgtables = setup_pgtables_arm,
     .start_info = start_info_arm,
     .shared_info = shared_info_arm,
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index a14d477..74de3c3 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -1082,15 +1082,8 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     /* allocate other pages */
     if ( dom->arch_hooks->alloc_magic_pages(dom) != 0 )
         goto err;
-    if ( dom->arch_hooks->count_pgtables )
-    {
-        if ( dom->arch_hooks->count_pgtables(dom) != 0 )
-            goto err;
-        if ( (dom->pgtables > 0) &&
-             (xc_dom_alloc_segment(dom, &dom->pgtables_seg, "page tables", 0,
-                                   dom->pgtables * page_size) != 0) )
-                goto err;
-    }
+    if ( dom->arch_hooks->alloc_pgtables(dom) != 0 )
+        goto err;
     if ( dom->alloc_bootstack )
         dom->bootstack_pfn = xc_dom_alloc_page(dom, "boot stack");
     DOMPRINTF("%-20s: virt_alloc_end : 0x%" PRIx64 "",
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index ed43c28..ea32b00 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -126,7 +126,7 @@ nr_page_tables(struct xc_dom_image *dom,
     return tables;
 }
 
-static int count_pgtables(struct xc_dom_image *dom, int pae,
+static int alloc_pgtables(struct xc_dom_image *dom, int pae,
                           int l4_bits, int l3_bits, int l2_bits, int l1_bits)
 {
     int pages, extra_pages;
@@ -172,7 +172,9 @@ static int count_pgtables(struct xc_dom_image *dom, int pae,
             break;
     }
     dom->virt_pgtab_end = try_virt_end + 1;
-    return 0;
+
+    return xc_dom_alloc_segment(dom, &dom->pgtables_seg, "page tables", 0,
+                                dom->pgtables * PAGE_SIZE_X86);
 }
 
 /* ------------------------------------------------------------------------ */
@@ -182,9 +184,9 @@ static int count_pgtables(struct xc_dom_image *dom, int pae,
 #define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
 #define L3_PROT (_PAGE_PRESENT)
 
-static int count_pgtables_x86_32_pae(struct xc_dom_image *dom)
+static int alloc_pgtables_x86_32_pae(struct xc_dom_image *dom)
 {
-    return count_pgtables(dom, 1, 0, 32,
+    return alloc_pgtables(dom, 1, 0, 32,
                           L3_PAGETABLE_SHIFT_PAE, L2_PAGETABLE_SHIFT_PAE);
 }
 
@@ -355,9 +357,9 @@ pfn_error:
 /* ------------------------------------------------------------------------ */
 /* x86_64 pagetables                                                        */
 
-static int count_pgtables_x86_64(struct xc_dom_image *dom)
+static int alloc_pgtables_x86_64(struct xc_dom_image *dom)
 {
-    return count_pgtables(dom, 0,
+    return alloc_pgtables(dom, 0,
                           L4_PAGETABLE_SHIFT_X86_64 + 9,
                           L4_PAGETABLE_SHIFT_X86_64,
                           L3_PAGETABLE_SHIFT_X86_64,
@@ -1620,6 +1622,12 @@ static int bootlate_pv(struct xc_dom_image *dom)
     return 0;
 }
 
+static int alloc_pgtables_hvm(struct xc_dom_image *dom)
+{
+    DOMPRINTF("%s: doing nothing", __func__);
+    return 0;
+}
+
 static int bootlate_hvm(struct xc_dom_image *dom)
 {
     DOMPRINTF("%s: doing nothing", __func__);
@@ -1643,7 +1651,7 @@ static struct xc_dom_arch xc_dom_32_pae = {
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 4,
     .alloc_magic_pages = alloc_magic_pages,
-    .count_pgtables = count_pgtables_x86_32_pae,
+    .alloc_pgtables = alloc_pgtables_x86_32_pae,
     .setup_pgtables = setup_pgtables_x86_32_pae,
     .start_info = start_info_x86_32,
     .shared_info = shared_info_x86_32,
@@ -1659,7 +1667,7 @@ static struct xc_dom_arch xc_dom_64 = {
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 8,
     .alloc_magic_pages = alloc_magic_pages,
-    .count_pgtables = count_pgtables_x86_64,
+    .alloc_pgtables = alloc_pgtables_x86_64,
     .setup_pgtables = setup_pgtables_x86_64,
     .start_info = start_info_x86_64,
     .shared_info = shared_info_x86_64,
@@ -1675,7 +1683,7 @@ static struct xc_dom_arch xc_hvm_32 = {
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 4,
     .alloc_magic_pages = alloc_magic_pages_hvm,
-    .count_pgtables = NULL,
+    .alloc_pgtables = alloc_pgtables_hvm,
     .setup_pgtables = NULL,
     .start_info = NULL,
     .shared_info = 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 Nov 25 10:39:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39: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 1a1XUG-0005St-Bt; Wed, 25 Nov 2015 10:39: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 1a1XUF-0005Sh-4c
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:43 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	56/67-22142-EEF85565; Wed, 25 Nov 2015 10:39:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448447980!6343750!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22732 invoked from network); 25 Nov 2015 10:39:41 -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;
	25 Nov 2015 10:39:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUC-0006ba-Op
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUC-0002si-Li
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:40 +0000
Date: Wed, 25 Nov 2015 10:39:40 +0000
Message-Id: <E1a1XUC-0002si-Li@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: rename domain builder
	count_pgtables to alloc_pgtables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ddb13e70225b8cd25ce6943f75f8ce928d37159c
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:30 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:55 2015 +0000

    libxc: rename domain builder count_pgtables to alloc_pgtables
    
    Rename the count_pgtables hook of the domain builder to alloc_pgtables
    and do the allocation of the guest memory for page tables inside this
    hook. This will remove the need for accessing the x86 specific pgtables
    member of struct xc_dom_image in the generic domain builder code.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    2 +-
 tools/libxc/xc_dom_arm.c     |    6 +++---
 tools/libxc/xc_dom_core.c    |   11 ++---------
 tools/libxc/xc_dom_x86.c     |   26 +++++++++++++++++---------
 4 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 3a0aa49..89aaa82 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -223,7 +223,7 @@ void xc_dom_register_loader(struct xc_dom_loader *loader);
 struct xc_dom_arch {
     /* pagetable setup */
     int (*alloc_magic_pages) (struct xc_dom_image * dom);
-    int (*count_pgtables) (struct xc_dom_image * dom);
+    int (*alloc_pgtables) (struct xc_dom_image * dom);
     int (*setup_pgtables) (struct xc_dom_image * dom);
 
     /* arch-specific data structs setup */
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 397eef0..d9a6371 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -49,7 +49,7 @@ const char *xc_domain_get_native_protocol(xc_interface *xch,
  * arm guests are hybrid and start off with paging disabled, therefore no
  * pagetables and nothing to do here.
  */
-static int count_pgtables_arm(struct xc_dom_image *dom)
+static int alloc_pgtables_arm(struct xc_dom_image *dom)
 {
     DOMPRINTF_CALLED(dom->xch);
     return 0;
@@ -534,7 +534,7 @@ static struct xc_dom_arch xc_dom_32 = {
     .page_shift = PAGE_SHIFT_ARM,
     .sizeof_pfn = 8,
     .alloc_magic_pages = alloc_magic_pages,
-    .count_pgtables = count_pgtables_arm,
+    .alloc_pgtables = alloc_pgtables_arm,
     .setup_pgtables = setup_pgtables_arm,
     .start_info = start_info_arm,
     .shared_info = shared_info_arm,
@@ -550,7 +550,7 @@ static struct xc_dom_arch xc_dom_64 = {
     .page_shift = PAGE_SHIFT_ARM,
     .sizeof_pfn = 8,
     .alloc_magic_pages = alloc_magic_pages,
-    .count_pgtables = count_pgtables_arm,
+    .alloc_pgtables = alloc_pgtables_arm,
     .setup_pgtables = setup_pgtables_arm,
     .start_info = start_info_arm,
     .shared_info = shared_info_arm,
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index a14d477..74de3c3 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -1082,15 +1082,8 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     /* allocate other pages */
     if ( dom->arch_hooks->alloc_magic_pages(dom) != 0 )
         goto err;
-    if ( dom->arch_hooks->count_pgtables )
-    {
-        if ( dom->arch_hooks->count_pgtables(dom) != 0 )
-            goto err;
-        if ( (dom->pgtables > 0) &&
-             (xc_dom_alloc_segment(dom, &dom->pgtables_seg, "page tables", 0,
-                                   dom->pgtables * page_size) != 0) )
-                goto err;
-    }
+    if ( dom->arch_hooks->alloc_pgtables(dom) != 0 )
+        goto err;
     if ( dom->alloc_bootstack )
         dom->bootstack_pfn = xc_dom_alloc_page(dom, "boot stack");
     DOMPRINTF("%-20s: virt_alloc_end : 0x%" PRIx64 "",
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index ed43c28..ea32b00 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -126,7 +126,7 @@ nr_page_tables(struct xc_dom_image *dom,
     return tables;
 }
 
-static int count_pgtables(struct xc_dom_image *dom, int pae,
+static int alloc_pgtables(struct xc_dom_image *dom, int pae,
                           int l4_bits, int l3_bits, int l2_bits, int l1_bits)
 {
     int pages, extra_pages;
@@ -172,7 +172,9 @@ static int count_pgtables(struct xc_dom_image *dom, int pae,
             break;
     }
     dom->virt_pgtab_end = try_virt_end + 1;
-    return 0;
+
+    return xc_dom_alloc_segment(dom, &dom->pgtables_seg, "page tables", 0,
+                                dom->pgtables * PAGE_SIZE_X86);
 }
 
 /* ------------------------------------------------------------------------ */
@@ -182,9 +184,9 @@ static int count_pgtables(struct xc_dom_image *dom, int pae,
 #define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
 #define L3_PROT (_PAGE_PRESENT)
 
-static int count_pgtables_x86_32_pae(struct xc_dom_image *dom)
+static int alloc_pgtables_x86_32_pae(struct xc_dom_image *dom)
 {
-    return count_pgtables(dom, 1, 0, 32,
+    return alloc_pgtables(dom, 1, 0, 32,
                           L3_PAGETABLE_SHIFT_PAE, L2_PAGETABLE_SHIFT_PAE);
 }
 
@@ -355,9 +357,9 @@ pfn_error:
 /* ------------------------------------------------------------------------ */
 /* x86_64 pagetables                                                        */
 
-static int count_pgtables_x86_64(struct xc_dom_image *dom)
+static int alloc_pgtables_x86_64(struct xc_dom_image *dom)
 {
-    return count_pgtables(dom, 0,
+    return alloc_pgtables(dom, 0,
                           L4_PAGETABLE_SHIFT_X86_64 + 9,
                           L4_PAGETABLE_SHIFT_X86_64,
                           L3_PAGETABLE_SHIFT_X86_64,
@@ -1620,6 +1622,12 @@ static int bootlate_pv(struct xc_dom_image *dom)
     return 0;
 }
 
+static int alloc_pgtables_hvm(struct xc_dom_image *dom)
+{
+    DOMPRINTF("%s: doing nothing", __func__);
+    return 0;
+}
+
 static int bootlate_hvm(struct xc_dom_image *dom)
 {
     DOMPRINTF("%s: doing nothing", __func__);
@@ -1643,7 +1651,7 @@ static struct xc_dom_arch xc_dom_32_pae = {
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 4,
     .alloc_magic_pages = alloc_magic_pages,
-    .count_pgtables = count_pgtables_x86_32_pae,
+    .alloc_pgtables = alloc_pgtables_x86_32_pae,
     .setup_pgtables = setup_pgtables_x86_32_pae,
     .start_info = start_info_x86_32,
     .shared_info = shared_info_x86_32,
@@ -1659,7 +1667,7 @@ static struct xc_dom_arch xc_dom_64 = {
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 8,
     .alloc_magic_pages = alloc_magic_pages,
-    .count_pgtables = count_pgtables_x86_64,
+    .alloc_pgtables = alloc_pgtables_x86_64,
     .setup_pgtables = setup_pgtables_x86_64,
     .start_info = start_info_x86_64,
     .shared_info = shared_info_x86_64,
@@ -1675,7 +1683,7 @@ static struct xc_dom_arch xc_hvm_32 = {
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 4,
     .alloc_magic_pages = alloc_magic_pages_hvm,
-    .count_pgtables = NULL,
+    .alloc_pgtables = alloc_pgtables_hvm,
     .setup_pgtables = NULL,
     .start_info = NULL,
     .shared_info = 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 Nov 25 10:39:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XUT-0005Us-5U; Wed, 25 Nov 2015 10:39:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUS-0005Ua-2K
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:56 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	EB/CF-21201-BFF85565; Wed, 25 Nov 2015 10:39:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1448447991!6340499!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64549 invoked from network); 25 Nov 2015 10:39:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Nov 2015 10:39:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUN-0006bm-1d
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUM-0002tl-WD
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:51 +0000
Date: Wed, 25 Nov 2015 10:39:50 +0000
Message-Id: <E1a1XUM-0002tl-WD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: introduce domain builder
	architecture specific data
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f3627f009a7b58c1b98da3221302c01abe8e7786
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:31 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:56 2015 +0000

    libxc: introduce domain builder architecture specific data
    
    Reorganize struct xc_dom_image to contain a pointer to domain builder
    architecture specific private data. This will abstract the architecture
    or domain type specific data from the general used data.
    
    The new area is allocated as soon as the domain type is known.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 stubdom/grub/kexec.c         |    6 +++++-
 tools/libxc/include/xc_dom.h |    6 +++++-
 tools/libxc/xc_dom_core.c    |   27 +++++++++++++++++++--------
 3 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index 2300318..8fd9ff9 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -272,7 +272,11 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
 #endif
 
     /* equivalent of xc_dom_mem_init */
-    dom->arch_hooks = xc_dom_find_arch_hooks(xc_handle, dom->guest_type);
+    if (xc_dom_set_arch_hooks(dom)) {
+        grub_printf("xc_dom_set_arch_hooks failed\n");
+        errnum = ERR_EXEC_FORMAT;
+        goto out;
+    }
     dom->total_pages = start_info.nr_pages;
 
     /* equivalent of arch_setup_meminit */
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 89aaa82..47f08fa 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -178,6 +178,9 @@ struct xc_dom_image {
     unsigned int *vnode_to_pnode;
     unsigned int nr_vnodes;
 
+    /* domain type/architecture specific data */
+    void *arch_private;
+
     /* kernel loader */
     struct xc_dom_arch *arch_hooks;
     /* allocate up to pfn_alloc_end */
@@ -240,6 +243,7 @@ struct xc_dom_arch {
     char *native_protocol;
     int page_shift;
     int sizeof_pfn;
+    int arch_private_size;
 
     struct xc_dom_arch *next;
 };
@@ -293,7 +297,7 @@ int xc_dom_devicetree_mem(struct xc_dom_image *dom, const void *mem,
                           size_t memsize);
 
 int xc_dom_parse_image(struct xc_dom_image *dom);
-struct xc_dom_arch *xc_dom_find_arch_hooks(xc_interface *xch, char *guest_type);
+int xc_dom_set_arch_hooks(struct xc_dom_image *dom);
 int xc_dom_build_image(struct xc_dom_image *dom);
 int xc_dom_update_guest_p2m(struct xc_dom_image *dom);
 
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 74de3c3..3a31222 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -710,19 +710,30 @@ void xc_dom_register_arch_hooks(struct xc_dom_arch *hooks)
     first_hook = hooks;
 }
 
-struct xc_dom_arch *xc_dom_find_arch_hooks(xc_interface *xch, char *guest_type)
+int xc_dom_set_arch_hooks(struct xc_dom_image *dom)
 {
     struct xc_dom_arch *hooks = first_hook;
 
     while (  hooks != NULL )
     {
-        if ( !strcmp(hooks->guest_type, guest_type))
-            return hooks;
+        if ( !strcmp(hooks->guest_type, dom->guest_type) )
+        {
+            if ( hooks->arch_private_size )
+            {
+                dom->arch_private = malloc(hooks->arch_private_size);
+                if ( dom->arch_private == NULL )
+                    return -1;
+                memset(dom->arch_private, 0, hooks->arch_private_size);
+                dom->alloc_malloc += hooks->arch_private_size;
+            }
+            dom->arch_hooks = hooks;
+            return 0;
+        }
         hooks = hooks->next;
     }
-    xc_dom_panic(xch, XC_INVALID_KERNEL,
-                 "%s: not found (type %s)", __FUNCTION__, guest_type);
-    return NULL;
+    xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                 "%s: not found (type %s)", __FUNCTION__, dom->guest_type);
+    return -1;
 }
 
 /* ------------------------------------------------------------------------ */
@@ -734,6 +745,7 @@ void xc_dom_release(struct xc_dom_image *dom)
     if ( dom->phys_pages )
         xc_dom_unmap_all(dom);
     xc_dom_free_all(dom);
+    free(dom->arch_private);
     free(dom);
 }
 
@@ -924,8 +936,7 @@ int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb)
     unsigned int page_shift;
     xen_pfn_t nr_pages;
 
-    dom->arch_hooks = xc_dom_find_arch_hooks(dom->xch, dom->guest_type);
-    if ( dom->arch_hooks == NULL )
+    if ( xc_dom_set_arch_hooks(dom) )
     {
         xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, "%s: arch hooks not set",
                      __FUNCTION__);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:39:57 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:39:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a1XUT-0005Us-5U; Wed, 25 Nov 2015 10:39:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUS-0005Ua-2K
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:56 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	EB/CF-21201-BFF85565; Wed, 25 Nov 2015 10:39:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1448447991!6340499!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64549 invoked from network); 25 Nov 2015 10:39:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Nov 2015 10:39:52 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUN-0006bm-1d
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUM-0002tl-WD
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:39:51 +0000
Date: Wed, 25 Nov 2015 10:39:50 +0000
Message-Id: <E1a1XUM-0002tl-WD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: introduce domain builder
	architecture specific data
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f3627f009a7b58c1b98da3221302c01abe8e7786
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:31 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:56 2015 +0000

    libxc: introduce domain builder architecture specific data
    
    Reorganize struct xc_dom_image to contain a pointer to domain builder
    architecture specific private data. This will abstract the architecture
    or domain type specific data from the general used data.
    
    The new area is allocated as soon as the domain type is known.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 stubdom/grub/kexec.c         |    6 +++++-
 tools/libxc/include/xc_dom.h |    6 +++++-
 tools/libxc/xc_dom_core.c    |   27 +++++++++++++++++++--------
 3 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index 2300318..8fd9ff9 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -272,7 +272,11 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
 #endif
 
     /* equivalent of xc_dom_mem_init */
-    dom->arch_hooks = xc_dom_find_arch_hooks(xc_handle, dom->guest_type);
+    if (xc_dom_set_arch_hooks(dom)) {
+        grub_printf("xc_dom_set_arch_hooks failed\n");
+        errnum = ERR_EXEC_FORMAT;
+        goto out;
+    }
     dom->total_pages = start_info.nr_pages;
 
     /* equivalent of arch_setup_meminit */
diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 89aaa82..47f08fa 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -178,6 +178,9 @@ struct xc_dom_image {
     unsigned int *vnode_to_pnode;
     unsigned int nr_vnodes;
 
+    /* domain type/architecture specific data */
+    void *arch_private;
+
     /* kernel loader */
     struct xc_dom_arch *arch_hooks;
     /* allocate up to pfn_alloc_end */
@@ -240,6 +243,7 @@ struct xc_dom_arch {
     char *native_protocol;
     int page_shift;
     int sizeof_pfn;
+    int arch_private_size;
 
     struct xc_dom_arch *next;
 };
@@ -293,7 +297,7 @@ int xc_dom_devicetree_mem(struct xc_dom_image *dom, const void *mem,
                           size_t memsize);
 
 int xc_dom_parse_image(struct xc_dom_image *dom);
-struct xc_dom_arch *xc_dom_find_arch_hooks(xc_interface *xch, char *guest_type);
+int xc_dom_set_arch_hooks(struct xc_dom_image *dom);
 int xc_dom_build_image(struct xc_dom_image *dom);
 int xc_dom_update_guest_p2m(struct xc_dom_image *dom);
 
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 74de3c3..3a31222 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -710,19 +710,30 @@ void xc_dom_register_arch_hooks(struct xc_dom_arch *hooks)
     first_hook = hooks;
 }
 
-struct xc_dom_arch *xc_dom_find_arch_hooks(xc_interface *xch, char *guest_type)
+int xc_dom_set_arch_hooks(struct xc_dom_image *dom)
 {
     struct xc_dom_arch *hooks = first_hook;
 
     while (  hooks != NULL )
     {
-        if ( !strcmp(hooks->guest_type, guest_type))
-            return hooks;
+        if ( !strcmp(hooks->guest_type, dom->guest_type) )
+        {
+            if ( hooks->arch_private_size )
+            {
+                dom->arch_private = malloc(hooks->arch_private_size);
+                if ( dom->arch_private == NULL )
+                    return -1;
+                memset(dom->arch_private, 0, hooks->arch_private_size);
+                dom->alloc_malloc += hooks->arch_private_size;
+            }
+            dom->arch_hooks = hooks;
+            return 0;
+        }
         hooks = hooks->next;
     }
-    xc_dom_panic(xch, XC_INVALID_KERNEL,
-                 "%s: not found (type %s)", __FUNCTION__, guest_type);
-    return NULL;
+    xc_dom_panic(dom->xch, XC_INVALID_KERNEL,
+                 "%s: not found (type %s)", __FUNCTION__, dom->guest_type);
+    return -1;
 }
 
 /* ------------------------------------------------------------------------ */
@@ -734,6 +745,7 @@ void xc_dom_release(struct xc_dom_image *dom)
     if ( dom->phys_pages )
         xc_dom_unmap_all(dom);
     xc_dom_free_all(dom);
+    free(dom->arch_private);
     free(dom);
 }
 
@@ -924,8 +936,7 @@ int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb)
     unsigned int page_shift;
     xen_pfn_t nr_pages;
 
-    dom->arch_hooks = xc_dom_find_arch_hooks(dom->xch, dom->guest_type);
-    if ( dom->arch_hooks == NULL )
+    if ( xc_dom_set_arch_hooks(dom) )
     {
         xc_dom_panic(dom->xch, XC_INTERNAL_ERROR, "%s: arch hooks not set",
                      __FUNCTION__);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:40:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:40: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 1a1XUe-0005Xk-AV; Wed, 25 Nov 2015 10:40: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 1a1XUd-0005XO-Au
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:07 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	42/A3-32615-60095565; Wed, 25 Nov 2015 10:40:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1448448004!6327476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31590 invoked from network); 25 Nov 2015 10:40: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;
	25 Nov 2015 10:40:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUX-0006bw-AJ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUX-0002v0-6X
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:01 +0000
Date: Wed, 25 Nov 2015 10:40:01 +0000
Message-Id: <E1a1XUX-0002v0-6X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: use domain builder architecture
	private data for x86 pv domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8db3c7db92ddf1049c69dbf22ef06786d280498
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:32 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:56 2015 +0000

    libxc: use domain builder architecture private data for x86 pv domains
    
    Move some data private to the x86 domain builder to the private data
    section. Remove extra_pages as they are used nowhere.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    8 -------
 tools/libxc/xc_dom_x86.c     |   48 ++++++++++++++++++++++++++++--------------
 2 files changed, 32 insertions(+), 24 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 47f08fa..f046ec5 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -97,15 +97,7 @@ struct xc_dom_image {
     xen_pfn_t pfn_alloc_end;
     xen_vaddr_t virt_alloc_end;
     xen_vaddr_t bsd_symtab_start;
-
-    /* initial page tables */
-    unsigned int pgtables;
-    unsigned int pg_l4;
-    unsigned int pg_l3;
-    unsigned int pg_l2;
-    unsigned int pg_l1;
     unsigned int alloc_bootstack;
-    unsigned int extra_pages;
     xen_vaddr_t virt_pgtab_end;
 
     /* other state info */
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index ea32b00..aba50df 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -69,6 +69,15 @@
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask)     ((addr) | (mask))
 
+struct xc_dom_image_x86 {
+    /* initial page tables */
+    unsigned int pgtables;
+    unsigned int pg_l4;
+    unsigned int pg_l3;
+    unsigned int pg_l2;
+    unsigned int pg_l1;
+};
+
 /* get guest IO ABI protocol */
 const char *xc_domain_get_native_protocol(xc_interface *xch,
                                           uint32_t domid)
@@ -132,9 +141,9 @@ static int alloc_pgtables(struct xc_dom_image *dom, int pae,
     int pages, extra_pages;
     xen_vaddr_t try_virt_end;
     xen_pfn_t try_pfn_end;
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
 
     extra_pages = dom->alloc_bootstack ? 1 : 0;
-    extra_pages += dom->extra_pages;
     extra_pages += 128; /* 512kB padding */
     pages = extra_pages;
     for ( ; ; )
@@ -152,29 +161,30 @@ static int alloc_pgtables(struct xc_dom_image *dom, int pae,
             return -ENOMEM;
         }
 
-        dom->pg_l4 =
+        domx86->pg_l4 =
             nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l4_bits);
-        dom->pg_l3 =
+        domx86->pg_l3 =
             nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l3_bits);
-        dom->pg_l2 =
+        domx86->pg_l2 =
             nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l2_bits);
-        dom->pg_l1 =
+        domx86->pg_l1 =
             nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l1_bits);
         if (pae && try_virt_end < 0xc0000000)
         {
             DOMPRINTF("%s: PAE: extra l2 page table for l3#3",
                       __FUNCTION__);
-            dom->pg_l2++;
+            domx86->pg_l2++;
         }
-        dom->pgtables = dom->pg_l4 + dom->pg_l3 + dom->pg_l2 + dom->pg_l1;
-        pages = dom->pgtables + extra_pages;
+        domx86->pgtables = domx86->pg_l4 + domx86->pg_l3 +
+                           domx86->pg_l2 + domx86->pg_l1;
+        pages = domx86->pgtables + extra_pages;
         if ( dom->virt_alloc_end + pages * PAGE_SIZE_X86 <= try_virt_end + 1 )
             break;
     }
     dom->virt_pgtab_end = try_virt_end + 1;
 
     return xc_dom_alloc_segment(dom, &dom->pgtables_seg, "page tables", 0,
-                                dom->pgtables * PAGE_SIZE_X86);
+                                domx86->pgtables * PAGE_SIZE_X86);
 }
 
 /* ------------------------------------------------------------------------ */
@@ -262,9 +272,10 @@ static xen_pfn_t move_l3_below_4G(struct xc_dom_image *dom,
 
 static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
 {
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
     xen_pfn_t l3pfn = dom->pgtables_seg.pfn;
-    xen_pfn_t l2pfn = l3pfn + dom->pg_l3;
-    xen_pfn_t l1pfn = l2pfn + dom->pg_l2;
+    xen_pfn_t l2pfn = l3pfn + domx86->pg_l3;
+    xen_pfn_t l1pfn = l2pfn + domx86->pg_l2;
     l3_pgentry_64_t *l3tab;
     l2_pgentry_64_t *l2tab = NULL;
     l1_pgentry_64_t *l1tab = NULL;
@@ -373,10 +384,11 @@ static int alloc_pgtables_x86_64(struct xc_dom_image *dom)
 
 static int setup_pgtables_x86_64(struct xc_dom_image *dom)
 {
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
     xen_pfn_t l4pfn = dom->pgtables_seg.pfn;
-    xen_pfn_t l3pfn = l4pfn + dom->pg_l4;
-    xen_pfn_t l2pfn = l3pfn + dom->pg_l3;
-    xen_pfn_t l1pfn = l2pfn + dom->pg_l2;
+    xen_pfn_t l3pfn = l4pfn + domx86->pg_l4;
+    xen_pfn_t l2pfn = l3pfn + domx86->pg_l3;
+    xen_pfn_t l1pfn = l2pfn + domx86->pg_l2;
     l4_pgentry_64_t *l4tab = xc_dom_pfn_to_ptr(dom, l4pfn, 1);
     l3_pgentry_64_t *l3tab = NULL;
     l2_pgentry_64_t *l2tab = NULL;
@@ -619,6 +631,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 
 static int start_info_x86_32(struct xc_dom_image *dom)
 {
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
     start_info_x86_32_t *start_info =
         xc_dom_pfn_to_ptr(dom, dom->start_info_pfn, 1);
     xen_pfn_t shinfo =
@@ -639,7 +652,7 @@ static int start_info_x86_32(struct xc_dom_image *dom)
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;
-    start_info->nr_pt_frames = dom->pgtables;
+    start_info->nr_pt_frames = domx86->pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
 
     start_info->flags = dom->flags;
@@ -665,6 +678,7 @@ static int start_info_x86_32(struct xc_dom_image *dom)
 
 static int start_info_x86_64(struct xc_dom_image *dom)
 {
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
     start_info_x86_64_t *start_info =
         xc_dom_pfn_to_ptr(dom, dom->start_info_pfn, 1);
     xen_pfn_t shinfo =
@@ -685,7 +699,7 @@ static int start_info_x86_64(struct xc_dom_image *dom)
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;
-    start_info->nr_pt_frames = dom->pgtables;
+    start_info->nr_pt_frames = domx86->pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
 
     start_info->flags = dom->flags;
@@ -1650,6 +1664,7 @@ static struct xc_dom_arch xc_dom_32_pae = {
     .native_protocol = XEN_IO_PROTO_ABI_X86_32,
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 4,
+    .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_32_pae,
     .setup_pgtables = setup_pgtables_x86_32_pae,
@@ -1666,6 +1681,7 @@ static struct xc_dom_arch xc_dom_64 = {
     .native_protocol = XEN_IO_PROTO_ABI_X86_64,
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 8,
+    .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_64,
     .setup_pgtables = setup_pgtables_x86_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 Wed Nov 25 10:40:08 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:40: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 1a1XUe-0005Xk-AV; Wed, 25 Nov 2015 10:40: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 1a1XUd-0005XO-Au
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:07 +0000
Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id
	42/A3-32615-60095565; Wed, 25 Nov 2015 10:40:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1448448004!6327476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31590 invoked from network); 25 Nov 2015 10:40: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;
	25 Nov 2015 10:40:05 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUX-0006bw-AJ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUX-0002v0-6X
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:01 +0000
Date: Wed, 25 Nov 2015 10:40:01 +0000
Message-Id: <E1a1XUX-0002v0-6X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: use domain builder architecture
	private data for x86 pv domains
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8db3c7db92ddf1049c69dbf22ef06786d280498
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:32 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:56 2015 +0000

    libxc: use domain builder architecture private data for x86 pv domains
    
    Move some data private to the x86 domain builder to the private data
    section. Remove extra_pages as they are used nowhere.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    8 -------
 tools/libxc/xc_dom_x86.c     |   48 ++++++++++++++++++++++++++++--------------
 2 files changed, 32 insertions(+), 24 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 47f08fa..f046ec5 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -97,15 +97,7 @@ struct xc_dom_image {
     xen_pfn_t pfn_alloc_end;
     xen_vaddr_t virt_alloc_end;
     xen_vaddr_t bsd_symtab_start;
-
-    /* initial page tables */
-    unsigned int pgtables;
-    unsigned int pg_l4;
-    unsigned int pg_l3;
-    unsigned int pg_l2;
-    unsigned int pg_l1;
     unsigned int alloc_bootstack;
-    unsigned int extra_pages;
     xen_vaddr_t virt_pgtab_end;
 
     /* other state info */
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index ea32b00..aba50df 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -69,6 +69,15 @@
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask)     ((addr) | (mask))
 
+struct xc_dom_image_x86 {
+    /* initial page tables */
+    unsigned int pgtables;
+    unsigned int pg_l4;
+    unsigned int pg_l3;
+    unsigned int pg_l2;
+    unsigned int pg_l1;
+};
+
 /* get guest IO ABI protocol */
 const char *xc_domain_get_native_protocol(xc_interface *xch,
                                           uint32_t domid)
@@ -132,9 +141,9 @@ static int alloc_pgtables(struct xc_dom_image *dom, int pae,
     int pages, extra_pages;
     xen_vaddr_t try_virt_end;
     xen_pfn_t try_pfn_end;
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
 
     extra_pages = dom->alloc_bootstack ? 1 : 0;
-    extra_pages += dom->extra_pages;
     extra_pages += 128; /* 512kB padding */
     pages = extra_pages;
     for ( ; ; )
@@ -152,29 +161,30 @@ static int alloc_pgtables(struct xc_dom_image *dom, int pae,
             return -ENOMEM;
         }
 
-        dom->pg_l4 =
+        domx86->pg_l4 =
             nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l4_bits);
-        dom->pg_l3 =
+        domx86->pg_l3 =
             nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l3_bits);
-        dom->pg_l2 =
+        domx86->pg_l2 =
             nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l2_bits);
-        dom->pg_l1 =
+        domx86->pg_l1 =
             nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l1_bits);
         if (pae && try_virt_end < 0xc0000000)
         {
             DOMPRINTF("%s: PAE: extra l2 page table for l3#3",
                       __FUNCTION__);
-            dom->pg_l2++;
+            domx86->pg_l2++;
         }
-        dom->pgtables = dom->pg_l4 + dom->pg_l3 + dom->pg_l2 + dom->pg_l1;
-        pages = dom->pgtables + extra_pages;
+        domx86->pgtables = domx86->pg_l4 + domx86->pg_l3 +
+                           domx86->pg_l2 + domx86->pg_l1;
+        pages = domx86->pgtables + extra_pages;
         if ( dom->virt_alloc_end + pages * PAGE_SIZE_X86 <= try_virt_end + 1 )
             break;
     }
     dom->virt_pgtab_end = try_virt_end + 1;
 
     return xc_dom_alloc_segment(dom, &dom->pgtables_seg, "page tables", 0,
-                                dom->pgtables * PAGE_SIZE_X86);
+                                domx86->pgtables * PAGE_SIZE_X86);
 }
 
 /* ------------------------------------------------------------------------ */
@@ -262,9 +272,10 @@ static xen_pfn_t move_l3_below_4G(struct xc_dom_image *dom,
 
 static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
 {
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
     xen_pfn_t l3pfn = dom->pgtables_seg.pfn;
-    xen_pfn_t l2pfn = l3pfn + dom->pg_l3;
-    xen_pfn_t l1pfn = l2pfn + dom->pg_l2;
+    xen_pfn_t l2pfn = l3pfn + domx86->pg_l3;
+    xen_pfn_t l1pfn = l2pfn + domx86->pg_l2;
     l3_pgentry_64_t *l3tab;
     l2_pgentry_64_t *l2tab = NULL;
     l1_pgentry_64_t *l1tab = NULL;
@@ -373,10 +384,11 @@ static int alloc_pgtables_x86_64(struct xc_dom_image *dom)
 
 static int setup_pgtables_x86_64(struct xc_dom_image *dom)
 {
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
     xen_pfn_t l4pfn = dom->pgtables_seg.pfn;
-    xen_pfn_t l3pfn = l4pfn + dom->pg_l4;
-    xen_pfn_t l2pfn = l3pfn + dom->pg_l3;
-    xen_pfn_t l1pfn = l2pfn + dom->pg_l2;
+    xen_pfn_t l3pfn = l4pfn + domx86->pg_l4;
+    xen_pfn_t l2pfn = l3pfn + domx86->pg_l3;
+    xen_pfn_t l1pfn = l2pfn + domx86->pg_l2;
     l4_pgentry_64_t *l4tab = xc_dom_pfn_to_ptr(dom, l4pfn, 1);
     l3_pgentry_64_t *l3tab = NULL;
     l2_pgentry_64_t *l2tab = NULL;
@@ -619,6 +631,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
 
 static int start_info_x86_32(struct xc_dom_image *dom)
 {
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
     start_info_x86_32_t *start_info =
         xc_dom_pfn_to_ptr(dom, dom->start_info_pfn, 1);
     xen_pfn_t shinfo =
@@ -639,7 +652,7 @@ static int start_info_x86_32(struct xc_dom_image *dom)
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;
-    start_info->nr_pt_frames = dom->pgtables;
+    start_info->nr_pt_frames = domx86->pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
 
     start_info->flags = dom->flags;
@@ -665,6 +678,7 @@ static int start_info_x86_32(struct xc_dom_image *dom)
 
 static int start_info_x86_64(struct xc_dom_image *dom)
 {
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
     start_info_x86_64_t *start_info =
         xc_dom_pfn_to_ptr(dom, dom->start_info_pfn, 1);
     xen_pfn_t shinfo =
@@ -685,7 +699,7 @@ static int start_info_x86_64(struct xc_dom_image *dom)
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;
-    start_info->nr_pt_frames = dom->pgtables;
+    start_info->nr_pt_frames = domx86->pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
 
     start_info->flags = dom->flags;
@@ -1650,6 +1664,7 @@ static struct xc_dom_arch xc_dom_32_pae = {
     .native_protocol = XEN_IO_PROTO_ABI_X86_32,
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 4,
+    .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_32_pae,
     .setup_pgtables = setup_pgtables_x86_32_pae,
@@ -1666,6 +1681,7 @@ static struct xc_dom_arch xc_dom_64 = {
     .native_protocol = XEN_IO_PROTO_ABI_X86_64,
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 8,
+    .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_64,
     .setup_pgtables = setup_pgtables_x86_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 Wed Nov 25 10:40:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:40: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 1a1XUo-0005Zc-Fd; Wed, 25 Nov 2015 10:40:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUn-0005ZK-6w
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:17 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	D6/02-16870-01095565; Wed, 25 Nov 2015 10:40:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448448015!6350532!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20853 invoked from network); 25 Nov 2015 10:40:15 -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;
	25 Nov 2015 10:40:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUk-0006ca-US
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUk-0002wd-TJ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:14 +0000
Date: Wed, 25 Nov 2015 10:40:14 +0000
Message-Id: <E1a1XUk-0002wd-TJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: create unmapped initrd in
	domain builder if supported
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8c45adec18e0512c3d34dcafb13414ecba21be6a
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:33 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:56 2015 +0000

    libxc: create unmapped initrd in domain builder if supported
    
    In case the kernel of a new pv-domU indicates it is supporting an
    unmapped initrd, don't waste precious virtual space for the initrd,
    but allocate only guest physical memory for it.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    5 +++++
 tools/libxc/xc_dom_core.c    |   19 +++++++++++++++++--
 tools/libxc/xc_dom_x86.c     |    8 ++++----
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index f046ec5..5c9cf3b 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -97,6 +97,11 @@ struct xc_dom_image {
     xen_pfn_t pfn_alloc_end;
     xen_vaddr_t virt_alloc_end;
     xen_vaddr_t bsd_symtab_start;
+
+    /* initrd parameters as specified in start_info page */
+    unsigned long initrd_start;
+    unsigned long initrd_len;
+
     unsigned int alloc_bootstack;
     xen_vaddr_t virt_pgtab_end;
 
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 3a31222..7b48b1f 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -1041,6 +1041,7 @@ static int xc_dom_build_ramdisk(struct xc_dom_image *dom)
 int xc_dom_build_image(struct xc_dom_image *dom)
 {
     unsigned int page_size;
+    bool unmapped_initrd;
 
     DOMPRINTF_CALLED(dom->xch);
 
@@ -1064,11 +1065,15 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     if ( dom->kernel_loader->loader(dom) != 0 )
         goto err;
 
-    /* load ramdisk */
-    if ( dom->ramdisk_blob )
+    /* Don't load ramdisk now if no initial mapping required. */
+    unmapped_initrd = dom->parms.unmapped_initrd && !dom->ramdisk_seg.vstart;
+
+    if ( dom->ramdisk_blob && !unmapped_initrd )
     {
         if ( xc_dom_build_ramdisk(dom) != 0 )
             goto err;
+        dom->initrd_start = dom->ramdisk_seg.vstart;
+        dom->initrd_len = dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart;
     }
 
     /* load devicetree */
@@ -1106,6 +1111,16 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     if ( dom->virt_pgtab_end && xc_dom_alloc_pad(dom, dom->virt_pgtab_end) )
         return -1;
 
+    /* Load ramdisk if no initial mapping required. */
+    if ( dom->ramdisk_blob && unmapped_initrd )
+    {
+        if ( xc_dom_build_ramdisk(dom) != 0 )
+            goto err;
+        dom->flags |= SIF_MOD_START_PFN;
+        dom->initrd_start = dom->ramdisk_seg.pfn;
+        dom->initrd_len = page_size * dom->ramdisk_seg.pages;
+    }
+
     return 0;
 
  err:
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index aba50df..3c6bb9c 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -663,8 +663,8 @@ static int start_info_x86_32(struct xc_dom_image *dom)
 
     if ( dom->ramdisk_blob )
     {
-        start_info->mod_start = dom->ramdisk_seg.vstart;
-        start_info->mod_len = dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart;
+        start_info->mod_start = dom->initrd_start;
+        start_info->mod_len = dom->initrd_len;
     }
 
     if ( dom->cmdline )
@@ -710,8 +710,8 @@ static int start_info_x86_64(struct xc_dom_image *dom)
 
     if ( dom->ramdisk_blob )
     {
-        start_info->mod_start = dom->ramdisk_seg.vstart;
-        start_info->mod_len = dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart;
+        start_info->mod_start = dom->initrd_start;
+        start_info->mod_len = dom->initrd_len;
     }
 
     if ( dom->cmdline )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:40:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:40: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 1a1XUo-0005Zc-Fd; Wed, 25 Nov 2015 10:40:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUn-0005ZK-6w
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:17 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	D6/02-16870-01095565; Wed, 25 Nov 2015 10:40:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448448015!6350532!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20853 invoked from network); 25 Nov 2015 10:40:15 -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;
	25 Nov 2015 10:40:15 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUk-0006ca-US
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUk-0002wd-TJ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:14 +0000
Date: Wed, 25 Nov 2015 10:40:14 +0000
Message-Id: <E1a1XUk-0002wd-TJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: create unmapped initrd in
	domain builder if supported
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8c45adec18e0512c3d34dcafb13414ecba21be6a
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:33 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:56 2015 +0000

    libxc: create unmapped initrd in domain builder if supported
    
    In case the kernel of a new pv-domU indicates it is supporting an
    unmapped initrd, don't waste precious virtual space for the initrd,
    but allocate only guest physical memory for it.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    5 +++++
 tools/libxc/xc_dom_core.c    |   19 +++++++++++++++++--
 tools/libxc/xc_dom_x86.c     |    8 ++++----
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index f046ec5..5c9cf3b 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -97,6 +97,11 @@ struct xc_dom_image {
     xen_pfn_t pfn_alloc_end;
     xen_vaddr_t virt_alloc_end;
     xen_vaddr_t bsd_symtab_start;
+
+    /* initrd parameters as specified in start_info page */
+    unsigned long initrd_start;
+    unsigned long initrd_len;
+
     unsigned int alloc_bootstack;
     xen_vaddr_t virt_pgtab_end;
 
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 3a31222..7b48b1f 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -1041,6 +1041,7 @@ static int xc_dom_build_ramdisk(struct xc_dom_image *dom)
 int xc_dom_build_image(struct xc_dom_image *dom)
 {
     unsigned int page_size;
+    bool unmapped_initrd;
 
     DOMPRINTF_CALLED(dom->xch);
 
@@ -1064,11 +1065,15 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     if ( dom->kernel_loader->loader(dom) != 0 )
         goto err;
 
-    /* load ramdisk */
-    if ( dom->ramdisk_blob )
+    /* Don't load ramdisk now if no initial mapping required. */
+    unmapped_initrd = dom->parms.unmapped_initrd && !dom->ramdisk_seg.vstart;
+
+    if ( dom->ramdisk_blob && !unmapped_initrd )
     {
         if ( xc_dom_build_ramdisk(dom) != 0 )
             goto err;
+        dom->initrd_start = dom->ramdisk_seg.vstart;
+        dom->initrd_len = dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart;
     }
 
     /* load devicetree */
@@ -1106,6 +1111,16 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     if ( dom->virt_pgtab_end && xc_dom_alloc_pad(dom, dom->virt_pgtab_end) )
         return -1;
 
+    /* Load ramdisk if no initial mapping required. */
+    if ( dom->ramdisk_blob && unmapped_initrd )
+    {
+        if ( xc_dom_build_ramdisk(dom) != 0 )
+            goto err;
+        dom->flags |= SIF_MOD_START_PFN;
+        dom->initrd_start = dom->ramdisk_seg.pfn;
+        dom->initrd_len = page_size * dom->ramdisk_seg.pages;
+    }
+
     return 0;
 
  err:
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index aba50df..3c6bb9c 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -663,8 +663,8 @@ static int start_info_x86_32(struct xc_dom_image *dom)
 
     if ( dom->ramdisk_blob )
     {
-        start_info->mod_start = dom->ramdisk_seg.vstart;
-        start_info->mod_len = dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart;
+        start_info->mod_start = dom->initrd_start;
+        start_info->mod_len = dom->initrd_len;
     }
 
     if ( dom->cmdline )
@@ -710,8 +710,8 @@ static int start_info_x86_64(struct xc_dom_image *dom)
 
     if ( dom->ramdisk_blob )
     {
-        start_info->mod_start = dom->ramdisk_seg.vstart;
-        start_info->mod_len = dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart;
+        start_info->mod_start = dom->initrd_start;
+        start_info->mod_len = dom->initrd_len;
     }
 
     if ( dom->cmdline )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:40:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:40: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 1a1XUy-0005cB-No; Wed, 25 Nov 2015 10:40:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUx-0005be-Ee
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:27 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	B2/48-13905-A1095565; Wed, 25 Nov 2015 10:40:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448448025!6343986!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31475 invoked from network); 25 Nov 2015 10:40:26 -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;
	25 Nov 2015 10:40:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUv-0006ci-6e
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUv-0002xG-3b
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:25 +0000
Date: Wed, 25 Nov 2015 10:40:25 +0000
Message-Id: <E1a1XUv-0002xG-3b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: split p2m allocation in domain
	builder from other magic 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 cd353959cdfbe06c2a6abfd73f03f40b84e1e3f1
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:34 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:56 2015 +0000

    libxc: split p2m allocation in domain builder from other magic pages
    
    Carve out the p2m list allocation from the .alloc_magic_pages hook of
    the domain builder in order to prepare allocating the p2m list outside
    of the initial kernel mapping. This will be needed to support loading
    domains with huge memory (>512 GB).
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    1 +
 tools/libxc/xc_dom_core.c    |    3 +++
 tools/libxc/xc_dom_x86.c     |   11 ++++++++++-
 3 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 5c9cf3b..5ba48db 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -224,6 +224,7 @@ struct xc_dom_arch {
     /* pagetable setup */
     int (*alloc_magic_pages) (struct xc_dom_image * dom);
     int (*alloc_pgtables) (struct xc_dom_image * dom);
+    int (*alloc_p2m_list) (struct xc_dom_image * dom);
     int (*setup_pgtables) (struct xc_dom_image * dom);
 
     /* arch-specific data structs setup */
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 7b48b1f..ad91b35 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -1096,6 +1096,9 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     }
 
     /* allocate other pages */
+    if ( dom->arch_hooks->alloc_p2m_list &&
+         dom->arch_hooks->alloc_p2m_list(dom) != 0 )
+        goto err;
     if ( dom->arch_hooks->alloc_magic_pages(dom) != 0 )
         goto err;
     if ( dom->arch_hooks->alloc_pgtables(dom) != 0 )
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 3c6bb9c..dd448cb 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -475,7 +475,7 @@ pfn_error:
 
 /* ------------------------------------------------------------------------ */
 
-static int alloc_magic_pages(struct xc_dom_image *dom)
+static int alloc_p2m_list(struct xc_dom_image *dom)
 {
     size_t p2m_alloc_size = dom->p2m_size * dom->arch_hooks->sizeof_pfn;
 
@@ -487,6 +487,13 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
     if ( dom->p2m_guest == NULL )
         return -1;
 
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int alloc_magic_pages(struct xc_dom_image *dom)
+{
     /* allocate special pages */
     dom->start_info_pfn = xc_dom_alloc_page(dom, "start info");
     dom->xenstore_pfn = xc_dom_alloc_page(dom, "xenstore");
@@ -1667,6 +1674,7 @@ static struct xc_dom_arch xc_dom_32_pae = {
     .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_32_pae,
+    .alloc_p2m_list = alloc_p2m_list,
     .setup_pgtables = setup_pgtables_x86_32_pae,
     .start_info = start_info_x86_32,
     .shared_info = shared_info_x86_32,
@@ -1684,6 +1692,7 @@ static struct xc_dom_arch xc_dom_64 = {
     .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_64,
+    .alloc_p2m_list = alloc_p2m_list,
     .setup_pgtables = setup_pgtables_x86_64,
     .start_info = start_info_x86_64,
     .shared_info = shared_info_x86_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 Wed Nov 25 10:40:29 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:40: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 1a1XUy-0005cB-No; Wed, 25 Nov 2015 10:40:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUx-0005be-Ee
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:27 +0000
Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id
	B2/48-13905-A1095565; Wed, 25 Nov 2015 10:40:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448448025!6343986!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31475 invoked from network); 25 Nov 2015 10:40:26 -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;
	25 Nov 2015 10:40:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUv-0006ci-6e
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XUv-0002xG-3b
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:25 +0000
Date: Wed, 25 Nov 2015 10:40:25 +0000
Message-Id: <E1a1XUv-0002xG-3b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: split p2m allocation in domain
	builder from other magic 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 cd353959cdfbe06c2a6abfd73f03f40b84e1e3f1
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:34 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:18:56 2015 +0000

    libxc: split p2m allocation in domain builder from other magic pages
    
    Carve out the p2m list allocation from the .alloc_magic_pages hook of
    the domain builder in order to prepare allocating the p2m list outside
    of the initial kernel mapping. This will be needed to support loading
    domains with huge memory (>512 GB).
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    1 +
 tools/libxc/xc_dom_core.c    |    3 +++
 tools/libxc/xc_dom_x86.c     |   11 ++++++++++-
 3 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 5c9cf3b..5ba48db 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -224,6 +224,7 @@ struct xc_dom_arch {
     /* pagetable setup */
     int (*alloc_magic_pages) (struct xc_dom_image * dom);
     int (*alloc_pgtables) (struct xc_dom_image * dom);
+    int (*alloc_p2m_list) (struct xc_dom_image * dom);
     int (*setup_pgtables) (struct xc_dom_image * dom);
 
     /* arch-specific data structs setup */
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index 7b48b1f..ad91b35 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -1096,6 +1096,9 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     }
 
     /* allocate other pages */
+    if ( dom->arch_hooks->alloc_p2m_list &&
+         dom->arch_hooks->alloc_p2m_list(dom) != 0 )
+        goto err;
     if ( dom->arch_hooks->alloc_magic_pages(dom) != 0 )
         goto err;
     if ( dom->arch_hooks->alloc_pgtables(dom) != 0 )
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 3c6bb9c..dd448cb 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -475,7 +475,7 @@ pfn_error:
 
 /* ------------------------------------------------------------------------ */
 
-static int alloc_magic_pages(struct xc_dom_image *dom)
+static int alloc_p2m_list(struct xc_dom_image *dom)
 {
     size_t p2m_alloc_size = dom->p2m_size * dom->arch_hooks->sizeof_pfn;
 
@@ -487,6 +487,13 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
     if ( dom->p2m_guest == NULL )
         return -1;
 
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+
+static int alloc_magic_pages(struct xc_dom_image *dom)
+{
     /* allocate special pages */
     dom->start_info_pfn = xc_dom_alloc_page(dom, "start info");
     dom->xenstore_pfn = xc_dom_alloc_page(dom, "xenstore");
@@ -1667,6 +1674,7 @@ static struct xc_dom_arch xc_dom_32_pae = {
     .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_32_pae,
+    .alloc_p2m_list = alloc_p2m_list,
     .setup_pgtables = setup_pgtables_x86_32_pae,
     .start_info = start_info_x86_32,
     .shared_info = shared_info_x86_32,
@@ -1684,6 +1692,7 @@ static struct xc_dom_arch xc_dom_64 = {
     .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_64,
+    .alloc_p2m_list = alloc_p2m_list,
     .setup_pgtables = setup_pgtables_x86_64,
     .start_info = start_info_x86_64,
     .shared_info = shared_info_x86_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 Wed Nov 25 10:40:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:40: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 1a1XVB-0005fo-T2; Wed, 25 Nov 2015 10:40:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XV9-0005fG-Tw
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:40 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	8C/36-12889-62095565; Wed, 25 Nov 2015 10:40:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1448448035!6149122!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3394 invoked from network); 25 Nov 2015 10:40:37 -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;
	25 Nov 2015 10:40:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XV5-0006cq-HX
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XV5-0002xm-EF
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:35 +0000
Date: Wed, 25 Nov 2015 10:40:35 +0000
Message-Id: <E1a1XV5-0002xm-EF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: rework of domain builder's page
	table 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 81a76e4b12961a9f54f5021809074196dfe6dbba
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:35 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:19:18 2015 +0000

    libxc: rework of domain builder's page table handler
    
    In order to prepare a p2m list outside of the initial kernel mapping
    do a rework of the domain builder's page table handler. The goal is
    to be able to use common helpers for page table allocation and setup
    for initial kernel page tables and page tables mapping the p2m list.
    This is achieved by supporting multiple mapping areas. The mapped
    virtual addresses of the single areas must not overlap, while the
    page tables of a new area added might already be partially present.
    Especially the top level page table is existing only once, of course.
    
    Currently restrict the number of mappings to 1 because the only mapping
    now is the initial mapping created by toolstack. There should not be
    behaviour change and guest visible change introduced.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_x86.c |  479 +++++++++++++++++++++++-----------------------
 tools/libxc/xg_private.h |   39 +---
 2 files changed, 252 insertions(+), 266 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index dd448cb..1614354 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <inttypes.h>
+#include <assert.h>
 
 #include <xen/xen.h>
 #include <xen/foreign/x86_32.h>
@@ -69,13 +70,29 @@
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask)     ((addr) | (mask))
 
-struct xc_dom_image_x86 {
-    /* initial page tables */
+struct xc_dom_params {
+    unsigned levels;
+    xen_vaddr_t vaddr_mask;
+    x86_pgentry_t lvl_prot[4];
+};
+
+struct xc_dom_x86_mapping_lvl {
+    xen_vaddr_t from;
+    xen_vaddr_t to;
+    xen_pfn_t pfn;
     unsigned int pgtables;
-    unsigned int pg_l4;
-    unsigned int pg_l3;
-    unsigned int pg_l2;
-    unsigned int pg_l1;
+};
+
+struct xc_dom_x86_mapping {
+    struct xc_dom_x86_mapping_lvl area;
+    struct xc_dom_x86_mapping_lvl lvls[4];
+};
+
+struct xc_dom_image_x86 {
+    unsigned n_mappings;
+#define MAPPING_MAX 1
+    struct xc_dom_x86_mapping maps[MAPPING_MAX];
+    struct xc_dom_params *params;
 };
 
 /* get guest IO ABI protocol */
@@ -105,102 +122,160 @@ const char *xc_domain_get_native_protocol(xc_interface *xch,
     return protocol;
 }
 
-static unsigned long
-nr_page_tables(struct xc_dom_image *dom,
-               xen_vaddr_t start, xen_vaddr_t end, unsigned long bits)
+static int count_pgtables(struct xc_dom_image *dom, xen_vaddr_t from,
+                          xen_vaddr_t to, xen_pfn_t pfn)
 {
-    xen_vaddr_t mask = bits_to_mask(bits);
-    int tables;
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map, *map_cmp;
+    xen_pfn_t pfn_end;
+    xen_vaddr_t mask;
+    unsigned bits;
+    int l, m;
 
-    if ( bits == 0 )
-        return 0;  /* unused */
+    if ( domx86->n_mappings == MAPPING_MAX )
+    {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "%s: too many mappings\n", __FUNCTION__);
+        return -ENOMEM;
+    }
+    map = domx86->maps + domx86->n_mappings;
 
-    if ( bits == (8 * sizeof(unsigned long)) )
+    pfn_end = pfn + ((to - from) >> PAGE_SHIFT_X86);
+    if ( pfn_end >= dom->p2m_size )
     {
-        /* must be pgd, need one */
-        start = 0;
-        end = -1;
-        tables = 1;
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "%s: not enough memory for initial mapping (%#"PRIpfn" > %#"PRIpfn")",
+                     __FUNCTION__, pfn_end, dom->p2m_size);
+        return -ENOMEM;
     }
-    else
+    for ( m = 0; m < domx86->n_mappings; m++ )
+    {
+        map_cmp = domx86->maps + m;
+        if ( from < map_cmp->area.to && to > map_cmp->area.from )
+        {
+            xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                         "%s: overlapping mappings\n", __FUNCTION__);
+            return -EINVAL;
+        }
+    }
+
+    memset(map, 0, sizeof(*map));
+    map->area.from = from & domx86->params->vaddr_mask;
+    map->area.to = to & domx86->params->vaddr_mask;
+
+    for ( l = domx86->params->levels - 1; l >= 0; l-- )
     {
-        start = round_down(start, mask);
-        end = round_up(end, mask);
-        tables = ((end - start) >> bits) + 1;
+        map->lvls[l].pfn = pfn + map->area.pgtables;
+        if ( l == domx86->params->levels - 1 )
+        {
+            /* Top level page table in first mapping only. */
+            if ( domx86->n_mappings == 0 )
+            {
+                map->lvls[l].from = 0;
+                map->lvls[l].to = domx86->params->vaddr_mask;
+                map->lvls[l].pgtables = 1;
+                map->area.pgtables++;
+            }
+            continue;
+        }
+
+        bits = PAGE_SHIFT_X86 + (l + 1) * PGTBL_LEVEL_SHIFT_X86;
+        mask = bits_to_mask(bits);
+        map->lvls[l].from = map->area.from & ~mask;
+        map->lvls[l].to = map->area.to | mask;
+
+        if ( domx86->params->levels == PGTBL_LEVELS_I386 &&
+             domx86->n_mappings == 0 && to < 0xc0000000 && l == 1 )
+        {
+            DOMPRINTF("%s: PAE: extra l2 page table for l3#3", __FUNCTION__);
+            map->lvls[l].to = domx86->params->vaddr_mask;
+        }
+
+        for ( m = 0; m < domx86->n_mappings; m++ )
+        {
+            map_cmp = domx86->maps + m;
+            if ( map_cmp->lvls[l].from == map_cmp->lvls[l].to )
+                continue;
+            if ( map->lvls[l].from >= map_cmp->lvls[l].from &&
+                 map->lvls[l].to <= map_cmp->lvls[l].to )
+            {
+                map->lvls[l].from = 0;
+                map->lvls[l].to = 0;
+                break;
+            }
+            assert(map->lvls[l].from >= map_cmp->lvls[l].from ||
+                   map->lvls[l].to <= map_cmp->lvls[l].to);
+            if ( map->lvls[l].from >= map_cmp->lvls[l].from &&
+                 map->lvls[l].from <= map_cmp->lvls[l].to )
+                map->lvls[l].from = map_cmp->lvls[l].to + 1;
+            if ( map->lvls[l].to >= map_cmp->lvls[l].from &&
+                 map->lvls[l].to <= map_cmp->lvls[l].to )
+                map->lvls[l].to = map_cmp->lvls[l].from - 1;
+        }
+        if ( map->lvls[l].from < map->lvls[l].to )
+            map->lvls[l].pgtables =
+                ((map->lvls[l].to - map->lvls[l].from) >> bits) + 1;
+        DOMPRINTF("%s: 0x%016" PRIx64 "/%d: 0x%016" PRIx64 " -> 0x%016" PRIx64
+                  ", %d table(s)", __FUNCTION__, mask, bits,
+                  map->lvls[l].from, map->lvls[l].to, map->lvls[l].pgtables);
+        map->area.pgtables += map->lvls[l].pgtables;
     }
 
-    DOMPRINTF("%s: 0x%016" PRIx64 "/%ld: 0x%016" PRIx64
-              " -> 0x%016" PRIx64 ", %d table(s)",
-              __FUNCTION__, mask, bits, start, end, tables);
-    return tables;
+    return 0;
 }
 
-static int alloc_pgtables(struct xc_dom_image *dom, int pae,
-                          int l4_bits, int l3_bits, int l2_bits, int l1_bits)
+static int alloc_pgtables(struct xc_dom_image *dom)
 {
     int pages, extra_pages;
     xen_vaddr_t try_virt_end;
-    xen_pfn_t try_pfn_end;
     struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map = domx86->maps + domx86->n_mappings;
 
     extra_pages = dom->alloc_bootstack ? 1 : 0;
-    extra_pages += 128; /* 512kB padding */
+    extra_pages += (512 * 1024) / PAGE_SIZE_X86; /* 512kB padding */
     pages = extra_pages;
     for ( ; ; )
     {
         try_virt_end = round_up(dom->virt_alloc_end + pages * PAGE_SIZE_X86,
                                 bits_to_mask(22)); /* 4MB alignment */
 
-        try_pfn_end = (try_virt_end - dom->parms.virt_base) >> PAGE_SHIFT_X86;
-
-        if ( try_pfn_end > dom->p2m_size )
-        {
-            xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
-                         "%s: not enough memory for initial mapping (%#"PRIpfn" > %#"PRIpfn")",
-                         __FUNCTION__, try_pfn_end, dom->p2m_size);
-            return -ENOMEM;
-        }
+        if ( count_pgtables(dom, dom->parms.virt_base, try_virt_end,
+                            dom->pfn_alloc_end) )
+            return -1;
 
-        domx86->pg_l4 =
-            nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l4_bits);
-        domx86->pg_l3 =
-            nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l3_bits);
-        domx86->pg_l2 =
-            nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l2_bits);
-        domx86->pg_l1 =
-            nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l1_bits);
-        if (pae && try_virt_end < 0xc0000000)
-        {
-            DOMPRINTF("%s: PAE: extra l2 page table for l3#3",
-                      __FUNCTION__);
-            domx86->pg_l2++;
-        }
-        domx86->pgtables = domx86->pg_l4 + domx86->pg_l3 +
-                           domx86->pg_l2 + domx86->pg_l1;
-        pages = domx86->pgtables + extra_pages;
+        pages = map->area.pgtables + extra_pages;
         if ( dom->virt_alloc_end + pages * PAGE_SIZE_X86 <= try_virt_end + 1 )
             break;
     }
+    map->area.pfn = 0;
+    domx86->n_mappings++;
     dom->virt_pgtab_end = try_virt_end + 1;
 
     return xc_dom_alloc_segment(dom, &dom->pgtables_seg, "page tables", 0,
-                                domx86->pgtables * PAGE_SIZE_X86);
+                                map->area.pgtables * PAGE_SIZE_X86);
 }
 
 /* ------------------------------------------------------------------------ */
 /* i386 pagetables                                                          */
 
-#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
-#define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
-#define L3_PROT (_PAGE_PRESENT)
+static struct xc_dom_params x86_32_params = {
+    .levels = PGTBL_LEVELS_I386,
+    .vaddr_mask = bits_to_mask(VIRT_BITS_I386),
+    .lvl_prot[0] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED,
+    .lvl_prot[1] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+    .lvl_prot[2] = _PAGE_PRESENT,
+};
 
 static int alloc_pgtables_x86_32_pae(struct xc_dom_image *dom)
 {
-    return alloc_pgtables(dom, 1, 0, 32,
-                          L3_PAGETABLE_SHIFT_PAE, L2_PAGETABLE_SHIFT_PAE);
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+
+    domx86->params = &x86_32_params;
+    return alloc_pgtables(dom);
 }
 
 #define pfn_to_paddr(pfn) ((xen_paddr_t)(pfn) << PAGE_SHIFT_X86)
+#define pgentry_to_pfn(entry) ((xen_pfn_t)((entry) >> PAGE_SHIFT_X86))
 
 /*
  * Move the l3 page table page below 4G for guests which do not
@@ -270,20 +345,100 @@ static xen_pfn_t move_l3_below_4G(struct xc_dom_image *dom,
     return l3mfn;
 }
 
+static x86_pgentry_t *get_pg_table_x86(struct xc_dom_image *dom, int m, int l)
+{
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map;
+    x86_pgentry_t *pg;
+
+    map = domx86->maps + m;
+    pg = xc_dom_pfn_to_ptr(dom, map->lvls[l].pfn, 0);
+    if ( pg )
+        return pg;
+
+    xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                 "%s: xc_dom_pfn_to_ptr failed", __FUNCTION__);
+    return NULL;
+}
+
+static x86_pgentry_t get_pg_prot_x86(struct xc_dom_image *dom, int l,
+                                     xen_pfn_t pfn)
+{
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map;
+    xen_pfn_t pfn_s, pfn_e;
+    x86_pgentry_t prot;
+    unsigned m;
+
+    prot = domx86->params->lvl_prot[l];
+    if ( l > 0 )
+        return prot;
+
+    for ( m = 0; m < domx86->n_mappings; m++ )
+    {
+        map = domx86->maps + m;
+        pfn_s = map->lvls[domx86->params->levels - 1].pfn;
+        pfn_e = map->area.pgtables + pfn_s;
+        if ( pfn >= pfn_s && pfn < pfn_e )
+            return prot & ~_PAGE_RW;
+    }
+
+    return prot;
+}
+
+static int setup_pgtables_x86(struct xc_dom_image *dom)
+{
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map1, *map2;
+    struct xc_dom_x86_mapping_lvl *lvl;
+    xen_vaddr_t from, to;
+    xen_pfn_t pfn, p, p_s, p_e;
+    x86_pgentry_t *pg;
+    unsigned m1, m2;
+    int l;
+
+    for ( l = domx86->params->levels - 1; l >= 0; l-- )
+        for ( m1 = 0; m1 < domx86->n_mappings; m1++ )
+        {
+            map1 = domx86->maps + m1;
+            from = map1->lvls[l].from;
+            to = map1->lvls[l].to;
+            pg = get_pg_table_x86(dom, m1, l);
+            if ( !pg )
+                return -1;
+            for ( m2 = 0; m2 < domx86->n_mappings; m2++ )
+            {
+                map2 = domx86->maps + m2;
+                lvl = (l > 0) ? map2->lvls + l - 1 : &map2->area;
+                if ( l > 0 && lvl->pgtables == 0 )
+                    continue;
+                if ( lvl->from >= to || lvl->to <= from )
+                    continue;
+                p_s = (max(from, lvl->from) - from) >>
+                      (PAGE_SHIFT_X86 + l * PGTBL_LEVEL_SHIFT_X86);
+                p_e = (min(to, lvl->to) - from) >>
+                      (PAGE_SHIFT_X86 + l * PGTBL_LEVEL_SHIFT_X86);
+                pfn = ((max(from, lvl->from) - lvl->from) >>
+                      (PAGE_SHIFT_X86 + l * PGTBL_LEVEL_SHIFT_X86)) + lvl->pfn;
+                for ( p = p_s; p <= p_e; p++ )
+                {
+                    pg[p] = pfn_to_paddr(xc_dom_p2m(dom, pfn)) |
+                            get_pg_prot_x86(dom, l, pfn);
+                    pfn++;
+                }
+            }
+        }
+
+    return 0;
+}
+
 static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
 {
     struct xc_dom_image_x86 *domx86 = dom->arch_private;
-    xen_pfn_t l3pfn = dom->pgtables_seg.pfn;
-    xen_pfn_t l2pfn = l3pfn + domx86->pg_l3;
-    xen_pfn_t l1pfn = l2pfn + domx86->pg_l2;
-    l3_pgentry_64_t *l3tab;
-    l2_pgentry_64_t *l2tab = NULL;
-    l1_pgentry_64_t *l1tab = NULL;
-    unsigned long l3off, l2off = 0, l1off;
-    xen_vaddr_t addr;
-    xen_pfn_t pgpfn;
-    xen_pfn_t l3mfn = xc_dom_p2m(dom, l3pfn);
+    xen_pfn_t l3mfn, l3pfn;
 
+    l3pfn = domx86->maps[0].lvls[2].pfn;
+    l3mfn = xc_dom_p2m(dom, l3pfn);
     if ( dom->parms.pae == XEN_PAE_YES )
     {
         if ( l3mfn >= 0x100000 )
@@ -299,180 +454,34 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
         }
     }
 
-    l3tab = xc_dom_pfn_to_ptr(dom, l3pfn, 1);
-    if ( l3tab == NULL )
-        goto pfn_error;
-
-    for ( addr = dom->parms.virt_base; addr < dom->virt_pgtab_end;
-          addr += PAGE_SIZE_X86 )
-    {
-        if ( l2tab == NULL )
-        {
-            /* get L2 tab, make L3 entry */
-            l2tab = xc_dom_pfn_to_ptr(dom, l2pfn, 1);
-            if ( l2tab == NULL )
-                goto pfn_error;
-            l3off = l3_table_offset_pae(addr);
-            l3tab[l3off] =
-                pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
-            l2pfn++;
-        }
-
-        if ( l1tab == NULL )
-        {
-            /* get L1 tab, make L2 entry */
-            l1tab = xc_dom_pfn_to_ptr(dom, l1pfn, 1);
-            if ( l1tab == NULL )
-                goto pfn_error;
-            l2off = l2_table_offset_pae(addr);
-            l2tab[l2off] =
-                pfn_to_paddr(xc_dom_p2m(dom, l1pfn)) | L2_PROT;
-            l1pfn++;
-        }
-
-        /* make L1 entry */
-        l1off = l1_table_offset_pae(addr);
-        pgpfn = (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
-        l1tab[l1off] =
-            pfn_to_paddr(xc_dom_p2m(dom, pgpfn)) | L1_PROT;
-        if ( (!dom->pvh_enabled)                &&
-             (addr >= dom->pgtables_seg.vstart) &&
-             (addr < dom->pgtables_seg.vend) )
-            l1tab[l1off] &= ~_PAGE_RW; /* page tables are r/o */
-
-        if ( l1off == (L1_PAGETABLE_ENTRIES_PAE - 1) )
-        {
-            l1tab = NULL;
-            if ( l2off == (L2_PAGETABLE_ENTRIES_PAE - 1) )
-                l2tab = NULL;
-        }
-    }
-
-    if ( dom->virt_pgtab_end <= 0xc0000000 )
-    {
-        DOMPRINTF("%s: PAE: extra l2 page table for l3#3", __FUNCTION__);
-        l3tab[3] = pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
-    }
-    return 0;
-
-pfn_error:
-    xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                 "%s: xc_dom_pfn_to_ptr failed", __FUNCTION__);
-    return -EINVAL;
+    return setup_pgtables_x86(dom);
 }
 
-#undef L1_PROT
-#undef L2_PROT
-#undef L3_PROT
-
 /* ------------------------------------------------------------------------ */
 /* x86_64 pagetables                                                        */
 
+static struct xc_dom_params x86_64_params = {
+    .levels = PGTBL_LEVELS_X86_64,
+    .vaddr_mask = bits_to_mask(VIRT_BITS_X86_64),
+    .lvl_prot[0] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED,
+    .lvl_prot[1] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+    .lvl_prot[2] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+    .lvl_prot[3] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+};
+
 static int alloc_pgtables_x86_64(struct xc_dom_image *dom)
 {
-    return alloc_pgtables(dom, 0,
-                          L4_PAGETABLE_SHIFT_X86_64 + 9,
-                          L4_PAGETABLE_SHIFT_X86_64,
-                          L3_PAGETABLE_SHIFT_X86_64,
-                          L2_PAGETABLE_SHIFT_X86_64);
-}
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
 
-#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
-#define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
-#define L3_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
-#define L4_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
+    domx86->params = &x86_64_params;
+    return alloc_pgtables(dom);
+}
 
 static int setup_pgtables_x86_64(struct xc_dom_image *dom)
 {
-    struct xc_dom_image_x86 *domx86 = dom->arch_private;
-    xen_pfn_t l4pfn = dom->pgtables_seg.pfn;
-    xen_pfn_t l3pfn = l4pfn + domx86->pg_l4;
-    xen_pfn_t l2pfn = l3pfn + domx86->pg_l3;
-    xen_pfn_t l1pfn = l2pfn + domx86->pg_l2;
-    l4_pgentry_64_t *l4tab = xc_dom_pfn_to_ptr(dom, l4pfn, 1);
-    l3_pgentry_64_t *l3tab = NULL;
-    l2_pgentry_64_t *l2tab = NULL;
-    l1_pgentry_64_t *l1tab = NULL;
-    uint64_t l4off, l3off = 0, l2off = 0, l1off;
-    uint64_t addr;
-    xen_pfn_t pgpfn;
-
-    if ( l4tab == NULL )
-        goto pfn_error;
-
-    for ( addr = dom->parms.virt_base; addr < dom->virt_pgtab_end;
-          addr += PAGE_SIZE_X86 )
-    {
-        if ( l3tab == NULL )
-        {
-            /* get L3 tab, make L4 entry */
-            l3tab = xc_dom_pfn_to_ptr(dom, l3pfn, 1);
-            if ( l3tab == NULL )
-                goto pfn_error;
-            l4off = l4_table_offset_x86_64(addr);
-            l4tab[l4off] =
-                pfn_to_paddr(xc_dom_p2m(dom, l3pfn)) | L4_PROT;
-            l3pfn++;
-        }
-
-        if ( l2tab == NULL )
-        {
-            /* get L2 tab, make L3 entry */
-            l2tab = xc_dom_pfn_to_ptr(dom, l2pfn, 1);
-            if ( l2tab == NULL )
-                goto pfn_error;
-            l3off = l3_table_offset_x86_64(addr);
-            l3tab[l3off] =
-                pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
-            l2pfn++;
-        }
-
-        if ( l1tab == NULL )
-        {
-            /* get L1 tab, make L2 entry */
-            l1tab = xc_dom_pfn_to_ptr(dom, l1pfn, 1);
-            if ( l1tab == NULL )
-                goto pfn_error;
-            l2off = l2_table_offset_x86_64(addr);
-            l2tab[l2off] =
-                pfn_to_paddr(xc_dom_p2m(dom, l1pfn)) | L2_PROT;
-            l1pfn++;
-        }
-
-        /* make L1 entry */
-        l1off = l1_table_offset_x86_64(addr);
-        pgpfn = (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
-        l1tab[l1off] =
-            pfn_to_paddr(xc_dom_p2m(dom, pgpfn)) | L1_PROT;
-        if ( (!dom->pvh_enabled)                &&
-             (addr >= dom->pgtables_seg.vstart) &&
-             (addr < dom->pgtables_seg.vend) )
-            l1tab[l1off] &= ~_PAGE_RW; /* page tables are r/o */
-
-        if ( l1off == (L1_PAGETABLE_ENTRIES_X86_64 - 1) )
-        {
-            l1tab = NULL;
-            if ( l2off == (L2_PAGETABLE_ENTRIES_X86_64 - 1) )
-            {
-                l2tab = NULL;
-                if ( l3off == (L3_PAGETABLE_ENTRIES_X86_64 - 1) )
-                    l3tab = NULL;
-            }
-        }
-    }
-    return 0;
-
-pfn_error:
-    xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                 "%s: xc_dom_pfn_to_ptr failed", __FUNCTION__);
-    return -EINVAL;
+    return setup_pgtables_x86(dom);
 }
 
-#undef L1_PROT
-#undef L2_PROT
-#undef L3_PROT
-#undef L4_PROT
-
 /* ------------------------------------------------------------------------ */
 
 static int alloc_p2m_list(struct xc_dom_image *dom)
@@ -659,7 +668,7 @@ static int start_info_x86_32(struct xc_dom_image *dom)
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;
-    start_info->nr_pt_frames = domx86->pgtables;
+    start_info->nr_pt_frames = domx86->maps[0].area.pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
 
     start_info->flags = dom->flags;
@@ -706,7 +715,7 @@ static int start_info_x86_64(struct xc_dom_image *dom)
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;
-    start_info->nr_pt_frames = domx86->pgtables;
+    start_info->nr_pt_frames = domx86->maps[0].area.pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
 
     start_info->flags = dom->flags;
diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index 5544897..a76d6b3 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -62,10 +62,13 @@ unsigned long csum_page (void * page);
 #define _PAGE_PSE       0x080
 #define _PAGE_GLOBAL    0x100
 
-#define L1_PAGETABLE_SHIFT_I386       12
-#define L2_PAGETABLE_SHIFT_I386       22
-#define L1_PAGETABLE_ENTRIES_I386   1024
-#define L2_PAGETABLE_ENTRIES_I386   1024
+#define VIRT_BITS_I386     32
+#define VIRT_BITS_X86_64   48
+
+#define PGTBL_LEVELS_I386       3
+#define PGTBL_LEVELS_X86_64     4
+
+#define PGTBL_LEVEL_SHIFT_X86   9
 
 #define L1_PAGETABLE_SHIFT_PAE        12
 #define L2_PAGETABLE_SHIFT_PAE        21
@@ -83,33 +86,7 @@ unsigned long csum_page (void * page);
 #define L3_PAGETABLE_ENTRIES_X86_64  512
 #define L4_PAGETABLE_ENTRIES_X86_64  512
 
-typedef uint32_t l1_pgentry_32_t;
-typedef uint32_t l2_pgentry_32_t;
-typedef uint64_t l1_pgentry_64_t;
-typedef uint64_t l2_pgentry_64_t;
-typedef uint64_t l3_pgentry_64_t;
-typedef uint64_t l4_pgentry_64_t;
-
-#define l1_table_offset_i386(_a) \
-  (((_a) >> L1_PAGETABLE_SHIFT_I386) & (L1_PAGETABLE_ENTRIES_I386 - 1))
-#define l2_table_offset_i386(_a) \
-  (((_a) >> L2_PAGETABLE_SHIFT_I386) & (L2_PAGETABLE_ENTRIES_I386 - 1))
-
-#define l1_table_offset_pae(_a) \
-  (((_a) >> L1_PAGETABLE_SHIFT_PAE) & (L1_PAGETABLE_ENTRIES_PAE - 1))
-#define l2_table_offset_pae(_a) \
-  (((_a) >> L2_PAGETABLE_SHIFT_PAE) & (L2_PAGETABLE_ENTRIES_PAE - 1))
-#define l3_table_offset_pae(_a) \
-  (((_a) >> L3_PAGETABLE_SHIFT_PAE) & (L3_PAGETABLE_ENTRIES_PAE - 1))
-
-#define l1_table_offset_x86_64(_a) \
-  (((_a) >> L1_PAGETABLE_SHIFT_X86_64) & (L1_PAGETABLE_ENTRIES_X86_64 - 1))
-#define l2_table_offset_x86_64(_a) \
-  (((_a) >> L2_PAGETABLE_SHIFT_X86_64) & (L2_PAGETABLE_ENTRIES_X86_64 - 1))
-#define l3_table_offset_x86_64(_a) \
-  (((_a) >> L3_PAGETABLE_SHIFT_X86_64) & (L3_PAGETABLE_ENTRIES_X86_64 - 1))
-#define l4_table_offset_x86_64(_a) \
-  (((_a) >> L4_PAGETABLE_SHIFT_X86_64) & (L4_PAGETABLE_ENTRIES_X86_64 - 1))
+typedef uint64_t x86_pgentry_t;
 
 #define PAGE_SHIFT_ARM          12
 #define PAGE_SIZE_ARM           (1UL << PAGE_SHIFT_ARM)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:40:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:40: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 1a1XVB-0005fo-T2; Wed, 25 Nov 2015 10:40:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XV9-0005fG-Tw
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:40 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	8C/36-12889-62095565; Wed, 25 Nov 2015 10:40:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1448448035!6149122!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3394 invoked from network); 25 Nov 2015 10:40:37 -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;
	25 Nov 2015 10:40:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XV5-0006cq-HX
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XV5-0002xm-EF
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:35 +0000
Date: Wed, 25 Nov 2015 10:40:35 +0000
Message-Id: <E1a1XV5-0002xm-EF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: rework of domain builder's page
	table 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 81a76e4b12961a9f54f5021809074196dfe6dbba
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:35 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:19:18 2015 +0000

    libxc: rework of domain builder's page table handler
    
    In order to prepare a p2m list outside of the initial kernel mapping
    do a rework of the domain builder's page table handler. The goal is
    to be able to use common helpers for page table allocation and setup
    for initial kernel page tables and page tables mapping the p2m list.
    This is achieved by supporting multiple mapping areas. The mapped
    virtual addresses of the single areas must not overlap, while the
    page tables of a new area added might already be partially present.
    Especially the top level page table is existing only once, of course.
    
    Currently restrict the number of mappings to 1 because the only mapping
    now is the initial mapping created by toolstack. There should not be
    behaviour change and guest visible change introduced.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_dom_x86.c |  479 +++++++++++++++++++++++-----------------------
 tools/libxc/xg_private.h |   39 +---
 2 files changed, 252 insertions(+), 266 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index dd448cb..1614354 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <inttypes.h>
+#include <assert.h>
 
 #include <xen/xen.h>
 #include <xen/foreign/x86_32.h>
@@ -69,13 +70,29 @@
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask)     ((addr) | (mask))
 
-struct xc_dom_image_x86 {
-    /* initial page tables */
+struct xc_dom_params {
+    unsigned levels;
+    xen_vaddr_t vaddr_mask;
+    x86_pgentry_t lvl_prot[4];
+};
+
+struct xc_dom_x86_mapping_lvl {
+    xen_vaddr_t from;
+    xen_vaddr_t to;
+    xen_pfn_t pfn;
     unsigned int pgtables;
-    unsigned int pg_l4;
-    unsigned int pg_l3;
-    unsigned int pg_l2;
-    unsigned int pg_l1;
+};
+
+struct xc_dom_x86_mapping {
+    struct xc_dom_x86_mapping_lvl area;
+    struct xc_dom_x86_mapping_lvl lvls[4];
+};
+
+struct xc_dom_image_x86 {
+    unsigned n_mappings;
+#define MAPPING_MAX 1
+    struct xc_dom_x86_mapping maps[MAPPING_MAX];
+    struct xc_dom_params *params;
 };
 
 /* get guest IO ABI protocol */
@@ -105,102 +122,160 @@ const char *xc_domain_get_native_protocol(xc_interface *xch,
     return protocol;
 }
 
-static unsigned long
-nr_page_tables(struct xc_dom_image *dom,
-               xen_vaddr_t start, xen_vaddr_t end, unsigned long bits)
+static int count_pgtables(struct xc_dom_image *dom, xen_vaddr_t from,
+                          xen_vaddr_t to, xen_pfn_t pfn)
 {
-    xen_vaddr_t mask = bits_to_mask(bits);
-    int tables;
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map, *map_cmp;
+    xen_pfn_t pfn_end;
+    xen_vaddr_t mask;
+    unsigned bits;
+    int l, m;
 
-    if ( bits == 0 )
-        return 0;  /* unused */
+    if ( domx86->n_mappings == MAPPING_MAX )
+    {
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "%s: too many mappings\n", __FUNCTION__);
+        return -ENOMEM;
+    }
+    map = domx86->maps + domx86->n_mappings;
 
-    if ( bits == (8 * sizeof(unsigned long)) )
+    pfn_end = pfn + ((to - from) >> PAGE_SHIFT_X86);
+    if ( pfn_end >= dom->p2m_size )
     {
-        /* must be pgd, need one */
-        start = 0;
-        end = -1;
-        tables = 1;
+        xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
+                     "%s: not enough memory for initial mapping (%#"PRIpfn" > %#"PRIpfn")",
+                     __FUNCTION__, pfn_end, dom->p2m_size);
+        return -ENOMEM;
     }
-    else
+    for ( m = 0; m < domx86->n_mappings; m++ )
+    {
+        map_cmp = domx86->maps + m;
+        if ( from < map_cmp->area.to && to > map_cmp->area.from )
+        {
+            xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                         "%s: overlapping mappings\n", __FUNCTION__);
+            return -EINVAL;
+        }
+    }
+
+    memset(map, 0, sizeof(*map));
+    map->area.from = from & domx86->params->vaddr_mask;
+    map->area.to = to & domx86->params->vaddr_mask;
+
+    for ( l = domx86->params->levels - 1; l >= 0; l-- )
     {
-        start = round_down(start, mask);
-        end = round_up(end, mask);
-        tables = ((end - start) >> bits) + 1;
+        map->lvls[l].pfn = pfn + map->area.pgtables;
+        if ( l == domx86->params->levels - 1 )
+        {
+            /* Top level page table in first mapping only. */
+            if ( domx86->n_mappings == 0 )
+            {
+                map->lvls[l].from = 0;
+                map->lvls[l].to = domx86->params->vaddr_mask;
+                map->lvls[l].pgtables = 1;
+                map->area.pgtables++;
+            }
+            continue;
+        }
+
+        bits = PAGE_SHIFT_X86 + (l + 1) * PGTBL_LEVEL_SHIFT_X86;
+        mask = bits_to_mask(bits);
+        map->lvls[l].from = map->area.from & ~mask;
+        map->lvls[l].to = map->area.to | mask;
+
+        if ( domx86->params->levels == PGTBL_LEVELS_I386 &&
+             domx86->n_mappings == 0 && to < 0xc0000000 && l == 1 )
+        {
+            DOMPRINTF("%s: PAE: extra l2 page table for l3#3", __FUNCTION__);
+            map->lvls[l].to = domx86->params->vaddr_mask;
+        }
+
+        for ( m = 0; m < domx86->n_mappings; m++ )
+        {
+            map_cmp = domx86->maps + m;
+            if ( map_cmp->lvls[l].from == map_cmp->lvls[l].to )
+                continue;
+            if ( map->lvls[l].from >= map_cmp->lvls[l].from &&
+                 map->lvls[l].to <= map_cmp->lvls[l].to )
+            {
+                map->lvls[l].from = 0;
+                map->lvls[l].to = 0;
+                break;
+            }
+            assert(map->lvls[l].from >= map_cmp->lvls[l].from ||
+                   map->lvls[l].to <= map_cmp->lvls[l].to);
+            if ( map->lvls[l].from >= map_cmp->lvls[l].from &&
+                 map->lvls[l].from <= map_cmp->lvls[l].to )
+                map->lvls[l].from = map_cmp->lvls[l].to + 1;
+            if ( map->lvls[l].to >= map_cmp->lvls[l].from &&
+                 map->lvls[l].to <= map_cmp->lvls[l].to )
+                map->lvls[l].to = map_cmp->lvls[l].from - 1;
+        }
+        if ( map->lvls[l].from < map->lvls[l].to )
+            map->lvls[l].pgtables =
+                ((map->lvls[l].to - map->lvls[l].from) >> bits) + 1;
+        DOMPRINTF("%s: 0x%016" PRIx64 "/%d: 0x%016" PRIx64 " -> 0x%016" PRIx64
+                  ", %d table(s)", __FUNCTION__, mask, bits,
+                  map->lvls[l].from, map->lvls[l].to, map->lvls[l].pgtables);
+        map->area.pgtables += map->lvls[l].pgtables;
     }
 
-    DOMPRINTF("%s: 0x%016" PRIx64 "/%ld: 0x%016" PRIx64
-              " -> 0x%016" PRIx64 ", %d table(s)",
-              __FUNCTION__, mask, bits, start, end, tables);
-    return tables;
+    return 0;
 }
 
-static int alloc_pgtables(struct xc_dom_image *dom, int pae,
-                          int l4_bits, int l3_bits, int l2_bits, int l1_bits)
+static int alloc_pgtables(struct xc_dom_image *dom)
 {
     int pages, extra_pages;
     xen_vaddr_t try_virt_end;
-    xen_pfn_t try_pfn_end;
     struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map = domx86->maps + domx86->n_mappings;
 
     extra_pages = dom->alloc_bootstack ? 1 : 0;
-    extra_pages += 128; /* 512kB padding */
+    extra_pages += (512 * 1024) / PAGE_SIZE_X86; /* 512kB padding */
     pages = extra_pages;
     for ( ; ; )
     {
         try_virt_end = round_up(dom->virt_alloc_end + pages * PAGE_SIZE_X86,
                                 bits_to_mask(22)); /* 4MB alignment */
 
-        try_pfn_end = (try_virt_end - dom->parms.virt_base) >> PAGE_SHIFT_X86;
-
-        if ( try_pfn_end > dom->p2m_size )
-        {
-            xc_dom_panic(dom->xch, XC_OUT_OF_MEMORY,
-                         "%s: not enough memory for initial mapping (%#"PRIpfn" > %#"PRIpfn")",
-                         __FUNCTION__, try_pfn_end, dom->p2m_size);
-            return -ENOMEM;
-        }
+        if ( count_pgtables(dom, dom->parms.virt_base, try_virt_end,
+                            dom->pfn_alloc_end) )
+            return -1;
 
-        domx86->pg_l4 =
-            nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l4_bits);
-        domx86->pg_l3 =
-            nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l3_bits);
-        domx86->pg_l2 =
-            nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l2_bits);
-        domx86->pg_l1 =
-            nr_page_tables(dom, dom->parms.virt_base, try_virt_end, l1_bits);
-        if (pae && try_virt_end < 0xc0000000)
-        {
-            DOMPRINTF("%s: PAE: extra l2 page table for l3#3",
-                      __FUNCTION__);
-            domx86->pg_l2++;
-        }
-        domx86->pgtables = domx86->pg_l4 + domx86->pg_l3 +
-                           domx86->pg_l2 + domx86->pg_l1;
-        pages = domx86->pgtables + extra_pages;
+        pages = map->area.pgtables + extra_pages;
         if ( dom->virt_alloc_end + pages * PAGE_SIZE_X86 <= try_virt_end + 1 )
             break;
     }
+    map->area.pfn = 0;
+    domx86->n_mappings++;
     dom->virt_pgtab_end = try_virt_end + 1;
 
     return xc_dom_alloc_segment(dom, &dom->pgtables_seg, "page tables", 0,
-                                domx86->pgtables * PAGE_SIZE_X86);
+                                map->area.pgtables * PAGE_SIZE_X86);
 }
 
 /* ------------------------------------------------------------------------ */
 /* i386 pagetables                                                          */
 
-#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
-#define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
-#define L3_PROT (_PAGE_PRESENT)
+static struct xc_dom_params x86_32_params = {
+    .levels = PGTBL_LEVELS_I386,
+    .vaddr_mask = bits_to_mask(VIRT_BITS_I386),
+    .lvl_prot[0] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED,
+    .lvl_prot[1] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+    .lvl_prot[2] = _PAGE_PRESENT,
+};
 
 static int alloc_pgtables_x86_32_pae(struct xc_dom_image *dom)
 {
-    return alloc_pgtables(dom, 1, 0, 32,
-                          L3_PAGETABLE_SHIFT_PAE, L2_PAGETABLE_SHIFT_PAE);
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+
+    domx86->params = &x86_32_params;
+    return alloc_pgtables(dom);
 }
 
 #define pfn_to_paddr(pfn) ((xen_paddr_t)(pfn) << PAGE_SHIFT_X86)
+#define pgentry_to_pfn(entry) ((xen_pfn_t)((entry) >> PAGE_SHIFT_X86))
 
 /*
  * Move the l3 page table page below 4G for guests which do not
@@ -270,20 +345,100 @@ static xen_pfn_t move_l3_below_4G(struct xc_dom_image *dom,
     return l3mfn;
 }
 
+static x86_pgentry_t *get_pg_table_x86(struct xc_dom_image *dom, int m, int l)
+{
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map;
+    x86_pgentry_t *pg;
+
+    map = domx86->maps + m;
+    pg = xc_dom_pfn_to_ptr(dom, map->lvls[l].pfn, 0);
+    if ( pg )
+        return pg;
+
+    xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                 "%s: xc_dom_pfn_to_ptr failed", __FUNCTION__);
+    return NULL;
+}
+
+static x86_pgentry_t get_pg_prot_x86(struct xc_dom_image *dom, int l,
+                                     xen_pfn_t pfn)
+{
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map;
+    xen_pfn_t pfn_s, pfn_e;
+    x86_pgentry_t prot;
+    unsigned m;
+
+    prot = domx86->params->lvl_prot[l];
+    if ( l > 0 )
+        return prot;
+
+    for ( m = 0; m < domx86->n_mappings; m++ )
+    {
+        map = domx86->maps + m;
+        pfn_s = map->lvls[domx86->params->levels - 1].pfn;
+        pfn_e = map->area.pgtables + pfn_s;
+        if ( pfn >= pfn_s && pfn < pfn_e )
+            return prot & ~_PAGE_RW;
+    }
+
+    return prot;
+}
+
+static int setup_pgtables_x86(struct xc_dom_image *dom)
+{
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map1, *map2;
+    struct xc_dom_x86_mapping_lvl *lvl;
+    xen_vaddr_t from, to;
+    xen_pfn_t pfn, p, p_s, p_e;
+    x86_pgentry_t *pg;
+    unsigned m1, m2;
+    int l;
+
+    for ( l = domx86->params->levels - 1; l >= 0; l-- )
+        for ( m1 = 0; m1 < domx86->n_mappings; m1++ )
+        {
+            map1 = domx86->maps + m1;
+            from = map1->lvls[l].from;
+            to = map1->lvls[l].to;
+            pg = get_pg_table_x86(dom, m1, l);
+            if ( !pg )
+                return -1;
+            for ( m2 = 0; m2 < domx86->n_mappings; m2++ )
+            {
+                map2 = domx86->maps + m2;
+                lvl = (l > 0) ? map2->lvls + l - 1 : &map2->area;
+                if ( l > 0 && lvl->pgtables == 0 )
+                    continue;
+                if ( lvl->from >= to || lvl->to <= from )
+                    continue;
+                p_s = (max(from, lvl->from) - from) >>
+                      (PAGE_SHIFT_X86 + l * PGTBL_LEVEL_SHIFT_X86);
+                p_e = (min(to, lvl->to) - from) >>
+                      (PAGE_SHIFT_X86 + l * PGTBL_LEVEL_SHIFT_X86);
+                pfn = ((max(from, lvl->from) - lvl->from) >>
+                      (PAGE_SHIFT_X86 + l * PGTBL_LEVEL_SHIFT_X86)) + lvl->pfn;
+                for ( p = p_s; p <= p_e; p++ )
+                {
+                    pg[p] = pfn_to_paddr(xc_dom_p2m(dom, pfn)) |
+                            get_pg_prot_x86(dom, l, pfn);
+                    pfn++;
+                }
+            }
+        }
+
+    return 0;
+}
+
 static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
 {
     struct xc_dom_image_x86 *domx86 = dom->arch_private;
-    xen_pfn_t l3pfn = dom->pgtables_seg.pfn;
-    xen_pfn_t l2pfn = l3pfn + domx86->pg_l3;
-    xen_pfn_t l1pfn = l2pfn + domx86->pg_l2;
-    l3_pgentry_64_t *l3tab;
-    l2_pgentry_64_t *l2tab = NULL;
-    l1_pgentry_64_t *l1tab = NULL;
-    unsigned long l3off, l2off = 0, l1off;
-    xen_vaddr_t addr;
-    xen_pfn_t pgpfn;
-    xen_pfn_t l3mfn = xc_dom_p2m(dom, l3pfn);
+    xen_pfn_t l3mfn, l3pfn;
 
+    l3pfn = domx86->maps[0].lvls[2].pfn;
+    l3mfn = xc_dom_p2m(dom, l3pfn);
     if ( dom->parms.pae == XEN_PAE_YES )
     {
         if ( l3mfn >= 0x100000 )
@@ -299,180 +454,34 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
         }
     }
 
-    l3tab = xc_dom_pfn_to_ptr(dom, l3pfn, 1);
-    if ( l3tab == NULL )
-        goto pfn_error;
-
-    for ( addr = dom->parms.virt_base; addr < dom->virt_pgtab_end;
-          addr += PAGE_SIZE_X86 )
-    {
-        if ( l2tab == NULL )
-        {
-            /* get L2 tab, make L3 entry */
-            l2tab = xc_dom_pfn_to_ptr(dom, l2pfn, 1);
-            if ( l2tab == NULL )
-                goto pfn_error;
-            l3off = l3_table_offset_pae(addr);
-            l3tab[l3off] =
-                pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
-            l2pfn++;
-        }
-
-        if ( l1tab == NULL )
-        {
-            /* get L1 tab, make L2 entry */
-            l1tab = xc_dom_pfn_to_ptr(dom, l1pfn, 1);
-            if ( l1tab == NULL )
-                goto pfn_error;
-            l2off = l2_table_offset_pae(addr);
-            l2tab[l2off] =
-                pfn_to_paddr(xc_dom_p2m(dom, l1pfn)) | L2_PROT;
-            l1pfn++;
-        }
-
-        /* make L1 entry */
-        l1off = l1_table_offset_pae(addr);
-        pgpfn = (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
-        l1tab[l1off] =
-            pfn_to_paddr(xc_dom_p2m(dom, pgpfn)) | L1_PROT;
-        if ( (!dom->pvh_enabled)                &&
-             (addr >= dom->pgtables_seg.vstart) &&
-             (addr < dom->pgtables_seg.vend) )
-            l1tab[l1off] &= ~_PAGE_RW; /* page tables are r/o */
-
-        if ( l1off == (L1_PAGETABLE_ENTRIES_PAE - 1) )
-        {
-            l1tab = NULL;
-            if ( l2off == (L2_PAGETABLE_ENTRIES_PAE - 1) )
-                l2tab = NULL;
-        }
-    }
-
-    if ( dom->virt_pgtab_end <= 0xc0000000 )
-    {
-        DOMPRINTF("%s: PAE: extra l2 page table for l3#3", __FUNCTION__);
-        l3tab[3] = pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
-    }
-    return 0;
-
-pfn_error:
-    xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                 "%s: xc_dom_pfn_to_ptr failed", __FUNCTION__);
-    return -EINVAL;
+    return setup_pgtables_x86(dom);
 }
 
-#undef L1_PROT
-#undef L2_PROT
-#undef L3_PROT
-
 /* ------------------------------------------------------------------------ */
 /* x86_64 pagetables                                                        */
 
+static struct xc_dom_params x86_64_params = {
+    .levels = PGTBL_LEVELS_X86_64,
+    .vaddr_mask = bits_to_mask(VIRT_BITS_X86_64),
+    .lvl_prot[0] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED,
+    .lvl_prot[1] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+    .lvl_prot[2] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+    .lvl_prot[3] = _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER,
+};
+
 static int alloc_pgtables_x86_64(struct xc_dom_image *dom)
 {
-    return alloc_pgtables(dom, 0,
-                          L4_PAGETABLE_SHIFT_X86_64 + 9,
-                          L4_PAGETABLE_SHIFT_X86_64,
-                          L3_PAGETABLE_SHIFT_X86_64,
-                          L2_PAGETABLE_SHIFT_X86_64);
-}
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
 
-#define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
-#define L2_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
-#define L3_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
-#define L4_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_USER)
+    domx86->params = &x86_64_params;
+    return alloc_pgtables(dom);
+}
 
 static int setup_pgtables_x86_64(struct xc_dom_image *dom)
 {
-    struct xc_dom_image_x86 *domx86 = dom->arch_private;
-    xen_pfn_t l4pfn = dom->pgtables_seg.pfn;
-    xen_pfn_t l3pfn = l4pfn + domx86->pg_l4;
-    xen_pfn_t l2pfn = l3pfn + domx86->pg_l3;
-    xen_pfn_t l1pfn = l2pfn + domx86->pg_l2;
-    l4_pgentry_64_t *l4tab = xc_dom_pfn_to_ptr(dom, l4pfn, 1);
-    l3_pgentry_64_t *l3tab = NULL;
-    l2_pgentry_64_t *l2tab = NULL;
-    l1_pgentry_64_t *l1tab = NULL;
-    uint64_t l4off, l3off = 0, l2off = 0, l1off;
-    uint64_t addr;
-    xen_pfn_t pgpfn;
-
-    if ( l4tab == NULL )
-        goto pfn_error;
-
-    for ( addr = dom->parms.virt_base; addr < dom->virt_pgtab_end;
-          addr += PAGE_SIZE_X86 )
-    {
-        if ( l3tab == NULL )
-        {
-            /* get L3 tab, make L4 entry */
-            l3tab = xc_dom_pfn_to_ptr(dom, l3pfn, 1);
-            if ( l3tab == NULL )
-                goto pfn_error;
-            l4off = l4_table_offset_x86_64(addr);
-            l4tab[l4off] =
-                pfn_to_paddr(xc_dom_p2m(dom, l3pfn)) | L4_PROT;
-            l3pfn++;
-        }
-
-        if ( l2tab == NULL )
-        {
-            /* get L2 tab, make L3 entry */
-            l2tab = xc_dom_pfn_to_ptr(dom, l2pfn, 1);
-            if ( l2tab == NULL )
-                goto pfn_error;
-            l3off = l3_table_offset_x86_64(addr);
-            l3tab[l3off] =
-                pfn_to_paddr(xc_dom_p2m(dom, l2pfn)) | L3_PROT;
-            l2pfn++;
-        }
-
-        if ( l1tab == NULL )
-        {
-            /* get L1 tab, make L2 entry */
-            l1tab = xc_dom_pfn_to_ptr(dom, l1pfn, 1);
-            if ( l1tab == NULL )
-                goto pfn_error;
-            l2off = l2_table_offset_x86_64(addr);
-            l2tab[l2off] =
-                pfn_to_paddr(xc_dom_p2m(dom, l1pfn)) | L2_PROT;
-            l1pfn++;
-        }
-
-        /* make L1 entry */
-        l1off = l1_table_offset_x86_64(addr);
-        pgpfn = (addr - dom->parms.virt_base) >> PAGE_SHIFT_X86;
-        l1tab[l1off] =
-            pfn_to_paddr(xc_dom_p2m(dom, pgpfn)) | L1_PROT;
-        if ( (!dom->pvh_enabled)                &&
-             (addr >= dom->pgtables_seg.vstart) &&
-             (addr < dom->pgtables_seg.vend) )
-            l1tab[l1off] &= ~_PAGE_RW; /* page tables are r/o */
-
-        if ( l1off == (L1_PAGETABLE_ENTRIES_X86_64 - 1) )
-        {
-            l1tab = NULL;
-            if ( l2off == (L2_PAGETABLE_ENTRIES_X86_64 - 1) )
-            {
-                l2tab = NULL;
-                if ( l3off == (L3_PAGETABLE_ENTRIES_X86_64 - 1) )
-                    l3tab = NULL;
-            }
-        }
-    }
-    return 0;
-
-pfn_error:
-    xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                 "%s: xc_dom_pfn_to_ptr failed", __FUNCTION__);
-    return -EINVAL;
+    return setup_pgtables_x86(dom);
 }
 
-#undef L1_PROT
-#undef L2_PROT
-#undef L3_PROT
-#undef L4_PROT
-
 /* ------------------------------------------------------------------------ */
 
 static int alloc_p2m_list(struct xc_dom_image *dom)
@@ -659,7 +668,7 @@ static int start_info_x86_32(struct xc_dom_image *dom)
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;
-    start_info->nr_pt_frames = domx86->pgtables;
+    start_info->nr_pt_frames = domx86->maps[0].area.pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
 
     start_info->flags = dom->flags;
@@ -706,7 +715,7 @@ static int start_info_x86_64(struct xc_dom_image *dom)
     start_info->nr_pages = dom->total_pages;
     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
     start_info->pt_base = dom->pgtables_seg.vstart;
-    start_info->nr_pt_frames = domx86->pgtables;
+    start_info->nr_pt_frames = domx86->maps[0].area.pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
 
     start_info->flags = dom->flags;
diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index 5544897..a76d6b3 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -62,10 +62,13 @@ unsigned long csum_page (void * page);
 #define _PAGE_PSE       0x080
 #define _PAGE_GLOBAL    0x100
 
-#define L1_PAGETABLE_SHIFT_I386       12
-#define L2_PAGETABLE_SHIFT_I386       22
-#define L1_PAGETABLE_ENTRIES_I386   1024
-#define L2_PAGETABLE_ENTRIES_I386   1024
+#define VIRT_BITS_I386     32
+#define VIRT_BITS_X86_64   48
+
+#define PGTBL_LEVELS_I386       3
+#define PGTBL_LEVELS_X86_64     4
+
+#define PGTBL_LEVEL_SHIFT_X86   9
 
 #define L1_PAGETABLE_SHIFT_PAE        12
 #define L2_PAGETABLE_SHIFT_PAE        21
@@ -83,33 +86,7 @@ unsigned long csum_page (void * page);
 #define L3_PAGETABLE_ENTRIES_X86_64  512
 #define L4_PAGETABLE_ENTRIES_X86_64  512
 
-typedef uint32_t l1_pgentry_32_t;
-typedef uint32_t l2_pgentry_32_t;
-typedef uint64_t l1_pgentry_64_t;
-typedef uint64_t l2_pgentry_64_t;
-typedef uint64_t l3_pgentry_64_t;
-typedef uint64_t l4_pgentry_64_t;
-
-#define l1_table_offset_i386(_a) \
-  (((_a) >> L1_PAGETABLE_SHIFT_I386) & (L1_PAGETABLE_ENTRIES_I386 - 1))
-#define l2_table_offset_i386(_a) \
-  (((_a) >> L2_PAGETABLE_SHIFT_I386) & (L2_PAGETABLE_ENTRIES_I386 - 1))
-
-#define l1_table_offset_pae(_a) \
-  (((_a) >> L1_PAGETABLE_SHIFT_PAE) & (L1_PAGETABLE_ENTRIES_PAE - 1))
-#define l2_table_offset_pae(_a) \
-  (((_a) >> L2_PAGETABLE_SHIFT_PAE) & (L2_PAGETABLE_ENTRIES_PAE - 1))
-#define l3_table_offset_pae(_a) \
-  (((_a) >> L3_PAGETABLE_SHIFT_PAE) & (L3_PAGETABLE_ENTRIES_PAE - 1))
-
-#define l1_table_offset_x86_64(_a) \
-  (((_a) >> L1_PAGETABLE_SHIFT_X86_64) & (L1_PAGETABLE_ENTRIES_X86_64 - 1))
-#define l2_table_offset_x86_64(_a) \
-  (((_a) >> L2_PAGETABLE_SHIFT_X86_64) & (L2_PAGETABLE_ENTRIES_X86_64 - 1))
-#define l3_table_offset_x86_64(_a) \
-  (((_a) >> L3_PAGETABLE_SHIFT_X86_64) & (L3_PAGETABLE_ENTRIES_X86_64 - 1))
-#define l4_table_offset_x86_64(_a) \
-  (((_a) >> L4_PAGETABLE_SHIFT_X86_64) & (L4_PAGETABLE_ENTRIES_X86_64 - 1))
+typedef uint64_t x86_pgentry_t;
 
 #define PAGE_SHIFT_ARM          12
 #define PAGE_SIZE_ARM           (1UL << PAGE_SHIFT_ARM)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:40:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:40: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 1a1XVL-0005i5-5d; Wed, 25 Nov 2015 10:40:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVJ-0005hk-DE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:49 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	21/79-18107-03095565; Wed, 25 Nov 2015 10:40:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448448046!6350681!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26366 invoked from network); 25 Nov 2015 10:40:46 -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;
	25 Nov 2015 10:40:46 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVF-0006cy-To
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVF-0002yH-PX
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:45 +0000
Date: Wed, 25 Nov 2015 10:40:45 +0000
Message-Id: <E1a1XVF-0002yH-PX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: create p2m list outside of
	kernel mapping if supported
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit abdf3c5b2b971dc12e665e8e0cda184b416efffe
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:36 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:19:22 2015 +0000

    libxc: create p2m list outside of kernel mapping if supported
    
    In case the kernel of a new pv-domU indicates it is supporting a p2m
    list outside the initial kernel mapping by specifying INIT_P2M, let
    the domain builder allocate the memory for the p2m list from physical
    guest memory only and map it to the address the kernel is expecting.
    
    This will enable loading pv-domUs larger than 512 GB.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    1 +
 tools/libxc/xc_dom_core.c    |   15 ++++++++++-
 tools/libxc/xc_dom_x86.c     |   56 ++++++++++++++++++++++++++++++++++++-----
 3 files changed, 64 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 5ba48db..6f0c6e0 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -241,6 +241,7 @@ struct xc_dom_arch {
     char *native_protocol;
     int page_shift;
     int sizeof_pfn;
+    int p2m_base_supported;
     int arch_private_size;
 
     struct xc_dom_arch *next;
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index ad91b35..5d6c3ba 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -777,6 +777,7 @@ struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
     dom->parms.virt_hypercall = UNSET_ADDR;
     dom->parms.virt_hv_start_low = UNSET_ADDR;
     dom->parms.elf_paddr_offset = UNSET_ADDR;
+    dom->parms.p2m_base = UNSET_ADDR;
 
     dom->alloc_malloc += sizeof(*dom);
     return dom;
@@ -1096,7 +1097,11 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     }
 
     /* allocate other pages */
-    if ( dom->arch_hooks->alloc_p2m_list &&
+    if ( !dom->arch_hooks->p2m_base_supported ||
+         dom->parms.p2m_base >= dom->parms.virt_base ||
+         (dom->parms.p2m_base & (XC_DOM_PAGE_SIZE(dom) - 1)) )
+        dom->parms.p2m_base = UNSET_ADDR;
+    if ( dom->arch_hooks->alloc_p2m_list && dom->parms.p2m_base == UNSET_ADDR &&
          dom->arch_hooks->alloc_p2m_list(dom) != 0 )
         goto err;
     if ( dom->arch_hooks->alloc_magic_pages(dom) != 0 )
@@ -1124,6 +1129,14 @@ int xc_dom_build_image(struct xc_dom_image *dom)
         dom->initrd_len = page_size * dom->ramdisk_seg.pages;
     }
 
+    /* Allocate p2m list if outside of initial kernel mapping. */
+    if ( dom->arch_hooks->alloc_p2m_list && dom->parms.p2m_base != UNSET_ADDR )
+    {
+        if ( dom->arch_hooks->alloc_p2m_list(dom) != 0 )
+            goto err;
+        dom->p2m_seg.vstart = dom->parms.p2m_base;
+    }
+
     return 0;
 
  err:
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 1614354..7279fa2 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -69,6 +69,7 @@
 #define bits_to_mask(bits)       (((xen_vaddr_t)1 << (bits))-1)
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask)     ((addr) | (mask))
+#define round_pg_up(addr)  (((addr) + PAGE_SIZE_X86 - 1) & ~(PAGE_SIZE_X86 - 1))
 
 struct xc_dom_params {
     unsigned levels;
@@ -90,7 +91,7 @@ struct xc_dom_x86_mapping {
 
 struct xc_dom_image_x86 {
     unsigned n_mappings;
-#define MAPPING_MAX 1
+#define MAPPING_MAX 2
     struct xc_dom_x86_mapping maps[MAPPING_MAX];
     struct xc_dom_params *params;
 };
@@ -484,11 +485,8 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
 
 /* ------------------------------------------------------------------------ */
 
-static int alloc_p2m_list(struct xc_dom_image *dom)
+static int alloc_p2m_list(struct xc_dom_image *dom, size_t p2m_alloc_size)
 {
-    size_t p2m_alloc_size = dom->p2m_size * dom->arch_hooks->sizeof_pfn;
-
-    /* allocate phys2mach table */
     if ( xc_dom_alloc_segment(dom, &dom->p2m_seg, "phys2mach",
                               0, p2m_alloc_size) )
         return -1;
@@ -499,6 +497,40 @@ static int alloc_p2m_list(struct xc_dom_image *dom)
     return 0;
 }
 
+static int alloc_p2m_list_x86_32(struct xc_dom_image *dom)
+{
+    size_t p2m_alloc_size = dom->p2m_size * dom->arch_hooks->sizeof_pfn;
+
+    p2m_alloc_size = round_pg_up(p2m_alloc_size);
+    return alloc_p2m_list(dom, p2m_alloc_size);
+}
+
+static int alloc_p2m_list_x86_64(struct xc_dom_image *dom)
+{
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map = domx86->maps + domx86->n_mappings;
+    size_t p2m_alloc_size = dom->p2m_size * dom->arch_hooks->sizeof_pfn;
+    xen_vaddr_t from, to;
+    unsigned lvl;
+
+    p2m_alloc_size = round_pg_up(p2m_alloc_size);
+    if ( dom->parms.p2m_base != UNSET_ADDR )
+    {
+        from = dom->parms.p2m_base;
+        to = from + p2m_alloc_size - 1;
+        if ( count_pgtables(dom, from, to, dom->pfn_alloc_end) )
+            return -1;
+
+        map->area.pfn = dom->pfn_alloc_end;
+        for ( lvl = 0; lvl < 4; lvl++ )
+            map->lvls[lvl].pfn += p2m_alloc_size >> PAGE_SHIFT_X86;
+        domx86->n_mappings++;
+        p2m_alloc_size += map->area.pgtables << PAGE_SHIFT_X86;
+    }
+
+    return alloc_p2m_list(dom, p2m_alloc_size);
+}
+
 /* ------------------------------------------------------------------------ */
 
 static int alloc_magic_pages(struct xc_dom_image *dom)
@@ -717,6 +749,11 @@ static int start_info_x86_64(struct xc_dom_image *dom)
     start_info->pt_base = dom->pgtables_seg.vstart;
     start_info->nr_pt_frames = domx86->maps[0].area.pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
+    if ( dom->parms.p2m_base != UNSET_ADDR )
+    {
+        start_info->first_p2m_pfn = dom->p2m_seg.pfn;
+        start_info->nr_p2m_frames = dom->p2m_seg.pages;
+    }
 
     start_info->flags = dom->flags;
     start_info->store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);
@@ -1601,7 +1638,10 @@ static int bootlate_pv(struct xc_dom_image *dom)
     if ( !xc_dom_feature_translated(dom) )
     {
         /* paravirtualized guest */
+
+        /* Drop references to all initial page tables before pinning. */
         xc_dom_unmap_one(dom, dom->pgtables_seg.pfn);
+        xc_dom_unmap_one(dom, dom->p2m_seg.pfn);
         rc = pin_table(dom->xch, pgd_type,
                        xc_dom_p2m(dom, dom->pgtables_seg.pfn),
                        dom->guest_domid);
@@ -1680,10 +1720,11 @@ static struct xc_dom_arch xc_dom_32_pae = {
     .native_protocol = XEN_IO_PROTO_ABI_X86_32,
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 4,
+    .p2m_base_supported = 0,
     .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_32_pae,
-    .alloc_p2m_list = alloc_p2m_list,
+    .alloc_p2m_list = alloc_p2m_list_x86_32,
     .setup_pgtables = setup_pgtables_x86_32_pae,
     .start_info = start_info_x86_32,
     .shared_info = shared_info_x86_32,
@@ -1698,10 +1739,11 @@ static struct xc_dom_arch xc_dom_64 = {
     .native_protocol = XEN_IO_PROTO_ABI_X86_64,
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 8,
+    .p2m_base_supported = 1,
     .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_64,
-    .alloc_p2m_list = alloc_p2m_list,
+    .alloc_p2m_list = alloc_p2m_list_x86_64,
     .setup_pgtables = setup_pgtables_x86_64,
     .start_info = start_info_x86_64,
     .shared_info = shared_info_x86_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 Wed Nov 25 10:40:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:40: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 1a1XVL-0005i5-5d; Wed, 25 Nov 2015 10:40:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVJ-0005hk-DE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:49 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	21/79-18107-03095565; Wed, 25 Nov 2015 10:40:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448448046!6350681!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26366 invoked from network); 25 Nov 2015 10:40:46 -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;
	25 Nov 2015 10:40:46 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVF-0006cy-To
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVF-0002yH-PX
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:45 +0000
Date: Wed, 25 Nov 2015 10:40:45 +0000
Message-Id: <E1a1XVF-0002yH-PX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: create p2m list outside of
	kernel mapping if supported
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit abdf3c5b2b971dc12e665e8e0cda184b416efffe
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 12 14:43:36 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:19:22 2015 +0000

    libxc: create p2m list outside of kernel mapping if supported
    
    In case the kernel of a new pv-domU indicates it is supporting a p2m
    list outside the initial kernel mapping by specifying INIT_P2M, let
    the domain builder allocate the memory for the p2m list from physical
    guest memory only and map it to the address the kernel is expecting.
    
    This will enable loading pv-domUs larger than 512 GB.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    1 +
 tools/libxc/xc_dom_core.c    |   15 ++++++++++-
 tools/libxc/xc_dom_x86.c     |   56 ++++++++++++++++++++++++++++++++++++-----
 3 files changed, 64 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 5ba48db..6f0c6e0 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -241,6 +241,7 @@ struct xc_dom_arch {
     char *native_protocol;
     int page_shift;
     int sizeof_pfn;
+    int p2m_base_supported;
     int arch_private_size;
 
     struct xc_dom_arch *next;
diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c
index ad91b35..5d6c3ba 100644
--- a/tools/libxc/xc_dom_core.c
+++ b/tools/libxc/xc_dom_core.c
@@ -777,6 +777,7 @@ struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
     dom->parms.virt_hypercall = UNSET_ADDR;
     dom->parms.virt_hv_start_low = UNSET_ADDR;
     dom->parms.elf_paddr_offset = UNSET_ADDR;
+    dom->parms.p2m_base = UNSET_ADDR;
 
     dom->alloc_malloc += sizeof(*dom);
     return dom;
@@ -1096,7 +1097,11 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     }
 
     /* allocate other pages */
-    if ( dom->arch_hooks->alloc_p2m_list &&
+    if ( !dom->arch_hooks->p2m_base_supported ||
+         dom->parms.p2m_base >= dom->parms.virt_base ||
+         (dom->parms.p2m_base & (XC_DOM_PAGE_SIZE(dom) - 1)) )
+        dom->parms.p2m_base = UNSET_ADDR;
+    if ( dom->arch_hooks->alloc_p2m_list && dom->parms.p2m_base == UNSET_ADDR &&
          dom->arch_hooks->alloc_p2m_list(dom) != 0 )
         goto err;
     if ( dom->arch_hooks->alloc_magic_pages(dom) != 0 )
@@ -1124,6 +1129,14 @@ int xc_dom_build_image(struct xc_dom_image *dom)
         dom->initrd_len = page_size * dom->ramdisk_seg.pages;
     }
 
+    /* Allocate p2m list if outside of initial kernel mapping. */
+    if ( dom->arch_hooks->alloc_p2m_list && dom->parms.p2m_base != UNSET_ADDR )
+    {
+        if ( dom->arch_hooks->alloc_p2m_list(dom) != 0 )
+            goto err;
+        dom->p2m_seg.vstart = dom->parms.p2m_base;
+    }
+
     return 0;
 
  err:
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 1614354..7279fa2 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -69,6 +69,7 @@
 #define bits_to_mask(bits)       (((xen_vaddr_t)1 << (bits))-1)
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask)     ((addr) | (mask))
+#define round_pg_up(addr)  (((addr) + PAGE_SIZE_X86 - 1) & ~(PAGE_SIZE_X86 - 1))
 
 struct xc_dom_params {
     unsigned levels;
@@ -90,7 +91,7 @@ struct xc_dom_x86_mapping {
 
 struct xc_dom_image_x86 {
     unsigned n_mappings;
-#define MAPPING_MAX 1
+#define MAPPING_MAX 2
     struct xc_dom_x86_mapping maps[MAPPING_MAX];
     struct xc_dom_params *params;
 };
@@ -484,11 +485,8 @@ static int setup_pgtables_x86_64(struct xc_dom_image *dom)
 
 /* ------------------------------------------------------------------------ */
 
-static int alloc_p2m_list(struct xc_dom_image *dom)
+static int alloc_p2m_list(struct xc_dom_image *dom, size_t p2m_alloc_size)
 {
-    size_t p2m_alloc_size = dom->p2m_size * dom->arch_hooks->sizeof_pfn;
-
-    /* allocate phys2mach table */
     if ( xc_dom_alloc_segment(dom, &dom->p2m_seg, "phys2mach",
                               0, p2m_alloc_size) )
         return -1;
@@ -499,6 +497,40 @@ static int alloc_p2m_list(struct xc_dom_image *dom)
     return 0;
 }
 
+static int alloc_p2m_list_x86_32(struct xc_dom_image *dom)
+{
+    size_t p2m_alloc_size = dom->p2m_size * dom->arch_hooks->sizeof_pfn;
+
+    p2m_alloc_size = round_pg_up(p2m_alloc_size);
+    return alloc_p2m_list(dom, p2m_alloc_size);
+}
+
+static int alloc_p2m_list_x86_64(struct xc_dom_image *dom)
+{
+    struct xc_dom_image_x86 *domx86 = dom->arch_private;
+    struct xc_dom_x86_mapping *map = domx86->maps + domx86->n_mappings;
+    size_t p2m_alloc_size = dom->p2m_size * dom->arch_hooks->sizeof_pfn;
+    xen_vaddr_t from, to;
+    unsigned lvl;
+
+    p2m_alloc_size = round_pg_up(p2m_alloc_size);
+    if ( dom->parms.p2m_base != UNSET_ADDR )
+    {
+        from = dom->parms.p2m_base;
+        to = from + p2m_alloc_size - 1;
+        if ( count_pgtables(dom, from, to, dom->pfn_alloc_end) )
+            return -1;
+
+        map->area.pfn = dom->pfn_alloc_end;
+        for ( lvl = 0; lvl < 4; lvl++ )
+            map->lvls[lvl].pfn += p2m_alloc_size >> PAGE_SHIFT_X86;
+        domx86->n_mappings++;
+        p2m_alloc_size += map->area.pgtables << PAGE_SHIFT_X86;
+    }
+
+    return alloc_p2m_list(dom, p2m_alloc_size);
+}
+
 /* ------------------------------------------------------------------------ */
 
 static int alloc_magic_pages(struct xc_dom_image *dom)
@@ -717,6 +749,11 @@ static int start_info_x86_64(struct xc_dom_image *dom)
     start_info->pt_base = dom->pgtables_seg.vstart;
     start_info->nr_pt_frames = domx86->maps[0].area.pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
+    if ( dom->parms.p2m_base != UNSET_ADDR )
+    {
+        start_info->first_p2m_pfn = dom->p2m_seg.pfn;
+        start_info->nr_p2m_frames = dom->p2m_seg.pages;
+    }
 
     start_info->flags = dom->flags;
     start_info->store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);
@@ -1601,7 +1638,10 @@ static int bootlate_pv(struct xc_dom_image *dom)
     if ( !xc_dom_feature_translated(dom) )
     {
         /* paravirtualized guest */
+
+        /* Drop references to all initial page tables before pinning. */
         xc_dom_unmap_one(dom, dom->pgtables_seg.pfn);
+        xc_dom_unmap_one(dom, dom->p2m_seg.pfn);
         rc = pin_table(dom->xch, pgd_type,
                        xc_dom_p2m(dom, dom->pgtables_seg.pfn),
                        dom->guest_domid);
@@ -1680,10 +1720,11 @@ static struct xc_dom_arch xc_dom_32_pae = {
     .native_protocol = XEN_IO_PROTO_ABI_X86_32,
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 4,
+    .p2m_base_supported = 0,
     .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_32_pae,
-    .alloc_p2m_list = alloc_p2m_list,
+    .alloc_p2m_list = alloc_p2m_list_x86_32,
     .setup_pgtables = setup_pgtables_x86_32_pae,
     .start_info = start_info_x86_32,
     .shared_info = shared_info_x86_32,
@@ -1698,10 +1739,11 @@ static struct xc_dom_arch xc_dom_64 = {
     .native_protocol = XEN_IO_PROTO_ABI_X86_64,
     .page_shift = PAGE_SHIFT_X86,
     .sizeof_pfn = 8,
+    .p2m_base_supported = 1,
     .arch_private_size = sizeof(struct xc_dom_image_x86),
     .alloc_magic_pages = alloc_magic_pages,
     .alloc_pgtables = alloc_pgtables_x86_64,
-    .alloc_p2m_list = alloc_p2m_list,
+    .alloc_p2m_list = alloc_p2m_list_x86_64,
     .setup_pgtables = setup_pgtables_x86_64,
     .start_info = start_info_x86_64,
     .shared_info = shared_info_x86_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 Wed Nov 25 10:41:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:41: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 1a1XVV-0005js-BY; Wed, 25 Nov 2015 10:41: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 1a1XVT-0005jV-7m
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:59 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	9A/B4-13183-A3095565; Wed, 25 Nov 2015 10:40:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448448056!6392662!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34654 invoked from network); 25 Nov 2015 10:40:57 -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;
	25 Nov 2015 10:40:57 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVQ-0006d6-Pp
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVQ-0002zI-MQ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:56 +0000
Date: Wed, 25 Nov 2015 10:40:56 +0000
Message-Id: <E1a1XVQ-0002zI-MQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: fix setup of Xen
	internally used IRQs (take 2)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fc0c3fa2ad5cdb7e9ccb068e3301499acf643bec
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 16 13:11:08 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 16 13:11:08 2015 +0100

    x86/IO-APIC: fix setup of Xen internally used IRQs (take 2)
    
    ..., i.e. namely that of a PCI serial card with an IRQ above the
    legacy range. This had got broken by the switch to cpumask_any() in
    cpu_mask_to_apicid_phys(). Fix this by allowing all CPUs for that IRQ
    (via setup_vector_irq() properly updating a booting CPU's vector_irq[],
    thus avoiding "No irq handler for vector" messages and the interrupt
    not working).
    
    Cleanup coding style and types there at once.
    
    While doing this I also noticed that io_apic_set_pci_routing() can't
    be quite right: It sets up the destination _before_ getting a vector
    allocated (which on other than systems using the flat APIC mode
    affects the possible destinations), and also didn't restrict affinity
    to ->arch.cpu_mask (as established by assign_irq_vector()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c    |    8 +++++++-
 xen/arch/x86/irq.c        |   27 +++++++++++++++++++--------
 xen/arch/x86/smpboot.c    |    2 +-
 xen/include/asm-x86/irq.h |    2 +-
 4 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index f8c8e55..511cd40 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2201,6 +2201,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 {
     struct irq_desc *desc = irq_to_desc(irq);
     struct IO_APIC_route_entry entry;
+    cpumask_t mask;
     unsigned long flags;
     int vector;
 
@@ -2220,7 +2221,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 
     entry.delivery_mode = INT_DELIVERY_MODE;
     entry.dest_mode = INT_DEST_MODE;
-    SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
     entry.trigger = edge_level;
     entry.polarity = active_high_low;
     entry.mask  = 1;
@@ -2236,6 +2236,12 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
         return vector;
     entry.vector = vector;
 
+    cpumask_copy(&mask, TARGET_CPUS);
+    /* Don't chance ending up with an empty mask. */
+    if (cpumask_intersects(&mask, desc->arch.cpu_mask))
+        cpumask_and(&mask, &mask, desc->arch.cpu_mask);
+    SET_DEST(entry, logical, cpu_mask_to_apicid(&mask));
+
     apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
 		"(%d-%d -> %#x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
 		mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index f1397d6..5f515a0 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -563,21 +563,26 @@ int assign_irq_vector(int irq, const cpumask_t *mask)
  * Initialize vector_irq on a new cpu. This function must be called
  * with vector_lock held.
  */
-void __setup_vector_irq(int cpu)
+void setup_vector_irq(unsigned int cpu)
 {
-    int irq, vector;
+    unsigned int irq, vector;
 
     /* Clear vector_irq */
-    for (vector = 0; vector < NR_VECTORS; ++vector)
+    for ( vector = 0; vector < NR_VECTORS; ++vector )
         per_cpu(vector_irq, cpu)[vector] = INT_MIN;
     /* Mark the inuse vectors */
-    for (irq = 0; irq < nr_irqs; ++irq) {
+    for ( irq = 0; irq < nr_irqs; ++irq )
+    {
         struct irq_desc *desc = irq_to_desc(irq);
 
-        if (!irq_desc_initialized(desc) ||
-            !cpumask_test_cpu(cpu, desc->arch.cpu_mask))
+        if ( !irq_desc_initialized(desc) )
             continue;
         vector = irq_to_vector(irq);
+        if ( vector >= FIRST_HIPRIORITY_VECTOR &&
+             vector <= LAST_HIPRIORITY_VECTOR )
+            cpumask_set_cpu(cpu, desc->arch.cpu_mask);
+        else if ( !cpumask_test_cpu(cpu, desc->arch.cpu_mask) )
+            continue;
         per_cpu(vector_irq, cpu)[vector] = irq;
     }
 }
@@ -2334,8 +2339,8 @@ void fixup_irqs(void)
 
     for ( irq = 0; irq < nr_irqs; irq++ )
     {
-        int break_affinity = 0;
-        int set_affinity = 1;
+        bool_t break_affinity = 0, set_affinity = 1;
+        unsigned int vector;
         cpumask_t affinity;
 
         if ( irq == 2 )
@@ -2347,6 +2352,12 @@ void fixup_irqs(void)
 
         spin_lock(&desc->lock);
 
+        vector = irq_to_vector(irq);
+        if ( vector >= FIRST_HIPRIORITY_VECTOR &&
+             vector <= LAST_HIPRIORITY_VECTOR )
+            cpumask_and(desc->arch.cpu_mask, desc->arch.cpu_mask,
+                        &cpu_online_map);
+
         cpumask_copy(&affinity, desc->affinity);
         if ( !desc->action || cpumask_subset(&affinity, &cpu_online_map) )
         {
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index dabc929..833a0a5 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -387,7 +387,7 @@ void start_secondary(void *unused)
      * this lock ensures we don't half assign or remove an irq from a cpu.
      */
     lock_vector_lock();
-    __setup_vector_irq(cpu);
+    setup_vector_irq(cpu);
     cpumask_set_cpu(cpu, &cpu_online_map);
     unlock_vector_lock();
 
diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h
index a44305e..fcf37a3 100644
--- a/xen/include/asm-x86/irq.h
+++ b/xen/include/asm-x86/irq.h
@@ -167,7 +167,7 @@ extern struct irq_desc *irq_desc;
 void lock_vector_lock(void);
 void unlock_vector_lock(void);
 
-void __setup_vector_irq(int cpu);
+void setup_vector_irq(unsigned int cpu);
 
 void move_native_irq(struct irq_desc *);
 void move_masked_irq(struct irq_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 Wed Nov 25 10:41:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:41: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 1a1XVV-0005js-BY; Wed, 25 Nov 2015 10:41: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 1a1XVT-0005jV-7m
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:59 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	9A/B4-13183-A3095565; Wed, 25 Nov 2015 10:40:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448448056!6392662!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34654 invoked from network); 25 Nov 2015 10:40:57 -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;
	25 Nov 2015 10:40:57 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVQ-0006d6-Pp
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVQ-0002zI-MQ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:40:56 +0000
Date: Wed, 25 Nov 2015 10:40:56 +0000
Message-Id: <E1a1XVQ-0002zI-MQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: fix setup of Xen
	internally used IRQs (take 2)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fc0c3fa2ad5cdb7e9ccb068e3301499acf643bec
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 16 13:11:08 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 16 13:11:08 2015 +0100

    x86/IO-APIC: fix setup of Xen internally used IRQs (take 2)
    
    ..., i.e. namely that of a PCI serial card with an IRQ above the
    legacy range. This had got broken by the switch to cpumask_any() in
    cpu_mask_to_apicid_phys(). Fix this by allowing all CPUs for that IRQ
    (via setup_vector_irq() properly updating a booting CPU's vector_irq[],
    thus avoiding "No irq handler for vector" messages and the interrupt
    not working).
    
    Cleanup coding style and types there at once.
    
    While doing this I also noticed that io_apic_set_pci_routing() can't
    be quite right: It sets up the destination _before_ getting a vector
    allocated (which on other than systems using the flat APIC mode
    affects the possible destinations), and also didn't restrict affinity
    to ->arch.cpu_mask (as established by assign_irq_vector()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c    |    8 +++++++-
 xen/arch/x86/irq.c        |   27 +++++++++++++++++++--------
 xen/arch/x86/smpboot.c    |    2 +-
 xen/include/asm-x86/irq.h |    2 +-
 4 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index f8c8e55..511cd40 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2201,6 +2201,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 {
     struct irq_desc *desc = irq_to_desc(irq);
     struct IO_APIC_route_entry entry;
+    cpumask_t mask;
     unsigned long flags;
     int vector;
 
@@ -2220,7 +2221,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
 
     entry.delivery_mode = INT_DELIVERY_MODE;
     entry.dest_mode = INT_DEST_MODE;
-    SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
     entry.trigger = edge_level;
     entry.polarity = active_high_low;
     entry.mask  = 1;
@@ -2236,6 +2236,12 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
         return vector;
     entry.vector = vector;
 
+    cpumask_copy(&mask, TARGET_CPUS);
+    /* Don't chance ending up with an empty mask. */
+    if (cpumask_intersects(&mask, desc->arch.cpu_mask))
+        cpumask_and(&mask, &mask, desc->arch.cpu_mask);
+    SET_DEST(entry, logical, cpu_mask_to_apicid(&mask));
+
     apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
 		"(%d-%d -> %#x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
 		mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index f1397d6..5f515a0 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -563,21 +563,26 @@ int assign_irq_vector(int irq, const cpumask_t *mask)
  * Initialize vector_irq on a new cpu. This function must be called
  * with vector_lock held.
  */
-void __setup_vector_irq(int cpu)
+void setup_vector_irq(unsigned int cpu)
 {
-    int irq, vector;
+    unsigned int irq, vector;
 
     /* Clear vector_irq */
-    for (vector = 0; vector < NR_VECTORS; ++vector)
+    for ( vector = 0; vector < NR_VECTORS; ++vector )
         per_cpu(vector_irq, cpu)[vector] = INT_MIN;
     /* Mark the inuse vectors */
-    for (irq = 0; irq < nr_irqs; ++irq) {
+    for ( irq = 0; irq < nr_irqs; ++irq )
+    {
         struct irq_desc *desc = irq_to_desc(irq);
 
-        if (!irq_desc_initialized(desc) ||
-            !cpumask_test_cpu(cpu, desc->arch.cpu_mask))
+        if ( !irq_desc_initialized(desc) )
             continue;
         vector = irq_to_vector(irq);
+        if ( vector >= FIRST_HIPRIORITY_VECTOR &&
+             vector <= LAST_HIPRIORITY_VECTOR )
+            cpumask_set_cpu(cpu, desc->arch.cpu_mask);
+        else if ( !cpumask_test_cpu(cpu, desc->arch.cpu_mask) )
+            continue;
         per_cpu(vector_irq, cpu)[vector] = irq;
     }
 }
@@ -2334,8 +2339,8 @@ void fixup_irqs(void)
 
     for ( irq = 0; irq < nr_irqs; irq++ )
     {
-        int break_affinity = 0;
-        int set_affinity = 1;
+        bool_t break_affinity = 0, set_affinity = 1;
+        unsigned int vector;
         cpumask_t affinity;
 
         if ( irq == 2 )
@@ -2347,6 +2352,12 @@ void fixup_irqs(void)
 
         spin_lock(&desc->lock);
 
+        vector = irq_to_vector(irq);
+        if ( vector >= FIRST_HIPRIORITY_VECTOR &&
+             vector <= LAST_HIPRIORITY_VECTOR )
+            cpumask_and(desc->arch.cpu_mask, desc->arch.cpu_mask,
+                        &cpu_online_map);
+
         cpumask_copy(&affinity, desc->affinity);
         if ( !desc->action || cpumask_subset(&affinity, &cpu_online_map) )
         {
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index dabc929..833a0a5 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -387,7 +387,7 @@ void start_secondary(void *unused)
      * this lock ensures we don't half assign or remove an irq from a cpu.
      */
     lock_vector_lock();
-    __setup_vector_irq(cpu);
+    setup_vector_irq(cpu);
     cpumask_set_cpu(cpu, &cpu_online_map);
     unlock_vector_lock();
 
diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h
index a44305e..fcf37a3 100644
--- a/xen/include/asm-x86/irq.h
+++ b/xen/include/asm-x86/irq.h
@@ -167,7 +167,7 @@ extern struct irq_desc *irq_desc;
 void lock_vector_lock(void);
 void unlock_vector_lock(void);
 
-void __setup_vector_irq(int cpu);
+void setup_vector_irq(unsigned int cpu);
 
 void move_native_irq(struct irq_desc *);
 void move_masked_irq(struct irq_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 Wed Nov 25 10:41:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:41: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 1a1XVf-0005no-GG; Wed, 25 Nov 2015 10:41: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 1a1XVd-0005m5-8T
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:09 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	35/A4-12831-44095565; Wed, 25 Nov 2015 10:41:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448448067!6344211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39276 invoked from network); 25 Nov 2015 10:41:08 -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;
	25 Nov 2015 10:41:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVb-0006dg-3F
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVb-00030k-0L
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:07 +0000
Date: Wed, 25 Nov 2015 10:41:07 +0000
Message-Id: <E1a1XVb-00030k-0L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: adjust setting of
	destinations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a85da715cfffbc294589ad4edc4c7564ae6fcc25
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 16 13:11:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 16 13:11:59 2015 +0100

    x86/IO-APIC: adjust setting of destinations
    
    setup_IO_APIC_irqs() runs before APs get brought up, so using
    desc->arch.cpu_mask as best risks it being either empty or having bits
    for CPUs other than the BP set. Just use the APIC ID of the only
    online CPU directly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 511cd40..6a71cef 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1039,7 +1039,7 @@ static void __init setup_IO_APIC_irqs(void)
                 disable_8259A_irq(irq_to_desc(irq));
 
             desc = irq_to_desc(irq);
-            SET_DEST(entry, logical, cpu_mask_to_apicid(desc->arch.cpu_mask));
+            SET_DEST(entry, logical, get_apic_id());
             spin_lock_irqsave(&ioapic_lock, flags);
             __ioapic_write_entry(apic, pin, 0, entry);
             set_native_irq_info(irq, TARGET_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 Nov 25 10:41:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:41: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 1a1XVf-0005no-GG; Wed, 25 Nov 2015 10:41: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 1a1XVd-0005m5-8T
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:09 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	35/A4-12831-44095565; Wed, 25 Nov 2015 10:41:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448448067!6344211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39276 invoked from network); 25 Nov 2015 10:41:08 -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;
	25 Nov 2015 10:41:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVb-0006dg-3F
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVb-00030k-0L
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:07 +0000
Date: Wed, 25 Nov 2015 10:41:07 +0000
Message-Id: <E1a1XVb-00030k-0L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: adjust setting of
	destinations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a85da715cfffbc294589ad4edc4c7564ae6fcc25
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 16 13:11:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 16 13:11:59 2015 +0100

    x86/IO-APIC: adjust setting of destinations
    
    setup_IO_APIC_irqs() runs before APs get brought up, so using
    desc->arch.cpu_mask as best risks it being either empty or having bits
    for CPUs other than the BP set. Just use the APIC ID of the only
    online CPU directly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 511cd40..6a71cef 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1039,7 +1039,7 @@ static void __init setup_IO_APIC_irqs(void)
                 disable_8259A_irq(irq_to_desc(irq));
 
             desc = irq_to_desc(irq);
-            SET_DEST(entry, logical, cpu_mask_to_apicid(desc->arch.cpu_mask));
+            SET_DEST(entry, logical, get_apic_id());
             spin_lock_irqsave(&ioapic_lock, flags);
             __ioapic_write_entry(apic, pin, 0, entry);
             set_native_irq_info(irq, TARGET_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 Nov 25 10:41:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:41: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 1a1XVv-0005qU-KR; Wed, 25 Nov 2015 10:41:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVs-0005q0-R9
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:24 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	F1/77-31443-45095565; Wed, 25 Nov 2015 10:41:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1448448082!761771!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 931 invoked from network); 25 Nov 2015 10:41:23 -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;
	25 Nov 2015 10:41:23 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVq-0006do-HZ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVl-00031O-8o
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:20 +0000
Date: Wed, 25 Nov 2015 10:41:17 +0000
Message-Id: <E1a1XVl-00031O-8o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: drop hard_smp_procssor_id()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ddebece6d540ac8d9211e9b3ff8f9c49cfccc428
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 16 13:12:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 16 13:12:20 2015 +0100

    x86: drop hard_smp_procssor_id()
    
    ... and use what it aliased to directly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/common.c     |    4 ++--
 xen/arch/x86/cpu/mcheck/mce.c |    3 ++-
 xen/arch/x86/io_apic.c        |    2 +-
 xen/arch/x86/smp.c            |    5 -----
 xen/arch/x86/smpboot.c        |    2 +-
 xen/include/asm-x86/smp.h     |    2 --
 6 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index a111ed6..e60929d 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -162,13 +162,13 @@ static inline u32 _phys_pkg_id(u32 cpuid_apic, int index_msb)
 /*
  * cpuid returns the value latched in the HW at reset, not the APIC ID
  * register's value.  For any box whose BIOS changes APIC IDs, like
- * clustered APIC systems, we must use hard_smp_processor_id.
+ * clustered APIC systems, we must use get_apic_id().
  *
  * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
  */
 static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
 {
-	return _phys_pkg_id(hard_smp_processor_id(), index_msb);
+	return _phys_pkg_id(get_apic_id(), index_msb);
 }
 
 /* Do minimum CPU detection early.
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 08cd3f2..d746d0e 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -20,6 +20,7 @@
 
 #include <asm/processor.h>
 #include <asm/system.h>
+#include <asm/apic.h>
 #include <asm/msr.h>
 #include <asm/p2m.h>
 
@@ -980,7 +981,7 @@ static void do_mc_get_cpu_info(void *v)
         cpuid(1, &junk, &ebx, &junk, &junk);
         xcp->mc_clusterid = (ebx >> 24) & 0xff;
     } else
-        xcp->mc_clusterid = hard_smp_processor_id();
+        xcp->mc_clusterid = get_apic_id();
 }
 
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 6a71cef..11a0e5d 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1843,7 +1843,7 @@ static void __init unlock_ExtINT_logic(void)
 
     entry1.dest_mode = 0;			/* physical delivery */
     entry1.mask = 0;			/* unmask IRQ now */
-    SET_DEST(entry1, physical, hard_smp_processor_id());
+    SET_DEST(entry1, physical, get_apic_id());
     entry1.delivery_mode = dest_ExtINT;
     entry1.polarity = entry0.polarity;
     entry1.trigger = 0;
diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c
index 8caa0bc..50ff6c2 100644
--- a/xen/arch/x86/smp.c
+++ b/xen/arch/x86/smp.c
@@ -23,11 +23,6 @@
 #include <asm/hvm/support.h>
 #include <mach_apic.h>
 
-int hard_smp_processor_id(void)
-{
-    return get_apic_id();
-}
-
 /*
  * send_IPI_mask(cpumask, vector): sends @vector IPI to CPUs in @cpumask,
  * excluding the local CPU. @cpumask may be empty.
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 833a0a5..5d48bac 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -854,7 +854,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
     {
         printk("weird, boot CPU (#%d) not listed by the BIOS.\n",
                boot_cpu_physical_apicid);
-        physid_set(hard_smp_processor_id(), phys_cpu_present_map);
+        physid_set(get_apic_id(), phys_cpu_present_map);
     }
 
     /* If we couldn't find a local APIC, then get out of here now! */
diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h
index fb0f42a..64f510b 100644
--- a/xen/include/asm-x86/smp.h
+++ b/xen/include/asm-x86/smp.h
@@ -54,8 +54,6 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm);
  */
 #define raw_smp_processor_id() (get_processor_id())
 
-int hard_smp_processor_id(void);
-
 void __stop_this_cpu(void);
 
 long cpu_up_helper(void *data);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:41:27 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:41: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 1a1XVv-0005qU-KR; Wed, 25 Nov 2015 10:41:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVs-0005q0-R9
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:24 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	F1/77-31443-45095565; Wed, 25 Nov 2015 10:41:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1448448082!761771!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 931 invoked from network); 25 Nov 2015 10:41:23 -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;
	25 Nov 2015 10:41:23 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVq-0006do-HZ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XVl-00031O-8o
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:20 +0000
Date: Wed, 25 Nov 2015 10:41:17 +0000
Message-Id: <E1a1XVl-00031O-8o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: drop hard_smp_procssor_id()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ddebece6d540ac8d9211e9b3ff8f9c49cfccc428
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Nov 16 13:12:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Nov 16 13:12:20 2015 +0100

    x86: drop hard_smp_procssor_id()
    
    ... and use what it aliased to directly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/common.c     |    4 ++--
 xen/arch/x86/cpu/mcheck/mce.c |    3 ++-
 xen/arch/x86/io_apic.c        |    2 +-
 xen/arch/x86/smp.c            |    5 -----
 xen/arch/x86/smpboot.c        |    2 +-
 xen/include/asm-x86/smp.h     |    2 --
 6 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index a111ed6..e60929d 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -162,13 +162,13 @@ static inline u32 _phys_pkg_id(u32 cpuid_apic, int index_msb)
 /*
  * cpuid returns the value latched in the HW at reset, not the APIC ID
  * register's value.  For any box whose BIOS changes APIC IDs, like
- * clustered APIC systems, we must use hard_smp_processor_id.
+ * clustered APIC systems, we must use get_apic_id().
  *
  * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
  */
 static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
 {
-	return _phys_pkg_id(hard_smp_processor_id(), index_msb);
+	return _phys_pkg_id(get_apic_id(), index_msb);
 }
 
 /* Do minimum CPU detection early.
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 08cd3f2..d746d0e 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -20,6 +20,7 @@
 
 #include <asm/processor.h>
 #include <asm/system.h>
+#include <asm/apic.h>
 #include <asm/msr.h>
 #include <asm/p2m.h>
 
@@ -980,7 +981,7 @@ static void do_mc_get_cpu_info(void *v)
         cpuid(1, &junk, &ebx, &junk, &junk);
         xcp->mc_clusterid = (ebx >> 24) & 0xff;
     } else
-        xcp->mc_clusterid = hard_smp_processor_id();
+        xcp->mc_clusterid = get_apic_id();
 }
 
 
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 6a71cef..11a0e5d 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1843,7 +1843,7 @@ static void __init unlock_ExtINT_logic(void)
 
     entry1.dest_mode = 0;			/* physical delivery */
     entry1.mask = 0;			/* unmask IRQ now */
-    SET_DEST(entry1, physical, hard_smp_processor_id());
+    SET_DEST(entry1, physical, get_apic_id());
     entry1.delivery_mode = dest_ExtINT;
     entry1.polarity = entry0.polarity;
     entry1.trigger = 0;
diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c
index 8caa0bc..50ff6c2 100644
--- a/xen/arch/x86/smp.c
+++ b/xen/arch/x86/smp.c
@@ -23,11 +23,6 @@
 #include <asm/hvm/support.h>
 #include <mach_apic.h>
 
-int hard_smp_processor_id(void)
-{
-    return get_apic_id();
-}
-
 /*
  * send_IPI_mask(cpumask, vector): sends @vector IPI to CPUs in @cpumask,
  * excluding the local CPU. @cpumask may be empty.
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 833a0a5..5d48bac 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -854,7 +854,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
     {
         printk("weird, boot CPU (#%d) not listed by the BIOS.\n",
                boot_cpu_physical_apicid);
-        physid_set(hard_smp_processor_id(), phys_cpu_present_map);
+        physid_set(get_apic_id(), phys_cpu_present_map);
     }
 
     /* If we couldn't find a local APIC, then get out of here now! */
diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h
index fb0f42a..64f510b 100644
--- a/xen/include/asm-x86/smp.h
+++ b/xen/include/asm-x86/smp.h
@@ -54,8 +54,6 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint32_t pxm);
  */
 #define raw_smp_processor_id() (get_processor_id())
 
-int hard_smp_processor_id(void);
-
 void __stop_this_cpu(void);
 
 long cpu_up_helper(void *data);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:41:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:41: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 1a1XW9-0005tZ-Pa; Wed, 25 Nov 2015 10:41: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 1a1XW8-0005tC-5a
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:40 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	6B/56-09570-36095565; Wed, 25 Nov 2015 10:41:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448448098!6477342!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51293 invoked from network); 25 Nov 2015 10:41:39 -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;
	25 Nov 2015 10:41:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XW6-0006e0-2i
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XW0-00032F-W0
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:33 +0000
Date: Wed, 25 Nov 2015 10:41:32 +0000
Message-Id: <E1a1XW0-00032F-W0@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 d07f63fa6e70350b23e7acbde06129247c4e655d
Merge: abdf3c5b2b971dc12e665e8e0cda184b416efffe ddebece6d540ac8d9211e9b3ff8f9c49cfccc428
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Nov 16 13:38:33 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:38:33 2015 +0000

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

 xen/arch/x86/cpu/common.c     |    4 ++--
 xen/arch/x86/cpu/mcheck/mce.c |    3 ++-
 xen/arch/x86/io_apic.c        |   12 +++++++++---
 xen/arch/x86/irq.c            |   27 +++++++++++++++++++--------
 xen/arch/x86/smp.c            |    5 -----
 xen/arch/x86/smpboot.c        |    4 ++--
 xen/include/asm-x86/irq.h     |    2 +-
 xen/include/asm-x86/smp.h     |    2 --
 8 files changed, 35 insertions(+), 24 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 Wed Nov 25 10:41:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:41: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 1a1XW9-0005tZ-Pa; Wed, 25 Nov 2015 10:41: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 1a1XW8-0005tC-5a
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:40 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	6B/56-09570-36095565; Wed, 25 Nov 2015 10:41:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448448098!6477342!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51293 invoked from network); 25 Nov 2015 10:41:39 -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;
	25 Nov 2015 10:41:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XW6-0006e0-2i
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XW0-00032F-W0
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:33 +0000
Date: Wed, 25 Nov 2015 10:41:32 +0000
Message-Id: <E1a1XW0-00032F-W0@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 d07f63fa6e70350b23e7acbde06129247c4e655d
Merge: abdf3c5b2b971dc12e665e8e0cda184b416efffe ddebece6d540ac8d9211e9b3ff8f9c49cfccc428
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Nov 16 13:38:33 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 16 13:38:33 2015 +0000

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

 xen/arch/x86/cpu/common.c     |    4 ++--
 xen/arch/x86/cpu/mcheck/mce.c |    3 ++-
 xen/arch/x86/io_apic.c        |   12 +++++++++---
 xen/arch/x86/irq.c            |   27 +++++++++++++++++++--------
 xen/arch/x86/smp.c            |    5 -----
 xen/arch/x86/smpboot.c        |    4 ++--
 xen/include/asm-x86/irq.h     |    2 +-
 xen/include/asm-x86/smp.h     |    2 --
 8 files changed, 35 insertions(+), 24 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 Wed Nov 25 10:41:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:41: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 1a1XWK-0005wP-0N; Wed, 25 Nov 2015 10:41:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWJ-0005w5-3Z
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:51 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	4E/D8-13487-E6095565; Wed, 25 Nov 2015 10:41:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448448108!6351008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37390 invoked from network); 25 Nov 2015 10:41:49 -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;
	25 Nov 2015 10:41:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWG-0006e8-I7
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWG-00032y-9g
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:48 +0000
Date: Wed, 25 Nov 2015 10:41:48 +0000
Message-Id: <E1a1XWG-00032y-9g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blkif.h: document blkif
	multi-queue/ring extension
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a2b3502c51c1aa24c447412b12e30e7a1d67f1f6
Author:     Bob Liu <bob.liu@oracle.com>
AuthorDate: Tue Nov 17 13:21:13 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 17 13:21:13 2015 +0100

    blkif.h: document blkif multi-queue/ring extension
    
    Document the multi-queue/ring feature in terms of XenStore keys to be written
    by the backend and by the frontend.
    
    Signed-off-by: Bob Liu <bob.liu@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/include/public/io/blkif.h |   48 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/blkif.h b/xen/include/public/io/blkif.h
index fbc9ddb..99f0326 100644
--- a/xen/include/public/io/blkif.h
+++ b/xen/include/public/io/blkif.h
@@ -442,6 +442,54 @@
  */
 
 /*
+ * Multiple hardware queues/rings:
+ * If supported, the backend will write the key "multi-queue-max-queues" to
+ * the directory for that vbd, and set its value to the maximum supported
+ * number of queues.
+ * Frontends that are aware of this feature and wish to use it can write the
+ * key "multi-queue-num-queues" with the number they wish to use, which must be
+ * greater than zero, and no more than the value reported by the backend in
+ * "multi-queue-max-queues".
+ *
+ * For frontends requesting just one queue, the usual event-channel and
+ * ring-ref keys are written as before, simplifying the backend processing
+ * to avoid distinguishing between a frontend that doesn't understand the
+ * multi-queue feature, and one that does, but requested only one queue.
+ *
+ * Frontends requesting two or more queues must not write the toplevel
+ * event-channel and ring-ref keys, instead writing those keys under sub-keys
+ * having the name "queue-N" where N is the integer ID of the queue/ring for
+ * which those keys belong. Queues are indexed from zero.
+ * For example, a frontend with two queues must write the following set of
+ * queue-related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref = "<ring-ref#0>"
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn#0>"
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref = "<ring-ref#1>"
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn#1>"
+ *
+ * It is also possible to use multiple queues/rings together with
+ * feature multi-page ring buffer.
+ * For example, a frontend requests two queues/rings and the size of each ring
+ * buffer is two pages must write the following set of related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/ring-page-order = "1"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref0 = "<ring-ref#0>"
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref1 = "<ring-ref#1>"
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn#0>"
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref0 = "<ring-ref#2>"
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref1 = "<ring-ref#3>"
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn#1>"
+ *
+ */
+
+/*
  * STATE DIAGRAMS
  *
  *****************************************************************************
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:41:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:41: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 1a1XWK-0005wP-0N; Wed, 25 Nov 2015 10:41:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWJ-0005w5-3Z
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:51 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	4E/D8-13487-E6095565; Wed, 25 Nov 2015 10:41:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448448108!6351008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 37390 invoked from network); 25 Nov 2015 10:41:49 -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;
	25 Nov 2015 10:41:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWG-0006e8-I7
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWG-00032y-9g
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:48 +0000
Date: Wed, 25 Nov 2015 10:41:48 +0000
Message-Id: <E1a1XWG-00032y-9g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blkif.h: document blkif
	multi-queue/ring extension
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a2b3502c51c1aa24c447412b12e30e7a1d67f1f6
Author:     Bob Liu <bob.liu@oracle.com>
AuthorDate: Tue Nov 17 13:21:13 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 17 13:21:13 2015 +0100

    blkif.h: document blkif multi-queue/ring extension
    
    Document the multi-queue/ring feature in terms of XenStore keys to be written
    by the backend and by the frontend.
    
    Signed-off-by: Bob Liu <bob.liu@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/include/public/io/blkif.h |   48 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/blkif.h b/xen/include/public/io/blkif.h
index fbc9ddb..99f0326 100644
--- a/xen/include/public/io/blkif.h
+++ b/xen/include/public/io/blkif.h
@@ -442,6 +442,54 @@
  */
 
 /*
+ * Multiple hardware queues/rings:
+ * If supported, the backend will write the key "multi-queue-max-queues" to
+ * the directory for that vbd, and set its value to the maximum supported
+ * number of queues.
+ * Frontends that are aware of this feature and wish to use it can write the
+ * key "multi-queue-num-queues" with the number they wish to use, which must be
+ * greater than zero, and no more than the value reported by the backend in
+ * "multi-queue-max-queues".
+ *
+ * For frontends requesting just one queue, the usual event-channel and
+ * ring-ref keys are written as before, simplifying the backend processing
+ * to avoid distinguishing between a frontend that doesn't understand the
+ * multi-queue feature, and one that does, but requested only one queue.
+ *
+ * Frontends requesting two or more queues must not write the toplevel
+ * event-channel and ring-ref keys, instead writing those keys under sub-keys
+ * having the name "queue-N" where N is the integer ID of the queue/ring for
+ * which those keys belong. Queues are indexed from zero.
+ * For example, a frontend with two queues must write the following set of
+ * queue-related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref = "<ring-ref#0>"
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn#0>"
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref = "<ring-ref#1>"
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn#1>"
+ *
+ * It is also possible to use multiple queues/rings together with
+ * feature multi-page ring buffer.
+ * For example, a frontend requests two queues/rings and the size of each ring
+ * buffer is two pages must write the following set of related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/ring-page-order = "1"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref0 = "<ring-ref#0>"
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref1 = "<ring-ref#1>"
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn#0>"
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref0 = "<ring-ref#2>"
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref1 = "<ring-ref#3>"
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn#1>"
+ *
+ */
+
+/*
  * STATE DIAGRAMS
  *
  *****************************************************************************
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:42:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XWV-0005yK-6C; Wed, 25 Nov 2015 10:42:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWT-0005y3-Or
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:01 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	72/2E-01748-87095565; Wed, 25 Nov 2015 10:42:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1448448119!5869389!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56115 invoked from network); 25 Nov 2015 10:41:59 -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;
	25 Nov 2015 10:41:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWQ-0006eG-Q3
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWQ-00034d-NL
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:58 +0000
Date: Wed, 25 Nov 2015 10:41:58 +0000
Message-Id: <E1a1XWQ-00034d-NL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: add cmpxchg16b 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 e0116acbbd0b18f395b56f589e0f0f8fcc6fc2e0
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 17 13:21:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 17 13:21:33 2015 +0100

    x86: add cmpxchg16b support
    
    This patch adds cmpxchg16b support for x86-64, so software
    can perform 128-bit atomic write/read.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/asm-x86/x86_64/system.h |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-x86/x86_64/system.h b/xen/include/asm-x86/x86_64/system.h
index 662813a..7026c05 100644
--- a/xen/include/asm-x86/x86_64/system.h
+++ b/xen/include/asm-x86/x86_64/system.h
@@ -6,6 +6,39 @@
                                    (unsigned long)(n),sizeof(*(ptr))))
 
 /*
+ * Atomic 16 bytes compare and exchange.  Compare OLD with MEM, if
+ * identical, store NEW in MEM.  Return the initial value in MEM.
+ * Success is indicated by comparing RETURN with OLD.
+ *
+ * This function can only be called when cpu_has_cx16 is true.
+ */
+
+static always_inline __uint128_t __cmpxchg16b(
+    volatile void *ptr, const __uint128_t *old, const __uint128_t *new)
+{
+    __uint128_t prev;
+    uint64_t new_high = *new >> 64;
+    uint64_t new_low = *new;
+
+    ASSERT(cpu_has_cx16);
+
+    asm volatile ( "lock; cmpxchg16b %1"
+                   : "=A" (prev), "+m" (*__xg(ptr))
+                   : "c" (new_high), "b" (new_low),
+                     "0" (*old) );
+
+    return prev;
+}
+
+#define cmpxchg16b(ptr, o, n) ({                           \
+    volatile void *_p = (ptr);                             \
+    ASSERT(!((unsigned long)_p & 0xf));                    \
+    BUILD_BUG_ON(sizeof(*(o)) != sizeof(__uint128_t));     \
+    BUILD_BUG_ON(sizeof(*(n)) != sizeof(__uint128_t));     \
+    __cmpxchg16b(_p, (void *)(o), (void *)(n));            \
+})
+
+/*
  * This function causes value _o to be changed to _n at location _p.
  * If this access causes a fault then we return 1, otherwise we return 0.
  * If no fault occurs then _o is updated to the value we saw at _p. If this
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:42:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XWV-0005yK-6C; Wed, 25 Nov 2015 10:42:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWT-0005y3-Or
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:01 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	72/2E-01748-87095565; Wed, 25 Nov 2015 10:42:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1448448119!5869389!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 56115 invoked from network); 25 Nov 2015 10:41:59 -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;
	25 Nov 2015 10:41:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWQ-0006eG-Q3
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWQ-00034d-NL
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:41:58 +0000
Date: Wed, 25 Nov 2015 10:41:58 +0000
Message-Id: <E1a1XWQ-00034d-NL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: add cmpxchg16b 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 e0116acbbd0b18f395b56f589e0f0f8fcc6fc2e0
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 17 13:21:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 17 13:21:33 2015 +0100

    x86: add cmpxchg16b support
    
    This patch adds cmpxchg16b support for x86-64, so software
    can perform 128-bit atomic write/read.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/asm-x86/x86_64/system.h |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-x86/x86_64/system.h b/xen/include/asm-x86/x86_64/system.h
index 662813a..7026c05 100644
--- a/xen/include/asm-x86/x86_64/system.h
+++ b/xen/include/asm-x86/x86_64/system.h
@@ -6,6 +6,39 @@
                                    (unsigned long)(n),sizeof(*(ptr))))
 
 /*
+ * Atomic 16 bytes compare and exchange.  Compare OLD with MEM, if
+ * identical, store NEW in MEM.  Return the initial value in MEM.
+ * Success is indicated by comparing RETURN with OLD.
+ *
+ * This function can only be called when cpu_has_cx16 is true.
+ */
+
+static always_inline __uint128_t __cmpxchg16b(
+    volatile void *ptr, const __uint128_t *old, const __uint128_t *new)
+{
+    __uint128_t prev;
+    uint64_t new_high = *new >> 64;
+    uint64_t new_low = *new;
+
+    ASSERT(cpu_has_cx16);
+
+    asm volatile ( "lock; cmpxchg16b %1"
+                   : "=A" (prev), "+m" (*__xg(ptr))
+                   : "c" (new_high), "b" (new_low),
+                     "0" (*old) );
+
+    return prev;
+}
+
+#define cmpxchg16b(ptr, o, n) ({                           \
+    volatile void *_p = (ptr);                             \
+    ASSERT(!((unsigned long)_p & 0xf));                    \
+    BUILD_BUG_ON(sizeof(*(o)) != sizeof(__uint128_t));     \
+    BUILD_BUG_ON(sizeof(*(n)) != sizeof(__uint128_t));     \
+    __cmpxchg16b(_p, (void *)(o), (void *)(n));            \
+})
+
+/*
  * This function causes value _o to be changed to _n at location _p.
  * If this access causes a fault then we return 1, otherwise we return 0.
  * If no fault occurs then _o is updated to the value we saw at _p. If this
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:42:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XWl-00060v-AD; Wed, 25 Nov 2015 10:42:19 +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 1a1XWk-00060a-4R
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:18 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	59/F4-25435-98095565; Wed, 25 Nov 2015 10:42:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1448448132!6151279!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41910 invoked from network); 25 Nov 2015 10:42: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;
	25 Nov 2015 10:42:14 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWb-0006er-3g
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWb-00035G-12
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:09 +0000
Date: Wed, 25 Nov 2015 10:42:09 +0000
Message-Id: <E1a1XWb-00035G-12@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: move some APIC related macros to
	apicdef.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 f2d2de56582cc2fee93554c0225fc9d560d13ced
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 17 13:21:52 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 17 13:21:52 2015 +0100

    x86: move some APIC related macros to apicdef.h
    
    Move some APIC related macros to apicdef.h, so they can be used
    outside of vlapic.c.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vlapic.c     |    5 -----
 xen/include/asm-x86/apicdef.h |    3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index b893b40..9b7c871 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -65,11 +65,6 @@ static const unsigned int vlapic_lvt_mask[VLAPIC_LVT_NUM] =
      LVT_MASK
 };
 
-/* Following could belong in apicdef.h */
-#define APIC_SHORT_MASK                  0xc0000
-#define APIC_DEST_NOSHORT                0x0
-#define APIC_DEST_MASK                   0x800
-
 #define vlapic_lvt_vector(vlapic, lvt_type)                     \
     (vlapic_get_reg(vlapic, lvt_type) & APIC_VECTOR_MASK)
 
diff --git a/xen/include/asm-x86/apicdef.h b/xen/include/asm-x86/apicdef.h
index 6069fce..8752287 100644
--- a/xen/include/asm-x86/apicdef.h
+++ b/xen/include/asm-x86/apicdef.h
@@ -54,9 +54,11 @@
 #define			APIC_ESR_RECVILL	0x00040
 #define			APIC_ESR_ILLREGA	0x00080
 #define		APIC_ICR	0x300
+#define			APIC_DEST_NOSHORT	0x00000
 #define			APIC_DEST_SELF		0x40000
 #define			APIC_DEST_ALLINC	0x80000
 #define			APIC_DEST_ALLBUT	0xC0000
+#define			APIC_SHORT_MASK		0xC0000
 #define			APIC_ICR_RR_MASK	0x30000
 #define			APIC_ICR_RR_INVALID	0x00000
 #define			APIC_ICR_RR_INPROG	0x10000
@@ -64,6 +66,7 @@
 #define			APIC_INT_LEVELTRIG	0x08000
 #define			APIC_INT_ASSERT		0x04000
 #define			APIC_ICR_BUSY		0x01000
+#define			APIC_DEST_MASK		0x00800
 #define			APIC_DEST_LOGICAL	0x00800
 #define			APIC_DEST_PHYSICAL	0x00000
 #define			APIC_DM_FIXED		0x00000
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:42:19 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XWl-00060v-AD; Wed, 25 Nov 2015 10:42:19 +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 1a1XWk-00060a-4R
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:18 +0000
Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id
	59/F4-25435-98095565; Wed, 25 Nov 2015 10:42:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1448448132!6151279!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41910 invoked from network); 25 Nov 2015 10:42: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;
	25 Nov 2015 10:42:14 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWb-0006er-3g
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWb-00035G-12
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:09 +0000
Date: Wed, 25 Nov 2015 10:42:09 +0000
Message-Id: <E1a1XWb-00035G-12@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: move some APIC related macros to
	apicdef.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 f2d2de56582cc2fee93554c0225fc9d560d13ced
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 17 13:21:52 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 17 13:21:52 2015 +0100

    x86: move some APIC related macros to apicdef.h
    
    Move some APIC related macros to apicdef.h, so they can be used
    outside of vlapic.c.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vlapic.c     |    5 -----
 xen/include/asm-x86/apicdef.h |    3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index b893b40..9b7c871 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -65,11 +65,6 @@ static const unsigned int vlapic_lvt_mask[VLAPIC_LVT_NUM] =
      LVT_MASK
 };
 
-/* Following could belong in apicdef.h */
-#define APIC_SHORT_MASK                  0xc0000
-#define APIC_DEST_NOSHORT                0x0
-#define APIC_DEST_MASK                   0x800
-
 #define vlapic_lvt_vector(vlapic, lvt_type)                     \
     (vlapic_get_reg(vlapic, lvt_type) & APIC_VECTOR_MASK)
 
diff --git a/xen/include/asm-x86/apicdef.h b/xen/include/asm-x86/apicdef.h
index 6069fce..8752287 100644
--- a/xen/include/asm-x86/apicdef.h
+++ b/xen/include/asm-x86/apicdef.h
@@ -54,9 +54,11 @@
 #define			APIC_ESR_RECVILL	0x00040
 #define			APIC_ESR_ILLREGA	0x00080
 #define		APIC_ICR	0x300
+#define			APIC_DEST_NOSHORT	0x00000
 #define			APIC_DEST_SELF		0x40000
 #define			APIC_DEST_ALLINC	0x80000
 #define			APIC_DEST_ALLBUT	0xC0000
+#define			APIC_SHORT_MASK		0xC0000
 #define			APIC_ICR_RR_MASK	0x30000
 #define			APIC_ICR_RR_INVALID	0x00000
 #define			APIC_ICR_RR_INPROG	0x10000
@@ -64,6 +66,7 @@
 #define			APIC_INT_LEVELTRIG	0x08000
 #define			APIC_INT_ASSERT		0x04000
 #define			APIC_ICR_BUSY		0x01000
+#define			APIC_DEST_MASK		0x00800
 #define			APIC_DEST_LOGICAL	0x00800
 #define			APIC_DEST_PHYSICAL	0x00000
 #define			APIC_DM_FIXED		0x00000
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:42:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XWq-00062D-EY; Wed, 25 Nov 2015 10:42:24 +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 1a1XWp-00061q-It
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:23 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	04/FC-28791-E8095565; Wed, 25 Nov 2015 10:42:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448448139!6152280!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16933 invoked from network); 25 Nov 2015 10:42:21 -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;
	25 Nov 2015 10:42:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWl-0006ev-Ic
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWl-00035s-8y
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:19 +0000
Date: Wed, 25 Nov 2015 10:42:19 +0000
Message-Id: <E1a1XWl-00035s-8y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ns16550: reset bar_64 on each iteration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7efcc5844437837c9fe26ab4935dd8f034b230a4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 17 13:22:44 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 17 13:22:44 2015 +0100

    ns16550: reset bar_64 on each iteration
    
    Re-using the possibly non-zero value from a previous iteration can't
    do any good.
    
    Take the opportunity and
    - limit a few other variables' scopes at once,
    - adjust a few types.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/ns16550.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 34f66f7..ebe01ec 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -830,14 +830,11 @@ static int __init check_existence(struct ns16550 *uart)
 
 #ifdef HAS_PCI
 static int __init
-pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
+pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int bar_idx)
 {
-    uint32_t bar, bar_64 = 0, len, len_64;
-    u64 size, mask, orig_base;
+    u64 orig_base = uart->io_base;
     unsigned int b, d, f, nextf, i;
-    u16 vendor, device;
 
-    orig_base = uart->io_base;
     uart->io_base = 0;
     /* NB. Start at bus 1 to avoid AMT: a plug-in card cannot be on bus 0. */
     for ( b = skip_amt ? 1 : 0; b < 0x100; b++ )
@@ -846,6 +843,9 @@ pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
         {
             for ( f = 0; f < 8; f = nextf )
             {
+                uint32_t bar, bar_64 = 0, len, len_64;
+                u64 size;
+
                 nextf = (f || (pci_conf_read16(0, b, d, f, PCI_HEADER_TYPE) &
                                0x80)) ? f + 1 : 8;
 
@@ -869,8 +869,8 @@ pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
                 /* MMIO based */
                 if ( !(bar & PCI_BASE_ADDRESS_SPACE_IO) )
                 {
-                    vendor = pci_conf_read16(0, b, d, f, PCI_VENDOR_ID);
-                    device = pci_conf_read16(0, b, d, f, PCI_DEVICE_ID);
+                    u16 vendor = pci_conf_read16(0, b, d, f, PCI_VENDOR_ID);
+                    u16 device = pci_conf_read16(0, b, d, f, PCI_DEVICE_ID);
 
                     pci_conf_write32(0, b, d, f,
                                      PCI_BASE_ADDRESS_0 + bar_idx*4, ~0u);
@@ -889,8 +889,8 @@ pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
                                     PCI_BASE_ADDRESS_0 + (bar_idx+1)*4);
                         pci_conf_write32(0, b, d, f,
                                     PCI_BASE_ADDRESS_0 + (bar_idx+1)*4, bar_64);
-                        mask = ((u64)~0 << 32) | PCI_BASE_ADDRESS_MEM_MASK;
-                        size = (((u64)len_64 << 32) | len) & mask;
+                        size  = ((u64)~0 << 32) | PCI_BASE_ADDRESS_MEM_MASK;
+                        size &= ((u64)len_64 << 32) | len;
                     }
                     else
                         size = len & PCI_BASE_ADDRESS_MEM_MASK;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:42:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XWq-00062D-EY; Wed, 25 Nov 2015 10:42:24 +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 1a1XWp-00061q-It
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:23 +0000
Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id
	04/FC-28791-E8095565; Wed, 25 Nov 2015 10:42:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448448139!6152280!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16933 invoked from network); 25 Nov 2015 10:42:21 -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;
	25 Nov 2015 10:42:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWl-0006ev-Ic
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWl-00035s-8y
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:19 +0000
Date: Wed, 25 Nov 2015 10:42:19 +0000
Message-Id: <E1a1XWl-00035s-8y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ns16550: reset bar_64 on each iteration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7efcc5844437837c9fe26ab4935dd8f034b230a4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 17 13:22:44 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 17 13:22:44 2015 +0100

    ns16550: reset bar_64 on each iteration
    
    Re-using the possibly non-zero value from a previous iteration can't
    do any good.
    
    Take the opportunity and
    - limit a few other variables' scopes at once,
    - adjust a few types.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/ns16550.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 34f66f7..ebe01ec 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -830,14 +830,11 @@ static int __init check_existence(struct ns16550 *uart)
 
 #ifdef HAS_PCI
 static int __init
-pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
+pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int bar_idx)
 {
-    uint32_t bar, bar_64 = 0, len, len_64;
-    u64 size, mask, orig_base;
+    u64 orig_base = uart->io_base;
     unsigned int b, d, f, nextf, i;
-    u16 vendor, device;
 
-    orig_base = uart->io_base;
     uart->io_base = 0;
     /* NB. Start at bus 1 to avoid AMT: a plug-in card cannot be on bus 0. */
     for ( b = skip_amt ? 1 : 0; b < 0x100; b++ )
@@ -846,6 +843,9 @@ pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
         {
             for ( f = 0; f < 8; f = nextf )
             {
+                uint32_t bar, bar_64 = 0, len, len_64;
+                u64 size;
+
                 nextf = (f || (pci_conf_read16(0, b, d, f, PCI_HEADER_TYPE) &
                                0x80)) ? f + 1 : 8;
 
@@ -869,8 +869,8 @@ pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
                 /* MMIO based */
                 if ( !(bar & PCI_BASE_ADDRESS_SPACE_IO) )
                 {
-                    vendor = pci_conf_read16(0, b, d, f, PCI_VENDOR_ID);
-                    device = pci_conf_read16(0, b, d, f, PCI_DEVICE_ID);
+                    u16 vendor = pci_conf_read16(0, b, d, f, PCI_VENDOR_ID);
+                    u16 device = pci_conf_read16(0, b, d, f, PCI_DEVICE_ID);
 
                     pci_conf_write32(0, b, d, f,
                                      PCI_BASE_ADDRESS_0 + bar_idx*4, ~0u);
@@ -889,8 +889,8 @@ pci_uart_config (struct ns16550 *uart, int skip_amt, int bar_idx)
                                     PCI_BASE_ADDRESS_0 + (bar_idx+1)*4);
                         pci_conf_write32(0, b, d, f,
                                     PCI_BASE_ADDRESS_0 + (bar_idx+1)*4, bar_64);
-                        mask = ((u64)~0 << 32) | PCI_BASE_ADDRESS_MEM_MASK;
-                        size = (((u64)len_64 << 32) | len) & mask;
+                        size  = ((u64)~0 << 32) | PCI_BASE_ADDRESS_MEM_MASK;
+                        size &= ((u64)len_64 << 32) | len;
                     }
                     else
                         size = len & PCI_BASE_ADDRESS_MEM_MASK;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:42:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XX1-00065a-Jj; Wed, 25 Nov 2015 10:42:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XX0-00064t-0a
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:34 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	21/B1-24856-99095565; Wed, 25 Nov 2015 10:42:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1448448150!6344204!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30989 invoked from network); 25 Nov 2015 10:42:30 -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;
	25 Nov 2015 10:42:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWv-0006f7-RC
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWv-00036K-OA
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:29 +0000
Date: Wed, 25 Nov 2015 10:42:29 +0000
Message-Id: <E1a1XWv-00036K-OA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ns16550: limit mapped MMIO size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b9730aaae72b813f0e01124e79ccc3b25509f3d3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 17 13:23:11 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 17 13:23:11 2015 +0100

    ns16550: limit mapped MMIO size
    
    There's no point in mapping more than the memory we actually may need
    to touch, and in fact the too large region could actually extend into
    another device's one (which currently is benign on x86 since only a
    single page gets mapped anyway, but which is a latent bug on ARM
    whenever PCI support gets enabled there).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/ns16550.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index ebe01ec..09abca8 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -931,6 +931,8 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int bar_idx)
                         uart->io_base += bar_idx * uart_param[p].uart_offset;
                         if ( uart_param[p].base_baud )
                             uart->clock_hz = uart_param[p].base_baud * 16;
+                        size = max(8U << uart_param[p].reg_shift,
+                                   uart_param[p].uart_offset);
                         /* Set device and MMIO region read only to Dom0 */
                         uart->enable_ro = 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 Wed Nov 25 10:42:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XX1-00065a-Jj; Wed, 25 Nov 2015 10:42:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XX0-00064t-0a
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:34 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	21/B1-24856-99095565; Wed, 25 Nov 2015 10:42:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1448448150!6344204!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30989 invoked from network); 25 Nov 2015 10:42:30 -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;
	25 Nov 2015 10:42:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWv-0006f7-RC
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XWv-00036K-OA
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:29 +0000
Date: Wed, 25 Nov 2015 10:42:29 +0000
Message-Id: <E1a1XWv-00036K-OA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ns16550: limit mapped MMIO size
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b9730aaae72b813f0e01124e79ccc3b25509f3d3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 17 13:23:11 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 17 13:23:11 2015 +0100

    ns16550: limit mapped MMIO size
    
    There's no point in mapping more than the memory we actually may need
    to touch, and in fact the too large region could actually extend into
    another device's one (which currently is benign on x86 since only a
    single page gets mapped anyway, but which is a latent bug on ARM
    whenever PCI support gets enabled there).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/ns16550.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index ebe01ec..09abca8 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -931,6 +931,8 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int bar_idx)
                         uart->io_base += bar_idx * uart_param[p].uart_offset;
                         if ( uart_param[p].base_baud )
                             uart->clock_hz = uart_param[p].base_baud * 16;
+                        size = max(8U << uart_param[p].reg_shift,
+                                   uart_param[p].uart_offset);
                         /* Set device and MMIO region read only to Dom0 */
                         uart->enable_ro = 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 Wed Nov 25 10:42:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XX9-000680-Nu; Wed, 25 Nov 2015 10:42: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 1a1XX8-00067X-DQ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:42 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	A7/A8-09570-1A095565; Wed, 25 Nov 2015 10:42:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448448160!6477674!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64430 invoked from network); 25 Nov 2015 10:42:41 -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;
	25 Nov 2015 10:42:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XX6-0006fF-42
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XX6-00036t-2N
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:40 +0000
Date: Wed, 25 Nov 2015 10:42:40 +0000
Message-Id: <E1a1XX6-00036t-2N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fixes to LAPIC probing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ed662ee62b02abbd02525dc8ac0cbf2e8182e88
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Nov 19 16:44:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 19 16:44:59 2015 +0100

    x86: fixes to LAPIC probing
    
    * Fix (unsafe) assumption that X86_FEATURE_APIC resided in feature word 0.
    * All 64bit processors have local APICs; drop the vendor check.
    * Unconditionally probe MSR_IA32_APICBASE (safely, to fail more gracefully in
      broken situations) and avoid a redundant double rdmsr().
    * Avoid repeatedly OR'ing APICBASE_ENABLE and DEFAULT_PHYS_BASE when
      attempting to reenable the LAPIC.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/apic.c |   30 +++++-------------------------
 1 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 7f6fea9..67733c0 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -814,25 +814,14 @@ custom_param("apic_verbosity", apic_set_verbosity);
 static int __init detect_init_APIC (void)
 {
     uint64_t msr_content;
-    u32 features;
 
     /* Disabled by kernel option? */
     if (enable_local_apic < 0)
         return -1;
 
-    switch (boot_cpu_data.x86_vendor) {
-    case X86_VENDOR_AMD:
-        if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) ||
-            (boot_cpu_data.x86 >= 0xf && boot_cpu_data.x86 <= 0x17))
-            break;
-        goto no_apic;
-    case X86_VENDOR_INTEL:
-        if (boot_cpu_data.x86 == 6 || boot_cpu_data.x86 == 15 ||
-            (boot_cpu_data.x86 == 5 && cpu_has_apic))
-            break;
-        goto no_apic;
-    default:
-        goto no_apic;
+    if (rdmsr_safe(MSR_IA32_APICBASE, msr_content)) {
+        printk("No local APIC present\n");
+        return -1;
     }
 
     if (!cpu_has_apic) {
@@ -851,14 +840,11 @@ static int __init detect_init_APIC (void)
          * software for Intel P6 or later and AMD K7
          * (Model > 1) or later.
          */
-        rdmsrl(MSR_IA32_APICBASE, msr_content);
         if (!(msr_content & MSR_IA32_APICBASE_ENABLE)) {
             printk("Local APIC disabled by BIOS -- reenabling.\n");
             msr_content &= ~MSR_IA32_APICBASE_BASE;
             msr_content |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE;
-            wrmsrl(MSR_IA32_APICBASE,
-                msr_content | MSR_IA32_APICBASE_ENABLE
-                | APIC_DEFAULT_PHYS_BASE);
+            wrmsrl(MSR_IA32_APICBASE, msr_content);
             enabled_via_apicbase = 1;
         }
     }
@@ -866,8 +852,7 @@ static int __init detect_init_APIC (void)
      * The APIC feature bit should now be enabled
      * in `cpuid'
      */
-    features = cpuid_edx(1);
-    if (!(features & (1 << X86_FEATURE_APIC))) {
+    if (!(cpuid_edx(1) & cpufeat_mask(X86_FEATURE_APIC))) {
         printk("Could not enable APIC!\n");
         return -1;
     }
@@ -876,7 +861,6 @@ static int __init detect_init_APIC (void)
     mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
 
     /* The BIOS may have set up the APIC at some other address */
-    rdmsrl(MSR_IA32_APICBASE, msr_content);
     if (msr_content & MSR_IA32_APICBASE_ENABLE)
         mp_lapic_addr = msr_content & MSR_IA32_APICBASE_BASE;
 
@@ -888,10 +872,6 @@ static int __init detect_init_APIC (void)
     apic_pm_activate();
 
     return 0;
-
-no_apic:
-    printk("No local APIC present or hardware disabled\n");
-    return -1;
 }
 
 void x2apic_ap_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 Nov 25 10:42:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XX9-000680-Nu; Wed, 25 Nov 2015 10:42: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 1a1XX8-00067X-DQ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:42 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	A7/A8-09570-1A095565; Wed, 25 Nov 2015 10:42:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448448160!6477674!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64430 invoked from network); 25 Nov 2015 10:42:41 -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;
	25 Nov 2015 10:42:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XX6-0006fF-42
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XX6-00036t-2N
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:40 +0000
Date: Wed, 25 Nov 2015 10:42:40 +0000
Message-Id: <E1a1XX6-00036t-2N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fixes to LAPIC probing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5ed662ee62b02abbd02525dc8ac0cbf2e8182e88
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Nov 19 16:44:59 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 19 16:44:59 2015 +0100

    x86: fixes to LAPIC probing
    
    * Fix (unsafe) assumption that X86_FEATURE_APIC resided in feature word 0.
    * All 64bit processors have local APICs; drop the vendor check.
    * Unconditionally probe MSR_IA32_APICBASE (safely, to fail more gracefully in
      broken situations) and avoid a redundant double rdmsr().
    * Avoid repeatedly OR'ing APICBASE_ENABLE and DEFAULT_PHYS_BASE when
      attempting to reenable the LAPIC.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/apic.c |   30 +++++-------------------------
 1 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 7f6fea9..67733c0 100644
--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -814,25 +814,14 @@ custom_param("apic_verbosity", apic_set_verbosity);
 static int __init detect_init_APIC (void)
 {
     uint64_t msr_content;
-    u32 features;
 
     /* Disabled by kernel option? */
     if (enable_local_apic < 0)
         return -1;
 
-    switch (boot_cpu_data.x86_vendor) {
-    case X86_VENDOR_AMD:
-        if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) ||
-            (boot_cpu_data.x86 >= 0xf && boot_cpu_data.x86 <= 0x17))
-            break;
-        goto no_apic;
-    case X86_VENDOR_INTEL:
-        if (boot_cpu_data.x86 == 6 || boot_cpu_data.x86 == 15 ||
-            (boot_cpu_data.x86 == 5 && cpu_has_apic))
-            break;
-        goto no_apic;
-    default:
-        goto no_apic;
+    if (rdmsr_safe(MSR_IA32_APICBASE, msr_content)) {
+        printk("No local APIC present\n");
+        return -1;
     }
 
     if (!cpu_has_apic) {
@@ -851,14 +840,11 @@ static int __init detect_init_APIC (void)
          * software for Intel P6 or later and AMD K7
          * (Model > 1) or later.
          */
-        rdmsrl(MSR_IA32_APICBASE, msr_content);
         if (!(msr_content & MSR_IA32_APICBASE_ENABLE)) {
             printk("Local APIC disabled by BIOS -- reenabling.\n");
             msr_content &= ~MSR_IA32_APICBASE_BASE;
             msr_content |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE;
-            wrmsrl(MSR_IA32_APICBASE,
-                msr_content | MSR_IA32_APICBASE_ENABLE
-                | APIC_DEFAULT_PHYS_BASE);
+            wrmsrl(MSR_IA32_APICBASE, msr_content);
             enabled_via_apicbase = 1;
         }
     }
@@ -866,8 +852,7 @@ static int __init detect_init_APIC (void)
      * The APIC feature bit should now be enabled
      * in `cpuid'
      */
-    features = cpuid_edx(1);
-    if (!(features & (1 << X86_FEATURE_APIC))) {
+    if (!(cpuid_edx(1) & cpufeat_mask(X86_FEATURE_APIC))) {
         printk("Could not enable APIC!\n");
         return -1;
     }
@@ -876,7 +861,6 @@ static int __init detect_init_APIC (void)
     mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
 
     /* The BIOS may have set up the APIC at some other address */
-    rdmsrl(MSR_IA32_APICBASE, msr_content);
     if (msr_content & MSR_IA32_APICBASE_ENABLE)
         mp_lapic_addr = msr_content & MSR_IA32_APICBASE_BASE;
 
@@ -888,10 +872,6 @@ static int __init detect_init_APIC (void)
     apic_pm_activate();
 
     return 0;
-
-no_apic:
-    printk("No local APIC present or hardware disabled\n");
-    return -1;
 }
 
 void x2apic_ap_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 Nov 25 10:42:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XXJ-0006At-T3; Wed, 25 Nov 2015 10:42:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXI-0006AS-Ix
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:52 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	81/DB-31443-BA095565; Wed, 25 Nov 2015 10:42:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1448448170!5882646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26631 invoked from network); 25 Nov 2015 10:42:51 -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;
	25 Nov 2015 10:42:51 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXG-0006fN-D1
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXG-00037P-BB
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:50 +0000
Date: Wed, 25 Nov 2015 10:42:50 +0000
Message-Id: <E1a1XXG-00037P-BB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: fix setting of
	destinations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 65288cf610ccf1aae423f65ac67ee5dbeff252a1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 19 16:46:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 19 16:46:10 2015 +0100

    x86/IO-APIC: fix setting of destinations
    
    In commit a85da715cf ("x86/IO-APIC: adjust setting of destinations") I
    made a pretty blatant mistake: get_apic_id() can be used there only
    when running APICs in physical mode. For both flat and clustered modes
    the change was wrong, causing different kinds of boot problems on
    affected systems. Don't revert that change though, but use TARGET_CPUS
    (equaling cpu_online_map, and with there only being a single online CPU
    fulfilling the original commits intention).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 11a0e5d..c2229ad 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1039,7 +1039,7 @@ static void __init setup_IO_APIC_irqs(void)
                 disable_8259A_irq(irq_to_desc(irq));
 
             desc = irq_to_desc(irq);
-            SET_DEST(entry, logical, get_apic_id());
+            SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
             spin_lock_irqsave(&ioapic_lock, flags);
             __ioapic_write_entry(apic, pin, 0, entry);
             set_native_irq_info(irq, TARGET_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 Nov 25 10:42:54 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:42: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 1a1XXJ-0006At-T3; Wed, 25 Nov 2015 10:42:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXI-0006AS-Ix
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:52 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	81/DB-31443-BA095565; Wed, 25 Nov 2015 10:42:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1448448170!5882646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26631 invoked from network); 25 Nov 2015 10:42:51 -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;
	25 Nov 2015 10:42:51 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXG-0006fN-D1
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXG-00037P-BB
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:42:50 +0000
Date: Wed, 25 Nov 2015 10:42:50 +0000
Message-Id: <E1a1XXG-00037P-BB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/IO-APIC: fix setting of
	destinations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 65288cf610ccf1aae423f65ac67ee5dbeff252a1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Nov 19 16:46:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Nov 19 16:46:10 2015 +0100

    x86/IO-APIC: fix setting of destinations
    
    In commit a85da715cf ("x86/IO-APIC: adjust setting of destinations") I
    made a pretty blatant mistake: get_apic_id() can be used there only
    when running APICs in physical mode. For both flat and clustered modes
    the change was wrong, causing different kinds of boot problems on
    affected systems. Don't revert that change though, but use TARGET_CPUS
    (equaling cpu_online_map, and with there only being a single online CPU
    fulfilling the original commits intention).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/io_apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 11a0e5d..c2229ad 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1039,7 +1039,7 @@ static void __init setup_IO_APIC_irqs(void)
                 disable_8259A_irq(irq_to_desc(irq));
 
             desc = irq_to_desc(irq);
-            SET_DEST(entry, logical, get_apic_id());
+            SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
             spin_lock_irqsave(&ioapic_lock, flags);
             __ioapic_write_entry(apic, pin, 0, entry);
             set_native_irq_info(irq, TARGET_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 Nov 25 10:43:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:43: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 1a1XXV-0006EP-6P; Wed, 25 Nov 2015 10:43:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXT-0006Dm-2C
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:03 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	66/BC-06091-6B095565; Wed, 25 Nov 2015 10:43:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1448448180!6343341!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12551 invoked from network); 25 Nov 2015 10:43:01 -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;
	25 Nov 2015 10:43:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXQ-0006fR-Mf
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXQ-00038Q-KE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:00 +0000
Date: Wed, 25 Nov 2015 10:43:00 +0000
Message-Id: <E1a1XXQ-00038Q-KE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PoD: tighten conditions for
	checking super 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 513c203a0046232c55adf6d70ec1dbe54e8d157f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 20 12:37:37 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 20 12:37:37 2015 +0100

    x86/PoD: tighten conditions for checking super page
    
    Since calling the function isn't cheap, try to avoid the call when we
    know up front it won't help; see the code comment for details on those
    conditions.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index be15cf3..5d23b0d 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -528,7 +528,6 @@ p2m_pod_decrease_reservation(struct domain *d,
     if ( unlikely(d->is_dying) )
         goto out_unlock;
 
-recount:
     pod = nonpod = ram = 0;
 
     /* Figure out if we need to steal some freed memory for our cache */
@@ -568,15 +567,20 @@ recount:
         goto out_entry_check;
     }
 
-    /* Try to grab entire superpages if possible.  Since the common case is for drivers
-     * to pass back singleton pages, see if we can take the whole page back and mark the
-     * rest PoD. */
-    if ( steal_for_cache
-         && p2m_pod_zero_check_superpage(p2m, gpfn & ~(SUPERPAGE_PAGES-1)))
+    /*
+     * Try to grab entire superpages if possible.  Since the common case is for
+     * drivers to pass back singleton pages, see if we can take the whole page
+     * back and mark the rest PoD.
+     * No need to do this though if
+     * - order >= SUPERPAGE_ORDER (the loop below will take care of this)
+     * - not all of the pages were RAM (now knowing order < SUPERPAGE_ORDER)
+     */
+    if ( steal_for_cache && order < SUPERPAGE_ORDER && ram == (1 << order) &&
+         p2m_pod_zero_check_superpage(p2m, gpfn & ~(SUPERPAGE_PAGES - 1)) )
     {
-        /* Since order may be arbitrary, we may have taken more or less
-         * than we were actually asked to; so just re-count from scratch */
-        goto recount;
+        pod = 1 << order;
+        ram = nonpod = 0;
+        ASSERT(steal_for_cache == (p2m->pod.entry_count > p2m->pod.count));
     }
 
     /* Process as long as:
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:43:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:43: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 1a1XXV-0006EP-6P; Wed, 25 Nov 2015 10:43:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXT-0006Dm-2C
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:03 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	66/BC-06091-6B095565; Wed, 25 Nov 2015 10:43:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1448448180!6343341!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12551 invoked from network); 25 Nov 2015 10:43:01 -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;
	25 Nov 2015 10:43:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXQ-0006fR-Mf
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXQ-00038Q-KE
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:00 +0000
Date: Wed, 25 Nov 2015 10:43:00 +0000
Message-Id: <E1a1XXQ-00038Q-KE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PoD: tighten conditions for
	checking super 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 513c203a0046232c55adf6d70ec1dbe54e8d157f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 20 12:37:37 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 20 12:37:37 2015 +0100

    x86/PoD: tighten conditions for checking super page
    
    Since calling the function isn't cheap, try to avoid the call when we
    know up front it won't help; see the code comment for details on those
    conditions.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-pod.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index be15cf3..5d23b0d 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -528,7 +528,6 @@ p2m_pod_decrease_reservation(struct domain *d,
     if ( unlikely(d->is_dying) )
         goto out_unlock;
 
-recount:
     pod = nonpod = ram = 0;
 
     /* Figure out if we need to steal some freed memory for our cache */
@@ -568,15 +567,20 @@ recount:
         goto out_entry_check;
     }
 
-    /* Try to grab entire superpages if possible.  Since the common case is for drivers
-     * to pass back singleton pages, see if we can take the whole page back and mark the
-     * rest PoD. */
-    if ( steal_for_cache
-         && p2m_pod_zero_check_superpage(p2m, gpfn & ~(SUPERPAGE_PAGES-1)))
+    /*
+     * Try to grab entire superpages if possible.  Since the common case is for
+     * drivers to pass back singleton pages, see if we can take the whole page
+     * back and mark the rest PoD.
+     * No need to do this though if
+     * - order >= SUPERPAGE_ORDER (the loop below will take care of this)
+     * - not all of the pages were RAM (now knowing order < SUPERPAGE_ORDER)
+     */
+    if ( steal_for_cache && order < SUPERPAGE_ORDER && ram == (1 << order) &&
+         p2m_pod_zero_check_superpage(p2m, gpfn & ~(SUPERPAGE_PAGES - 1)) )
     {
-        /* Since order may be arbitrary, we may have taken more or less
-         * than we were actually asked to; so just re-count from scratch */
-        goto recount;
+        pod = 1 << order;
+        ram = nonpod = 0;
+        ASSERT(steal_for_cache == (p2m->pod.entry_count > p2m->pod.count));
     }
 
     /* Process as long as:
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:43:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:43: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 1a1XXf-0006Gm-BU; Wed, 25 Nov 2015 10:43:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXd-0006GQ-JV
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:13 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	C1/C2-21201-0C095565; Wed, 25 Nov 2015 10:43:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448448191!6473187!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47081 invoked from network); 25 Nov 2015 10:43:12 -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;
	25 Nov 2015 10:43:12 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXa-0006g5-Ui
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXa-000396-SQ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:10 +0000
Date: Wed, 25 Nov 2015 10:43:10 +0000
Message-Id: <E1a1XXa-000396-SQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/P2M: consolidate handling of types
	not requiring a valid MFN
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c35eefded2992fc9b979f99190422527650872fd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 20 12:38:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 20 12:38:33 2015 +0100

    x86/P2M: consolidate handling of types not requiring a valid MFN
    
    As noted regarding the mixture of checks in p2m_pt_set_entry(),
    introduce a new P2M type group allowing to be used everywhere we
    just care about accepting operations with either a valid MFN or a type
    permitting to be used without (valid) MFN.
    
    Note that p2m_mmio_dm is not included in P2M_NO_MFN_TYPES, as for the
    intended purpose that one ought to be treated similar to p2m_invalid
    (perhaps the two should ultimately get folded anyway).
    
    Note further that PoD superpages now get INVALID_MFN used when creating
    page table entries (was _mfn(0) before).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-ept.c |    3 +--
 xen/arch/x86/mm/p2m-pod.c |   12 ++++++------
 xen/arch/x86/mm/p2m-pt.c  |    7 +++----
 xen/include/asm-x86/p2m.h |    7 +++++++
 4 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 86440fc..8fabb44 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -780,8 +780,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         ept_entry = table + (gfn_remainder >> (i * EPT_TABLE_ORDER));
     }
 
-    if ( mfn_valid(mfn_x(mfn)) || direct_mmio || p2m_is_paged(p2mt) ||
-         (p2mt == p2m_ram_paging_in) )
+    if ( mfn_valid(mfn_x(mfn)) || p2m_allows_invalid_mfn(p2mt) )
     {
         int emt = epte_get_entry_emt(p2m->domain, gfn, mfn,
                                      i * EPT_TABLE_ORDER, &ipat, direct_mmio);
diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 5d23b0d..ea16d3e 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -753,7 +753,7 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
     }
 
     /* Try to remove the page, restoring old mapping if it fails. */
-    p2m_set_entry(p2m, gfn, _mfn(0), PAGE_ORDER_2M,
+    p2m_set_entry(p2m, gfn, _mfn(INVALID_MFN), PAGE_ORDER_2M,
                   p2m_populate_on_demand, p2m->default_access);
 
     /* Make none of the MFNs are used elsewhere... for example, mapped
@@ -869,7 +869,7 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count)
         }
 
         /* Try to remove the page, restoring old mapping if it fails. */
-        p2m_set_entry(p2m, gfns[i], _mfn(0), PAGE_ORDER_4K,
+        p2m_set_entry(p2m, gfns[i], _mfn(INVALID_MFN), PAGE_ORDER_4K,
                       p2m_populate_on_demand, p2m->default_access);
 
         /* See if the page was successfully unmapped.  (Allow one refcount
@@ -1070,7 +1070,7 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
          * NOTE: In a fine-grained p2m locking scenario this operation
          * may need to promote its locking from gfn->1g superpage
          */
-        p2m_set_entry(p2m, gfn_aligned, _mfn(0), PAGE_ORDER_2M,
+        p2m_set_entry(p2m, gfn_aligned, _mfn(INVALID_MFN), PAGE_ORDER_2M,
                       p2m_populate_on_demand, p2m->default_access);
         return 0;
     }
@@ -1152,7 +1152,7 @@ remap_and_retry:
      * need promoting the gfn lock from gfn->2M superpage */
     gfn_aligned = (gfn>>order)<<order;
     for(i=0; i<(1<<order); i++)
-        p2m_set_entry(p2m, gfn_aligned+i, _mfn(0), PAGE_ORDER_4K,
+        p2m_set_entry(p2m, gfn_aligned + i, _mfn(INVALID_MFN), PAGE_ORDER_4K,
                       p2m_populate_on_demand, p2m->default_access);
     if ( tb_init_done )
     {
@@ -1210,8 +1210,8 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     }
 
     /* Now, actually do the two-way mapping */
-    rc = p2m_set_entry(p2m, gfn, _mfn(0), order, p2m_populate_on_demand,
-                       p2m->default_access);
+    rc = p2m_set_entry(p2m, gfn, _mfn(INVALID_MFN), order,
+                       p2m_populate_on_demand, p2m->default_access);
     if ( rc == 0 )
     {
         pod_lock(p2m);
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 28a31ee..0a7bee4 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -571,7 +571,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
-        l3e_content = mfn_valid(mfn) 
+        l3e_content = mfn_valid(mfn) || p2m_allows_invalid_mfn(p2mt)
             ? l3e_from_pfn(mfn_x(mfn),
                            p2m_type_to_flags(p2mt, mfn) | _PAGE_PSE)
             : l3e_empty();
@@ -607,8 +607,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             p2m_get_iommu_flags(p2m_flags_to_type(l1e_get_flags(*p2m_entry)));
         old_mfn = l1e_get_pfn(*p2m_entry);
 
-        if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
-                            || p2m_is_paging(p2mt) )
+        if ( mfn_valid(mfn) || p2m_allows_invalid_mfn(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
                                              p2m_type_to_flags(p2mt, mfn));
         else
@@ -644,7 +643,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
-        if ( mfn_valid(mfn) || p2m_is_pod(p2mt) )
+        if ( mfn_valid(mfn) || p2m_allows_invalid_mfn(p2mt) )
             l2e_content = l2e_from_pfn(mfn_x(mfn),
                                        p2m_type_to_flags(p2mt, mfn) |
                                        _PAGE_PSE);
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index d748557..fa46dd9 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -141,6 +141,11 @@ typedef unsigned int p2m_query_t;
                             | p2m_to_mask(p2m_ram_logdirty) )
 #define P2M_SHARED_TYPES   (p2m_to_mask(p2m_ram_shared))
 
+/* Valid types not necessarily associated with a (valid) MFN. */
+#define P2M_INVALID_MFN_TYPES (P2M_POD_TYPES                  \
+                               | p2m_to_mask(p2m_mmio_direct) \
+                               | P2M_PAGING_TYPES)
+
 /* Broken type: the frame backing this pfn has failed in hardware
  * and must not be touched. */
 #define P2M_BROKEN_TYPES (p2m_to_mask(p2m_ram_broken))
@@ -171,6 +176,8 @@ typedef unsigned int p2m_query_t;
                              (P2M_RAM_TYPES | P2M_GRANT_TYPES |  \
                               p2m_to_mask(p2m_map_foreign)))
 
+#define p2m_allows_invalid_mfn(t) (p2m_to_mask(t) & P2M_INVALID_MFN_TYPES)
+
 typedef enum {
     p2m_host,
     p2m_nested,
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:43:15 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:43: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 1a1XXf-0006Gm-BU; Wed, 25 Nov 2015 10:43:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXd-0006GQ-JV
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:13 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	C1/C2-21201-0C095565; Wed, 25 Nov 2015 10:43:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448448191!6473187!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 47081 invoked from network); 25 Nov 2015 10:43:12 -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;
	25 Nov 2015 10:43:12 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXa-0006g5-Ui
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXa-000396-SQ
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:10 +0000
Date: Wed, 25 Nov 2015 10:43:10 +0000
Message-Id: <E1a1XXa-000396-SQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/P2M: consolidate handling of types
	not requiring a valid MFN
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c35eefded2992fc9b979f99190422527650872fd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Nov 20 12:38:33 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Nov 20 12:38:33 2015 +0100

    x86/P2M: consolidate handling of types not requiring a valid MFN
    
    As noted regarding the mixture of checks in p2m_pt_set_entry(),
    introduce a new P2M type group allowing to be used everywhere we
    just care about accepting operations with either a valid MFN or a type
    permitting to be used without (valid) MFN.
    
    Note that p2m_mmio_dm is not included in P2M_NO_MFN_TYPES, as for the
    intended purpose that one ought to be treated similar to p2m_invalid
    (perhaps the two should ultimately get folded anyway).
    
    Note further that PoD superpages now get INVALID_MFN used when creating
    page table entries (was _mfn(0) before).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/arch/x86/mm/p2m-ept.c |    3 +--
 xen/arch/x86/mm/p2m-pod.c |   12 ++++++------
 xen/arch/x86/mm/p2m-pt.c  |    7 +++----
 xen/include/asm-x86/p2m.h |    7 +++++++
 4 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 86440fc..8fabb44 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -780,8 +780,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         ept_entry = table + (gfn_remainder >> (i * EPT_TABLE_ORDER));
     }
 
-    if ( mfn_valid(mfn_x(mfn)) || direct_mmio || p2m_is_paged(p2mt) ||
-         (p2mt == p2m_ram_paging_in) )
+    if ( mfn_valid(mfn_x(mfn)) || p2m_allows_invalid_mfn(p2mt) )
     {
         int emt = epte_get_entry_emt(p2m->domain, gfn, mfn,
                                      i * EPT_TABLE_ORDER, &ipat, direct_mmio);
diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 5d23b0d..ea16d3e 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -753,7 +753,7 @@ p2m_pod_zero_check_superpage(struct p2m_domain *p2m, unsigned long gfn)
     }
 
     /* Try to remove the page, restoring old mapping if it fails. */
-    p2m_set_entry(p2m, gfn, _mfn(0), PAGE_ORDER_2M,
+    p2m_set_entry(p2m, gfn, _mfn(INVALID_MFN), PAGE_ORDER_2M,
                   p2m_populate_on_demand, p2m->default_access);
 
     /* Make none of the MFNs are used elsewhere... for example, mapped
@@ -869,7 +869,7 @@ p2m_pod_zero_check(struct p2m_domain *p2m, unsigned long *gfns, int count)
         }
 
         /* Try to remove the page, restoring old mapping if it fails. */
-        p2m_set_entry(p2m, gfns[i], _mfn(0), PAGE_ORDER_4K,
+        p2m_set_entry(p2m, gfns[i], _mfn(INVALID_MFN), PAGE_ORDER_4K,
                       p2m_populate_on_demand, p2m->default_access);
 
         /* See if the page was successfully unmapped.  (Allow one refcount
@@ -1070,7 +1070,7 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
          * NOTE: In a fine-grained p2m locking scenario this operation
          * may need to promote its locking from gfn->1g superpage
          */
-        p2m_set_entry(p2m, gfn_aligned, _mfn(0), PAGE_ORDER_2M,
+        p2m_set_entry(p2m, gfn_aligned, _mfn(INVALID_MFN), PAGE_ORDER_2M,
                       p2m_populate_on_demand, p2m->default_access);
         return 0;
     }
@@ -1152,7 +1152,7 @@ remap_and_retry:
      * need promoting the gfn lock from gfn->2M superpage */
     gfn_aligned = (gfn>>order)<<order;
     for(i=0; i<(1<<order); i++)
-        p2m_set_entry(p2m, gfn_aligned+i, _mfn(0), PAGE_ORDER_4K,
+        p2m_set_entry(p2m, gfn_aligned + i, _mfn(INVALID_MFN), PAGE_ORDER_4K,
                       p2m_populate_on_demand, p2m->default_access);
     if ( tb_init_done )
     {
@@ -1210,8 +1210,8 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     }
 
     /* Now, actually do the two-way mapping */
-    rc = p2m_set_entry(p2m, gfn, _mfn(0), order, p2m_populate_on_demand,
-                       p2m->default_access);
+    rc = p2m_set_entry(p2m, gfn, _mfn(INVALID_MFN), order,
+                       p2m_populate_on_demand, p2m->default_access);
     if ( rc == 0 )
     {
         pod_lock(p2m);
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 28a31ee..0a7bee4 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -571,7 +571,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
 
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
-        l3e_content = mfn_valid(mfn) 
+        l3e_content = mfn_valid(mfn) || p2m_allows_invalid_mfn(p2mt)
             ? l3e_from_pfn(mfn_x(mfn),
                            p2m_type_to_flags(p2mt, mfn) | _PAGE_PSE)
             : l3e_empty();
@@ -607,8 +607,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
             p2m_get_iommu_flags(p2m_flags_to_type(l1e_get_flags(*p2m_entry)));
         old_mfn = l1e_get_pfn(*p2m_entry);
 
-        if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
-                            || p2m_is_paging(p2mt) )
+        if ( mfn_valid(mfn) || p2m_allows_invalid_mfn(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
                                              p2m_type_to_flags(p2mt, mfn));
         else
@@ -644,7 +643,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
         
         ASSERT(!mfn_valid(mfn) || p2mt != p2m_mmio_direct);
-        if ( mfn_valid(mfn) || p2m_is_pod(p2mt) )
+        if ( mfn_valid(mfn) || p2m_allows_invalid_mfn(p2mt) )
             l2e_content = l2e_from_pfn(mfn_x(mfn),
                                        p2m_type_to_flags(p2mt, mfn) |
                                        _PAGE_PSE);
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index d748557..fa46dd9 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -141,6 +141,11 @@ typedef unsigned int p2m_query_t;
                             | p2m_to_mask(p2m_ram_logdirty) )
 #define P2M_SHARED_TYPES   (p2m_to_mask(p2m_ram_shared))
 
+/* Valid types not necessarily associated with a (valid) MFN. */
+#define P2M_INVALID_MFN_TYPES (P2M_POD_TYPES                  \
+                               | p2m_to_mask(p2m_mmio_direct) \
+                               | P2M_PAGING_TYPES)
+
 /* Broken type: the frame backing this pfn has failed in hardware
  * and must not be touched. */
 #define P2M_BROKEN_TYPES (p2m_to_mask(p2m_ram_broken))
@@ -171,6 +176,8 @@ typedef unsigned int p2m_query_t;
                              (P2M_RAM_TYPES | P2M_GRANT_TYPES |  \
                               p2m_to_mask(p2m_map_foreign)))
 
+#define p2m_allows_invalid_mfn(t) (p2m_to_mask(t) & P2M_INVALID_MFN_TYPES)
+
 typedef enum {
     p2m_host,
     p2m_nested,
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:43:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:43: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 1a1XXp-0006Ik-Fk; Wed, 25 Nov 2015 10:43:25 +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 1a1XXn-0006IH-Ub
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:24 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	B6/45-13475-AC095565; Wed, 25 Nov 2015 10:43:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1448448201!6155239!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26605 invoked from network); 25 Nov 2015 10:43:22 -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;
	25 Nov 2015 10:43:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXl-0006g9-Ac
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXl-00039Z-5E
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:21 +0000
Date: Wed, 25 Nov 2015 10:43:21 +0000
Message-Id: <E1a1XXl-00039Z-5E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: correct bug in domain builder
	regarding page tables for pvh
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 225166ea901f0532454ef771f5d6b1e8528c21bd
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 19 17:11:08 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 20 14:14:57 2015 +0000

    libxl: correct bug in domain builder regarding page tables for pvh
    
    Commit 81a76e4b12961a9f54f5021809074196dfe6dbba ("libxc: rework of
    domain builder's page table handler") dropped a special case for pvh
    resulting in page tables being mapped read-only. This led to a panic
    of the domain in early boot.
    
    Correct this error.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 tools/libxc/xc_dom_x86.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 7279fa2..5ff33ca 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -372,7 +372,7 @@ static x86_pgentry_t get_pg_prot_x86(struct xc_dom_image *dom, int l,
     unsigned m;
 
     prot = domx86->params->lvl_prot[l];
-    if ( l > 0 )
+    if ( l > 0 || dom->pvh_enabled )
         return prot;
 
     for ( m = 0; m < domx86->n_mappings; m++ )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:43:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:43: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 1a1XXp-0006Ik-Fk; Wed, 25 Nov 2015 10:43:25 +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 1a1XXn-0006IH-Ub
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:24 +0000
Received: from [193.109.254.147] by server-9.bemta-14.messagelabs.com id
	B6/45-13475-AC095565; Wed, 25 Nov 2015 10:43:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1448448201!6155239!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26605 invoked from network); 25 Nov 2015 10:43:22 -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;
	25 Nov 2015 10:43:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXl-0006g9-Ac
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXl-00039Z-5E
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:21 +0000
Date: Wed, 25 Nov 2015 10:43:21 +0000
Message-Id: <E1a1XXl-00039Z-5E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: correct bug in domain builder
	regarding page tables for pvh
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 225166ea901f0532454ef771f5d6b1e8528c21bd
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Nov 19 17:11:08 2015 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 20 14:14:57 2015 +0000

    libxl: correct bug in domain builder regarding page tables for pvh
    
    Commit 81a76e4b12961a9f54f5021809074196dfe6dbba ("libxc: rework of
    domain builder's page table handler") dropped a special case for pvh
    resulting in page tables being mapped read-only. This led to a panic
    of the domain in early boot.
    
    Correct this error.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Wei Liu <wei.liu2@citrix.com>
    Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 tools/libxc/xc_dom_x86.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index 7279fa2..5ff33ca 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -372,7 +372,7 @@ static x86_pgentry_t get_pg_prot_x86(struct xc_dom_image *dom, int l,
     unsigned m;
 
     prot = domx86->params->lvl_prot[l];
-    if ( l > 0 )
+    if ( l > 0 || dom->pvh_enabled )
         return prot;
 
     for ( m = 0; m < domx86->n_mappings; m++ )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:43:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:43: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 1a1XXz-0006MT-1X; Wed, 25 Nov 2015 10:43:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXx-0006M4-P3
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:33 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	6E/93-24856-5D095565; Wed, 25 Nov 2015 10:43:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448448211!6351553!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14429 invoked from network); 25 Nov 2015 10:43:32 -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;
	25 Nov 2015 10:43:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXv-0006gH-J6
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXv-0003A4-GR
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:31 +0000
Date: Wed, 25 Nov 2015 10:43:31 +0000
Message-Id: <E1a1XXv-0003A4-GR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Correct
	XC_DOM_PAGE_SIZE() to return a long long
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aec38117171b1fef50d6c3cf42dbd176907c7e18
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Nov 19 14:45:41 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 20 14:24:02 2015 +0000

    tools/libxc: Correct XC_DOM_PAGE_SIZE() to return a long long
    
    c/s abdf3c5b "libxc: create p2m list outside of kernel mapping if supported"
    introduces a use which Coverity objects to; an int used to mask a uint64_t.
    
    The result needs to be signed to allow ~XC_DOM_PAGE_SIZE() to function
    correctly, and long long to function properly in 32bit builds.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 6f0c6e0..2176216 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -249,7 +249,7 @@ struct xc_dom_arch {
 void xc_dom_register_arch_hooks(struct xc_dom_arch *hooks);
 
 #define XC_DOM_PAGE_SHIFT(dom)  ((dom)->arch_hooks->page_shift)
-#define XC_DOM_PAGE_SIZE(dom)   (1 << (dom)->arch_hooks->page_shift)
+#define XC_DOM_PAGE_SIZE(dom)   (1LL << (dom)->arch_hooks->page_shift)
 
 /* --- main functions ---------------------------------------------- */
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:43:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:43: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 1a1XXz-0006MT-1X; Wed, 25 Nov 2015 10:43:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXx-0006M4-P3
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:33 +0000
Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id
	6E/93-24856-5D095565; Wed, 25 Nov 2015 10:43:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448448211!6351553!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14429 invoked from network); 25 Nov 2015 10:43:32 -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;
	25 Nov 2015 10:43:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXv-0006gH-J6
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XXv-0003A4-GR
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:31 +0000
Date: Wed, 25 Nov 2015 10:43:31 +0000
Message-Id: <E1a1XXv-0003A4-GR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Correct
	XC_DOM_PAGE_SIZE() to return a long long
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aec38117171b1fef50d6c3cf42dbd176907c7e18
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Nov 19 14:45:41 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Nov 20 14:24:02 2015 +0000

    tools/libxc: Correct XC_DOM_PAGE_SIZE() to return a long long
    
    c/s abdf3c5b "libxc: create p2m list outside of kernel mapping if supported"
    introduces a use which Coverity objects to; an int used to mask a uint64_t.
    
    The result needs to be signed to allow ~XC_DOM_PAGE_SIZE() to function
    correctly, and long long to function properly in 32bit builds.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/include/xc_dom.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 6f0c6e0..2176216 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -249,7 +249,7 @@ struct xc_dom_arch {
 void xc_dom_register_arch_hooks(struct xc_dom_arch *hooks);
 
 #define XC_DOM_PAGE_SHIFT(dom)  ((dom)->arch_hooks->page_shift)
-#define XC_DOM_PAGE_SIZE(dom)   (1 << (dom)->arch_hooks->page_shift)
+#define XC_DOM_PAGE_SIZE(dom)   (1LL << (dom)->arch_hooks->page_shift)
 
 /* --- main functions ---------------------------------------------- */
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 25 10:43:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:43: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 1a1XYC-0006Qr-6W; Wed, 25 Nov 2015 10:43: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 1a1XYA-0006QG-Ei
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:46 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	06/8E-03763-1E095565; Wed, 25 Nov 2015 10:43:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1448448222!6404562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15002 invoked from network); 25 Nov 2015 10:43:42 -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;
	25 Nov 2015 10:43:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XY5-0006gP-Rx
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XY5-0003AZ-Pz
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:41 +0000
Date: Wed, 25 Nov 2015 10:43:41 +0000
Message-Id: <E1a1XY5-0003AZ-Pz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MINIOS_UPSTREAM_REVISION 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 827db7b26384ce083df7154d77f13379b2cf4121
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Nov 23 09:39:17 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 23 09:39:17 2015 +0000

    MINIOS_UPSTREAM_REVISION Update
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 76bdc88..c982d1c 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= 22d01aab99180539b38b13ba30f0e1cd62b72147
-# Tue Oct 27 15:43:28 2015 +0000
-# xenbus: notify the other end when necessary
+MINIOS_UPSTREAM_REVISION ?= 8d84345a20d8a46ea26379c9f19961f6aa3e6e83
+# Fri Nov 20 19:32:42 2015 +0100
+# minios: don't rely on specific page table allocation scheme
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 # Tue Mar 17 10:52:16 2015 -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 Wed Nov 25 10:43:48 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Nov 2015 10:43: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 1a1XYC-0006Qr-6W; Wed, 25 Nov 2015 10:43: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 1a1XYA-0006QG-Ei
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:46 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	06/8E-03763-1E095565; Wed, 25 Nov 2015 10:43:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1448448222!6404562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15002 invoked from network); 25 Nov 2015 10:43:42 -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;
	25 Nov 2015 10:43:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XY5-0006gP-Rx
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a1XY5-0003AZ-Pz
	for xen-changelog@lists.xensource.com; Wed, 25 Nov 2015 10:43:41 +0000
Date: Wed, 25 Nov 2015 10:43:41 +0000
Message-Id: <E1a1XY5-0003AZ-Pz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MINIOS_UPSTREAM_REVISION 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 827db7b26384ce083df7154d77f13379b2cf4121
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Nov 23 09:39:17 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Nov 23 09:39:17 2015 +0000

    MINIOS_UPSTREAM_REVISION Update
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 76bdc88..c982d1c 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= 22d01aab99180539b38b13ba30f0e1cd62b72147
-# Tue Oct 27 15:43:28 2015 +0000
-# xenbus: notify the other end when necessary
+MINIOS_UPSTREAM_REVISION ?= 8d84345a20d8a46ea26379c9f19961f6aa3e6e83
+# Fri Nov 20 19:32:42 2015 +0100
+# minios: don't rely on specific page table allocation scheme
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
 # Tue Mar 17 10:52:16 2015 -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 Thu Nov 26 20:44:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23Ok-0003ql-JG; Thu, 26 Nov 2015 20:44:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Oj-0003qb-CI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:09 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	07/76-01753-81F67565; Thu, 26 Nov 2015 20:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1448570646!6870626!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52730 invoked from network); 26 Nov 2015 20:44:07 -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;
	26 Nov 2015 20:44:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Og-00034A-B9
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Og-0000LP-1G
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:06 +0000
Date: Thu, 26 Nov 2015 20:44:06 +0000
Message-Id: <E1a23Og-0000LP-1G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: allocate VMCS pages from domain
	heap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b47431691409004c7218f6a6ba5c9c0bcf483ea
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 12:06:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:06:26 2015 +0100

    VMX: allocate VMCS pages from domain heap
    
    There being only very few uses of the virtual address of a VMCS,
    convert these cases to establish a mapping and lift the Xen heap
    restriction from the VMCS allocation.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   61 +++++++++++++++++++-----------------
 xen/arch/x86/hvm/vmx/vvmx.c        |   43 +++++++++++++++----------
 xen/include/asm-x86/hvm/vcpu.h     |    4 +-
 xen/include/asm-x86/hvm/vmx/vmcs.h |    6 ++--
 4 files changed, 63 insertions(+), 51 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 53207e6..7cdb063 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -119,8 +119,8 @@ const u32 vmx_introspection_force_enabled_msrs[] = {
 const unsigned int vmx_introspection_force_enabled_msrs_size =
     ARRAY_SIZE(vmx_introspection_force_enabled_msrs);
 
-static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
-static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
+static DEFINE_PER_CPU_READ_MOSTLY(paddr_t, vmxon_region);
+static DEFINE_PER_CPU(paddr_t, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
 DEFINE_PER_CPU(bool_t, vmxon);
 
@@ -483,25 +483,28 @@ static int vmx_init_vmcs_config(void)
     return 0;
 }
 
-static struct vmcs_struct *vmx_alloc_vmcs(void)
+static paddr_t vmx_alloc_vmcs(void)
 {
+    struct page_info *pg;
     struct vmcs_struct *vmcs;
 
-    if ( (vmcs = alloc_xenheap_page()) == NULL )
+    if ( (pg = alloc_domheap_page(NULL, 0)) == NULL )
     {
         gdprintk(XENLOG_WARNING, "Failed to allocate VMCS.\n");
-        return NULL;
+        return 0;
     }
 
+    vmcs = __map_domain_page(pg);
     clear_page(vmcs);
     vmcs->vmcs_revision_id = vmcs_revision_id;
+    unmap_domain_page(vmcs);
 
-    return vmcs;
+    return page_to_maddr(pg);
 }
 
-static void vmx_free_vmcs(struct vmcs_struct *vmcs)
+static void vmx_free_vmcs(paddr_t pa)
 {
-    free_xenheap_page(vmcs);
+    free_domheap_page(maddr_to_page(pa));
 }
 
 static void __vmx_clear_vmcs(void *info)
@@ -514,7 +517,7 @@ static void __vmx_clear_vmcs(void *info)
 
     if ( arch_vmx->active_cpu == smp_processor_id() )
     {
-        __vmpclear(virt_to_maddr(arch_vmx->vmcs));
+        __vmpclear(arch_vmx->vmcs_pa);
         if ( arch_vmx->vmcs_shadow_maddr )
             __vmpclear(arch_vmx->vmcs_shadow_maddr);
 
@@ -523,8 +526,8 @@ static void __vmx_clear_vmcs(void *info)
 
         list_del(&arch_vmx->active_list);
 
-        if ( arch_vmx->vmcs == this_cpu(current_vmcs) )
-            this_cpu(current_vmcs) = NULL;
+        if ( arch_vmx->vmcs_pa == this_cpu(current_vmcs) )
+            this_cpu(current_vmcs) = 0;
     }
 }
 
@@ -550,8 +553,8 @@ static void vmx_load_vmcs(struct vcpu *v)
 
     ASSERT(v->arch.hvm_vmx.active_cpu == smp_processor_id());
 
-    __vmptrld(virt_to_maddr(v->arch.hvm_vmx.vmcs));
-    this_cpu(current_vmcs) = v->arch.hvm_vmx.vmcs;
+    __vmptrld(v->arch.hvm_vmx.vmcs_pa);
+    this_cpu(current_vmcs) = v->arch.hvm_vmx.vmcs_pa;
 
     local_irq_restore(flags);
 }
@@ -565,11 +568,11 @@ int vmx_cpu_up_prepare(unsigned int cpu)
     if ( nvmx_cpu_up_prepare(cpu) != 0 )
         printk("CPU%d: Could not allocate virtual VMCS buffer.\n", cpu);
 
-    if ( per_cpu(vmxon_region, cpu) != NULL )
+    if ( per_cpu(vmxon_region, cpu) )
         return 0;
 
     per_cpu(vmxon_region, cpu) = vmx_alloc_vmcs();
-    if ( per_cpu(vmxon_region, cpu) != NULL )
+    if ( per_cpu(vmxon_region, cpu) )
         return 0;
 
     printk("CPU%d: Could not allocate host VMCS\n", cpu);
@@ -580,7 +583,7 @@ int vmx_cpu_up_prepare(unsigned int cpu)
 void vmx_cpu_dead(unsigned int cpu)
 {
     vmx_free_vmcs(per_cpu(vmxon_region, cpu));
-    per_cpu(vmxon_region, cpu) = NULL;
+    per_cpu(vmxon_region, cpu) = 0;
     nvmx_cpu_dead(cpu);
 }
 
@@ -638,7 +641,7 @@ int vmx_cpu_up(void)
     if ( (rc = vmx_cpu_up_prepare(cpu)) != 0 )
         return rc;
 
-    switch ( __vmxon(virt_to_maddr(this_cpu(vmxon_region))) )
+    switch ( __vmxon(this_cpu(vmxon_region)) )
     {
     case -2: /* #UD or #GP */
         if ( bios_locked &&
@@ -710,7 +713,7 @@ bool_t vmx_vmcs_try_enter(struct vcpu *v)
      * vmx_vmcs_enter/exit and scheduling tail critical regions.
      */
     if ( likely(v == current) )
-        return v->arch.hvm_vmx.vmcs == this_cpu(current_vmcs);
+        return v->arch.hvm_vmx.vmcs_pa == this_cpu(current_vmcs);
 
     fv = &this_cpu(foreign_vmcs);
 
@@ -906,17 +909,17 @@ int vmx_check_msr_bitmap(unsigned long *msr_bitmap, u32 msr, int access_type)
 /*
  * Switch VMCS between layer 1 & 2 guest
  */
-void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to)
+void vmx_vmcs_switch(paddr_t from, paddr_t to)
 {
     struct arch_vmx_struct *vmx = &current->arch.hvm_vmx;
     spin_lock(&vmx->vmcs_lock);
 
-    __vmpclear(virt_to_maddr(from));
+    __vmpclear(from);
     if ( vmx->vmcs_shadow_maddr )
         __vmpclear(vmx->vmcs_shadow_maddr);
-    __vmptrld(virt_to_maddr(to));
+    __vmptrld(to);
 
-    vmx->vmcs = to;
+    vmx->vmcs_pa = to;
     vmx->launched = 0;
     this_cpu(current_vmcs) = to;
 
@@ -936,11 +939,11 @@ void virtual_vmcs_enter(void *vvmcs)
 
 void virtual_vmcs_exit(void *vvmcs)
 {
-    struct vmcs_struct *cur = this_cpu(current_vmcs);
+    paddr_t cur = this_cpu(current_vmcs);
 
     __vmpclear(pfn_to_paddr(domain_page_map_to_mfn(vvmcs)));
     if ( cur )
-        __vmptrld(virt_to_maddr(cur));
+        __vmptrld(cur);
 
 }
 
@@ -1582,17 +1585,17 @@ int vmx_create_vmcs(struct vcpu *v)
     struct arch_vmx_struct *arch_vmx = &v->arch.hvm_vmx;
     int rc;
 
-    if ( (arch_vmx->vmcs = vmx_alloc_vmcs()) == NULL )
+    if ( (arch_vmx->vmcs_pa = vmx_alloc_vmcs()) == 0 )
         return -ENOMEM;
 
     INIT_LIST_HEAD(&arch_vmx->active_list);
-    __vmpclear(virt_to_maddr(arch_vmx->vmcs));
+    __vmpclear(arch_vmx->vmcs_pa);
     arch_vmx->active_cpu = -1;
     arch_vmx->launched   = 0;
 
     if ( (rc = construct_vmcs(v)) != 0 )
     {
-        vmx_free_vmcs(arch_vmx->vmcs);
+        vmx_free_vmcs(arch_vmx->vmcs_pa);
         return rc;
     }
 
@@ -1605,7 +1608,7 @@ void vmx_destroy_vmcs(struct vcpu *v)
 
     vmx_clear_vmcs(v);
 
-    vmx_free_vmcs(arch_vmx->vmcs);
+    vmx_free_vmcs(arch_vmx->vmcs_pa);
 
     free_xenheap_page(v->arch.hvm_vmx.host_msr_area);
     free_xenheap_page(v->arch.hvm_vmx.msr_area);
@@ -1629,7 +1632,7 @@ void vmx_do_resume(struct vcpu *v)
 
     if ( v->arch.hvm_vmx.active_cpu == smp_processor_id() )
     {
-        if ( v->arch.hvm_vmx.vmcs != this_cpu(current_vmcs) )
+        if ( v->arch.hvm_vmx.vmcs_pa != this_cpu(current_vmcs) )
             vmx_load_vmcs(v);
     }
     else
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 3ac9cf9..ea1052e 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -56,13 +56,14 @@ int nvmx_vcpu_initialise(struct vcpu *v)
 {
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    struct page_info *pg = alloc_domheap_page(NULL, 0);
 
-    nvcpu->nv_n2vmcx = alloc_xenheap_page();
-    if ( !nvcpu->nv_n2vmcx )
+    if ( !pg )
     {
         gdprintk(XENLOG_ERR, "nest: allocation for shadow vmcs failed\n");
         return -ENOMEM;
     }
+    nvcpu->nv_n2vmcx_pa = page_to_maddr(pg);
 
     /* non-root VMREAD/VMWRITE bitmap. */
     if ( cpu_has_vmx_vmcs_shadowing )
@@ -129,13 +130,14 @@ void nvmx_vcpu_destroy(struct vcpu *v)
      * in order to avoid double free of L2 VMCS and the possible memory
      * leak of L1 VMCS page.
      */
-    if ( nvcpu->nv_n1vmcx )
-        v->arch.hvm_vmx.vmcs = nvcpu->nv_n1vmcx;
+    if ( nvcpu->nv_n1vmcx_pa )
+        v->arch.hvm_vmx.vmcs_pa = nvcpu->nv_n1vmcx_pa;
 
-    if ( nvcpu->nv_n2vmcx ) {
-        __vmpclear(virt_to_maddr(nvcpu->nv_n2vmcx));
-        free_xenheap_page(nvcpu->nv_n2vmcx);
-        nvcpu->nv_n2vmcx = NULL;
+    if ( nvcpu->nv_n2vmcx_pa )
+    {
+        __vmpclear(nvcpu->nv_n2vmcx_pa);
+        free_domheap_page(maddr_to_page(nvcpu->nv_n2vmcx_pa));
+        nvcpu->nv_n2vmcx_pa = 0;
     }
 
     /* Must also cope with nvmx_vcpu_initialise() not having got called. */
@@ -726,8 +728,8 @@ static void __clear_current_vvmcs(struct vcpu *v)
 {
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     
-    if ( nvcpu->nv_n2vmcx )
-        __vmpclear(virt_to_maddr(nvcpu->nv_n2vmcx));
+    if ( nvcpu->nv_n2vmcx_pa )
+        __vmpclear(nvcpu->nv_n2vmcx_pa);
 }
 
 static bool_t __must_check _map_msr_bitmap(struct vcpu *v)
@@ -1125,7 +1127,7 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
     void *vvmcs = nvcpu->nv_vvmcx;
     unsigned long lm_l1, lm_l2;
 
-    vmx_vmcs_switch(v->arch.hvm_vmx.vmcs, nvcpu->nv_n2vmcx);
+    vmx_vmcs_switch(v->arch.hvm_vmx.vmcs_pa, nvcpu->nv_n2vmcx_pa);
 
     nestedhvm_vcpu_enter_guestmode(v);
     nvcpu->nv_vmentry_pending = 0;
@@ -1335,7 +1337,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
          !(v->arch.hvm_vcpu.guest_efer & EFER_LMA) )
         shadow_to_vvmcs_bulk(v, ARRAY_SIZE(gpdpte_fields), gpdpte_fields);
 
-    vmx_vmcs_switch(v->arch.hvm_vmx.vmcs, nvcpu->nv_n1vmcx);
+    vmx_vmcs_switch(v->arch.hvm_vmx.vmcs_pa, nvcpu->nv_n1vmcx_pa);
 
     nestedhvm_vcpu_exit_guestmode(v);
     nvcpu->nv_vmexit_pending = 0;
@@ -1433,10 +1435,11 @@ int nvmx_handle_vmxon(struct cpu_user_regs *regs)
      * `fork' the host vmcs to shadow_vmcs
      * vmcs_lock is not needed since we are on current
      */
-    nvcpu->nv_n1vmcx = v->arch.hvm_vmx.vmcs;
-    __vmpclear(virt_to_maddr(v->arch.hvm_vmx.vmcs));
-    memcpy(nvcpu->nv_n2vmcx, v->arch.hvm_vmx.vmcs, PAGE_SIZE);
-    __vmptrld(virt_to_maddr(v->arch.hvm_vmx.vmcs));
+    nvcpu->nv_n1vmcx_pa = v->arch.hvm_vmx.vmcs_pa;
+    __vmpclear(v->arch.hvm_vmx.vmcs_pa);
+    copy_domain_page(_mfn(PFN_DOWN(nvcpu->nv_n2vmcx_pa)),
+                     _mfn(PFN_DOWN(v->arch.hvm_vmx.vmcs_pa)));
+    __vmptrld(v->arch.hvm_vmx.vmcs_pa);
     v->arch.hvm_vmx.launched = 0;
     vmreturn(regs, VMSUCCEED);
 
@@ -1888,9 +1891,15 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
      */
     switch (msr) {
     case MSR_IA32_VMX_BASIC:
+    {
+        const struct vmcs_struct *vmcs =
+            map_domain_page(_mfn(PFN_DOWN(v->arch.hvm_vmx.vmcs_pa)));
+
         data = (host_data & (~0ul << 32)) |
-               (v->arch.hvm_vmx.vmcs->vmcs_revision_id & 0x7fffffff);
+               (vmcs->vmcs_revision_id & 0x7fffffff);
+        unmap_domain_page(vmcs);
         break;
+    }
     case MSR_IA32_VMX_PINBASED_CTLS:
     case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
         /* 1-seetings */
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index de81f8a..152d9f3 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -104,8 +104,8 @@ struct nestedvcpu {
     void *nv_n2vmcx; /* shadow VMCB/VMCS used to run l2 guest */
 
     uint64_t nv_vvmcxaddr; /* l1 guest physical address of nv_vvmcx */
-    uint64_t nv_n1vmcx_pa; /* host physical address of nv_n1vmcx */
-    uint64_t nv_n2vmcx_pa; /* host physical address of nv_n2vmcx */
+    paddr_t nv_n1vmcx_pa; /* host physical address of nv_n1vmcx */
+    paddr_t nv_n2vmcx_pa; /* host physical address of nv_n2vmcx */
 
     /* SVM/VMX arch specific */
     union {
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 865d9fc..ad9798c 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -92,8 +92,8 @@ struct pi_desc {
 #define NR_PML_ENTRIES   512
 
 struct arch_vmx_struct {
-    /* Virtual address of VMCS. */
-    struct vmcs_struct  *vmcs;
+    /* Physical address of VMCS. */
+    paddr_t              vmcs_pa;
     /* VMCS shadow machine address. */
     paddr_t             vmcs_shadow_maddr;
 
@@ -488,7 +488,7 @@ void vmx_enable_intercept_for_msr(struct vcpu *v, u32 msr, int type);
 int vmx_read_guest_msr(u32 msr, u64 *val);
 int vmx_write_guest_msr(u32 msr, u64 val);
 int vmx_add_msr(u32 msr, int type);
-void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
+void vmx_vmcs_switch(paddr_t from, paddr_t to);
 void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 int vmx_check_msr_bitmap(unsigned long *msr_bitmap, u32 msr, int access_type);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:44:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23Ok-0003ql-JG; Thu, 26 Nov 2015 20:44:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Oj-0003qb-CI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:09 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	07/76-01753-81F67565; Thu, 26 Nov 2015 20:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1448570646!6870626!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52730 invoked from network); 26 Nov 2015 20:44:07 -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;
	26 Nov 2015 20:44:07 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Og-00034A-B9
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Og-0000LP-1G
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:06 +0000
Date: Thu, 26 Nov 2015 20:44:06 +0000
Message-Id: <E1a23Og-0000LP-1G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: allocate VMCS pages from domain
	heap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3b47431691409004c7218f6a6ba5c9c0bcf483ea
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 12:06:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:06:26 2015 +0100

    VMX: allocate VMCS pages from domain heap
    
    There being only very few uses of the virtual address of a VMCS,
    convert these cases to establish a mapping and lift the Xen heap
    restriction from the VMCS allocation.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   61 +++++++++++++++++++-----------------
 xen/arch/x86/hvm/vmx/vvmx.c        |   43 +++++++++++++++----------
 xen/include/asm-x86/hvm/vcpu.h     |    4 +-
 xen/include/asm-x86/hvm/vmx/vmcs.h |    6 ++--
 4 files changed, 63 insertions(+), 51 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 53207e6..7cdb063 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -119,8 +119,8 @@ const u32 vmx_introspection_force_enabled_msrs[] = {
 const unsigned int vmx_introspection_force_enabled_msrs_size =
     ARRAY_SIZE(vmx_introspection_force_enabled_msrs);
 
-static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
-static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
+static DEFINE_PER_CPU_READ_MOSTLY(paddr_t, vmxon_region);
+static DEFINE_PER_CPU(paddr_t, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
 DEFINE_PER_CPU(bool_t, vmxon);
 
@@ -483,25 +483,28 @@ static int vmx_init_vmcs_config(void)
     return 0;
 }
 
-static struct vmcs_struct *vmx_alloc_vmcs(void)
+static paddr_t vmx_alloc_vmcs(void)
 {
+    struct page_info *pg;
     struct vmcs_struct *vmcs;
 
-    if ( (vmcs = alloc_xenheap_page()) == NULL )
+    if ( (pg = alloc_domheap_page(NULL, 0)) == NULL )
     {
         gdprintk(XENLOG_WARNING, "Failed to allocate VMCS.\n");
-        return NULL;
+        return 0;
     }
 
+    vmcs = __map_domain_page(pg);
     clear_page(vmcs);
     vmcs->vmcs_revision_id = vmcs_revision_id;
+    unmap_domain_page(vmcs);
 
-    return vmcs;
+    return page_to_maddr(pg);
 }
 
-static void vmx_free_vmcs(struct vmcs_struct *vmcs)
+static void vmx_free_vmcs(paddr_t pa)
 {
-    free_xenheap_page(vmcs);
+    free_domheap_page(maddr_to_page(pa));
 }
 
 static void __vmx_clear_vmcs(void *info)
@@ -514,7 +517,7 @@ static void __vmx_clear_vmcs(void *info)
 
     if ( arch_vmx->active_cpu == smp_processor_id() )
     {
-        __vmpclear(virt_to_maddr(arch_vmx->vmcs));
+        __vmpclear(arch_vmx->vmcs_pa);
         if ( arch_vmx->vmcs_shadow_maddr )
             __vmpclear(arch_vmx->vmcs_shadow_maddr);
 
@@ -523,8 +526,8 @@ static void __vmx_clear_vmcs(void *info)
 
         list_del(&arch_vmx->active_list);
 
-        if ( arch_vmx->vmcs == this_cpu(current_vmcs) )
-            this_cpu(current_vmcs) = NULL;
+        if ( arch_vmx->vmcs_pa == this_cpu(current_vmcs) )
+            this_cpu(current_vmcs) = 0;
     }
 }
 
@@ -550,8 +553,8 @@ static void vmx_load_vmcs(struct vcpu *v)
 
     ASSERT(v->arch.hvm_vmx.active_cpu == smp_processor_id());
 
-    __vmptrld(virt_to_maddr(v->arch.hvm_vmx.vmcs));
-    this_cpu(current_vmcs) = v->arch.hvm_vmx.vmcs;
+    __vmptrld(v->arch.hvm_vmx.vmcs_pa);
+    this_cpu(current_vmcs) = v->arch.hvm_vmx.vmcs_pa;
 
     local_irq_restore(flags);
 }
@@ -565,11 +568,11 @@ int vmx_cpu_up_prepare(unsigned int cpu)
     if ( nvmx_cpu_up_prepare(cpu) != 0 )
         printk("CPU%d: Could not allocate virtual VMCS buffer.\n", cpu);
 
-    if ( per_cpu(vmxon_region, cpu) != NULL )
+    if ( per_cpu(vmxon_region, cpu) )
         return 0;
 
     per_cpu(vmxon_region, cpu) = vmx_alloc_vmcs();
-    if ( per_cpu(vmxon_region, cpu) != NULL )
+    if ( per_cpu(vmxon_region, cpu) )
         return 0;
 
     printk("CPU%d: Could not allocate host VMCS\n", cpu);
@@ -580,7 +583,7 @@ int vmx_cpu_up_prepare(unsigned int cpu)
 void vmx_cpu_dead(unsigned int cpu)
 {
     vmx_free_vmcs(per_cpu(vmxon_region, cpu));
-    per_cpu(vmxon_region, cpu) = NULL;
+    per_cpu(vmxon_region, cpu) = 0;
     nvmx_cpu_dead(cpu);
 }
 
@@ -638,7 +641,7 @@ int vmx_cpu_up(void)
     if ( (rc = vmx_cpu_up_prepare(cpu)) != 0 )
         return rc;
 
-    switch ( __vmxon(virt_to_maddr(this_cpu(vmxon_region))) )
+    switch ( __vmxon(this_cpu(vmxon_region)) )
     {
     case -2: /* #UD or #GP */
         if ( bios_locked &&
@@ -710,7 +713,7 @@ bool_t vmx_vmcs_try_enter(struct vcpu *v)
      * vmx_vmcs_enter/exit and scheduling tail critical regions.
      */
     if ( likely(v == current) )
-        return v->arch.hvm_vmx.vmcs == this_cpu(current_vmcs);
+        return v->arch.hvm_vmx.vmcs_pa == this_cpu(current_vmcs);
 
     fv = &this_cpu(foreign_vmcs);
 
@@ -906,17 +909,17 @@ int vmx_check_msr_bitmap(unsigned long *msr_bitmap, u32 msr, int access_type)
 /*
  * Switch VMCS between layer 1 & 2 guest
  */
-void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to)
+void vmx_vmcs_switch(paddr_t from, paddr_t to)
 {
     struct arch_vmx_struct *vmx = &current->arch.hvm_vmx;
     spin_lock(&vmx->vmcs_lock);
 
-    __vmpclear(virt_to_maddr(from));
+    __vmpclear(from);
     if ( vmx->vmcs_shadow_maddr )
         __vmpclear(vmx->vmcs_shadow_maddr);
-    __vmptrld(virt_to_maddr(to));
+    __vmptrld(to);
 
-    vmx->vmcs = to;
+    vmx->vmcs_pa = to;
     vmx->launched = 0;
     this_cpu(current_vmcs) = to;
 
@@ -936,11 +939,11 @@ void virtual_vmcs_enter(void *vvmcs)
 
 void virtual_vmcs_exit(void *vvmcs)
 {
-    struct vmcs_struct *cur = this_cpu(current_vmcs);
+    paddr_t cur = this_cpu(current_vmcs);
 
     __vmpclear(pfn_to_paddr(domain_page_map_to_mfn(vvmcs)));
     if ( cur )
-        __vmptrld(virt_to_maddr(cur));
+        __vmptrld(cur);
 
 }
 
@@ -1582,17 +1585,17 @@ int vmx_create_vmcs(struct vcpu *v)
     struct arch_vmx_struct *arch_vmx = &v->arch.hvm_vmx;
     int rc;
 
-    if ( (arch_vmx->vmcs = vmx_alloc_vmcs()) == NULL )
+    if ( (arch_vmx->vmcs_pa = vmx_alloc_vmcs()) == 0 )
         return -ENOMEM;
 
     INIT_LIST_HEAD(&arch_vmx->active_list);
-    __vmpclear(virt_to_maddr(arch_vmx->vmcs));
+    __vmpclear(arch_vmx->vmcs_pa);
     arch_vmx->active_cpu = -1;
     arch_vmx->launched   = 0;
 
     if ( (rc = construct_vmcs(v)) != 0 )
     {
-        vmx_free_vmcs(arch_vmx->vmcs);
+        vmx_free_vmcs(arch_vmx->vmcs_pa);
         return rc;
     }
 
@@ -1605,7 +1608,7 @@ void vmx_destroy_vmcs(struct vcpu *v)
 
     vmx_clear_vmcs(v);
 
-    vmx_free_vmcs(arch_vmx->vmcs);
+    vmx_free_vmcs(arch_vmx->vmcs_pa);
 
     free_xenheap_page(v->arch.hvm_vmx.host_msr_area);
     free_xenheap_page(v->arch.hvm_vmx.msr_area);
@@ -1629,7 +1632,7 @@ void vmx_do_resume(struct vcpu *v)
 
     if ( v->arch.hvm_vmx.active_cpu == smp_processor_id() )
     {
-        if ( v->arch.hvm_vmx.vmcs != this_cpu(current_vmcs) )
+        if ( v->arch.hvm_vmx.vmcs_pa != this_cpu(current_vmcs) )
             vmx_load_vmcs(v);
     }
     else
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 3ac9cf9..ea1052e 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -56,13 +56,14 @@ int nvmx_vcpu_initialise(struct vcpu *v)
 {
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    struct page_info *pg = alloc_domheap_page(NULL, 0);
 
-    nvcpu->nv_n2vmcx = alloc_xenheap_page();
-    if ( !nvcpu->nv_n2vmcx )
+    if ( !pg )
     {
         gdprintk(XENLOG_ERR, "nest: allocation for shadow vmcs failed\n");
         return -ENOMEM;
     }
+    nvcpu->nv_n2vmcx_pa = page_to_maddr(pg);
 
     /* non-root VMREAD/VMWRITE bitmap. */
     if ( cpu_has_vmx_vmcs_shadowing )
@@ -129,13 +130,14 @@ void nvmx_vcpu_destroy(struct vcpu *v)
      * in order to avoid double free of L2 VMCS and the possible memory
      * leak of L1 VMCS page.
      */
-    if ( nvcpu->nv_n1vmcx )
-        v->arch.hvm_vmx.vmcs = nvcpu->nv_n1vmcx;
+    if ( nvcpu->nv_n1vmcx_pa )
+        v->arch.hvm_vmx.vmcs_pa = nvcpu->nv_n1vmcx_pa;
 
-    if ( nvcpu->nv_n2vmcx ) {
-        __vmpclear(virt_to_maddr(nvcpu->nv_n2vmcx));
-        free_xenheap_page(nvcpu->nv_n2vmcx);
-        nvcpu->nv_n2vmcx = NULL;
+    if ( nvcpu->nv_n2vmcx_pa )
+    {
+        __vmpclear(nvcpu->nv_n2vmcx_pa);
+        free_domheap_page(maddr_to_page(nvcpu->nv_n2vmcx_pa));
+        nvcpu->nv_n2vmcx_pa = 0;
     }
 
     /* Must also cope with nvmx_vcpu_initialise() not having got called. */
@@ -726,8 +728,8 @@ static void __clear_current_vvmcs(struct vcpu *v)
 {
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     
-    if ( nvcpu->nv_n2vmcx )
-        __vmpclear(virt_to_maddr(nvcpu->nv_n2vmcx));
+    if ( nvcpu->nv_n2vmcx_pa )
+        __vmpclear(nvcpu->nv_n2vmcx_pa);
 }
 
 static bool_t __must_check _map_msr_bitmap(struct vcpu *v)
@@ -1125,7 +1127,7 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
     void *vvmcs = nvcpu->nv_vvmcx;
     unsigned long lm_l1, lm_l2;
 
-    vmx_vmcs_switch(v->arch.hvm_vmx.vmcs, nvcpu->nv_n2vmcx);
+    vmx_vmcs_switch(v->arch.hvm_vmx.vmcs_pa, nvcpu->nv_n2vmcx_pa);
 
     nestedhvm_vcpu_enter_guestmode(v);
     nvcpu->nv_vmentry_pending = 0;
@@ -1335,7 +1337,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
          !(v->arch.hvm_vcpu.guest_efer & EFER_LMA) )
         shadow_to_vvmcs_bulk(v, ARRAY_SIZE(gpdpte_fields), gpdpte_fields);
 
-    vmx_vmcs_switch(v->arch.hvm_vmx.vmcs, nvcpu->nv_n1vmcx);
+    vmx_vmcs_switch(v->arch.hvm_vmx.vmcs_pa, nvcpu->nv_n1vmcx_pa);
 
     nestedhvm_vcpu_exit_guestmode(v);
     nvcpu->nv_vmexit_pending = 0;
@@ -1433,10 +1435,11 @@ int nvmx_handle_vmxon(struct cpu_user_regs *regs)
      * `fork' the host vmcs to shadow_vmcs
      * vmcs_lock is not needed since we are on current
      */
-    nvcpu->nv_n1vmcx = v->arch.hvm_vmx.vmcs;
-    __vmpclear(virt_to_maddr(v->arch.hvm_vmx.vmcs));
-    memcpy(nvcpu->nv_n2vmcx, v->arch.hvm_vmx.vmcs, PAGE_SIZE);
-    __vmptrld(virt_to_maddr(v->arch.hvm_vmx.vmcs));
+    nvcpu->nv_n1vmcx_pa = v->arch.hvm_vmx.vmcs_pa;
+    __vmpclear(v->arch.hvm_vmx.vmcs_pa);
+    copy_domain_page(_mfn(PFN_DOWN(nvcpu->nv_n2vmcx_pa)),
+                     _mfn(PFN_DOWN(v->arch.hvm_vmx.vmcs_pa)));
+    __vmptrld(v->arch.hvm_vmx.vmcs_pa);
     v->arch.hvm_vmx.launched = 0;
     vmreturn(regs, VMSUCCEED);
 
@@ -1888,9 +1891,15 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
      */
     switch (msr) {
     case MSR_IA32_VMX_BASIC:
+    {
+        const struct vmcs_struct *vmcs =
+            map_domain_page(_mfn(PFN_DOWN(v->arch.hvm_vmx.vmcs_pa)));
+
         data = (host_data & (~0ul << 32)) |
-               (v->arch.hvm_vmx.vmcs->vmcs_revision_id & 0x7fffffff);
+               (vmcs->vmcs_revision_id & 0x7fffffff);
+        unmap_domain_page(vmcs);
         break;
+    }
     case MSR_IA32_VMX_PINBASED_CTLS:
     case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
         /* 1-seetings */
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index de81f8a..152d9f3 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -104,8 +104,8 @@ struct nestedvcpu {
     void *nv_n2vmcx; /* shadow VMCB/VMCS used to run l2 guest */
 
     uint64_t nv_vvmcxaddr; /* l1 guest physical address of nv_vvmcx */
-    uint64_t nv_n1vmcx_pa; /* host physical address of nv_n1vmcx */
-    uint64_t nv_n2vmcx_pa; /* host physical address of nv_n2vmcx */
+    paddr_t nv_n1vmcx_pa; /* host physical address of nv_n1vmcx */
+    paddr_t nv_n2vmcx_pa; /* host physical address of nv_n2vmcx */
 
     /* SVM/VMX arch specific */
     union {
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 865d9fc..ad9798c 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -92,8 +92,8 @@ struct pi_desc {
 #define NR_PML_ENTRIES   512
 
 struct arch_vmx_struct {
-    /* Virtual address of VMCS. */
-    struct vmcs_struct  *vmcs;
+    /* Physical address of VMCS. */
+    paddr_t              vmcs_pa;
     /* VMCS shadow machine address. */
     paddr_t             vmcs_shadow_maddr;
 
@@ -488,7 +488,7 @@ void vmx_enable_intercept_for_msr(struct vcpu *v, u32 msr, int type);
 int vmx_read_guest_msr(u32 msr, u64 *val);
 int vmx_write_guest_msr(u32 msr, u64 val);
 int vmx_add_msr(u32 msr, int type);
-void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
+void vmx_vmcs_switch(paddr_t from, paddr_t to);
 void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 int vmx_check_msr_bitmap(unsigned long *msr_bitmap, u32 msr, int access_type);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:44:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23Oy-0003sA-Nf; Thu, 26 Nov 2015 20:44:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ox-0003s3-P1
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:24 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	73/11-02940-62F67565; Thu, 26 Nov 2015 20:44:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448570656!6941166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1181 invoked from network); 26 Nov 2015 20:44:17 -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;
	26 Nov 2015 20:44:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Oq-00034F-M1
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Oq-0000Lo-J4
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:16 +0000
Date: Thu, 26 Nov 2015 20:44:16 +0000
Message-Id: <E1a23Oq-0000Lo-J4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vVMX: use latched VMCS machine 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 d02e84b9d9d16b6b56186f0dfdcb3c90b83c82a3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 12:07:27 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:07:27 2015 +0100

    vVMX: use latched VMCS machine address
    
    Instead of calling domain_page_map_to_mfn() over and over, latch the
    guest VMCS machine address unconditionally (i.e. independent of whether
    VMCS shadowing is supported by the hardware).
    
    Since this requires altering the parameters of __[gs]et_vmcs{,_real}()
    (and hence all their callers) anyway, take the opportunity to also drop
    the bogus double underscores from their names (and from
    __[gs]et_vmcs_virtual() as well).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/intr.c        |    4 +-
 xen/arch/x86/hvm/vmx/vmcs.c        |   21 ++--
 xen/arch/x86/hvm/vmx/vmx.c         |    6 +-
 xen/arch/x86/hvm/vmx/vvmx.c        |  308 ++++++++++++++++--------------------
 xen/include/asm-x86/hvm/vmx/vmcs.h |   10 +-
 xen/include/asm-x86/hvm/vmx/vvmx.h |   26 ++--
 6 files changed, 169 insertions(+), 206 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c
index 56c40b1..8fca08c 100644
--- a/xen/arch/x86/hvm/vmx/intr.c
+++ b/xen/arch/x86/hvm/vmx/intr.c
@@ -191,13 +191,13 @@ static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
         if ( intack.source == hvm_intsrc_pic ||
                  intack.source == hvm_intsrc_lapic )
         {
-            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+            ctrl = get_vvmcs(v, PIN_BASED_VM_EXEC_CONTROL);
             if ( !(ctrl & PIN_BASED_EXT_INTR_MASK) )
                 return 0;
 
             vmx_inject_extint(intack.vector, intack.source);
 
-            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, VM_EXIT_CONTROLS);
+            ctrl = get_vvmcs(v, VM_EXIT_CONTROLS);
             if ( ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
             {
                 /* for now, duplicate the ack path in vmx_intr_assist */
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 7cdb063..d6dab8e 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -932,37 +932,36 @@ void vmx_vmcs_switch(paddr_t from, paddr_t to)
     spin_unlock(&vmx->vmcs_lock);
 }
 
-void virtual_vmcs_enter(void *vvmcs)
+void virtual_vmcs_enter(const struct vcpu *v)
 {
-    __vmptrld(pfn_to_paddr(domain_page_map_to_mfn(vvmcs)));
+    __vmptrld(v->arch.hvm_vmx.vmcs_shadow_maddr);
 }
 
-void virtual_vmcs_exit(void *vvmcs)
+void virtual_vmcs_exit(const struct vcpu *v)
 {
     paddr_t cur = this_cpu(current_vmcs);
 
-    __vmpclear(pfn_to_paddr(domain_page_map_to_mfn(vvmcs)));
+    __vmpclear(v->arch.hvm_vmx.vmcs_shadow_maddr);
     if ( cur )
         __vmptrld(cur);
-
 }
 
-u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding)
+u64 virtual_vmcs_vmread(const struct vcpu *v, u32 vmcs_encoding)
 {
     u64 res;
 
-    virtual_vmcs_enter(vvmcs);
+    virtual_vmcs_enter(v);
     __vmread(vmcs_encoding, &res);
-    virtual_vmcs_exit(vvmcs);
+    virtual_vmcs_exit(v);
 
     return res;
 }
 
-void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val)
+void virtual_vmcs_vmwrite(const struct vcpu *v, u32 vmcs_encoding, u64 val)
 {
-    virtual_vmcs_enter(vvmcs);
+    virtual_vmcs_enter(v);
     __vmwrite(vmcs_encoding, val);
-    virtual_vmcs_exit(vvmcs);
+    virtual_vmcs_exit(v);
 }
 
 static int construct_vmcs(struct vcpu *v)
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index eb6248e..4b8d2fa 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1458,8 +1458,7 @@ void vmx_inject_extint(int trap, uint8_t source)
     u32    pin_based_cntrl;
 
     if ( nestedhvm_vcpu_in_guestmode(v) ) {
-        pin_based_cntrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, 
-                                     PIN_BASED_VM_EXEC_CONTROL);
+        pin_based_cntrl = get_vvmcs(v, PIN_BASED_VM_EXEC_CONTROL);
         if ( pin_based_cntrl & PIN_BASED_EXT_INTR_MASK ) {
             nvmx_enqueue_n2_exceptions (v, 
                INTR_INFO_VALID_MASK |
@@ -1479,8 +1478,7 @@ void vmx_inject_nmi(void)
     u32    pin_based_cntrl;
 
     if ( nestedhvm_vcpu_in_guestmode(v) ) {
-        pin_based_cntrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, 
-                                     PIN_BASED_VM_EXEC_CONTROL);
+        pin_based_cntrl = get_vvmcs(v, PIN_BASED_VM_EXEC_CONTROL);
         if ( pin_based_cntrl & PIN_BASED_NMI_EXITING ) {
             nvmx_enqueue_n2_exceptions (v, 
                INTR_INFO_VALID_MASK |
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index ea1052e..e48d872 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -175,11 +175,7 @@ int nvmx_vcpu_reset(struct vcpu *v)
 
 uint64_t nvmx_vcpu_eptp_base(struct vcpu *v)
 {
-    uint64_t eptp_base;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-
-    eptp_base = __get_vvmcs(nvcpu->nv_vvmcx, EPT_POINTER);
-    return eptp_base & PAGE_MASK;
+    return get_vvmcs(v, EPT_POINTER) & PAGE_MASK;
 }
 
 bool_t nvmx_ept_enabled(struct vcpu *v)
@@ -236,7 +232,7 @@ static int vvmcs_offset(u32 width, u32 type, u32 index)
     return offset;
 }
 
-u64 __get_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding)
+u64 get_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding)
 {
     union vmcs_encoding enc;
     u64 *content = (u64 *) vvmcs;
@@ -266,12 +262,12 @@ u64 __get_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding)
     return res;
 }
 
-u64 __get_vvmcs_real(void *vvmcs, u32 vmcs_encoding)
+u64 get_vvmcs_real(const struct vcpu *v, u32 encoding)
 {
-    return virtual_vmcs_vmread(vvmcs, vmcs_encoding);
+    return virtual_vmcs_vmread(v, encoding);
 }
 
-void __set_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding, u64 val)
+void set_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding, u64 val)
 {
     union vmcs_encoding enc;
     u64 *content = (u64 *) vvmcs;
@@ -307,9 +303,9 @@ void __set_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding, u64 val)
     content[offset] = res;
 }
 
-void __set_vvmcs_real(void *vvmcs, u32 vmcs_encoding, u64 val)
+void set_vvmcs_real(const struct vcpu *v, u32 encoding, u64 val)
 {
-    virtual_vmcs_vmwrite(vvmcs, vmcs_encoding, val);
+    virtual_vmcs_vmwrite(v, encoding, val);
 }
 
 static unsigned long reg_read(struct cpu_user_regs *regs,
@@ -331,25 +327,20 @@ static void reg_write(struct cpu_user_regs *regs,
 
 static inline u32 __n2_pin_exec_control(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-
-    return __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+    return get_vvmcs(v, PIN_BASED_VM_EXEC_CONTROL);
 }
 
 static inline u32 __n2_exec_control(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-
-    return __get_vvmcs(nvcpu->nv_vvmcx, CPU_BASED_VM_EXEC_CONTROL);
+    return get_vvmcs(v, CPU_BASED_VM_EXEC_CONTROL);
 }
 
 static inline u32 __n2_secondary_exec_control(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u64 second_ctrl = 0;
 
     if ( __n2_exec_control(v) & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
-        second_ctrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+        second_ctrl = get_vvmcs(v, SECONDARY_VM_EXEC_CONTROL);
 
     return second_ctrl;
 }
@@ -502,18 +493,17 @@ static void vmreturn(struct cpu_user_regs *regs, enum vmx_ops_result ops_res)
 bool_t nvmx_intercepts_exception(struct vcpu *v, unsigned int trap,
                                  int error_code)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u32 exception_bitmap, pfec_match=0, pfec_mask=0;
     int r;
 
     ASSERT ( trap < 32 );
 
-    exception_bitmap = __get_vvmcs(nvcpu->nv_vvmcx, EXCEPTION_BITMAP);
+    exception_bitmap = get_vvmcs(v, EXCEPTION_BITMAP);
     r = exception_bitmap & (1 << trap) ? 1: 0;
 
     if ( trap == TRAP_page_fault ) {
-        pfec_match = __get_vvmcs(nvcpu->nv_vvmcx, PAGE_FAULT_ERROR_CODE_MATCH);
-        pfec_mask  = __get_vvmcs(nvcpu->nv_vvmcx, PAGE_FAULT_ERROR_CODE_MASK);
+        pfec_match = get_vvmcs(v, PAGE_FAULT_ERROR_CODE_MATCH);
+        pfec_mask  = get_vvmcs(v, PAGE_FAULT_ERROR_CODE_MASK);
         if ( (error_code & pfec_mask) != pfec_match )
             r = !r;
     }
@@ -528,9 +518,7 @@ static inline u32 __shadow_control(struct vcpu *v,
                                  unsigned int field,
                                  u32 host_value)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-
-    return (u32) __get_vvmcs(nvcpu->nv_vvmcx, field) | host_value;
+    return get_vvmcs(v, field) | host_value;
 }
 
 static void set_shadow_control(struct vcpu *v,
@@ -597,13 +585,12 @@ void nvmx_update_secondary_exec_control(struct vcpu *v,
                                         unsigned long host_cntrl)
 {
     u32 shadow_cntrl;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     u32 apicv_bit = SECONDARY_EXEC_APIC_REGISTER_VIRT |
                     SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY;
 
     host_cntrl &= ~apicv_bit;
-    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+    shadow_cntrl = get_vvmcs(v, SECONDARY_VM_EXEC_CONTROL);
 
     /* No vAPIC-v support, so it shouldn't be set in vmcs12. */
     ASSERT(!(shadow_cntrl & apicv_bit));
@@ -616,10 +603,9 @@ void nvmx_update_secondary_exec_control(struct vcpu *v,
 static void nvmx_update_pin_control(struct vcpu *v, unsigned long host_cntrl)
 {
     u32 shadow_cntrl;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
     host_cntrl &= ~PIN_BASED_POSTED_INTERRUPT;
-    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+    shadow_cntrl = get_vvmcs(v, PIN_BASED_VM_EXEC_CONTROL);
 
     /* No vAPIC-v support, so it shouldn't be set in vmcs12. */
     ASSERT(!(shadow_cntrl & PIN_BASED_POSTED_INTERRUPT));
@@ -631,9 +617,8 @@ static void nvmx_update_pin_control(struct vcpu *v, unsigned long host_cntrl)
 static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
 {
     u32 shadow_cntrl;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
-    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
+    shadow_cntrl = get_vvmcs(v, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_LOAD_HOST_PAT
                       | VM_EXIT_LOAD_HOST_EFER
@@ -645,9 +630,8 @@ static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
 static void nvmx_update_entry_control(struct vcpu *v)
 {
     u32 shadow_cntrl;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
-    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_ENTRY_CONTROLS);
+    shadow_cntrl = get_vvmcs(v, VM_ENTRY_CONTROLS);
     shadow_cntrl &= ~(VM_ENTRY_LOAD_GUEST_PAT
                       | VM_ENTRY_LOAD_GUEST_EFER
                       | VM_ENTRY_LOAD_PERF_GLOBAL_CTRL);
@@ -661,7 +645,6 @@ void nvmx_update_exception_bitmap(struct vcpu *v, unsigned long value)
 
 static void nvmx_update_apic_access_address(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u32 ctrl;
 
     ctrl = __n2_secondary_exec_control(v);
@@ -671,7 +654,7 @@ static void nvmx_update_apic_access_address(struct vcpu *v)
         unsigned long apic_gpfn;
         struct page_info *apic_pg;
 
-        apic_gpfn = __get_vvmcs(nvcpu->nv_vvmcx, APIC_ACCESS_ADDR) >> PAGE_SHIFT;
+        apic_gpfn = get_vvmcs(v, APIC_ACCESS_ADDR) >> PAGE_SHIFT;
         apic_pg = get_page_from_gfn(v->domain, apic_gpfn, &p2mt, P2M_ALLOC);
         ASSERT(apic_pg && !p2m_is_paging(p2mt));
         __vmwrite(APIC_ACCESS_ADDR, page_to_maddr(apic_pg));
@@ -683,7 +666,6 @@ static void nvmx_update_apic_access_address(struct vcpu *v)
 
 static void nvmx_update_virtual_apic_address(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u32 ctrl;
 
     ctrl = __n2_exec_control(v);
@@ -693,7 +675,7 @@ static void nvmx_update_virtual_apic_address(struct vcpu *v)
         unsigned long vapic_gpfn;
         struct page_info *vapic_pg;
 
-        vapic_gpfn = __get_vvmcs(nvcpu->nv_vvmcx, VIRTUAL_APIC_PAGE_ADDR) >> PAGE_SHIFT;
+        vapic_gpfn = get_vvmcs(v, VIRTUAL_APIC_PAGE_ADDR) >> PAGE_SHIFT;
         vapic_pg = get_page_from_gfn(v->domain, vapic_gpfn, &p2mt, P2M_ALLOC);
         ASSERT(vapic_pg && !p2m_is_paging(p2mt));
         __vmwrite(VIRTUAL_APIC_PAGE_ADDR, page_to_maddr(vapic_pg));
@@ -705,23 +687,20 @@ static void nvmx_update_virtual_apic_address(struct vcpu *v)
 
 static void nvmx_update_tpr_threshold(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u32 ctrl = __n2_exec_control(v);
+
     if ( ctrl & CPU_BASED_TPR_SHADOW )
-        __vmwrite(TPR_THRESHOLD, __get_vvmcs(nvcpu->nv_vvmcx, TPR_THRESHOLD));
+        __vmwrite(TPR_THRESHOLD, get_vvmcs(v, TPR_THRESHOLD));
     else
         __vmwrite(TPR_THRESHOLD, 0);
 }
 
 static void nvmx_update_pfec(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-    void *vvmcs = nvcpu->nv_vvmcx;
-
     __vmwrite(PAGE_FAULT_ERROR_CODE_MASK,
-        __get_vvmcs(vvmcs, PAGE_FAULT_ERROR_CODE_MASK));
+              get_vvmcs(v, PAGE_FAULT_ERROR_CODE_MASK));
     __vmwrite(PAGE_FAULT_ERROR_CODE_MATCH,
-        __get_vvmcs(vvmcs, PAGE_FAULT_ERROR_CODE_MATCH));
+              get_vvmcs(v, PAGE_FAULT_ERROR_CODE_MATCH));
 }
 
 static void __clear_current_vvmcs(struct vcpu *v)
@@ -739,7 +718,7 @@ static bool_t __must_check _map_msr_bitmap(struct vcpu *v)
 
     if ( nvmx->msrbitmap )
         hvm_unmap_guest_frame(nvmx->msrbitmap, 1);
-    gpa = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, MSR_BITMAP);
+    gpa = get_vvmcs(v, MSR_BITMAP);
     nvmx->msrbitmap = hvm_map_guest_frame_ro(gpa >> PAGE_SHIFT, 1);
 
     return nvmx->msrbitmap != NULL;
@@ -754,7 +733,7 @@ static bool_t __must_check _map_io_bitmap(struct vcpu *v, u64 vmcs_reg)
     index = vmcs_reg == IO_BITMAP_A ? 0 : 1;
     if (nvmx->iobitmap[index])
         hvm_unmap_guest_frame(nvmx->iobitmap[index], 1);
-    gpa = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, vmcs_reg);
+    gpa = get_vvmcs(v, vmcs_reg);
     nvmx->iobitmap[index] = hvm_map_guest_frame_ro(gpa >> PAGE_SHIFT, 1);
 
     return nvmx->iobitmap[index] != NULL;
@@ -777,6 +756,7 @@ static void nvmx_purge_vvmcs(struct vcpu *v)
         hvm_unmap_guest_frame(nvcpu->nv_vvmcx, 1);
     nvcpu->nv_vvmcx = NULL;
     nvcpu->nv_vvmcxaddr = VMCX_EADDR;
+    v->arch.hvm_vmx.vmcs_shadow_maddr = 0;
     for (i=0; i<2; i++) {
         if ( nvmx->iobitmap[i] ) {
             hvm_unmap_guest_frame(nvmx->iobitmap[i], 1);
@@ -792,11 +772,10 @@ static void nvmx_purge_vvmcs(struct vcpu *v)
 u64 nvmx_get_tsc_offset(struct vcpu *v)
 {
     u64 offset = 0;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
-    if ( __get_vvmcs(nvcpu->nv_vvmcx, CPU_BASED_VM_EXEC_CONTROL) &
+    if ( get_vvmcs(v, CPU_BASED_VM_EXEC_CONTROL) &
          CPU_BASED_USE_TSC_OFFSETING )
-        offset = __get_vvmcs(nvcpu->nv_vvmcx, TSC_OFFSET);
+        offset = get_vvmcs(v, TSC_OFFSET);
 
     return offset;
 }
@@ -911,12 +890,9 @@ static struct vmcs_host_to_guest {
     {HOST_SYSENTER_EIP, GUEST_SYSENTER_EIP},
 };
 
-static void vvmcs_to_shadow(void *vvmcs, unsigned int field)
+static void vvmcs_to_shadow(const struct vcpu *v, unsigned int field)
 {
-    u64 value;
-
-    value = __get_vvmcs(vvmcs, field);
-    __vmwrite(field, value);
+    __vmwrite(field, get_vvmcs(v, field));
 }
 
 static void vvmcs_to_shadow_bulk(struct vcpu *v, unsigned int n,
@@ -950,15 +926,15 @@ static void vvmcs_to_shadow_bulk(struct vcpu *v, unsigned int n,
 
 fallback:
     for ( i = 0; i < n; i++ )
-        vvmcs_to_shadow(vvmcs, field[i]);
+        vvmcs_to_shadow(v, field[i]);
 }
 
-static inline void shadow_to_vvmcs(void *vvmcs, unsigned int field)
+static inline void shadow_to_vvmcs(const struct vcpu *v, unsigned int field)
 {
     unsigned long value;
 
     if ( __vmread_safe(field, &value) )
-        __set_vvmcs(vvmcs, field, value);
+        set_vvmcs(v, field, value);
 }
 
 static void shadow_to_vvmcs_bulk(struct vcpu *v, unsigned int n,
@@ -992,7 +968,7 @@ static void shadow_to_vvmcs_bulk(struct vcpu *v, unsigned int n,
 
 fallback:
     for ( i = 0; i < n; i++ )
-        shadow_to_vvmcs(vvmcs, field[i]);
+        shadow_to_vvmcs(v, field[i]);
 }
 
 static void load_shadow_control(struct vcpu *v)
@@ -1017,7 +993,6 @@ static void load_shadow_control(struct vcpu *v)
 static void load_shadow_guest_state(struct vcpu *v)
 {
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-    void *vvmcs = nvcpu->nv_vvmcx;
     u32 control;
     u64 cr_gh_mask, cr_read_shadow;
 
@@ -1031,18 +1006,18 @@ 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), 1);
-    hvm_set_cr4(__get_vvmcs(vvmcs, GUEST_CR4), 1);
-    hvm_set_cr3(__get_vvmcs(vvmcs, GUEST_CR3), 1);
+    nvcpu->guest_cr[0] = get_vvmcs(v, CR0_READ_SHADOW);
+    nvcpu->guest_cr[4] = get_vvmcs(v, CR4_READ_SHADOW);
+    hvm_set_cr0(get_vvmcs(v, GUEST_CR0), 1);
+    hvm_set_cr4(get_vvmcs(v, GUEST_CR4), 1);
+    hvm_set_cr3(get_vvmcs(v, GUEST_CR3), 1);
 
-    control = __get_vvmcs(vvmcs, VM_ENTRY_CONTROLS);
+    control = get_vvmcs(v, VM_ENTRY_CONTROLS);
     if ( control & VM_ENTRY_LOAD_GUEST_PAT )
-        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, GUEST_PAT));
+        hvm_set_guest_pat(v, get_vvmcs(v, GUEST_PAT));
     if ( control & VM_ENTRY_LOAD_PERF_GLOBAL_CTRL )
         hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL,
-                                __get_vvmcs(vvmcs, GUEST_PERF_GLOBAL_CTRL), 0);
+                                get_vvmcs(v, GUEST_PERF_GLOBAL_CTRL), 0);
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset, 0);
 
@@ -1053,14 +1028,14 @@ static void load_shadow_guest_state(struct vcpu *v)
      * guest host mask to 0xffffffff in shadow VMCS (follow the host L1 VMCS),
      * then calculate the corresponding read shadow separately for CR0 and CR4.
      */
-    cr_gh_mask = __get_vvmcs(vvmcs, CR0_GUEST_HOST_MASK);
-    cr_read_shadow = (__get_vvmcs(vvmcs, GUEST_CR0) & ~cr_gh_mask) |
-                     (__get_vvmcs(vvmcs, CR0_READ_SHADOW) & cr_gh_mask);
+    cr_gh_mask = get_vvmcs(v, CR0_GUEST_HOST_MASK);
+    cr_read_shadow = (get_vvmcs(v, GUEST_CR0) & ~cr_gh_mask) |
+                     (get_vvmcs(v, CR0_READ_SHADOW) & cr_gh_mask);
     __vmwrite(CR0_READ_SHADOW, cr_read_shadow);
 
-    cr_gh_mask = __get_vvmcs(vvmcs, CR4_GUEST_HOST_MASK);
-    cr_read_shadow = (__get_vvmcs(vvmcs, GUEST_CR4) & ~cr_gh_mask) |
-                     (__get_vvmcs(vvmcs, CR4_READ_SHADOW) & cr_gh_mask);
+    cr_gh_mask = get_vvmcs(v, CR4_GUEST_HOST_MASK);
+    cr_read_shadow = (get_vvmcs(v, GUEST_CR4) & ~cr_gh_mask) |
+                     (get_vvmcs(v, CR4_READ_SHADOW) & cr_gh_mask);
     __vmwrite(CR4_READ_SHADOW, cr_read_shadow);
 
     /* TODO: CR3 target control */
@@ -1084,11 +1059,11 @@ static uint64_t get_host_eptp(struct vcpu *v)
     return ept_get_eptp(ept_data);
 }
 
-static bool_t nvmx_vpid_enabled(struct nestedvcpu *nvcpu)
+static bool_t nvmx_vpid_enabled(const struct vcpu *v)
 {
     uint32_t second_cntl;
 
-    second_cntl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+    second_cntl = get_vvmcs(v, SECONDARY_VM_EXEC_CONTROL);
     if ( second_cntl & SECONDARY_EXEC_ENABLE_VPID )
         return 1;
     return 0;
@@ -1099,32 +1074,38 @@ static void nvmx_set_vmcs_pointer(struct vcpu *v, struct vmcs_struct *vvmcs)
     unsigned long vvmcs_mfn = domain_page_map_to_mfn(vvmcs);
     paddr_t vvmcs_maddr = vvmcs_mfn << PAGE_SHIFT;
 
-    __vmpclear(vvmcs_maddr);
-    vvmcs->vmcs_revision_id |= VMCS_RID_TYPE_MASK;
+    if ( cpu_has_vmx_vmcs_shadowing )
+    {
+        __vmpclear(vvmcs_maddr);
+        vvmcs->vmcs_revision_id |= VMCS_RID_TYPE_MASK;
+        __vmwrite(VMCS_LINK_POINTER, vvmcs_maddr);
+        __vmwrite(VMREAD_BITMAP, page_to_maddr(v->arch.hvm_vmx.vmread_bitmap));
+        __vmwrite(VMWRITE_BITMAP, page_to_maddr(v->arch.hvm_vmx.vmwrite_bitmap));
+    }
     v->arch.hvm_vmx.vmcs_shadow_maddr = vvmcs_maddr;
-    __vmwrite(VMCS_LINK_POINTER, vvmcs_maddr);
-    __vmwrite(VMREAD_BITMAP, page_to_maddr(v->arch.hvm_vmx.vmread_bitmap));
-    __vmwrite(VMWRITE_BITMAP, page_to_maddr(v->arch.hvm_vmx.vmwrite_bitmap));
 }
 
 static void nvmx_clear_vmcs_pointer(struct vcpu *v, struct vmcs_struct *vvmcs)
 {
-    unsigned long vvmcs_mfn = domain_page_map_to_mfn(vvmcs);
-    paddr_t vvmcs_maddr = vvmcs_mfn << PAGE_SHIFT;
-
-    __vmpclear(vvmcs_maddr);
-    vvmcs->vmcs_revision_id &= ~VMCS_RID_TYPE_MASK;
     v->arch.hvm_vmx.vmcs_shadow_maddr = 0;
-    __vmwrite(VMCS_LINK_POINTER, ~0ul);
-    __vmwrite(VMREAD_BITMAP, 0);
-    __vmwrite(VMWRITE_BITMAP, 0);
+
+    if ( cpu_has_vmx_vmcs_shadowing )
+    {
+        unsigned long vvmcs_mfn = domain_page_map_to_mfn(vvmcs);
+        paddr_t vvmcs_maddr = vvmcs_mfn << PAGE_SHIFT;
+
+        __vmpclear(vvmcs_maddr);
+        vvmcs->vmcs_revision_id &= ~VMCS_RID_TYPE_MASK;
+        __vmwrite(VMCS_LINK_POINTER, ~0ul);
+        __vmwrite(VMREAD_BITMAP, 0);
+        __vmwrite(VMWRITE_BITMAP, 0);
+    }
 }
 
 static void virtual_vmentry(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-    void *vvmcs = nvcpu->nv_vvmcx;
     unsigned long lm_l1, lm_l2;
 
     vmx_vmcs_switch(v->arch.hvm_vmx.vmcs_pa, nvcpu->nv_n2vmcx_pa);
@@ -1143,8 +1124,7 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
      * L1 exit_controls
      */
     lm_l1 = !!hvm_long_mode_enabled(v);
-    lm_l2 = !!(__get_vvmcs(vvmcs, VM_ENTRY_CONTROLS) &
-                           VM_ENTRY_IA32E_MODE);
+    lm_l2 = !!(get_vvmcs(v, VM_ENTRY_CONTROLS) & VM_ENTRY_IA32E_MODE);
 
     if ( lm_l2 )
         v->arch.hvm_vcpu.guest_efer |= EFER_LMA | EFER_LME;
@@ -1161,9 +1141,9 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
          !(v->arch.hvm_vcpu.guest_efer & EFER_LMA) )
         vvmcs_to_shadow_bulk(v, ARRAY_SIZE(gpdpte_fields), gpdpte_fields);
 
-    regs->eip = __get_vvmcs(vvmcs, GUEST_RIP);
-    regs->esp = __get_vvmcs(vvmcs, GUEST_RSP);
-    regs->eflags = __get_vvmcs(vvmcs, GUEST_RFLAGS);
+    regs->eip = get_vvmcs(v, GUEST_RIP);
+    regs->esp = get_vvmcs(v, GUEST_RSP);
+    regs->eflags = get_vvmcs(v, GUEST_RFLAGS);
 
     /* updating host cr0 to sync TS bit */
     __vmwrite(HOST_CR0, v->arch.hvm_vmx.host_cr0);
@@ -1175,10 +1155,10 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
         __vmwrite(EPT_POINTER, get_host_eptp(v));
 
     /* nested VPID support! */
-    if ( cpu_has_vmx_vpid && nvmx_vpid_enabled(nvcpu) )
+    if ( cpu_has_vmx_vpid && nvmx_vpid_enabled(v) )
     {
         struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
-        uint32_t new_vpid =  __get_vvmcs(vvmcs, VIRTUAL_PROCESSOR_ID);
+        uint32_t new_vpid = get_vvmcs(v, VIRTUAL_PROCESSOR_ID);
 
         if ( nvmx->guest_vpid != new_vpid )
         {
@@ -1191,34 +1171,29 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
 
 static void sync_vvmcs_guest_state(struct vcpu *v, struct cpu_user_regs *regs)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-    void *vvmcs = nvcpu->nv_vvmcx;
-
     /* copy shadow vmcs.gstate back to vvmcs.gstate */
     shadow_to_vvmcs_bulk(v, ARRAY_SIZE(vmcs_gstate_field),
                          vmcs_gstate_field);
     /* RIP, RSP are in user regs */
-    __set_vvmcs(vvmcs, GUEST_RIP, regs->eip);
-    __set_vvmcs(vvmcs, GUEST_RSP, regs->esp);
+    set_vvmcs(v, GUEST_RIP, regs->eip);
+    set_vvmcs(v, GUEST_RSP, regs->esp);
 
     /* CR3 sync if exec doesn't want cr3 load exiting: i.e. nested EPT */
     if ( !(__n2_exec_control(v) & CPU_BASED_CR3_LOAD_EXITING) )
-        shadow_to_vvmcs(vvmcs, GUEST_CR3);
+        shadow_to_vvmcs(v, GUEST_CR3);
 }
 
 static void sync_vvmcs_ro(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
-    void *vvmcs = nvcpu->nv_vvmcx;
 
     shadow_to_vvmcs_bulk(v, ARRAY_SIZE(vmcs_ro_field), vmcs_ro_field);
 
     /* Adjust exit_reason/exit_qualifciation for violation case */
-    if ( __get_vvmcs(vvmcs, VM_EXIT_REASON) == EXIT_REASON_EPT_VIOLATION )
+    if ( get_vvmcs(v, VM_EXIT_REASON) == EXIT_REASON_EPT_VIOLATION )
     {
-        __set_vvmcs(vvmcs, EXIT_QUALIFICATION, nvmx->ept.exit_qual);
-        __set_vvmcs(vvmcs, VM_EXIT_REASON, nvmx->ept.exit_reason);
+        set_vvmcs(v, EXIT_QUALIFICATION, nvmx->ept.exit_qual);
+        set_vvmcs(v, VM_EXIT_REASON, nvmx->ept.exit_reason);
     }
 }
 
@@ -1226,34 +1201,32 @@ static void load_vvmcs_host_state(struct vcpu *v)
 {
     int i;
     u64 r;
-    void *vvmcs = vcpu_nestedhvm(v).nv_vvmcx;
     u32 control;
 
     for ( i = 0; i < ARRAY_SIZE(vmcs_h2g_field); i++ )
     {
-        r = __get_vvmcs(vvmcs, vmcs_h2g_field[i].host_field);
+        r = get_vvmcs(v, vmcs_h2g_field[i].host_field);
         __vmwrite(vmcs_h2g_field[i].guest_field, r);
     }
 
-    hvm_set_cr0(__get_vvmcs(vvmcs, HOST_CR0), 1);
-    hvm_set_cr4(__get_vvmcs(vvmcs, HOST_CR4), 1);
-    hvm_set_cr3(__get_vvmcs(vvmcs, HOST_CR3), 1);
+    hvm_set_cr0(get_vvmcs(v, HOST_CR0), 1);
+    hvm_set_cr4(get_vvmcs(v, HOST_CR4), 1);
+    hvm_set_cr3(get_vvmcs(v, HOST_CR3), 1);
 
-    control = __get_vvmcs(vvmcs, VM_EXIT_CONTROLS);
+    control = get_vvmcs(v, VM_EXIT_CONTROLS);
     if ( control & VM_EXIT_LOAD_HOST_PAT )
-        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, HOST_PAT));
+        hvm_set_guest_pat(v, get_vvmcs(v, HOST_PAT));
     if ( control & VM_EXIT_LOAD_PERF_GLOBAL_CTRL )
         hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL,
-                                __get_vvmcs(vvmcs, HOST_PERF_GLOBAL_CTRL), 1);
+                                get_vvmcs(v, HOST_PERF_GLOBAL_CTRL), 1);
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset, 0);
 
-    __set_vvmcs(vvmcs, VM_ENTRY_INTR_INFO, 0);
+    set_vvmcs(v, VM_ENTRY_INTR_INFO, 0);
 }
 
 static void sync_exception_state(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
 
     if ( !(nvmx->intr.intr_info & INTR_INFO_VALID_MASK) )
@@ -1263,10 +1236,9 @@ static void sync_exception_state(struct vcpu *v)
     {
     case X86_EVENTTYPE_EXT_INTR:
         /* rename exit_reason to EXTERNAL_INTERRUPT */
-        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_REASON,
-                    EXIT_REASON_EXTERNAL_INTERRUPT);
-        __set_vvmcs(nvcpu->nv_vvmcx, EXIT_QUALIFICATION, 0);
-        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_INTR_INFO,
+        set_vvmcs(v, VM_EXIT_REASON, EXIT_REASON_EXTERNAL_INTERRUPT);
+        set_vvmcs(v, EXIT_QUALIFICATION, 0);
+        set_vvmcs(v, VM_EXIT_INTR_INFO,
                     nvmx->intr.intr_info);
         break;
 
@@ -1274,17 +1246,13 @@ static void sync_exception_state(struct vcpu *v)
     case X86_EVENTTYPE_SW_INTERRUPT:
     case X86_EVENTTYPE_SW_EXCEPTION:
         /* throw to L1 */
-        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_INTR_INFO,
-                    nvmx->intr.intr_info);
-        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_INTR_ERROR_CODE,
-                    nvmx->intr.error_code);
+        set_vvmcs(v, VM_EXIT_INTR_INFO, nvmx->intr.intr_info);
+        set_vvmcs(v, VM_EXIT_INTR_ERROR_CODE, 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);
+        set_vvmcs(v, VM_EXIT_REASON, EXIT_REASON_EXCEPTION_NMI);
+        set_vvmcs(v, EXIT_QUALIFICATION, 0);
+        set_vvmcs(v, VM_EXIT_INTR_INFO, nvmx->intr.intr_info);
         break;
     default:
         gdprintk(XENLOG_ERR, "Exception state %lx not handled\n",
@@ -1296,9 +1264,8 @@ static void sync_exception_state(struct vcpu *v)
 static void nvmx_update_apicv(struct vcpu *v)
 {
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-    unsigned long reason = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_REASON);
-    uint32_t intr_info = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_INTR_INFO);
+    unsigned long reason = get_vvmcs(v, VM_EXIT_REASON);
+    uint32_t intr_info = get_vvmcs(v, VM_EXIT_INTR_INFO);
 
     if ( reason == EXIT_REASON_EXTERNAL_INTERRUPT &&
          nvmx->intr.source == hvm_intsrc_lapic &&
@@ -1344,8 +1311,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
     nvcpu->nv_vmswitch_in_progress = 1;
 
     lm_l2 = !!hvm_long_mode_enabled(v);
-    lm_l1 = !!(__get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS) &
-                           VM_EXIT_IA32E_MODE);
+    lm_l1 = !!(get_vvmcs(v, VM_EXIT_CONTROLS) & VM_EXIT_IA32E_MODE);
 
     if ( lm_l1 )
         v->arch.hvm_vcpu.guest_efer |= EFER_LMA | EFER_LME;
@@ -1361,8 +1327,8 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
     if ( lm_l1 != lm_l2 )
         paging_update_paging_modes(v);
 
-    regs->eip = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RIP);
-    regs->esp = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RSP);
+    regs->eip = get_vvmcs(v, HOST_RIP);
+    regs->esp = get_vvmcs(v, HOST_RSP);
     /* VM exit clears all bits except bit 1 */
     regs->eflags = 0x2;
 
@@ -1539,7 +1505,6 @@ int nvmx_handle_vmresume(struct cpu_user_regs *regs)
 {
     bool_t launched;
     struct vcpu *v = current;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     int rc = vmx_inst_check_privilege(regs, 0);
 
@@ -1553,7 +1518,7 @@ int nvmx_handle_vmresume(struct cpu_user_regs *regs)
     }
 
     launched = vvmcs_launched(&nvmx->launched_list,
-                   domain_page_map_to_mfn(nvcpu->nv_vvmcx));
+                              PFN_DOWN(v->arch.hvm_vmx.vmcs_shadow_maddr));
     if ( !launched ) {
        vmreturn (regs, VMFAIL_VALID);
        return X86EMUL_OKAY;
@@ -1565,7 +1530,6 @@ int nvmx_handle_vmlaunch(struct cpu_user_regs *regs)
 {
     bool_t launched;
     struct vcpu *v = current;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     int rc = vmx_inst_check_privilege(regs, 0);
 
@@ -1579,7 +1543,7 @@ int nvmx_handle_vmlaunch(struct cpu_user_regs *regs)
     }
 
     launched = vvmcs_launched(&nvmx->launched_list,
-                   domain_page_map_to_mfn(nvcpu->nv_vvmcx));
+                              PFN_DOWN(v->arch.hvm_vmx.vmcs_shadow_maddr));
     if ( launched ) {
        vmreturn (regs, VMFAIL_VALID);
        return X86EMUL_OKAY;
@@ -1589,7 +1553,7 @@ int nvmx_handle_vmlaunch(struct cpu_user_regs *regs)
         if ( rc == X86EMUL_OKAY )
         {
             if ( set_vvmcs_launched(&nvmx->launched_list,
-                    domain_page_map_to_mfn(nvcpu->nv_vvmcx)) < 0 )
+                                    PFN_DOWN(v->arch.hvm_vmx.vmcs_shadow_maddr)) < 0 )
                 return X86EMUL_UNHANDLEABLE;
         }
     }
@@ -1644,8 +1608,7 @@ int nvmx_handle_vmptrld(struct cpu_user_regs *regs)
         }
     }
 
-    if ( cpu_has_vmx_vmcs_shadowing )
-        nvmx_set_vmcs_pointer(v, nvcpu->nv_vvmcx);
+    nvmx_set_vmcs_pointer(v, nvcpu->nv_vvmcx);
 
     vmreturn(regs, VMSUCCEED);
 
@@ -1694,10 +1657,10 @@ int nvmx_handle_vmclear(struct cpu_user_regs *regs)
         rc = VMFAIL_INVALID;
     else if ( gpa == nvcpu->nv_vvmcxaddr )
     {
-        if ( cpu_has_vmx_vmcs_shadowing )
-            nvmx_clear_vmcs_pointer(v, nvcpu->nv_vvmcx);
-        clear_vvmcs_launched(&nvmx->launched_list,
-            domain_page_map_to_mfn(nvcpu->nv_vvmcx));
+        unsigned long mfn = PFN_DOWN(v->arch.hvm_vmx.vmcs_shadow_maddr);
+
+        nvmx_clear_vmcs_pointer(v, nvcpu->nv_vvmcx);
+        clear_vvmcs_launched(&nvmx->launched_list, mfn);
         nvmx_purge_vvmcs(v);
     }
     else 
@@ -1726,7 +1689,6 @@ int nvmx_handle_vmread(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     struct vmx_inst_decoded decode;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u64 value = 0;
     int rc;
 
@@ -1734,7 +1696,7 @@ int nvmx_handle_vmread(struct cpu_user_regs *regs)
     if ( rc != X86EMUL_OKAY )
         return rc;
 
-    value = __get_vvmcs(nvcpu->nv_vvmcx, reg_read(regs, decode.reg2));
+    value = get_vvmcs(v, reg_read(regs, decode.reg2));
 
     switch ( decode.type ) {
     case VMX_INST_MEMREG_TYPE_MEMORY:
@@ -1755,7 +1717,6 @@ int nvmx_handle_vmwrite(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     struct vmx_inst_decoded decode;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     unsigned long operand; 
     u64 vmcs_encoding;
     bool_t okay = 1;
@@ -1765,7 +1726,7 @@ int nvmx_handle_vmwrite(struct cpu_user_regs *regs)
         return X86EMUL_EXCEPTION;
 
     vmcs_encoding = reg_read(regs, decode.reg2);
-    __set_vvmcs(nvcpu->nv_vvmcx, vmcs_encoding, operand);
+    set_vvmcs(v, vmcs_encoding, operand);
 
     switch ( vmcs_encoding & ~VMCS_HIGH(0) )
     {
@@ -2197,7 +2158,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         }
         else if ( (intr_info & valid_mask) == valid_mask )
         {
-            exec_bitmap =__get_vvmcs(nvcpu->nv_vvmcx, EXCEPTION_BITMAP);
+            exec_bitmap = get_vvmcs(v, EXCEPTION_BITMAP);
 
             if ( exec_bitmap & (1 << vector) )
                 nvcpu->nv_vmexit_pending = 1;
@@ -2316,8 +2277,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
              * special handler is needed if L1 doesn't intercept rdtsc,
              * avoiding changing guest_tsc and messing up timekeeping in L1
              */
-            tsc = hvm_get_guest_tsc(v);
-            tsc += __get_vvmcs(nvcpu->nv_vvmcx, TSC_OFFSET);
+            tsc = hvm_get_guest_tsc(v) + get_vvmcs(v, TSC_OFFSET);
             regs->eax = (uint32_t)tsc;
             regs->edx = (uint32_t)(tsc >> 32);
             update_guest_eip();
@@ -2406,7 +2366,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                 val = *reg;
                 if ( cr == 0 )
                 {
-                    u64 cr0_gh_mask = __get_vvmcs(nvcpu->nv_vvmcx, CR0_GUEST_HOST_MASK);
+                    u64 cr0_gh_mask = get_vvmcs(v, CR0_GUEST_HOST_MASK);
 
                     __vmread(CR0_READ_SHADOW, &old_val);
                     changed_bits = old_val ^ val;
@@ -2414,14 +2374,15 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                         nvcpu->nv_vmexit_pending = 1;
                     else
                     {
-                        u64 guest_cr0 = __get_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0);
-                        __set_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0,
-                                    (guest_cr0 & cr0_gh_mask) | (val & ~cr0_gh_mask));
+                        u64 guest_cr0 = get_vvmcs(v, GUEST_CR0);
+
+                        set_vvmcs(v, GUEST_CR0,
+                                  (guest_cr0 & cr0_gh_mask) | (val & ~cr0_gh_mask));
                     }
                 }
                 else if ( cr == 4 )
                 {
-                    u64 cr4_gh_mask = __get_vvmcs(nvcpu->nv_vvmcx, CR4_GUEST_HOST_MASK);
+                    u64 cr4_gh_mask = get_vvmcs(v, CR4_GUEST_HOST_MASK);
 
                     __vmread(CR4_READ_SHADOW, &old_val);
                     changed_bits = old_val ^ val;
@@ -2429,9 +2390,10 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                         nvcpu->nv_vmexit_pending = 1;
                     else
                     {
-                        u64 guest_cr4 = __get_vvmcs(nvcpu->nv_vvmcx, GUEST_CR4);
-                        __set_vvmcs(nvcpu->nv_vvmcx, GUEST_CR4,
-                                    (guest_cr4 & cr4_gh_mask) | (val & ~cr4_gh_mask));
+                        u64 guest_cr4 = get_vvmcs(v, GUEST_CR4);
+
+                        set_vvmcs(v, GUEST_CR4,
+                                  (guest_cr4 & cr4_gh_mask) | (val & ~cr4_gh_mask));
                     }
                 }
                 else
@@ -2440,20 +2402,21 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
             }
             case VMX_CONTROL_REG_ACCESS_TYPE_CLTS:
             {
-                u64 cr0_gh_mask = __get_vvmcs(nvcpu->nv_vvmcx, CR0_GUEST_HOST_MASK);
+                u64 cr0_gh_mask = get_vvmcs(v, CR0_GUEST_HOST_MASK);
 
                 if ( cr0_gh_mask & X86_CR0_TS )
                     nvcpu->nv_vmexit_pending = 1;
                 else
                 {
-                    u64 guest_cr0 = __get_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0);
-                    __set_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0, (guest_cr0 & ~X86_CR0_TS));
+                    u64 guest_cr0 = get_vvmcs(v, GUEST_CR0);
+
+                    set_vvmcs(v, GUEST_CR0, (guest_cr0 & ~X86_CR0_TS));
                 }
                 break;
             }
             case VMX_CONTROL_REG_ACCESS_TYPE_LMSW:
             {
-                u64 cr0_gh_mask = __get_vvmcs(nvcpu->nv_vvmcx, CR0_GUEST_HOST_MASK);
+                u64 cr0_gh_mask = get_vvmcs(v, CR0_GUEST_HOST_MASK);
 
                 __vmread(CR0_READ_SHADOW, &old_val);
                 old_val &= X86_CR0_PE|X86_CR0_MP|X86_CR0_EM|X86_CR0_TS;
@@ -2464,8 +2427,9 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                     nvcpu->nv_vmexit_pending = 1;
                 else
                 {
-                    u64 guest_cr0 = __get_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0);
-                    __set_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0, (guest_cr0 & cr0_gh_mask) | (val & ~cr0_gh_mask));
+                    u64 guest_cr0 = get_vvmcs(v, GUEST_CR0);
+
+                    set_vvmcs(v, GUEST_CR0, (guest_cr0 & cr0_gh_mask) | (val & ~cr0_gh_mask));
                 }
                 break;
             }
@@ -2517,7 +2481,7 @@ void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int cr)
     if ( !nestedhvm_vmswitch_in_progress(v) )
     {
         unsigned long virtual_cr_mask = 
-            __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, mask_field);
+            get_vvmcs(v, mask_field);
 
         /*
          * We get here when L2 changed cr in a way that did not change
@@ -2529,7 +2493,7 @@ void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int 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);
+            get_vvmcs(v, cr_field);
     }
 
     /* nvcpu.guest_cr is what L2 write to cr actually. */
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index ad9798c..f873523 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -95,7 +95,7 @@ struct arch_vmx_struct {
     /* Physical address of VMCS. */
     paddr_t              vmcs_pa;
     /* VMCS shadow machine address. */
-    paddr_t             vmcs_shadow_maddr;
+    paddr_t              vmcs_shadow_maddr;
 
     /* Protects remote usage of VMCS (VMPTRLD/VMCLEAR). */
     spinlock_t           vmcs_lock;
@@ -492,10 +492,10 @@ void vmx_vmcs_switch(paddr_t from, paddr_t to);
 void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 int vmx_check_msr_bitmap(unsigned long *msr_bitmap, u32 msr, int access_type);
-void virtual_vmcs_enter(void *vvmcs);
-void virtual_vmcs_exit(void *vvmcs);
-u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding);
-void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val);
+void virtual_vmcs_enter(const struct vcpu *);
+void virtual_vmcs_exit(const struct vcpu *);
+u64 virtual_vmcs_vmread(const struct vcpu *, u32 encoding);
+void virtual_vmcs_vmwrite(const struct vcpu *, u32 encoding, u64 val);
 
 static inline int vmx_add_guest_msr(u32 msr)
 {
diff --git a/xen/include/asm-x86/hvm/vmx/vvmx.h b/xen/include/asm-x86/hvm/vmx/vvmx.h
index 60fdc21..aca8b4b 100644
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h
@@ -181,18 +181,20 @@ enum vvmcs_encoding_type {
     VVMCS_TYPE_HSTATE,
 };
 
-u64 __get_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding);
-u64 __get_vvmcs_real(void *vvmcs, u32 vmcs_encoding);
-void __set_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding, u64 val);
-void __set_vvmcs_real(void *vvmcs, u32 vmcs_encoding, u64 val);
-
-#define __get_vvmcs(_vvmcs, _vmcs_encoding) \
-  (cpu_has_vmx_vmcs_shadowing ? __get_vvmcs_real(_vvmcs, _vmcs_encoding) \
-                              : __get_vvmcs_virtual(_vvmcs, _vmcs_encoding))
-
-#define __set_vvmcs(_vvmcs, _vmcs_encoding, _val) \
-  (cpu_has_vmx_vmcs_shadowing ? __set_vvmcs_real(_vvmcs, _vmcs_encoding, _val) \
-                              : __set_vvmcs_virtual(_vvmcs, _vmcs_encoding, _val))
+u64 get_vvmcs_virtual(void *vvmcs, u32 encoding);
+u64 get_vvmcs_real(const struct vcpu *, u32 encoding);
+void set_vvmcs_virtual(void *vvmcs, u32 encoding, u64 val);
+void set_vvmcs_real(const struct vcpu *, u32 encoding, u64 val);
+
+#define get_vvmcs(vcpu, encoding) \
+  (cpu_has_vmx_vmcs_shadowing ? \
+   get_vvmcs_real(vcpu, encoding) : \
+   get_vvmcs_virtual(vcpu_nestedhvm(vcpu).nv_vvmcx, encoding))
+
+#define set_vvmcs(vcpu, encoding, val) \
+  (cpu_has_vmx_vmcs_shadowing ? \
+   set_vvmcs_real(vcpu, encoding, val) : \
+   set_vvmcs_virtual(vcpu_nestedhvm(vcpu).nv_vvmcx, encoding, val))
 
 uint64_t get_shadow_eptp(struct vcpu *v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:44:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23Oy-0003sA-Nf; Thu, 26 Nov 2015 20:44:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ox-0003s3-P1
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:24 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	73/11-02940-62F67565; Thu, 26 Nov 2015 20:44:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448570656!6941166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1181 invoked from network); 26 Nov 2015 20:44:17 -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;
	26 Nov 2015 20:44:17 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Oq-00034F-M1
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Oq-0000Lo-J4
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:16 +0000
Date: Thu, 26 Nov 2015 20:44:16 +0000
Message-Id: <E1a23Oq-0000Lo-J4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vVMX: use latched VMCS machine 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 d02e84b9d9d16b6b56186f0dfdcb3c90b83c82a3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 12:07:27 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:07:27 2015 +0100

    vVMX: use latched VMCS machine address
    
    Instead of calling domain_page_map_to_mfn() over and over, latch the
    guest VMCS machine address unconditionally (i.e. independent of whether
    VMCS shadowing is supported by the hardware).
    
    Since this requires altering the parameters of __[gs]et_vmcs{,_real}()
    (and hence all their callers) anyway, take the opportunity to also drop
    the bogus double underscores from their names (and from
    __[gs]et_vmcs_virtual() as well).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/intr.c        |    4 +-
 xen/arch/x86/hvm/vmx/vmcs.c        |   21 ++--
 xen/arch/x86/hvm/vmx/vmx.c         |    6 +-
 xen/arch/x86/hvm/vmx/vvmx.c        |  308 ++++++++++++++++--------------------
 xen/include/asm-x86/hvm/vmx/vmcs.h |   10 +-
 xen/include/asm-x86/hvm/vmx/vvmx.h |   26 ++--
 6 files changed, 169 insertions(+), 206 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/intr.c b/xen/arch/x86/hvm/vmx/intr.c
index 56c40b1..8fca08c 100644
--- a/xen/arch/x86/hvm/vmx/intr.c
+++ b/xen/arch/x86/hvm/vmx/intr.c
@@ -191,13 +191,13 @@ static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
         if ( intack.source == hvm_intsrc_pic ||
                  intack.source == hvm_intsrc_lapic )
         {
-            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+            ctrl = get_vvmcs(v, PIN_BASED_VM_EXEC_CONTROL);
             if ( !(ctrl & PIN_BASED_EXT_INTR_MASK) )
                 return 0;
 
             vmx_inject_extint(intack.vector, intack.source);
 
-            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, VM_EXIT_CONTROLS);
+            ctrl = get_vvmcs(v, VM_EXIT_CONTROLS);
             if ( ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
             {
                 /* for now, duplicate the ack path in vmx_intr_assist */
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 7cdb063..d6dab8e 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -932,37 +932,36 @@ void vmx_vmcs_switch(paddr_t from, paddr_t to)
     spin_unlock(&vmx->vmcs_lock);
 }
 
-void virtual_vmcs_enter(void *vvmcs)
+void virtual_vmcs_enter(const struct vcpu *v)
 {
-    __vmptrld(pfn_to_paddr(domain_page_map_to_mfn(vvmcs)));
+    __vmptrld(v->arch.hvm_vmx.vmcs_shadow_maddr);
 }
 
-void virtual_vmcs_exit(void *vvmcs)
+void virtual_vmcs_exit(const struct vcpu *v)
 {
     paddr_t cur = this_cpu(current_vmcs);
 
-    __vmpclear(pfn_to_paddr(domain_page_map_to_mfn(vvmcs)));
+    __vmpclear(v->arch.hvm_vmx.vmcs_shadow_maddr);
     if ( cur )
         __vmptrld(cur);
-
 }
 
-u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding)
+u64 virtual_vmcs_vmread(const struct vcpu *v, u32 vmcs_encoding)
 {
     u64 res;
 
-    virtual_vmcs_enter(vvmcs);
+    virtual_vmcs_enter(v);
     __vmread(vmcs_encoding, &res);
-    virtual_vmcs_exit(vvmcs);
+    virtual_vmcs_exit(v);
 
     return res;
 }
 
-void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val)
+void virtual_vmcs_vmwrite(const struct vcpu *v, u32 vmcs_encoding, u64 val)
 {
-    virtual_vmcs_enter(vvmcs);
+    virtual_vmcs_enter(v);
     __vmwrite(vmcs_encoding, val);
-    virtual_vmcs_exit(vvmcs);
+    virtual_vmcs_exit(v);
 }
 
 static int construct_vmcs(struct vcpu *v)
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index eb6248e..4b8d2fa 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1458,8 +1458,7 @@ void vmx_inject_extint(int trap, uint8_t source)
     u32    pin_based_cntrl;
 
     if ( nestedhvm_vcpu_in_guestmode(v) ) {
-        pin_based_cntrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, 
-                                     PIN_BASED_VM_EXEC_CONTROL);
+        pin_based_cntrl = get_vvmcs(v, PIN_BASED_VM_EXEC_CONTROL);
         if ( pin_based_cntrl & PIN_BASED_EXT_INTR_MASK ) {
             nvmx_enqueue_n2_exceptions (v, 
                INTR_INFO_VALID_MASK |
@@ -1479,8 +1478,7 @@ void vmx_inject_nmi(void)
     u32    pin_based_cntrl;
 
     if ( nestedhvm_vcpu_in_guestmode(v) ) {
-        pin_based_cntrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, 
-                                     PIN_BASED_VM_EXEC_CONTROL);
+        pin_based_cntrl = get_vvmcs(v, PIN_BASED_VM_EXEC_CONTROL);
         if ( pin_based_cntrl & PIN_BASED_NMI_EXITING ) {
             nvmx_enqueue_n2_exceptions (v, 
                INTR_INFO_VALID_MASK |
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index ea1052e..e48d872 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -175,11 +175,7 @@ int nvmx_vcpu_reset(struct vcpu *v)
 
 uint64_t nvmx_vcpu_eptp_base(struct vcpu *v)
 {
-    uint64_t eptp_base;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-
-    eptp_base = __get_vvmcs(nvcpu->nv_vvmcx, EPT_POINTER);
-    return eptp_base & PAGE_MASK;
+    return get_vvmcs(v, EPT_POINTER) & PAGE_MASK;
 }
 
 bool_t nvmx_ept_enabled(struct vcpu *v)
@@ -236,7 +232,7 @@ static int vvmcs_offset(u32 width, u32 type, u32 index)
     return offset;
 }
 
-u64 __get_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding)
+u64 get_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding)
 {
     union vmcs_encoding enc;
     u64 *content = (u64 *) vvmcs;
@@ -266,12 +262,12 @@ u64 __get_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding)
     return res;
 }
 
-u64 __get_vvmcs_real(void *vvmcs, u32 vmcs_encoding)
+u64 get_vvmcs_real(const struct vcpu *v, u32 encoding)
 {
-    return virtual_vmcs_vmread(vvmcs, vmcs_encoding);
+    return virtual_vmcs_vmread(v, encoding);
 }
 
-void __set_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding, u64 val)
+void set_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding, u64 val)
 {
     union vmcs_encoding enc;
     u64 *content = (u64 *) vvmcs;
@@ -307,9 +303,9 @@ void __set_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding, u64 val)
     content[offset] = res;
 }
 
-void __set_vvmcs_real(void *vvmcs, u32 vmcs_encoding, u64 val)
+void set_vvmcs_real(const struct vcpu *v, u32 encoding, u64 val)
 {
-    virtual_vmcs_vmwrite(vvmcs, vmcs_encoding, val);
+    virtual_vmcs_vmwrite(v, encoding, val);
 }
 
 static unsigned long reg_read(struct cpu_user_regs *regs,
@@ -331,25 +327,20 @@ static void reg_write(struct cpu_user_regs *regs,
 
 static inline u32 __n2_pin_exec_control(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-
-    return __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+    return get_vvmcs(v, PIN_BASED_VM_EXEC_CONTROL);
 }
 
 static inline u32 __n2_exec_control(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-
-    return __get_vvmcs(nvcpu->nv_vvmcx, CPU_BASED_VM_EXEC_CONTROL);
+    return get_vvmcs(v, CPU_BASED_VM_EXEC_CONTROL);
 }
 
 static inline u32 __n2_secondary_exec_control(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u64 second_ctrl = 0;
 
     if ( __n2_exec_control(v) & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
-        second_ctrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+        second_ctrl = get_vvmcs(v, SECONDARY_VM_EXEC_CONTROL);
 
     return second_ctrl;
 }
@@ -502,18 +493,17 @@ static void vmreturn(struct cpu_user_regs *regs, enum vmx_ops_result ops_res)
 bool_t nvmx_intercepts_exception(struct vcpu *v, unsigned int trap,
                                  int error_code)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u32 exception_bitmap, pfec_match=0, pfec_mask=0;
     int r;
 
     ASSERT ( trap < 32 );
 
-    exception_bitmap = __get_vvmcs(nvcpu->nv_vvmcx, EXCEPTION_BITMAP);
+    exception_bitmap = get_vvmcs(v, EXCEPTION_BITMAP);
     r = exception_bitmap & (1 << trap) ? 1: 0;
 
     if ( trap == TRAP_page_fault ) {
-        pfec_match = __get_vvmcs(nvcpu->nv_vvmcx, PAGE_FAULT_ERROR_CODE_MATCH);
-        pfec_mask  = __get_vvmcs(nvcpu->nv_vvmcx, PAGE_FAULT_ERROR_CODE_MASK);
+        pfec_match = get_vvmcs(v, PAGE_FAULT_ERROR_CODE_MATCH);
+        pfec_mask  = get_vvmcs(v, PAGE_FAULT_ERROR_CODE_MASK);
         if ( (error_code & pfec_mask) != pfec_match )
             r = !r;
     }
@@ -528,9 +518,7 @@ static inline u32 __shadow_control(struct vcpu *v,
                                  unsigned int field,
                                  u32 host_value)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-
-    return (u32) __get_vvmcs(nvcpu->nv_vvmcx, field) | host_value;
+    return get_vvmcs(v, field) | host_value;
 }
 
 static void set_shadow_control(struct vcpu *v,
@@ -597,13 +585,12 @@ void nvmx_update_secondary_exec_control(struct vcpu *v,
                                         unsigned long host_cntrl)
 {
     u32 shadow_cntrl;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     u32 apicv_bit = SECONDARY_EXEC_APIC_REGISTER_VIRT |
                     SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY;
 
     host_cntrl &= ~apicv_bit;
-    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+    shadow_cntrl = get_vvmcs(v, SECONDARY_VM_EXEC_CONTROL);
 
     /* No vAPIC-v support, so it shouldn't be set in vmcs12. */
     ASSERT(!(shadow_cntrl & apicv_bit));
@@ -616,10 +603,9 @@ void nvmx_update_secondary_exec_control(struct vcpu *v,
 static void nvmx_update_pin_control(struct vcpu *v, unsigned long host_cntrl)
 {
     u32 shadow_cntrl;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
     host_cntrl &= ~PIN_BASED_POSTED_INTERRUPT;
-    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+    shadow_cntrl = get_vvmcs(v, PIN_BASED_VM_EXEC_CONTROL);
 
     /* No vAPIC-v support, so it shouldn't be set in vmcs12. */
     ASSERT(!(shadow_cntrl & PIN_BASED_POSTED_INTERRUPT));
@@ -631,9 +617,8 @@ static void nvmx_update_pin_control(struct vcpu *v, unsigned long host_cntrl)
 static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
 {
     u32 shadow_cntrl;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
-    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
+    shadow_cntrl = get_vvmcs(v, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_LOAD_HOST_PAT
                       | VM_EXIT_LOAD_HOST_EFER
@@ -645,9 +630,8 @@ static void nvmx_update_exit_control(struct vcpu *v, unsigned long host_cntrl)
 static void nvmx_update_entry_control(struct vcpu *v)
 {
     u32 shadow_cntrl;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
-    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_ENTRY_CONTROLS);
+    shadow_cntrl = get_vvmcs(v, VM_ENTRY_CONTROLS);
     shadow_cntrl &= ~(VM_ENTRY_LOAD_GUEST_PAT
                       | VM_ENTRY_LOAD_GUEST_EFER
                       | VM_ENTRY_LOAD_PERF_GLOBAL_CTRL);
@@ -661,7 +645,6 @@ void nvmx_update_exception_bitmap(struct vcpu *v, unsigned long value)
 
 static void nvmx_update_apic_access_address(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u32 ctrl;
 
     ctrl = __n2_secondary_exec_control(v);
@@ -671,7 +654,7 @@ static void nvmx_update_apic_access_address(struct vcpu *v)
         unsigned long apic_gpfn;
         struct page_info *apic_pg;
 
-        apic_gpfn = __get_vvmcs(nvcpu->nv_vvmcx, APIC_ACCESS_ADDR) >> PAGE_SHIFT;
+        apic_gpfn = get_vvmcs(v, APIC_ACCESS_ADDR) >> PAGE_SHIFT;
         apic_pg = get_page_from_gfn(v->domain, apic_gpfn, &p2mt, P2M_ALLOC);
         ASSERT(apic_pg && !p2m_is_paging(p2mt));
         __vmwrite(APIC_ACCESS_ADDR, page_to_maddr(apic_pg));
@@ -683,7 +666,6 @@ static void nvmx_update_apic_access_address(struct vcpu *v)
 
 static void nvmx_update_virtual_apic_address(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u32 ctrl;
 
     ctrl = __n2_exec_control(v);
@@ -693,7 +675,7 @@ static void nvmx_update_virtual_apic_address(struct vcpu *v)
         unsigned long vapic_gpfn;
         struct page_info *vapic_pg;
 
-        vapic_gpfn = __get_vvmcs(nvcpu->nv_vvmcx, VIRTUAL_APIC_PAGE_ADDR) >> PAGE_SHIFT;
+        vapic_gpfn = get_vvmcs(v, VIRTUAL_APIC_PAGE_ADDR) >> PAGE_SHIFT;
         vapic_pg = get_page_from_gfn(v->domain, vapic_gpfn, &p2mt, P2M_ALLOC);
         ASSERT(vapic_pg && !p2m_is_paging(p2mt));
         __vmwrite(VIRTUAL_APIC_PAGE_ADDR, page_to_maddr(vapic_pg));
@@ -705,23 +687,20 @@ static void nvmx_update_virtual_apic_address(struct vcpu *v)
 
 static void nvmx_update_tpr_threshold(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u32 ctrl = __n2_exec_control(v);
+
     if ( ctrl & CPU_BASED_TPR_SHADOW )
-        __vmwrite(TPR_THRESHOLD, __get_vvmcs(nvcpu->nv_vvmcx, TPR_THRESHOLD));
+        __vmwrite(TPR_THRESHOLD, get_vvmcs(v, TPR_THRESHOLD));
     else
         __vmwrite(TPR_THRESHOLD, 0);
 }
 
 static void nvmx_update_pfec(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-    void *vvmcs = nvcpu->nv_vvmcx;
-
     __vmwrite(PAGE_FAULT_ERROR_CODE_MASK,
-        __get_vvmcs(vvmcs, PAGE_FAULT_ERROR_CODE_MASK));
+              get_vvmcs(v, PAGE_FAULT_ERROR_CODE_MASK));
     __vmwrite(PAGE_FAULT_ERROR_CODE_MATCH,
-        __get_vvmcs(vvmcs, PAGE_FAULT_ERROR_CODE_MATCH));
+              get_vvmcs(v, PAGE_FAULT_ERROR_CODE_MATCH));
 }
 
 static void __clear_current_vvmcs(struct vcpu *v)
@@ -739,7 +718,7 @@ static bool_t __must_check _map_msr_bitmap(struct vcpu *v)
 
     if ( nvmx->msrbitmap )
         hvm_unmap_guest_frame(nvmx->msrbitmap, 1);
-    gpa = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, MSR_BITMAP);
+    gpa = get_vvmcs(v, MSR_BITMAP);
     nvmx->msrbitmap = hvm_map_guest_frame_ro(gpa >> PAGE_SHIFT, 1);
 
     return nvmx->msrbitmap != NULL;
@@ -754,7 +733,7 @@ static bool_t __must_check _map_io_bitmap(struct vcpu *v, u64 vmcs_reg)
     index = vmcs_reg == IO_BITMAP_A ? 0 : 1;
     if (nvmx->iobitmap[index])
         hvm_unmap_guest_frame(nvmx->iobitmap[index], 1);
-    gpa = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, vmcs_reg);
+    gpa = get_vvmcs(v, vmcs_reg);
     nvmx->iobitmap[index] = hvm_map_guest_frame_ro(gpa >> PAGE_SHIFT, 1);
 
     return nvmx->iobitmap[index] != NULL;
@@ -777,6 +756,7 @@ static void nvmx_purge_vvmcs(struct vcpu *v)
         hvm_unmap_guest_frame(nvcpu->nv_vvmcx, 1);
     nvcpu->nv_vvmcx = NULL;
     nvcpu->nv_vvmcxaddr = VMCX_EADDR;
+    v->arch.hvm_vmx.vmcs_shadow_maddr = 0;
     for (i=0; i<2; i++) {
         if ( nvmx->iobitmap[i] ) {
             hvm_unmap_guest_frame(nvmx->iobitmap[i], 1);
@@ -792,11 +772,10 @@ static void nvmx_purge_vvmcs(struct vcpu *v)
 u64 nvmx_get_tsc_offset(struct vcpu *v)
 {
     u64 offset = 0;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
-    if ( __get_vvmcs(nvcpu->nv_vvmcx, CPU_BASED_VM_EXEC_CONTROL) &
+    if ( get_vvmcs(v, CPU_BASED_VM_EXEC_CONTROL) &
          CPU_BASED_USE_TSC_OFFSETING )
-        offset = __get_vvmcs(nvcpu->nv_vvmcx, TSC_OFFSET);
+        offset = get_vvmcs(v, TSC_OFFSET);
 
     return offset;
 }
@@ -911,12 +890,9 @@ static struct vmcs_host_to_guest {
     {HOST_SYSENTER_EIP, GUEST_SYSENTER_EIP},
 };
 
-static void vvmcs_to_shadow(void *vvmcs, unsigned int field)
+static void vvmcs_to_shadow(const struct vcpu *v, unsigned int field)
 {
-    u64 value;
-
-    value = __get_vvmcs(vvmcs, field);
-    __vmwrite(field, value);
+    __vmwrite(field, get_vvmcs(v, field));
 }
 
 static void vvmcs_to_shadow_bulk(struct vcpu *v, unsigned int n,
@@ -950,15 +926,15 @@ static void vvmcs_to_shadow_bulk(struct vcpu *v, unsigned int n,
 
 fallback:
     for ( i = 0; i < n; i++ )
-        vvmcs_to_shadow(vvmcs, field[i]);
+        vvmcs_to_shadow(v, field[i]);
 }
 
-static inline void shadow_to_vvmcs(void *vvmcs, unsigned int field)
+static inline void shadow_to_vvmcs(const struct vcpu *v, unsigned int field)
 {
     unsigned long value;
 
     if ( __vmread_safe(field, &value) )
-        __set_vvmcs(vvmcs, field, value);
+        set_vvmcs(v, field, value);
 }
 
 static void shadow_to_vvmcs_bulk(struct vcpu *v, unsigned int n,
@@ -992,7 +968,7 @@ static void shadow_to_vvmcs_bulk(struct vcpu *v, unsigned int n,
 
 fallback:
     for ( i = 0; i < n; i++ )
-        shadow_to_vvmcs(vvmcs, field[i]);
+        shadow_to_vvmcs(v, field[i]);
 }
 
 static void load_shadow_control(struct vcpu *v)
@@ -1017,7 +993,6 @@ static void load_shadow_control(struct vcpu *v)
 static void load_shadow_guest_state(struct vcpu *v)
 {
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-    void *vvmcs = nvcpu->nv_vvmcx;
     u32 control;
     u64 cr_gh_mask, cr_read_shadow;
 
@@ -1031,18 +1006,18 @@ 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), 1);
-    hvm_set_cr4(__get_vvmcs(vvmcs, GUEST_CR4), 1);
-    hvm_set_cr3(__get_vvmcs(vvmcs, GUEST_CR3), 1);
+    nvcpu->guest_cr[0] = get_vvmcs(v, CR0_READ_SHADOW);
+    nvcpu->guest_cr[4] = get_vvmcs(v, CR4_READ_SHADOW);
+    hvm_set_cr0(get_vvmcs(v, GUEST_CR0), 1);
+    hvm_set_cr4(get_vvmcs(v, GUEST_CR4), 1);
+    hvm_set_cr3(get_vvmcs(v, GUEST_CR3), 1);
 
-    control = __get_vvmcs(vvmcs, VM_ENTRY_CONTROLS);
+    control = get_vvmcs(v, VM_ENTRY_CONTROLS);
     if ( control & VM_ENTRY_LOAD_GUEST_PAT )
-        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, GUEST_PAT));
+        hvm_set_guest_pat(v, get_vvmcs(v, GUEST_PAT));
     if ( control & VM_ENTRY_LOAD_PERF_GLOBAL_CTRL )
         hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL,
-                                __get_vvmcs(vvmcs, GUEST_PERF_GLOBAL_CTRL), 0);
+                                get_vvmcs(v, GUEST_PERF_GLOBAL_CTRL), 0);
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset, 0);
 
@@ -1053,14 +1028,14 @@ static void load_shadow_guest_state(struct vcpu *v)
      * guest host mask to 0xffffffff in shadow VMCS (follow the host L1 VMCS),
      * then calculate the corresponding read shadow separately for CR0 and CR4.
      */
-    cr_gh_mask = __get_vvmcs(vvmcs, CR0_GUEST_HOST_MASK);
-    cr_read_shadow = (__get_vvmcs(vvmcs, GUEST_CR0) & ~cr_gh_mask) |
-                     (__get_vvmcs(vvmcs, CR0_READ_SHADOW) & cr_gh_mask);
+    cr_gh_mask = get_vvmcs(v, CR0_GUEST_HOST_MASK);
+    cr_read_shadow = (get_vvmcs(v, GUEST_CR0) & ~cr_gh_mask) |
+                     (get_vvmcs(v, CR0_READ_SHADOW) & cr_gh_mask);
     __vmwrite(CR0_READ_SHADOW, cr_read_shadow);
 
-    cr_gh_mask = __get_vvmcs(vvmcs, CR4_GUEST_HOST_MASK);
-    cr_read_shadow = (__get_vvmcs(vvmcs, GUEST_CR4) & ~cr_gh_mask) |
-                     (__get_vvmcs(vvmcs, CR4_READ_SHADOW) & cr_gh_mask);
+    cr_gh_mask = get_vvmcs(v, CR4_GUEST_HOST_MASK);
+    cr_read_shadow = (get_vvmcs(v, GUEST_CR4) & ~cr_gh_mask) |
+                     (get_vvmcs(v, CR4_READ_SHADOW) & cr_gh_mask);
     __vmwrite(CR4_READ_SHADOW, cr_read_shadow);
 
     /* TODO: CR3 target control */
@@ -1084,11 +1059,11 @@ static uint64_t get_host_eptp(struct vcpu *v)
     return ept_get_eptp(ept_data);
 }
 
-static bool_t nvmx_vpid_enabled(struct nestedvcpu *nvcpu)
+static bool_t nvmx_vpid_enabled(const struct vcpu *v)
 {
     uint32_t second_cntl;
 
-    second_cntl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+    second_cntl = get_vvmcs(v, SECONDARY_VM_EXEC_CONTROL);
     if ( second_cntl & SECONDARY_EXEC_ENABLE_VPID )
         return 1;
     return 0;
@@ -1099,32 +1074,38 @@ static void nvmx_set_vmcs_pointer(struct vcpu *v, struct vmcs_struct *vvmcs)
     unsigned long vvmcs_mfn = domain_page_map_to_mfn(vvmcs);
     paddr_t vvmcs_maddr = vvmcs_mfn << PAGE_SHIFT;
 
-    __vmpclear(vvmcs_maddr);
-    vvmcs->vmcs_revision_id |= VMCS_RID_TYPE_MASK;
+    if ( cpu_has_vmx_vmcs_shadowing )
+    {
+        __vmpclear(vvmcs_maddr);
+        vvmcs->vmcs_revision_id |= VMCS_RID_TYPE_MASK;
+        __vmwrite(VMCS_LINK_POINTER, vvmcs_maddr);
+        __vmwrite(VMREAD_BITMAP, page_to_maddr(v->arch.hvm_vmx.vmread_bitmap));
+        __vmwrite(VMWRITE_BITMAP, page_to_maddr(v->arch.hvm_vmx.vmwrite_bitmap));
+    }
     v->arch.hvm_vmx.vmcs_shadow_maddr = vvmcs_maddr;
-    __vmwrite(VMCS_LINK_POINTER, vvmcs_maddr);
-    __vmwrite(VMREAD_BITMAP, page_to_maddr(v->arch.hvm_vmx.vmread_bitmap));
-    __vmwrite(VMWRITE_BITMAP, page_to_maddr(v->arch.hvm_vmx.vmwrite_bitmap));
 }
 
 static void nvmx_clear_vmcs_pointer(struct vcpu *v, struct vmcs_struct *vvmcs)
 {
-    unsigned long vvmcs_mfn = domain_page_map_to_mfn(vvmcs);
-    paddr_t vvmcs_maddr = vvmcs_mfn << PAGE_SHIFT;
-
-    __vmpclear(vvmcs_maddr);
-    vvmcs->vmcs_revision_id &= ~VMCS_RID_TYPE_MASK;
     v->arch.hvm_vmx.vmcs_shadow_maddr = 0;
-    __vmwrite(VMCS_LINK_POINTER, ~0ul);
-    __vmwrite(VMREAD_BITMAP, 0);
-    __vmwrite(VMWRITE_BITMAP, 0);
+
+    if ( cpu_has_vmx_vmcs_shadowing )
+    {
+        unsigned long vvmcs_mfn = domain_page_map_to_mfn(vvmcs);
+        paddr_t vvmcs_maddr = vvmcs_mfn << PAGE_SHIFT;
+
+        __vmpclear(vvmcs_maddr);
+        vvmcs->vmcs_revision_id &= ~VMCS_RID_TYPE_MASK;
+        __vmwrite(VMCS_LINK_POINTER, ~0ul);
+        __vmwrite(VMREAD_BITMAP, 0);
+        __vmwrite(VMWRITE_BITMAP, 0);
+    }
 }
 
 static void virtual_vmentry(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-    void *vvmcs = nvcpu->nv_vvmcx;
     unsigned long lm_l1, lm_l2;
 
     vmx_vmcs_switch(v->arch.hvm_vmx.vmcs_pa, nvcpu->nv_n2vmcx_pa);
@@ -1143,8 +1124,7 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
      * L1 exit_controls
      */
     lm_l1 = !!hvm_long_mode_enabled(v);
-    lm_l2 = !!(__get_vvmcs(vvmcs, VM_ENTRY_CONTROLS) &
-                           VM_ENTRY_IA32E_MODE);
+    lm_l2 = !!(get_vvmcs(v, VM_ENTRY_CONTROLS) & VM_ENTRY_IA32E_MODE);
 
     if ( lm_l2 )
         v->arch.hvm_vcpu.guest_efer |= EFER_LMA | EFER_LME;
@@ -1161,9 +1141,9 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
          !(v->arch.hvm_vcpu.guest_efer & EFER_LMA) )
         vvmcs_to_shadow_bulk(v, ARRAY_SIZE(gpdpte_fields), gpdpte_fields);
 
-    regs->eip = __get_vvmcs(vvmcs, GUEST_RIP);
-    regs->esp = __get_vvmcs(vvmcs, GUEST_RSP);
-    regs->eflags = __get_vvmcs(vvmcs, GUEST_RFLAGS);
+    regs->eip = get_vvmcs(v, GUEST_RIP);
+    regs->esp = get_vvmcs(v, GUEST_RSP);
+    regs->eflags = get_vvmcs(v, GUEST_RFLAGS);
 
     /* updating host cr0 to sync TS bit */
     __vmwrite(HOST_CR0, v->arch.hvm_vmx.host_cr0);
@@ -1175,10 +1155,10 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
         __vmwrite(EPT_POINTER, get_host_eptp(v));
 
     /* nested VPID support! */
-    if ( cpu_has_vmx_vpid && nvmx_vpid_enabled(nvcpu) )
+    if ( cpu_has_vmx_vpid && nvmx_vpid_enabled(v) )
     {
         struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
-        uint32_t new_vpid =  __get_vvmcs(vvmcs, VIRTUAL_PROCESSOR_ID);
+        uint32_t new_vpid = get_vvmcs(v, VIRTUAL_PROCESSOR_ID);
 
         if ( nvmx->guest_vpid != new_vpid )
         {
@@ -1191,34 +1171,29 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
 
 static void sync_vvmcs_guest_state(struct vcpu *v, struct cpu_user_regs *regs)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-    void *vvmcs = nvcpu->nv_vvmcx;
-
     /* copy shadow vmcs.gstate back to vvmcs.gstate */
     shadow_to_vvmcs_bulk(v, ARRAY_SIZE(vmcs_gstate_field),
                          vmcs_gstate_field);
     /* RIP, RSP are in user regs */
-    __set_vvmcs(vvmcs, GUEST_RIP, regs->eip);
-    __set_vvmcs(vvmcs, GUEST_RSP, regs->esp);
+    set_vvmcs(v, GUEST_RIP, regs->eip);
+    set_vvmcs(v, GUEST_RSP, regs->esp);
 
     /* CR3 sync if exec doesn't want cr3 load exiting: i.e. nested EPT */
     if ( !(__n2_exec_control(v) & CPU_BASED_CR3_LOAD_EXITING) )
-        shadow_to_vvmcs(vvmcs, GUEST_CR3);
+        shadow_to_vvmcs(v, GUEST_CR3);
 }
 
 static void sync_vvmcs_ro(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
-    void *vvmcs = nvcpu->nv_vvmcx;
 
     shadow_to_vvmcs_bulk(v, ARRAY_SIZE(vmcs_ro_field), vmcs_ro_field);
 
     /* Adjust exit_reason/exit_qualifciation for violation case */
-    if ( __get_vvmcs(vvmcs, VM_EXIT_REASON) == EXIT_REASON_EPT_VIOLATION )
+    if ( get_vvmcs(v, VM_EXIT_REASON) == EXIT_REASON_EPT_VIOLATION )
     {
-        __set_vvmcs(vvmcs, EXIT_QUALIFICATION, nvmx->ept.exit_qual);
-        __set_vvmcs(vvmcs, VM_EXIT_REASON, nvmx->ept.exit_reason);
+        set_vvmcs(v, EXIT_QUALIFICATION, nvmx->ept.exit_qual);
+        set_vvmcs(v, VM_EXIT_REASON, nvmx->ept.exit_reason);
     }
 }
 
@@ -1226,34 +1201,32 @@ static void load_vvmcs_host_state(struct vcpu *v)
 {
     int i;
     u64 r;
-    void *vvmcs = vcpu_nestedhvm(v).nv_vvmcx;
     u32 control;
 
     for ( i = 0; i < ARRAY_SIZE(vmcs_h2g_field); i++ )
     {
-        r = __get_vvmcs(vvmcs, vmcs_h2g_field[i].host_field);
+        r = get_vvmcs(v, vmcs_h2g_field[i].host_field);
         __vmwrite(vmcs_h2g_field[i].guest_field, r);
     }
 
-    hvm_set_cr0(__get_vvmcs(vvmcs, HOST_CR0), 1);
-    hvm_set_cr4(__get_vvmcs(vvmcs, HOST_CR4), 1);
-    hvm_set_cr3(__get_vvmcs(vvmcs, HOST_CR3), 1);
+    hvm_set_cr0(get_vvmcs(v, HOST_CR0), 1);
+    hvm_set_cr4(get_vvmcs(v, HOST_CR4), 1);
+    hvm_set_cr3(get_vvmcs(v, HOST_CR3), 1);
 
-    control = __get_vvmcs(vvmcs, VM_EXIT_CONTROLS);
+    control = get_vvmcs(v, VM_EXIT_CONTROLS);
     if ( control & VM_EXIT_LOAD_HOST_PAT )
-        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, HOST_PAT));
+        hvm_set_guest_pat(v, get_vvmcs(v, HOST_PAT));
     if ( control & VM_EXIT_LOAD_PERF_GLOBAL_CTRL )
         hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL,
-                                __get_vvmcs(vvmcs, HOST_PERF_GLOBAL_CTRL), 1);
+                                get_vvmcs(v, HOST_PERF_GLOBAL_CTRL), 1);
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset, 0);
 
-    __set_vvmcs(vvmcs, VM_ENTRY_INTR_INFO, 0);
+    set_vvmcs(v, VM_ENTRY_INTR_INFO, 0);
 }
 
 static void sync_exception_state(struct vcpu *v)
 {
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
 
     if ( !(nvmx->intr.intr_info & INTR_INFO_VALID_MASK) )
@@ -1263,10 +1236,9 @@ static void sync_exception_state(struct vcpu *v)
     {
     case X86_EVENTTYPE_EXT_INTR:
         /* rename exit_reason to EXTERNAL_INTERRUPT */
-        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_REASON,
-                    EXIT_REASON_EXTERNAL_INTERRUPT);
-        __set_vvmcs(nvcpu->nv_vvmcx, EXIT_QUALIFICATION, 0);
-        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_INTR_INFO,
+        set_vvmcs(v, VM_EXIT_REASON, EXIT_REASON_EXTERNAL_INTERRUPT);
+        set_vvmcs(v, EXIT_QUALIFICATION, 0);
+        set_vvmcs(v, VM_EXIT_INTR_INFO,
                     nvmx->intr.intr_info);
         break;
 
@@ -1274,17 +1246,13 @@ static void sync_exception_state(struct vcpu *v)
     case X86_EVENTTYPE_SW_INTERRUPT:
     case X86_EVENTTYPE_SW_EXCEPTION:
         /* throw to L1 */
-        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_INTR_INFO,
-                    nvmx->intr.intr_info);
-        __set_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_INTR_ERROR_CODE,
-                    nvmx->intr.error_code);
+        set_vvmcs(v, VM_EXIT_INTR_INFO, nvmx->intr.intr_info);
+        set_vvmcs(v, VM_EXIT_INTR_ERROR_CODE, 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);
+        set_vvmcs(v, VM_EXIT_REASON, EXIT_REASON_EXCEPTION_NMI);
+        set_vvmcs(v, EXIT_QUALIFICATION, 0);
+        set_vvmcs(v, VM_EXIT_INTR_INFO, nvmx->intr.intr_info);
         break;
     default:
         gdprintk(XENLOG_ERR, "Exception state %lx not handled\n",
@@ -1296,9 +1264,8 @@ static void sync_exception_state(struct vcpu *v)
 static void nvmx_update_apicv(struct vcpu *v)
 {
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
-    unsigned long reason = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_REASON);
-    uint32_t intr_info = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_INTR_INFO);
+    unsigned long reason = get_vvmcs(v, VM_EXIT_REASON);
+    uint32_t intr_info = get_vvmcs(v, VM_EXIT_INTR_INFO);
 
     if ( reason == EXIT_REASON_EXTERNAL_INTERRUPT &&
          nvmx->intr.source == hvm_intsrc_lapic &&
@@ -1344,8 +1311,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
     nvcpu->nv_vmswitch_in_progress = 1;
 
     lm_l2 = !!hvm_long_mode_enabled(v);
-    lm_l1 = !!(__get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS) &
-                           VM_EXIT_IA32E_MODE);
+    lm_l1 = !!(get_vvmcs(v, VM_EXIT_CONTROLS) & VM_EXIT_IA32E_MODE);
 
     if ( lm_l1 )
         v->arch.hvm_vcpu.guest_efer |= EFER_LMA | EFER_LME;
@@ -1361,8 +1327,8 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
     if ( lm_l1 != lm_l2 )
         paging_update_paging_modes(v);
 
-    regs->eip = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RIP);
-    regs->esp = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RSP);
+    regs->eip = get_vvmcs(v, HOST_RIP);
+    regs->esp = get_vvmcs(v, HOST_RSP);
     /* VM exit clears all bits except bit 1 */
     regs->eflags = 0x2;
 
@@ -1539,7 +1505,6 @@ int nvmx_handle_vmresume(struct cpu_user_regs *regs)
 {
     bool_t launched;
     struct vcpu *v = current;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     int rc = vmx_inst_check_privilege(regs, 0);
 
@@ -1553,7 +1518,7 @@ int nvmx_handle_vmresume(struct cpu_user_regs *regs)
     }
 
     launched = vvmcs_launched(&nvmx->launched_list,
-                   domain_page_map_to_mfn(nvcpu->nv_vvmcx));
+                              PFN_DOWN(v->arch.hvm_vmx.vmcs_shadow_maddr));
     if ( !launched ) {
        vmreturn (regs, VMFAIL_VALID);
        return X86EMUL_OKAY;
@@ -1565,7 +1530,6 @@ int nvmx_handle_vmlaunch(struct cpu_user_regs *regs)
 {
     bool_t launched;
     struct vcpu *v = current;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
     int rc = vmx_inst_check_privilege(regs, 0);
 
@@ -1579,7 +1543,7 @@ int nvmx_handle_vmlaunch(struct cpu_user_regs *regs)
     }
 
     launched = vvmcs_launched(&nvmx->launched_list,
-                   domain_page_map_to_mfn(nvcpu->nv_vvmcx));
+                              PFN_DOWN(v->arch.hvm_vmx.vmcs_shadow_maddr));
     if ( launched ) {
        vmreturn (regs, VMFAIL_VALID);
        return X86EMUL_OKAY;
@@ -1589,7 +1553,7 @@ int nvmx_handle_vmlaunch(struct cpu_user_regs *regs)
         if ( rc == X86EMUL_OKAY )
         {
             if ( set_vvmcs_launched(&nvmx->launched_list,
-                    domain_page_map_to_mfn(nvcpu->nv_vvmcx)) < 0 )
+                                    PFN_DOWN(v->arch.hvm_vmx.vmcs_shadow_maddr)) < 0 )
                 return X86EMUL_UNHANDLEABLE;
         }
     }
@@ -1644,8 +1608,7 @@ int nvmx_handle_vmptrld(struct cpu_user_regs *regs)
         }
     }
 
-    if ( cpu_has_vmx_vmcs_shadowing )
-        nvmx_set_vmcs_pointer(v, nvcpu->nv_vvmcx);
+    nvmx_set_vmcs_pointer(v, nvcpu->nv_vvmcx);
 
     vmreturn(regs, VMSUCCEED);
 
@@ -1694,10 +1657,10 @@ int nvmx_handle_vmclear(struct cpu_user_regs *regs)
         rc = VMFAIL_INVALID;
     else if ( gpa == nvcpu->nv_vvmcxaddr )
     {
-        if ( cpu_has_vmx_vmcs_shadowing )
-            nvmx_clear_vmcs_pointer(v, nvcpu->nv_vvmcx);
-        clear_vvmcs_launched(&nvmx->launched_list,
-            domain_page_map_to_mfn(nvcpu->nv_vvmcx));
+        unsigned long mfn = PFN_DOWN(v->arch.hvm_vmx.vmcs_shadow_maddr);
+
+        nvmx_clear_vmcs_pointer(v, nvcpu->nv_vvmcx);
+        clear_vvmcs_launched(&nvmx->launched_list, mfn);
         nvmx_purge_vvmcs(v);
     }
     else 
@@ -1726,7 +1689,6 @@ int nvmx_handle_vmread(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     struct vmx_inst_decoded decode;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     u64 value = 0;
     int rc;
 
@@ -1734,7 +1696,7 @@ int nvmx_handle_vmread(struct cpu_user_regs *regs)
     if ( rc != X86EMUL_OKAY )
         return rc;
 
-    value = __get_vvmcs(nvcpu->nv_vvmcx, reg_read(regs, decode.reg2));
+    value = get_vvmcs(v, reg_read(regs, decode.reg2));
 
     switch ( decode.type ) {
     case VMX_INST_MEMREG_TYPE_MEMORY:
@@ -1755,7 +1717,6 @@ int nvmx_handle_vmwrite(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     struct vmx_inst_decoded decode;
-    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     unsigned long operand; 
     u64 vmcs_encoding;
     bool_t okay = 1;
@@ -1765,7 +1726,7 @@ int nvmx_handle_vmwrite(struct cpu_user_regs *regs)
         return X86EMUL_EXCEPTION;
 
     vmcs_encoding = reg_read(regs, decode.reg2);
-    __set_vvmcs(nvcpu->nv_vvmcx, vmcs_encoding, operand);
+    set_vvmcs(v, vmcs_encoding, operand);
 
     switch ( vmcs_encoding & ~VMCS_HIGH(0) )
     {
@@ -2197,7 +2158,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
         }
         else if ( (intr_info & valid_mask) == valid_mask )
         {
-            exec_bitmap =__get_vvmcs(nvcpu->nv_vvmcx, EXCEPTION_BITMAP);
+            exec_bitmap = get_vvmcs(v, EXCEPTION_BITMAP);
 
             if ( exec_bitmap & (1 << vector) )
                 nvcpu->nv_vmexit_pending = 1;
@@ -2316,8 +2277,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
              * special handler is needed if L1 doesn't intercept rdtsc,
              * avoiding changing guest_tsc and messing up timekeeping in L1
              */
-            tsc = hvm_get_guest_tsc(v);
-            tsc += __get_vvmcs(nvcpu->nv_vvmcx, TSC_OFFSET);
+            tsc = hvm_get_guest_tsc(v) + get_vvmcs(v, TSC_OFFSET);
             regs->eax = (uint32_t)tsc;
             regs->edx = (uint32_t)(tsc >> 32);
             update_guest_eip();
@@ -2406,7 +2366,7 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                 val = *reg;
                 if ( cr == 0 )
                 {
-                    u64 cr0_gh_mask = __get_vvmcs(nvcpu->nv_vvmcx, CR0_GUEST_HOST_MASK);
+                    u64 cr0_gh_mask = get_vvmcs(v, CR0_GUEST_HOST_MASK);
 
                     __vmread(CR0_READ_SHADOW, &old_val);
                     changed_bits = old_val ^ val;
@@ -2414,14 +2374,15 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                         nvcpu->nv_vmexit_pending = 1;
                     else
                     {
-                        u64 guest_cr0 = __get_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0);
-                        __set_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0,
-                                    (guest_cr0 & cr0_gh_mask) | (val & ~cr0_gh_mask));
+                        u64 guest_cr0 = get_vvmcs(v, GUEST_CR0);
+
+                        set_vvmcs(v, GUEST_CR0,
+                                  (guest_cr0 & cr0_gh_mask) | (val & ~cr0_gh_mask));
                     }
                 }
                 else if ( cr == 4 )
                 {
-                    u64 cr4_gh_mask = __get_vvmcs(nvcpu->nv_vvmcx, CR4_GUEST_HOST_MASK);
+                    u64 cr4_gh_mask = get_vvmcs(v, CR4_GUEST_HOST_MASK);
 
                     __vmread(CR4_READ_SHADOW, &old_val);
                     changed_bits = old_val ^ val;
@@ -2429,9 +2390,10 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                         nvcpu->nv_vmexit_pending = 1;
                     else
                     {
-                        u64 guest_cr4 = __get_vvmcs(nvcpu->nv_vvmcx, GUEST_CR4);
-                        __set_vvmcs(nvcpu->nv_vvmcx, GUEST_CR4,
-                                    (guest_cr4 & cr4_gh_mask) | (val & ~cr4_gh_mask));
+                        u64 guest_cr4 = get_vvmcs(v, GUEST_CR4);
+
+                        set_vvmcs(v, GUEST_CR4,
+                                  (guest_cr4 & cr4_gh_mask) | (val & ~cr4_gh_mask));
                     }
                 }
                 else
@@ -2440,20 +2402,21 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
             }
             case VMX_CONTROL_REG_ACCESS_TYPE_CLTS:
             {
-                u64 cr0_gh_mask = __get_vvmcs(nvcpu->nv_vvmcx, CR0_GUEST_HOST_MASK);
+                u64 cr0_gh_mask = get_vvmcs(v, CR0_GUEST_HOST_MASK);
 
                 if ( cr0_gh_mask & X86_CR0_TS )
                     nvcpu->nv_vmexit_pending = 1;
                 else
                 {
-                    u64 guest_cr0 = __get_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0);
-                    __set_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0, (guest_cr0 & ~X86_CR0_TS));
+                    u64 guest_cr0 = get_vvmcs(v, GUEST_CR0);
+
+                    set_vvmcs(v, GUEST_CR0, (guest_cr0 & ~X86_CR0_TS));
                 }
                 break;
             }
             case VMX_CONTROL_REG_ACCESS_TYPE_LMSW:
             {
-                u64 cr0_gh_mask = __get_vvmcs(nvcpu->nv_vvmcx, CR0_GUEST_HOST_MASK);
+                u64 cr0_gh_mask = get_vvmcs(v, CR0_GUEST_HOST_MASK);
 
                 __vmread(CR0_READ_SHADOW, &old_val);
                 old_val &= X86_CR0_PE|X86_CR0_MP|X86_CR0_EM|X86_CR0_TS;
@@ -2464,8 +2427,9 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
                     nvcpu->nv_vmexit_pending = 1;
                 else
                 {
-                    u64 guest_cr0 = __get_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0);
-                    __set_vvmcs(nvcpu->nv_vvmcx, GUEST_CR0, (guest_cr0 & cr0_gh_mask) | (val & ~cr0_gh_mask));
+                    u64 guest_cr0 = get_vvmcs(v, GUEST_CR0);
+
+                    set_vvmcs(v, GUEST_CR0, (guest_cr0 & cr0_gh_mask) | (val & ~cr0_gh_mask));
                 }
                 break;
             }
@@ -2517,7 +2481,7 @@ void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int cr)
     if ( !nestedhvm_vmswitch_in_progress(v) )
     {
         unsigned long virtual_cr_mask = 
-            __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, mask_field);
+            get_vvmcs(v, mask_field);
 
         /*
          * We get here when L2 changed cr in a way that did not change
@@ -2529,7 +2493,7 @@ void nvmx_set_cr_read_shadow(struct vcpu *v, unsigned int 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);
+            get_vvmcs(v, cr_field);
     }
 
     /* nvcpu.guest_cr is what L2 write to cr actually. */
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index ad9798c..f873523 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -95,7 +95,7 @@ struct arch_vmx_struct {
     /* Physical address of VMCS. */
     paddr_t              vmcs_pa;
     /* VMCS shadow machine address. */
-    paddr_t             vmcs_shadow_maddr;
+    paddr_t              vmcs_shadow_maddr;
 
     /* Protects remote usage of VMCS (VMPTRLD/VMCLEAR). */
     spinlock_t           vmcs_lock;
@@ -492,10 +492,10 @@ void vmx_vmcs_switch(paddr_t from, paddr_t to);
 void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 int vmx_check_msr_bitmap(unsigned long *msr_bitmap, u32 msr, int access_type);
-void virtual_vmcs_enter(void *vvmcs);
-void virtual_vmcs_exit(void *vvmcs);
-u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding);
-void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val);
+void virtual_vmcs_enter(const struct vcpu *);
+void virtual_vmcs_exit(const struct vcpu *);
+u64 virtual_vmcs_vmread(const struct vcpu *, u32 encoding);
+void virtual_vmcs_vmwrite(const struct vcpu *, u32 encoding, u64 val);
 
 static inline int vmx_add_guest_msr(u32 msr)
 {
diff --git a/xen/include/asm-x86/hvm/vmx/vvmx.h b/xen/include/asm-x86/hvm/vmx/vvmx.h
index 60fdc21..aca8b4b 100644
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h
@@ -181,18 +181,20 @@ enum vvmcs_encoding_type {
     VVMCS_TYPE_HSTATE,
 };
 
-u64 __get_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding);
-u64 __get_vvmcs_real(void *vvmcs, u32 vmcs_encoding);
-void __set_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding, u64 val);
-void __set_vvmcs_real(void *vvmcs, u32 vmcs_encoding, u64 val);
-
-#define __get_vvmcs(_vvmcs, _vmcs_encoding) \
-  (cpu_has_vmx_vmcs_shadowing ? __get_vvmcs_real(_vvmcs, _vmcs_encoding) \
-                              : __get_vvmcs_virtual(_vvmcs, _vmcs_encoding))
-
-#define __set_vvmcs(_vvmcs, _vmcs_encoding, _val) \
-  (cpu_has_vmx_vmcs_shadowing ? __set_vvmcs_real(_vvmcs, _vmcs_encoding, _val) \
-                              : __set_vvmcs_virtual(_vvmcs, _vmcs_encoding, _val))
+u64 get_vvmcs_virtual(void *vvmcs, u32 encoding);
+u64 get_vvmcs_real(const struct vcpu *, u32 encoding);
+void set_vvmcs_virtual(void *vvmcs, u32 encoding, u64 val);
+void set_vvmcs_real(const struct vcpu *, u32 encoding, u64 val);
+
+#define get_vvmcs(vcpu, encoding) \
+  (cpu_has_vmx_vmcs_shadowing ? \
+   get_vvmcs_real(vcpu, encoding) : \
+   get_vvmcs_virtual(vcpu_nestedhvm(vcpu).nv_vvmcx, encoding))
+
+#define set_vvmcs(vcpu, encoding, val) \
+  (cpu_has_vmx_vmcs_shadowing ? \
+   set_vvmcs_real(vcpu, encoding, val) : \
+   set_vvmcs_virtual(vcpu_nestedhvm(vcpu).nv_vvmcx, encoding, val))
 
 uint64_t get_shadow_eptp(struct vcpu *v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:44:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:44:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23P5-0003tw-27; Thu, 26 Nov 2015 20:44: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 1a23P3-0003tf-Gt
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:29 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	EE/84-14422-C2F67565; Thu, 26 Nov 2015 20:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1448570667!6808654!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6211 invoked from network); 26 Nov 2015 20:44:27 -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;
	26 Nov 2015 20:44:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23P0-00034R-US
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23P0-0000MG-SN
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:26 +0000
Date: Thu, 26 Nov 2015 20:44:26 +0000
Message-Id: <E1a23P0-0000MG-SN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] iommu: add iommu_intpost to control
	VT-d Posted-Interrupts feature
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9670e7df84180748fbd2bb74162a1e557d75df75
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:09:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:09:28 2015 +0100

    iommu: add iommu_intpost to control VT-d Posted-Interrupts feature
    
    VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt.
    With VT-d Posted-Interrupts enabled, external interrupts from
    direct-assigned devices can be delivered to guests without VMM
    intervention when guest is running in non-root mode.
    
    This patch adds variable 'iommu_intpost' to control whether enable VT-d
    posted-interrupt or not in the generic IOMMU code.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/iommu.c |   13 ++++++++++++-
 xen/include/xen/iommu.h         |    2 +-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 3e55abf..3d02550 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -57,6 +57,14 @@ bool_t __read_mostly iommu_passthrough;
 bool_t __read_mostly iommu_snoop = 1;
 bool_t __read_mostly iommu_qinval = 1;
 bool_t __read_mostly iommu_intremap = 1;
+
+/*
+ * In the current implementation of VT-d posted interrupts, in some extreme
+ * cases, the per cpu list which saves the blocked vCPU will be very long,
+ * and this will affect the interrupt latency, so let this feature off by
+ * default until we find a good solution to resolve it.
+ */
+bool_t __read_mostly iommu_intpost;
 bool_t __read_mostly iommu_hap_pt_share = 1;
 bool_t __read_mostly iommu_debug;
 bool_t __read_mostly amd_iommu_perdev_intremap = 1;
@@ -307,6 +315,9 @@ int __init iommu_setup(void)
         panic("Couldn't enable %s and iommu=required/force",
               !iommu_enabled ? "IOMMU" : "Interrupt Remapping");
 
+    if ( !iommu_intremap )
+        iommu_intpost = 0;
+
     if ( !iommu_enabled )
     {
         iommu_snoop = 0;
@@ -374,7 +385,7 @@ void iommu_crash_shutdown(void)
     const struct iommu_ops *ops = iommu_get_ops();
     if ( iommu_enabled )
         ops->crash_shutdown();
-    iommu_enabled = iommu_intremap = 0;
+    iommu_enabled = iommu_intremap = iommu_intpost = 0;
 }
 
 int iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt)
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 8f3a20e..1f5d04a 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -30,7 +30,7 @@
 extern bool_t iommu_enable, iommu_enabled;
 extern bool_t force_iommu, iommu_verbose;
 extern bool_t iommu_workaround_bios_bug, iommu_igfx, iommu_passthrough;
-extern bool_t iommu_snoop, iommu_qinval, iommu_intremap;
+extern bool_t iommu_snoop, iommu_qinval, iommu_intremap, iommu_intpost;
 extern bool_t iommu_hap_pt_share;
 extern bool_t iommu_debug;
 extern bool_t amd_iommu_perdev_intremap;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:44:31 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:44:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23P5-0003tw-27; Thu, 26 Nov 2015 20:44: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 1a23P3-0003tf-Gt
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:29 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	EE/84-14422-C2F67565; Thu, 26 Nov 2015 20:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1448570667!6808654!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6211 invoked from network); 26 Nov 2015 20:44:27 -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;
	26 Nov 2015 20:44:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23P0-00034R-US
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23P0-0000MG-SN
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:26 +0000
Date: Thu, 26 Nov 2015 20:44:26 +0000
Message-Id: <E1a23P0-0000MG-SN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] iommu: add iommu_intpost to control
	VT-d Posted-Interrupts feature
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9670e7df84180748fbd2bb74162a1e557d75df75
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:09:28 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:09:28 2015 +0100

    iommu: add iommu_intpost to control VT-d Posted-Interrupts feature
    
    VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt.
    With VT-d Posted-Interrupts enabled, external interrupts from
    direct-assigned devices can be delivered to guests without VMM
    intervention when guest is running in non-root mode.
    
    This patch adds variable 'iommu_intpost' to control whether enable VT-d
    posted-interrupt or not in the generic IOMMU code.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/iommu.c |   13 ++++++++++++-
 xen/include/xen/iommu.h         |    2 +-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 3e55abf..3d02550 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -57,6 +57,14 @@ bool_t __read_mostly iommu_passthrough;
 bool_t __read_mostly iommu_snoop = 1;
 bool_t __read_mostly iommu_qinval = 1;
 bool_t __read_mostly iommu_intremap = 1;
+
+/*
+ * In the current implementation of VT-d posted interrupts, in some extreme
+ * cases, the per cpu list which saves the blocked vCPU will be very long,
+ * and this will affect the interrupt latency, so let this feature off by
+ * default until we find a good solution to resolve it.
+ */
+bool_t __read_mostly iommu_intpost;
 bool_t __read_mostly iommu_hap_pt_share = 1;
 bool_t __read_mostly iommu_debug;
 bool_t __read_mostly amd_iommu_perdev_intremap = 1;
@@ -307,6 +315,9 @@ int __init iommu_setup(void)
         panic("Couldn't enable %s and iommu=required/force",
               !iommu_enabled ? "IOMMU" : "Interrupt Remapping");
 
+    if ( !iommu_intremap )
+        iommu_intpost = 0;
+
     if ( !iommu_enabled )
     {
         iommu_snoop = 0;
@@ -374,7 +385,7 @@ void iommu_crash_shutdown(void)
     const struct iommu_ops *ops = iommu_get_ops();
     if ( iommu_enabled )
         ops->crash_shutdown();
-    iommu_enabled = iommu_intremap = 0;
+    iommu_enabled = iommu_intremap = iommu_intpost = 0;
 }
 
 int iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt)
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 8f3a20e..1f5d04a 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -30,7 +30,7 @@
 extern bool_t iommu_enable, iommu_enabled;
 extern bool_t force_iommu, iommu_verbose;
 extern bool_t iommu_workaround_bios_bug, iommu_igfx, iommu_passthrough;
-extern bool_t iommu_snoop, iommu_qinval, iommu_intremap;
+extern bool_t iommu_snoop, iommu_qinval, iommu_intremap, iommu_intpost;
 extern bool_t iommu_hap_pt_share;
 extern bool_t iommu_debug;
 extern bool_t amd_iommu_perdev_intremap;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:44:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:44: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 1a23PF-0003vW-6E; Thu, 26 Nov 2015 20:44: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 1a23PD-0003vK-Mu
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:39 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	A7/41-02940-73F67565; Thu, 26 Nov 2015 20:44:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448570677!6856691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35673 invoked from network); 26 Nov 2015 20:44:38 -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;
	26 Nov 2015 20:44:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PB-00034d-Ap
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PB-0000NT-7Q
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:37 +0000
Date: Thu, 26 Nov 2015 20:44:37 +0000
Message-Id: <E1a23PB-0000NT-7Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d Posted-Interrupts feature
	detection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1d028f7f2bce751b457d5551eb5fa17d4ad79600
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:10:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:10:10 2015 +0100

    VT-d Posted-Interrupts feature detection
    
    VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt.
    With VT-d Posted-Interrupts enabled, external interrupts from
    direct-assigned devices can be delivered to guests without VMM
    intervention when guest is running in non-root mode.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |   14 ++++++++++++--
 xen/drivers/passthrough/vtd/iommu.h |    1 +
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index d95f4d4..1d17769 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2156,8 +2156,8 @@ int __init intel_vtd_setup(void)
     }
 
     /* We enable the following features only if they are supported by all VT-d
-     * engines: Snoop Control, DMA passthrough, Queued Invalidation and
-     * Interrupt Remapping.
+     * engines: Snoop Control, DMA passthrough, Queued Invalidation, Interrupt
+     * Remapping, and Posted Interrupt
      */
     for_each_drhd_unit ( drhd )
     {
@@ -2185,6 +2185,14 @@ int __init intel_vtd_setup(void)
         if ( iommu_intremap && !ecap_intr_remap(iommu->ecap) )
             iommu_intremap = 0;
 
+        /*
+         * We cannot use posted interrupt if X86_FEATURE_CX16 is
+         * not supported, since we count on this feature to
+         * atomically update 16-byte IRTE in posted format.
+         */
+        if ( !cap_intr_post(iommu->cap) || !cpu_has_cx16 )
+            iommu_intpost = 0;
+
         if ( !vtd_ept_page_compatible(iommu) )
             iommu_hap_pt_share = 0;
 
@@ -2210,6 +2218,7 @@ int __init intel_vtd_setup(void)
     P(iommu_passthrough, "Dom0 DMA Passthrough");
     P(iommu_qinval, "Queued Invalidation");
     P(iommu_intremap, "Interrupt Remapping");
+    P(iommu_intpost, "Posted Interrupt");
     P(iommu_hap_pt_share, "Shared EPT tables");
 #undef P
 
@@ -2229,6 +2238,7 @@ int __init intel_vtd_setup(void)
     iommu_passthrough = 0;
     iommu_qinval = 0;
     iommu_intremap = 0;
+    iommu_intpost = 0;
     return ret;
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index ac71ed1..22abefe 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -61,6 +61,7 @@
 /*
  * Decoding Capability Register
  */
+#define cap_intr_post(c)       (((c) >> 59) & 1)
 #define cap_read_drain(c)      (((c) >> 55) & 1)
 #define cap_write_drain(c)     (((c) >> 54) & 1)
 #define cap_max_amask_val(c)   (((c) >> 48) & 0x3f)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:44:41 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:44: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 1a23PF-0003vW-6E; Thu, 26 Nov 2015 20:44: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 1a23PD-0003vK-Mu
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:39 +0000
Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id
	A7/41-02940-73F67565; Thu, 26 Nov 2015 20:44:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448570677!6856691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 35673 invoked from network); 26 Nov 2015 20:44:38 -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;
	26 Nov 2015 20:44:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PB-00034d-Ap
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PB-0000NT-7Q
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:37 +0000
Date: Thu, 26 Nov 2015 20:44:37 +0000
Message-Id: <E1a23PB-0000NT-7Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d Posted-Interrupts feature
	detection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1d028f7f2bce751b457d5551eb5fa17d4ad79600
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:10:10 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:10:10 2015 +0100

    VT-d Posted-Interrupts feature detection
    
    VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt.
    With VT-d Posted-Interrupts enabled, external interrupts from
    direct-assigned devices can be delivered to guests without VMM
    intervention when guest is running in non-root mode.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c |   14 ++++++++++++--
 xen/drivers/passthrough/vtd/iommu.h |    1 +
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index d95f4d4..1d17769 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2156,8 +2156,8 @@ int __init intel_vtd_setup(void)
     }
 
     /* We enable the following features only if they are supported by all VT-d
-     * engines: Snoop Control, DMA passthrough, Queued Invalidation and
-     * Interrupt Remapping.
+     * engines: Snoop Control, DMA passthrough, Queued Invalidation, Interrupt
+     * Remapping, and Posted Interrupt
      */
     for_each_drhd_unit ( drhd )
     {
@@ -2185,6 +2185,14 @@ int __init intel_vtd_setup(void)
         if ( iommu_intremap && !ecap_intr_remap(iommu->ecap) )
             iommu_intremap = 0;
 
+        /*
+         * We cannot use posted interrupt if X86_FEATURE_CX16 is
+         * not supported, since we count on this feature to
+         * atomically update 16-byte IRTE in posted format.
+         */
+        if ( !cap_intr_post(iommu->cap) || !cpu_has_cx16 )
+            iommu_intpost = 0;
+
         if ( !vtd_ept_page_compatible(iommu) )
             iommu_hap_pt_share = 0;
 
@@ -2210,6 +2218,7 @@ int __init intel_vtd_setup(void)
     P(iommu_passthrough, "Dom0 DMA Passthrough");
     P(iommu_qinval, "Queued Invalidation");
     P(iommu_intremap, "Interrupt Remapping");
+    P(iommu_intpost, "Posted Interrupt");
     P(iommu_hap_pt_share, "Shared EPT tables");
 #undef P
 
@@ -2229,6 +2238,7 @@ int __init intel_vtd_setup(void)
     iommu_passthrough = 0;
     iommu_qinval = 0;
     iommu_intremap = 0;
+    iommu_intpost = 0;
     return ret;
 }
 
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index ac71ed1..22abefe 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -61,6 +61,7 @@
 /*
  * Decoding Capability Register
  */
+#define cap_intr_post(c)       (((c) >> 59) & 1)
 #define cap_read_drain(c)      (((c) >> 55) & 1)
 #define cap_write_drain(c)     (((c) >> 54) & 1)
 #define cap_max_amask_val(c)   (((c) >> 48) & 0x3f)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:44:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:44:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23PP-0003x5-AP; Thu, 26 Nov 2015 20:44:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PO-0003wr-3G
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:50 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	EC/6D-31443-14F67565; Thu, 26 Nov 2015 20:44:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1448570687!6321743!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27613 invoked from network); 26 Nov 2015 20:44:48 -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;
	26 Nov 2015 20:44:48 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PL-00034l-JI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PL-0000Nt-HK
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:47 +0000
Date: Thu, 26 Nov 2015 20:44:47 +0000
Message-Id: <E1a23PL-0000Nt-HK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vmx: extend struct pi_desc to support
	VT-d Posted-Interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 30e3f328a5cc3747d9e038f2a80f39363dd65ea0
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:10:36 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:10:36 2015 +0100

    vmx: extend struct pi_desc to support VT-d Posted-Interrupts
    
    Extend struct pi_desc according to VT-d Posted-Interrupts Spec.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/include/asm-x86/hvm/vmx/vmcs.h |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index f873523..0a69a44 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -80,8 +80,18 @@ struct vmx_domain {
 
 struct pi_desc {
     DECLARE_BITMAP(pir, NR_VECTORS);
-    u32 control;
-    u32 rsvd[7];
+    union {
+        struct {
+            u16     on     : 1,  /* bit 256 - Outstanding Notification */
+                    sn     : 1,  /* bit 257 - Suppress Notification */
+                    rsvd_1 : 14; /* bit 271:258 - Reserved */
+            u8      nv;          /* bit 279:272 - Notification Vector */
+            u8      rsvd_2;      /* bit 287:280 - Reserved */
+            u32     ndst;        /* bit 319:288 - Notification Destination */
+        };
+        u64 control;
+    };
+    u32 rsvd[6];
 } __attribute__ ((aligned (64)));
 
 #define ept_get_wl(ept)   ((ept)->ept_wl)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:44:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:44:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23PP-0003x5-AP; Thu, 26 Nov 2015 20:44:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PO-0003wr-3G
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:50 +0000
Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id
	EC/6D-31443-14F67565; Thu, 26 Nov 2015 20:44:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1448570687!6321743!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27613 invoked from network); 26 Nov 2015 20:44:48 -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;
	26 Nov 2015 20:44:48 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PL-00034l-JI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PL-0000Nt-HK
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:47 +0000
Date: Thu, 26 Nov 2015 20:44:47 +0000
Message-Id: <E1a23PL-0000Nt-HK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vmx: extend struct pi_desc to support
	VT-d Posted-Interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 30e3f328a5cc3747d9e038f2a80f39363dd65ea0
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:10:36 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:10:36 2015 +0100

    vmx: extend struct pi_desc to support VT-d Posted-Interrupts
    
    Extend struct pi_desc according to VT-d Posted-Interrupts Spec.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/include/asm-x86/hvm/vmx/vmcs.h |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index f873523..0a69a44 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -80,8 +80,18 @@ struct vmx_domain {
 
 struct pi_desc {
     DECLARE_BITMAP(pir, NR_VECTORS);
-    u32 control;
-    u32 rsvd[7];
+    union {
+        struct {
+            u16     on     : 1,  /* bit 256 - Outstanding Notification */
+                    sn     : 1,  /* bit 257 - Suppress Notification */
+                    rsvd_1 : 14; /* bit 271:258 - Reserved */
+            u8      nv;          /* bit 279:272 - Notification Vector */
+            u8      rsvd_2;      /* bit 287:280 - Reserved */
+            u32     ndst;        /* bit 319:288 - Notification Destination */
+        };
+        u64 control;
+    };
+    u32 rsvd[6];
 } __attribute__ ((aligned (64)));
 
 #define ept_get_wl(ept)   ((ept)->ept_wl)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:45:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23PZ-0003zE-EU; Thu, 26 Nov 2015 20:45:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PY-0003yz-9B
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:00 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	D4/E9-31450-B4F67565; Thu, 26 Nov 2015 20:44:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1448570698!6811600!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41399 invoked from network); 26 Nov 2015 20:44:58 -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;
	26 Nov 2015 20:44:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PV-00034t-RI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PV-0000OJ-PJ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:57 +0000
Date: Thu, 26 Nov 2015 20:44:57 +0000
Message-Id: <E1a23PV-0000OJ-PJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vmx: add some helper functions for
	Posted-Interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 03523ab0d338f8b017775f044377baf0b79a44d1
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:11:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:11:00 2015 +0100

    vmx: add some helper functions for Posted-Interrupts
    
    This patch adds some helper functions to manipulate the
    Posted-Interrupts Descriptor.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/include/asm-x86/hvm/vmx/vmx.h |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index f16a306..dd3a135 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -101,6 +101,7 @@ void vmx_update_cpu_exec_control(struct vcpu *v);
 void vmx_update_secondary_exec_control(struct vcpu *v);
 
 #define POSTED_INTR_ON  0
+#define POSTED_INTR_SN  1
 static inline int pi_test_and_set_pir(int vector, struct pi_desc *pi_desc)
 {
     return test_and_set_bit(vector, pi_desc->pir);
@@ -121,11 +122,31 @@ static inline int pi_test_and_clear_on(struct pi_desc *pi_desc)
     return test_and_clear_bit(POSTED_INTR_ON, &pi_desc->control);
 }
 
+static inline int pi_test_on(struct pi_desc *pi_desc)
+{
+    return pi_desc->on;
+}
+
 static inline unsigned long pi_get_pir(struct pi_desc *pi_desc, int group)
 {
     return xchg(&pi_desc->pir[group], 0);
 }
 
+static inline int pi_test_sn(struct pi_desc *pi_desc)
+{
+    return pi_desc->sn;
+}
+
+static inline void pi_set_sn(struct pi_desc *pi_desc)
+{
+    set_bit(POSTED_INTR_SN, &pi_desc->control);
+}
+
+static inline void pi_clear_sn(struct pi_desc *pi_desc)
+{
+    clear_bit(POSTED_INTR_SN, &pi_desc->control);
+}
+
 /*
  * Exit Reasons
  */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:45:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23PZ-0003zE-EU; Thu, 26 Nov 2015 20:45:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PY-0003yz-9B
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:00 +0000
Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id
	D4/E9-31450-B4F67565; Thu, 26 Nov 2015 20:44:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1448570698!6811600!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 41399 invoked from network); 26 Nov 2015 20:44:58 -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;
	26 Nov 2015 20:44:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PV-00034t-RI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23PV-0000OJ-PJ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:44:57 +0000
Date: Thu, 26 Nov 2015 20:44:57 +0000
Message-Id: <E1a23PV-0000OJ-PJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vmx: add some helper functions for
	Posted-Interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 03523ab0d338f8b017775f044377baf0b79a44d1
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:11:00 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:11:00 2015 +0100

    vmx: add some helper functions for Posted-Interrupts
    
    This patch adds some helper functions to manipulate the
    Posted-Interrupts Descriptor.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/include/asm-x86/hvm/vmx/vmx.h |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index f16a306..dd3a135 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -101,6 +101,7 @@ void vmx_update_cpu_exec_control(struct vcpu *v);
 void vmx_update_secondary_exec_control(struct vcpu *v);
 
 #define POSTED_INTR_ON  0
+#define POSTED_INTR_SN  1
 static inline int pi_test_and_set_pir(int vector, struct pi_desc *pi_desc)
 {
     return test_and_set_bit(vector, pi_desc->pir);
@@ -121,11 +122,31 @@ static inline int pi_test_and_clear_on(struct pi_desc *pi_desc)
     return test_and_clear_bit(POSTED_INTR_ON, &pi_desc->control);
 }
 
+static inline int pi_test_on(struct pi_desc *pi_desc)
+{
+    return pi_desc->on;
+}
+
 static inline unsigned long pi_get_pir(struct pi_desc *pi_desc, int group)
 {
     return xchg(&pi_desc->pir[group], 0);
 }
 
+static inline int pi_test_sn(struct pi_desc *pi_desc)
+{
+    return pi_desc->sn;
+}
+
+static inline void pi_set_sn(struct pi_desc *pi_desc)
+{
+    set_bit(POSTED_INTR_SN, &pi_desc->control);
+}
+
+static inline void pi_clear_sn(struct pi_desc *pi_desc)
+{
+    clear_bit(POSTED_INTR_SN, &pi_desc->control);
+}
+
 /*
  * Exit Reasons
  */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:45:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23Pj-00040y-Ih; Thu, 26 Nov 2015 20:45: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 1a23Pi-00040m-DB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:10 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	58/3A-30270-55F67565; Thu, 26 Nov 2015 20:45:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1448570708!6809882!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44257 invoked from network); 26 Nov 2015 20:45:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:45:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Pg-00035w-71
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Pg-0000Oy-3O
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:08 +0000
Date: Thu, 26 Nov 2015 20:45:08 +0000
Message-Id: <E1a23Pg-0000Oy-3O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vmx: initialize VT-d Posted-Interrupts
	Descriptor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29446895edc28da63ba0f7e97872b09745eba823
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:12:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:12:39 2015 +0100

    vmx: initialize VT-d Posted-Interrupts Descriptor
    
    This patch initializes the VT-d Posted-interrupt Descriptor.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c       |   22 ++++++++++++++++++++++
 xen/include/asm-x86/hvm/vmx/vmx.h |    2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index d6dab8e..202c0a4 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -39,6 +39,7 @@
 #include <asm/flushtlb.h>
 #include <asm/shadow.h>
 #include <asm/tboot.h>
+#include <asm/apic.h>
 
 static bool_t __read_mostly opt_vpid_enabled = 1;
 boolean_param("vpid", opt_vpid_enabled);
@@ -964,6 +965,24 @@ void virtual_vmcs_vmwrite(const struct vcpu *v, u32 vmcs_encoding, u64 val)
     virtual_vmcs_exit(v);
 }
 
+/*
+ * This function is only called in a vCPU's initialization phase,
+ * so we can update the posted-interrupt descriptor in non-atomic way.
+ */
+static void pi_desc_init(struct vcpu *v)
+{
+    uint32_t dest;
+
+    v->arch.hvm_vmx.pi_desc.nv = posted_intr_vector;
+
+    dest = cpu_physical_id(v->processor);
+
+    if ( x2apic_enabled )
+        v->arch.hvm_vmx.pi_desc.ndst = dest;
+    else
+        v->arch.hvm_vmx.pi_desc.ndst = MASK_INSR(dest, PI_xAPIC_NDST_MASK);
+}
+
 static int construct_vmcs(struct vcpu *v)
 {
     struct domain *d = v->domain;
@@ -1102,6 +1121,9 @@ static int construct_vmcs(struct vcpu *v)
 
     if ( cpu_has_vmx_posted_intr_processing )
     {
+        if ( iommu_intpost )
+            pi_desc_init(v);
+
         __vmwrite(PI_DESC_ADDR, virt_to_maddr(&v->arch.hvm_vmx.pi_desc));
         __vmwrite(POSTED_INTR_NOTIFICATION_VECTOR, posted_intr_vector);
     }
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index dd3a135..7831b9a 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -88,6 +88,8 @@ typedef enum {
 #define EPT_EMT_WB              6
 #define EPT_EMT_RSV2            7
 
+#define PI_xAPIC_NDST_MASK      0xFF00
+
 void vmx_asm_vmexit_handler(struct cpu_user_regs);
 void vmx_asm_do_vmentry(void);
 void vmx_intr_assist(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:45:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23Pj-00040y-Ih; Thu, 26 Nov 2015 20:45: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 1a23Pi-00040m-DB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:10 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	58/3A-30270-55F67565; Thu, 26 Nov 2015 20:45:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1448570708!6809882!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44257 invoked from network); 26 Nov 2015 20:45:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:45:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Pg-00035w-71
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Pg-0000Oy-3O
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:08 +0000
Date: Thu, 26 Nov 2015 20:45:08 +0000
Message-Id: <E1a23Pg-0000Oy-3O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vmx: initialize VT-d Posted-Interrupts
	Descriptor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29446895edc28da63ba0f7e97872b09745eba823
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:12:39 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:12:39 2015 +0100

    vmx: initialize VT-d Posted-Interrupts Descriptor
    
    This patch initializes the VT-d Posted-interrupt Descriptor.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c       |   22 ++++++++++++++++++++++
 xen/include/asm-x86/hvm/vmx/vmx.h |    2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index d6dab8e..202c0a4 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -39,6 +39,7 @@
 #include <asm/flushtlb.h>
 #include <asm/shadow.h>
 #include <asm/tboot.h>
+#include <asm/apic.h>
 
 static bool_t __read_mostly opt_vpid_enabled = 1;
 boolean_param("vpid", opt_vpid_enabled);
@@ -964,6 +965,24 @@ void virtual_vmcs_vmwrite(const struct vcpu *v, u32 vmcs_encoding, u64 val)
     virtual_vmcs_exit(v);
 }
 
+/*
+ * This function is only called in a vCPU's initialization phase,
+ * so we can update the posted-interrupt descriptor in non-atomic way.
+ */
+static void pi_desc_init(struct vcpu *v)
+{
+    uint32_t dest;
+
+    v->arch.hvm_vmx.pi_desc.nv = posted_intr_vector;
+
+    dest = cpu_physical_id(v->processor);
+
+    if ( x2apic_enabled )
+        v->arch.hvm_vmx.pi_desc.ndst = dest;
+    else
+        v->arch.hvm_vmx.pi_desc.ndst = MASK_INSR(dest, PI_xAPIC_NDST_MASK);
+}
+
 static int construct_vmcs(struct vcpu *v)
 {
     struct domain *d = v->domain;
@@ -1102,6 +1121,9 @@ static int construct_vmcs(struct vcpu *v)
 
     if ( cpu_has_vmx_posted_intr_processing )
     {
+        if ( iommu_intpost )
+            pi_desc_init(v);
+
         __vmwrite(PI_DESC_ADDR, virt_to_maddr(&v->arch.hvm_vmx.pi_desc));
         __vmwrite(POSTED_INTR_NOTIFICATION_VECTOR, posted_intr_vector);
     }
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index dd3a135..7831b9a 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -88,6 +88,8 @@ typedef enum {
 #define EPT_EMT_WB              6
 #define EPT_EMT_RSV2            7
 
+#define PI_xAPIC_NDST_MASK      0xFF00
+
 void vmx_asm_vmexit_handler(struct cpu_user_regs);
 void vmx_asm_do_vmentry(void);
 void vmx_intr_assist(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:45:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23Pu-00042g-P4; Thu, 26 Nov 2015 20:45: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 1a23Pt-00042O-8F
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:21 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	4A/FB-12889-06F67565; Thu, 26 Nov 2015 20:45:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1448570718!6653736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38551 invoked from network); 26 Nov 2015 20:45:19 -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;
	26 Nov 2015 20:45:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Pq-000364-Mw
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Pq-0000PL-De
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:18 +0000
Date: Thu, 26 Nov 2015 20:45:18 +0000
Message-Id: <E1a23Pq-0000PL-De@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: remove pointless casts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0ba0faa7f02fb310a330579adeef3534e6eca5a8
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:13:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:13:03 2015 +0100

    VT-d: remove pointless casts
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/utils.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index 36ed3d6..fb974aa 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -234,10 +234,9 @@ void vtd_dump_iommu_info(unsigned char key)
                     continue;
                 printk("  %04x:  %x   %x  %04x %08x %02x    %x   %x  %x  %x  %x"
                     "   %x %x\n", i,
-                    (u32)p->hi.svt, (u32)p->hi.sq, (u32)p->hi.sid,
-                    (u32)p->lo.dst, (u32)p->lo.vector, (u32)p->lo.avail,
-                    (u32)p->lo.dlm, (u32)p->lo.tm, (u32)p->lo.rh,
-                    (u32)p->lo.dm, (u32)p->lo.fpd, (u32)p->lo.p);
+                    p->hi.svt, p->hi.sq, p->hi.sid, p->lo.dst, p->lo.vector,
+                    p->lo.avail, p->lo.dlm, p->lo.tm, p->lo.rh, p->lo.dm,
+                    p->lo.fpd, p->lo.p);
                 print_cnt++;
             }
             if ( iremap_entries )
@@ -281,11 +280,10 @@ void vtd_dump_iommu_info(unsigned char key)
 
                 printk("   %02x:  %04x   %x    %x   %x   %x   %x    %x"
                     "    %x     %02x\n", i,
-                    (u32)remap->index_0_14 | ((u32)remap->index_15 << 15),
-                    (u32)remap->format, (u32)remap->mask, (u32)remap->trigger,
-                    (u32)remap->irr, (u32)remap->polarity,
-                    (u32)remap->delivery_status, (u32)remap->delivery_mode,
-                    (u32)remap->vector);
+                    remap->index_0_14 | (remap->index_15 << 15),
+                    remap->format, remap->mask, remap->trigger, remap->irr,
+                    remap->polarity, remap->delivery_status, remap->delivery_mode,
+                    remap->vector);
             }
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:45:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23Pu-00042g-P4; Thu, 26 Nov 2015 20:45: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 1a23Pt-00042O-8F
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:21 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	4A/FB-12889-06F67565; Thu, 26 Nov 2015 20:45:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1448570718!6653736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38551 invoked from network); 26 Nov 2015 20:45:19 -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;
	26 Nov 2015 20:45:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Pq-000364-Mw
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Pq-0000PL-De
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:18 +0000
Date: Thu, 26 Nov 2015 20:45:18 +0000
Message-Id: <E1a23Pq-0000PL-De@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: remove pointless casts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0ba0faa7f02fb310a330579adeef3534e6eca5a8
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:13:03 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:13:03 2015 +0100

    VT-d: remove pointless casts
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/utils.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index 36ed3d6..fb974aa 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -234,10 +234,9 @@ void vtd_dump_iommu_info(unsigned char key)
                     continue;
                 printk("  %04x:  %x   %x  %04x %08x %02x    %x   %x  %x  %x  %x"
                     "   %x %x\n", i,
-                    (u32)p->hi.svt, (u32)p->hi.sq, (u32)p->hi.sid,
-                    (u32)p->lo.dst, (u32)p->lo.vector, (u32)p->lo.avail,
-                    (u32)p->lo.dlm, (u32)p->lo.tm, (u32)p->lo.rh,
-                    (u32)p->lo.dm, (u32)p->lo.fpd, (u32)p->lo.p);
+                    p->hi.svt, p->hi.sq, p->hi.sid, p->lo.dst, p->lo.vector,
+                    p->lo.avail, p->lo.dlm, p->lo.tm, p->lo.rh, p->lo.dm,
+                    p->lo.fpd, p->lo.p);
                 print_cnt++;
             }
             if ( iremap_entries )
@@ -281,11 +280,10 @@ void vtd_dump_iommu_info(unsigned char key)
 
                 printk("   %02x:  %04x   %x    %x   %x   %x   %x    %x"
                     "    %x     %02x\n", i,
-                    (u32)remap->index_0_14 | ((u32)remap->index_15 << 15),
-                    (u32)remap->format, (u32)remap->mask, (u32)remap->trigger,
-                    (u32)remap->irr, (u32)remap->polarity,
-                    (u32)remap->delivery_status, (u32)remap->delivery_mode,
-                    (u32)remap->vector);
+                    remap->index_0_14 | (remap->index_15 << 15),
+                    remap->format, remap->mask, remap->trigger, remap->irr,
+                    remap->polarity, remap->delivery_status, remap->delivery_mode,
+                    remap->vector);
             }
         }
     }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:45:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:45: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 1a23Q5-00045M-TR; Thu, 26 Nov 2015 20:45:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Q4-00044y-1i
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:32 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	13/09-09570-B6F67565; Thu, 26 Nov 2015 20:45:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448570729!6941283!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20098 invoked from network); 26 Nov 2015 20:45:30 -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;
	26 Nov 2015 20:45:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Q1-00036C-3Q
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Q0-0000QL-Uy
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:29 +0000
Date: Thu, 26 Nov 2015 20:45:28 +0000
Message-Id: <E1a23Q0-0000QL-Uy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vt-d: extend struct iremap_entry to
	support VT-d Posted-Interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 853f8af87dda6cce0175bb0562c416a7cad1e514
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:13:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:13:58 2015 +0100

    vt-d: extend struct iremap_entry to support VT-d Posted-Interrupts
    
    Extend struct iremap_entry according to VT-d Posted-Interrupts Spec.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/intremap.c |   92 ++++++++++++++++---------------
 xen/drivers/passthrough/vtd/iommu.h    |   44 ++++++++++-----
 xen/drivers/passthrough/vtd/utils.c    |    8 ++--
 3 files changed, 81 insertions(+), 63 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 776ec54..ed9fb82 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -122,9 +122,9 @@ static u16 hpetid_to_bdf(unsigned int hpet_id)
 static void set_ire_sid(struct iremap_entry *ire,
                         unsigned int svt, unsigned int sq, unsigned int sid)
 {
-    ire->hi.svt = svt;
-    ire->hi.sq = sq;
-    ire->hi.sid = sid;
+    ire->remap.svt = svt;
+    ire->remap.sq = sq;
+    ire->remap.sid = sid;
 }
 
 static void set_ioapic_source_id(int apic_id, struct iremap_entry *ire)
@@ -219,7 +219,7 @@ static unsigned int alloc_remap_entry(struct iommu *iommu, unsigned int nr)
         else
             p = &iremap_entries[i % (1 << IREMAP_ENTRY_ORDER)];
 
-        if ( p->lo_val || p->hi_val ) /* not a free entry */
+        if ( p->val ) /* not a free entry */
             found = 0;
         else if ( ++found == nr )
             break;
@@ -253,7 +253,7 @@ static int remap_entry_to_ioapic_rte(
     GET_IREMAP_ENTRY(ir_ctrl->iremap_maddr, index,
                      iremap_entries, iremap_entry);
 
-    if ( iremap_entry->hi_val == 0 && iremap_entry->lo_val == 0 )
+    if ( iremap_entry->val == 0 )
     {
         dprintk(XENLOG_ERR VTDPREFIX,
                 "%s: index (%d) get an empty entry!\n",
@@ -263,13 +263,13 @@ static int remap_entry_to_ioapic_rte(
         return -EFAULT;
     }
 
-    old_rte->vector = iremap_entry->lo.vector;
-    old_rte->delivery_mode = iremap_entry->lo.dlm;
-    old_rte->dest_mode = iremap_entry->lo.dm;
-    old_rte->trigger = iremap_entry->lo.tm;
+    old_rte->vector = iremap_entry->remap.vector;
+    old_rte->delivery_mode = iremap_entry->remap.dlm;
+    old_rte->dest_mode = iremap_entry->remap.dm;
+    old_rte->trigger = iremap_entry->remap.tm;
     old_rte->__reserved_2 = 0;
     old_rte->dest.logical.__reserved_1 = 0;
-    old_rte->dest.logical.logical_dest = iremap_entry->lo.dst >> 8;
+    old_rte->dest.logical.logical_dest = iremap_entry->remap.dst >> 8;
 
     unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
@@ -317,27 +317,28 @@ static int ioapic_rte_to_remap_entry(struct iommu *iommu,
     if ( rte_upper )
     {
         if ( x2apic_enabled )
-            new_ire.lo.dst = value;
+            new_ire.remap.dst = value;
         else
-            new_ire.lo.dst = (value >> 24) << 8;
+            new_ire.remap.dst = (value >> 24) << 8;
     }
     else
     {
         *(((u32 *)&new_rte) + 0) = value;
-        new_ire.lo.fpd = 0;
-        new_ire.lo.dm = new_rte.dest_mode;
-        new_ire.lo.tm = new_rte.trigger;
-        new_ire.lo.dlm = new_rte.delivery_mode;
+        new_ire.remap.fpd = 0;
+        new_ire.remap.dm = new_rte.dest_mode;
+        new_ire.remap.tm = new_rte.trigger;
+        new_ire.remap.dlm = new_rte.delivery_mode;
         /* Hardware require RH = 1 for LPR delivery mode */
-        new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio);
-        new_ire.lo.avail = 0;
-        new_ire.lo.res_1 = 0;
-        new_ire.lo.vector = new_rte.vector;
-        new_ire.lo.res_2 = 0;
+        new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
+        new_ire.remap.avail = 0;
+        new_ire.remap.res_1 = 0;
+        new_ire.remap.vector = new_rte.vector;
+        new_ire.remap.res_2 = 0;
 
         set_ioapic_source_id(IO_APIC_ID(apic), &new_ire);
-        new_ire.hi.res_1 = 0;
-        new_ire.lo.p = 1;     /* finally, set present bit */
+        new_ire.remap.res_3 = 0;
+        new_ire.remap.res_4 = 0;
+        new_ire.remap.p = 1;     /* finally, set present bit */
 
         /* now construct new ioapic rte entry */
         remap_rte->vector = new_rte.vector;
@@ -510,7 +511,7 @@ static int remap_entry_to_msi_msg(
     GET_IREMAP_ENTRY(ir_ctrl->iremap_maddr, index,
                      iremap_entries, iremap_entry);
 
-    if ( iremap_entry->hi_val == 0 && iremap_entry->lo_val == 0 )
+    if ( iremap_entry->val == 0 )
     {
         dprintk(XENLOG_ERR VTDPREFIX,
                 "%s: index (%d) get an empty entry!\n",
@@ -523,25 +524,25 @@ static int remap_entry_to_msi_msg(
     msg->address_hi = MSI_ADDR_BASE_HI;
     msg->address_lo =
         MSI_ADDR_BASE_LO |
-        ((iremap_entry->lo.dm == 0) ?
+        ((iremap_entry->remap.dm == 0) ?
             MSI_ADDR_DESTMODE_PHYS:
             MSI_ADDR_DESTMODE_LOGIC) |
-        ((iremap_entry->lo.dlm != dest_LowestPrio) ?
+        ((iremap_entry->remap.dlm != dest_LowestPrio) ?
             MSI_ADDR_REDIRECTION_CPU:
             MSI_ADDR_REDIRECTION_LOWPRI);
     if ( x2apic_enabled )
-        msg->dest32 = iremap_entry->lo.dst;
+        msg->dest32 = iremap_entry->remap.dst;
     else
-        msg->dest32 = (iremap_entry->lo.dst >> 8) & 0xff;
+        msg->dest32 = (iremap_entry->remap.dst >> 8) & 0xff;
     msg->address_lo |= MSI_ADDR_DEST_ID(msg->dest32);
 
     msg->data =
         MSI_DATA_TRIGGER_EDGE |
         MSI_DATA_LEVEL_ASSERT |
-        ((iremap_entry->lo.dlm != dest_LowestPrio) ?
+        ((iremap_entry->remap.dlm != dest_LowestPrio) ?
             MSI_DATA_DELIVERY_FIXED:
             MSI_DATA_DELIVERY_LOWPRI) |
-        iremap_entry->lo.vector;
+        iremap_entry->remap.vector;
 
     unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
@@ -600,29 +601,30 @@ static int msi_msg_to_remap_entry(
     memcpy(&new_ire, iremap_entry, sizeof(struct iremap_entry));
 
     /* Set interrupt remapping table entry */
-    new_ire.lo.fpd = 0;
-    new_ire.lo.dm = (msg->address_lo >> MSI_ADDR_DESTMODE_SHIFT) & 0x1;
-    new_ire.lo.tm = (msg->data >> MSI_DATA_TRIGGER_SHIFT) & 0x1;
-    new_ire.lo.dlm = (msg->data >> MSI_DATA_DELIVERY_MODE_SHIFT) & 0x1;
+    new_ire.remap.fpd = 0;
+    new_ire.remap.dm = (msg->address_lo >> MSI_ADDR_DESTMODE_SHIFT) & 0x1;
+    new_ire.remap.tm = (msg->data >> MSI_DATA_TRIGGER_SHIFT) & 0x1;
+    new_ire.remap.dlm = (msg->data >> MSI_DATA_DELIVERY_MODE_SHIFT) & 0x1;
     /* Hardware require RH = 1 for LPR delivery mode */
-    new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio);
-    new_ire.lo.avail = 0;
-    new_ire.lo.res_1 = 0;
-    new_ire.lo.vector = (msg->data >> MSI_DATA_VECTOR_SHIFT) &
-                        MSI_DATA_VECTOR_MASK;
-    new_ire.lo.res_2 = 0;
+    new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
+    new_ire.remap.avail = 0;
+    new_ire.remap.res_1 = 0;
+    new_ire.remap.vector = (msg->data >> MSI_DATA_VECTOR_SHIFT) &
+                            MSI_DATA_VECTOR_MASK;
+    new_ire.remap.res_2 = 0;
     if ( x2apic_enabled )
-        new_ire.lo.dst = msg->dest32;
+        new_ire.remap.dst = msg->dest32;
     else
-        new_ire.lo.dst = ((msg->address_lo >> MSI_ADDR_DEST_ID_SHIFT)
-                          & 0xff) << 8;
+        new_ire.remap.dst = ((msg->address_lo >> MSI_ADDR_DEST_ID_SHIFT)
+                             & 0xff) << 8;
 
     if ( pdev )
         set_msi_source_id(pdev, &new_ire);
     else
         set_hpet_source_id(msi_desc->hpet_id, &new_ire);
-    new_ire.hi.res_1 = 0;
-    new_ire.lo.p = 1;    /* finally, set present bit */
+    new_ire.remap.res_3 = 0;
+    new_ire.remap.res_4 = 0;
+    new_ire.remap.p = 1;    /* finally, set present bit */
 
     /* now construct new MSI/MSI-X rte entry */
     remap_rte = (struct msi_msg_remap_entry *)msg;
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index 22abefe..b440b69 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -281,29 +281,45 @@ struct dma_pte {
 /* interrupt remap entry */
 struct iremap_entry {
   union {
-    u64 lo_val;
+    __uint128_t val;
+    struct { u64 lo, hi; };
     struct {
-        u64 p       : 1,
+        u16 p       : 1,
             fpd     : 1,
             dm      : 1,
             rh      : 1,
             tm      : 1,
             dlm     : 3,
             avail   : 4,
-            res_1   : 4,
-            vector  : 8,
-            res_2   : 8,
-            dst     : 32;
-    }lo;
-  };
-  union {
-    u64 hi_val;
+            res_1   : 3,
+            im      : 1;
+        u8  vector;
+        u8  res_2;
+        u32 dst;
+        u16 sid;
+        u16 sq      : 2,
+            svt     : 2,
+            res_3   : 12;
+        u32 res_4;
+    } remap;
     struct {
-        u64 sid     : 16,
-            sq      : 2,
+        u16 p       : 1,
+            fpd     : 1,
+            res_1   : 6,
+            avail   : 4,
+            res_2   : 2,
+            urg     : 1,
+            im      : 1;
+        u8  vector;
+        u8  res_3;
+        u32 res_4   : 6,
+            pda_l   : 26;
+        u16 sid;
+        u16 sq      : 2,
             svt     : 2,
-            res_1   : 44;
-    }hi;
+            res_5   : 12;
+        u32 pda_h;
+    } post;
   };
 };
 
diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index fb974aa..00184f0 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -230,13 +230,13 @@ void vtd_dump_iommu_info(unsigned char key)
                 else
                     p = &iremap_entries[i % (1 << IREMAP_ENTRY_ORDER)];
 
-                if ( !p->lo.p )
+                if ( !p->remap.p )
                     continue;
                 printk("  %04x:  %x   %x  %04x %08x %02x    %x   %x  %x  %x  %x"
                     "   %x %x\n", i,
-                    p->hi.svt, p->hi.sq, p->hi.sid, p->lo.dst, p->lo.vector,
-                    p->lo.avail, p->lo.dlm, p->lo.tm, p->lo.rh, p->lo.dm,
-                    p->lo.fpd, p->lo.p);
+                    p->remap.svt, p->remap.sq, p->remap.sid, p->remap.dst,
+                    p->remap.vector, p->remap.avail, p->remap.dlm, p->remap.tm,
+                    p->remap.rh, p->remap.dm, p->remap.fpd, p->remap.p);
                 print_cnt++;
             }
             if ( iremap_entries )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:45:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:45: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 1a23Q5-00045M-TR; Thu, 26 Nov 2015 20:45:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Q4-00044y-1i
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:32 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	13/09-09570-B6F67565; Thu, 26 Nov 2015 20:45:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448570729!6941283!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20098 invoked from network); 26 Nov 2015 20:45:30 -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;
	26 Nov 2015 20:45:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Q1-00036C-3Q
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Q0-0000QL-Uy
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:29 +0000
Date: Thu, 26 Nov 2015 20:45:28 +0000
Message-Id: <E1a23Q0-0000QL-Uy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vt-d: extend struct iremap_entry to
	support VT-d Posted-Interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 853f8af87dda6cce0175bb0562c416a7cad1e514
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:13:58 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:13:58 2015 +0100

    vt-d: extend struct iremap_entry to support VT-d Posted-Interrupts
    
    Extend struct iremap_entry according to VT-d Posted-Interrupts Spec.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/intremap.c |   92 ++++++++++++++++---------------
 xen/drivers/passthrough/vtd/iommu.h    |   44 ++++++++++-----
 xen/drivers/passthrough/vtd/utils.c    |    8 ++--
 3 files changed, 81 insertions(+), 63 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 776ec54..ed9fb82 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -122,9 +122,9 @@ static u16 hpetid_to_bdf(unsigned int hpet_id)
 static void set_ire_sid(struct iremap_entry *ire,
                         unsigned int svt, unsigned int sq, unsigned int sid)
 {
-    ire->hi.svt = svt;
-    ire->hi.sq = sq;
-    ire->hi.sid = sid;
+    ire->remap.svt = svt;
+    ire->remap.sq = sq;
+    ire->remap.sid = sid;
 }
 
 static void set_ioapic_source_id(int apic_id, struct iremap_entry *ire)
@@ -219,7 +219,7 @@ static unsigned int alloc_remap_entry(struct iommu *iommu, unsigned int nr)
         else
             p = &iremap_entries[i % (1 << IREMAP_ENTRY_ORDER)];
 
-        if ( p->lo_val || p->hi_val ) /* not a free entry */
+        if ( p->val ) /* not a free entry */
             found = 0;
         else if ( ++found == nr )
             break;
@@ -253,7 +253,7 @@ static int remap_entry_to_ioapic_rte(
     GET_IREMAP_ENTRY(ir_ctrl->iremap_maddr, index,
                      iremap_entries, iremap_entry);
 
-    if ( iremap_entry->hi_val == 0 && iremap_entry->lo_val == 0 )
+    if ( iremap_entry->val == 0 )
     {
         dprintk(XENLOG_ERR VTDPREFIX,
                 "%s: index (%d) get an empty entry!\n",
@@ -263,13 +263,13 @@ static int remap_entry_to_ioapic_rte(
         return -EFAULT;
     }
 
-    old_rte->vector = iremap_entry->lo.vector;
-    old_rte->delivery_mode = iremap_entry->lo.dlm;
-    old_rte->dest_mode = iremap_entry->lo.dm;
-    old_rte->trigger = iremap_entry->lo.tm;
+    old_rte->vector = iremap_entry->remap.vector;
+    old_rte->delivery_mode = iremap_entry->remap.dlm;
+    old_rte->dest_mode = iremap_entry->remap.dm;
+    old_rte->trigger = iremap_entry->remap.tm;
     old_rte->__reserved_2 = 0;
     old_rte->dest.logical.__reserved_1 = 0;
-    old_rte->dest.logical.logical_dest = iremap_entry->lo.dst >> 8;
+    old_rte->dest.logical.logical_dest = iremap_entry->remap.dst >> 8;
 
     unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
@@ -317,27 +317,28 @@ static int ioapic_rte_to_remap_entry(struct iommu *iommu,
     if ( rte_upper )
     {
         if ( x2apic_enabled )
-            new_ire.lo.dst = value;
+            new_ire.remap.dst = value;
         else
-            new_ire.lo.dst = (value >> 24) << 8;
+            new_ire.remap.dst = (value >> 24) << 8;
     }
     else
     {
         *(((u32 *)&new_rte) + 0) = value;
-        new_ire.lo.fpd = 0;
-        new_ire.lo.dm = new_rte.dest_mode;
-        new_ire.lo.tm = new_rte.trigger;
-        new_ire.lo.dlm = new_rte.delivery_mode;
+        new_ire.remap.fpd = 0;
+        new_ire.remap.dm = new_rte.dest_mode;
+        new_ire.remap.tm = new_rte.trigger;
+        new_ire.remap.dlm = new_rte.delivery_mode;
         /* Hardware require RH = 1 for LPR delivery mode */
-        new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio);
-        new_ire.lo.avail = 0;
-        new_ire.lo.res_1 = 0;
-        new_ire.lo.vector = new_rte.vector;
-        new_ire.lo.res_2 = 0;
+        new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
+        new_ire.remap.avail = 0;
+        new_ire.remap.res_1 = 0;
+        new_ire.remap.vector = new_rte.vector;
+        new_ire.remap.res_2 = 0;
 
         set_ioapic_source_id(IO_APIC_ID(apic), &new_ire);
-        new_ire.hi.res_1 = 0;
-        new_ire.lo.p = 1;     /* finally, set present bit */
+        new_ire.remap.res_3 = 0;
+        new_ire.remap.res_4 = 0;
+        new_ire.remap.p = 1;     /* finally, set present bit */
 
         /* now construct new ioapic rte entry */
         remap_rte->vector = new_rte.vector;
@@ -510,7 +511,7 @@ static int remap_entry_to_msi_msg(
     GET_IREMAP_ENTRY(ir_ctrl->iremap_maddr, index,
                      iremap_entries, iremap_entry);
 
-    if ( iremap_entry->hi_val == 0 && iremap_entry->lo_val == 0 )
+    if ( iremap_entry->val == 0 )
     {
         dprintk(XENLOG_ERR VTDPREFIX,
                 "%s: index (%d) get an empty entry!\n",
@@ -523,25 +524,25 @@ static int remap_entry_to_msi_msg(
     msg->address_hi = MSI_ADDR_BASE_HI;
     msg->address_lo =
         MSI_ADDR_BASE_LO |
-        ((iremap_entry->lo.dm == 0) ?
+        ((iremap_entry->remap.dm == 0) ?
             MSI_ADDR_DESTMODE_PHYS:
             MSI_ADDR_DESTMODE_LOGIC) |
-        ((iremap_entry->lo.dlm != dest_LowestPrio) ?
+        ((iremap_entry->remap.dlm != dest_LowestPrio) ?
             MSI_ADDR_REDIRECTION_CPU:
             MSI_ADDR_REDIRECTION_LOWPRI);
     if ( x2apic_enabled )
-        msg->dest32 = iremap_entry->lo.dst;
+        msg->dest32 = iremap_entry->remap.dst;
     else
-        msg->dest32 = (iremap_entry->lo.dst >> 8) & 0xff;
+        msg->dest32 = (iremap_entry->remap.dst >> 8) & 0xff;
     msg->address_lo |= MSI_ADDR_DEST_ID(msg->dest32);
 
     msg->data =
         MSI_DATA_TRIGGER_EDGE |
         MSI_DATA_LEVEL_ASSERT |
-        ((iremap_entry->lo.dlm != dest_LowestPrio) ?
+        ((iremap_entry->remap.dlm != dest_LowestPrio) ?
             MSI_DATA_DELIVERY_FIXED:
             MSI_DATA_DELIVERY_LOWPRI) |
-        iremap_entry->lo.vector;
+        iremap_entry->remap.vector;
 
     unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
@@ -600,29 +601,30 @@ static int msi_msg_to_remap_entry(
     memcpy(&new_ire, iremap_entry, sizeof(struct iremap_entry));
 
     /* Set interrupt remapping table entry */
-    new_ire.lo.fpd = 0;
-    new_ire.lo.dm = (msg->address_lo >> MSI_ADDR_DESTMODE_SHIFT) & 0x1;
-    new_ire.lo.tm = (msg->data >> MSI_DATA_TRIGGER_SHIFT) & 0x1;
-    new_ire.lo.dlm = (msg->data >> MSI_DATA_DELIVERY_MODE_SHIFT) & 0x1;
+    new_ire.remap.fpd = 0;
+    new_ire.remap.dm = (msg->address_lo >> MSI_ADDR_DESTMODE_SHIFT) & 0x1;
+    new_ire.remap.tm = (msg->data >> MSI_DATA_TRIGGER_SHIFT) & 0x1;
+    new_ire.remap.dlm = (msg->data >> MSI_DATA_DELIVERY_MODE_SHIFT) & 0x1;
     /* Hardware require RH = 1 for LPR delivery mode */
-    new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio);
-    new_ire.lo.avail = 0;
-    new_ire.lo.res_1 = 0;
-    new_ire.lo.vector = (msg->data >> MSI_DATA_VECTOR_SHIFT) &
-                        MSI_DATA_VECTOR_MASK;
-    new_ire.lo.res_2 = 0;
+    new_ire.remap.rh = (new_ire.remap.dlm == dest_LowestPrio);
+    new_ire.remap.avail = 0;
+    new_ire.remap.res_1 = 0;
+    new_ire.remap.vector = (msg->data >> MSI_DATA_VECTOR_SHIFT) &
+                            MSI_DATA_VECTOR_MASK;
+    new_ire.remap.res_2 = 0;
     if ( x2apic_enabled )
-        new_ire.lo.dst = msg->dest32;
+        new_ire.remap.dst = msg->dest32;
     else
-        new_ire.lo.dst = ((msg->address_lo >> MSI_ADDR_DEST_ID_SHIFT)
-                          & 0xff) << 8;
+        new_ire.remap.dst = ((msg->address_lo >> MSI_ADDR_DEST_ID_SHIFT)
+                             & 0xff) << 8;
 
     if ( pdev )
         set_msi_source_id(pdev, &new_ire);
     else
         set_hpet_source_id(msi_desc->hpet_id, &new_ire);
-    new_ire.hi.res_1 = 0;
-    new_ire.lo.p = 1;    /* finally, set present bit */
+    new_ire.remap.res_3 = 0;
+    new_ire.remap.res_4 = 0;
+    new_ire.remap.p = 1;    /* finally, set present bit */
 
     /* now construct new MSI/MSI-X rte entry */
     remap_rte = (struct msi_msg_remap_entry *)msg;
diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/passthrough/vtd/iommu.h
index 22abefe..b440b69 100644
--- a/xen/drivers/passthrough/vtd/iommu.h
+++ b/xen/drivers/passthrough/vtd/iommu.h
@@ -281,29 +281,45 @@ struct dma_pte {
 /* interrupt remap entry */
 struct iremap_entry {
   union {
-    u64 lo_val;
+    __uint128_t val;
+    struct { u64 lo, hi; };
     struct {
-        u64 p       : 1,
+        u16 p       : 1,
             fpd     : 1,
             dm      : 1,
             rh      : 1,
             tm      : 1,
             dlm     : 3,
             avail   : 4,
-            res_1   : 4,
-            vector  : 8,
-            res_2   : 8,
-            dst     : 32;
-    }lo;
-  };
-  union {
-    u64 hi_val;
+            res_1   : 3,
+            im      : 1;
+        u8  vector;
+        u8  res_2;
+        u32 dst;
+        u16 sid;
+        u16 sq      : 2,
+            svt     : 2,
+            res_3   : 12;
+        u32 res_4;
+    } remap;
     struct {
-        u64 sid     : 16,
-            sq      : 2,
+        u16 p       : 1,
+            fpd     : 1,
+            res_1   : 6,
+            avail   : 4,
+            res_2   : 2,
+            urg     : 1,
+            im      : 1;
+        u8  vector;
+        u8  res_3;
+        u32 res_4   : 6,
+            pda_l   : 26;
+        u16 sid;
+        u16 sq      : 2,
             svt     : 2,
-            res_1   : 44;
-    }hi;
+            res_5   : 12;
+        u32 pda_h;
+    } post;
   };
 };
 
diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index fb974aa..00184f0 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -230,13 +230,13 @@ void vtd_dump_iommu_info(unsigned char key)
                 else
                     p = &iremap_entries[i % (1 << IREMAP_ENTRY_ORDER)];
 
-                if ( !p->lo.p )
+                if ( !p->remap.p )
                     continue;
                 printk("  %04x:  %x   %x  %04x %08x %02x    %x   %x  %x  %x  %x"
                     "   %x %x\n", i,
-                    p->hi.svt, p->hi.sq, p->hi.sid, p->lo.dst, p->lo.vector,
-                    p->lo.avail, p->lo.dlm, p->lo.tm, p->lo.rh, p->lo.dm,
-                    p->lo.fpd, p->lo.p);
+                    p->remap.svt, p->remap.sq, p->remap.sid, p->remap.dst,
+                    p->remap.vector, p->remap.avail, p->remap.dlm, p->remap.tm,
+                    p->remap.rh, p->remap.dm, p->remap.fpd, p->remap.p);
                 print_cnt++;
             }
             if ( iremap_entries )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:45:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:45: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 1a23QE-00046x-4z; Thu, 26 Nov 2015 20:45:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QD-00046m-Iz
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:41 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	37/88-06091-47F67565; Thu, 26 Nov 2015 20:45:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1448570739!6811689!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52977 invoked from network); 26 Nov 2015 20:45:40 -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;
	26 Nov 2015 20:45:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QB-00036K-Fn
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QB-0000Ql-C4
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:39 +0000
Date: Thu, 26 Nov 2015 20:45:39 +0000
Message-Id: <E1a23QB-0000Ql-C4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: dump the posted format IRTE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dee1aee5810bb4b95f28208244671c9740ac6b07
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:14:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:14:17 2015 +0100

    VT-d: dump the posted format IRTE
    
    Add the utility to dump the posted format IRTE.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/utils.c |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index 00184f0..fdc768e 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -203,6 +203,9 @@ void vtd_dump_iommu_info(unsigned char key)
             ecap_intr_remap(iommu->ecap) ? "" : "not ",
             (status & DMA_GSTS_IRES) ? " and enabled" : "" );
 
+        printk("  Interrupt Posting: %ssupported.\n",
+               cap_intr_post(iommu->cap) ? "" : "not ");
+
         if ( status & DMA_GSTS_IRES )
         {
             /* Dump interrupt remapping table. */
@@ -213,8 +216,9 @@ void vtd_dump_iommu_info(unsigned char key)
 
             printk("  Interrupt remapping table (nr_entry=%#x. "
                 "Only dump P=1 entries here):\n", nr_entry);
-            printk("       SVT  SQ   SID      DST  V  AVL DLM TM RH DM "
-                   "FPD P\n");
+            printk("R means remapped format, P means posted format.\n");
+            printk("R:       SVT  SQ   SID  V  AVL FPD      DST DLM TM RH DM P\n");
+            printk("P:       SVT  SQ   SID  V  AVL FPD              PDA  URG P\n");
             for ( i = 0; i < nr_entry; i++ )
             {
                 struct iremap_entry *p;
@@ -232,11 +236,21 @@ void vtd_dump_iommu_info(unsigned char key)
 
                 if ( !p->remap.p )
                     continue;
-                printk("  %04x:  %x   %x  %04x %08x %02x    %x   %x  %x  %x  %x"
-                    "   %x %x\n", i,
-                    p->remap.svt, p->remap.sq, p->remap.sid, p->remap.dst,
-                    p->remap.vector, p->remap.avail, p->remap.dlm, p->remap.tm,
-                    p->remap.rh, p->remap.dm, p->remap.fpd, p->remap.p);
+                if ( !p->remap.im )
+                    printk("R:  %04x:  %x   %x  %04x %02x    %x   %x %08x   %x  %x  %x  %x %x\n",
+                           i,
+                           p->remap.svt, p->remap.sq, p->remap.sid,
+                           p->remap.vector, p->remap.avail, p->remap.fpd,
+                           p->remap.dst, p->remap.dlm, p->remap.tm, p->remap.rh,
+                           p->remap.dm, p->remap.p);
+                else
+                    printk("P:  %04x:  %x   %x  %04x %02x    %x   %x %16lx    %x %x\n",
+                           i,
+                           p->post.svt, p->post.sq, p->post.sid, p->post.vector,
+                           p->post.avail, p->post.fpd,
+                           ((u64)p->post.pda_h << 32) | (p->post.pda_l << 6),
+                           p->post.urg, p->post.p);
+
                 print_cnt++;
             }
             if ( iremap_entries )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:45:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:45: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 1a23QE-00046x-4z; Thu, 26 Nov 2015 20:45:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QD-00046m-Iz
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:41 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	37/88-06091-47F67565; Thu, 26 Nov 2015 20:45:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1448570739!6811689!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52977 invoked from network); 26 Nov 2015 20:45:40 -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;
	26 Nov 2015 20:45:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QB-00036K-Fn
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QB-0000Ql-C4
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:39 +0000
Date: Thu, 26 Nov 2015 20:45:39 +0000
Message-Id: <E1a23QB-0000Ql-C4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: dump the posted format IRTE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dee1aee5810bb4b95f28208244671c9740ac6b07
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Nov 24 12:14:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:14:17 2015 +0100

    VT-d: dump the posted format IRTE
    
    Add the utility to dump the posted format IRTE.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/utils.c |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c
index 00184f0..fdc768e 100644
--- a/xen/drivers/passthrough/vtd/utils.c
+++ b/xen/drivers/passthrough/vtd/utils.c
@@ -203,6 +203,9 @@ void vtd_dump_iommu_info(unsigned char key)
             ecap_intr_remap(iommu->ecap) ? "" : "not ",
             (status & DMA_GSTS_IRES) ? " and enabled" : "" );
 
+        printk("  Interrupt Posting: %ssupported.\n",
+               cap_intr_post(iommu->cap) ? "" : "not ");
+
         if ( status & DMA_GSTS_IRES )
         {
             /* Dump interrupt remapping table. */
@@ -213,8 +216,9 @@ void vtd_dump_iommu_info(unsigned char key)
 
             printk("  Interrupt remapping table (nr_entry=%#x. "
                 "Only dump P=1 entries here):\n", nr_entry);
-            printk("       SVT  SQ   SID      DST  V  AVL DLM TM RH DM "
-                   "FPD P\n");
+            printk("R means remapped format, P means posted format.\n");
+            printk("R:       SVT  SQ   SID  V  AVL FPD      DST DLM TM RH DM P\n");
+            printk("P:       SVT  SQ   SID  V  AVL FPD              PDA  URG P\n");
             for ( i = 0; i < nr_entry; i++ )
             {
                 struct iremap_entry *p;
@@ -232,11 +236,21 @@ void vtd_dump_iommu_info(unsigned char key)
 
                 if ( !p->remap.p )
                     continue;
-                printk("  %04x:  %x   %x  %04x %08x %02x    %x   %x  %x  %x  %x"
-                    "   %x %x\n", i,
-                    p->remap.svt, p->remap.sq, p->remap.sid, p->remap.dst,
-                    p->remap.vector, p->remap.avail, p->remap.dlm, p->remap.tm,
-                    p->remap.rh, p->remap.dm, p->remap.fpd, p->remap.p);
+                if ( !p->remap.im )
+                    printk("R:  %04x:  %x   %x  %04x %02x    %x   %x %08x   %x  %x  %x  %x %x\n",
+                           i,
+                           p->remap.svt, p->remap.sq, p->remap.sid,
+                           p->remap.vector, p->remap.avail, p->remap.fpd,
+                           p->remap.dst, p->remap.dlm, p->remap.tm, p->remap.rh,
+                           p->remap.dm, p->remap.p);
+                else
+                    printk("P:  %04x:  %x   %x  %04x %02x    %x   %x %16lx    %x %x\n",
+                           i,
+                           p->post.svt, p->post.sq, p->post.sid, p->post.vector,
+                           p->post.avail, p->post.fpd,
+                           ((u64)p->post.pda_h << 32) | (p->post.pda_l << 6),
+                           p->post.urg, p->post.p);
+
                 print_cnt++;
             }
             if ( iremap_entries )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:45:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:45: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 1a23QP-00048k-A6; Thu, 26 Nov 2015 20:45:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QO-00048a-2o
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:52 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	6F/29-09570-F7F67565; Thu, 26 Nov 2015 20:45:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1448570750!239127!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55893 invoked from network); 26 Nov 2015 20:45:50 -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;
	26 Nov 2015 20:45:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QL-00036S-Py
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QL-0000RI-NG
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:49 +0000
Date: Thu, 26 Nov 2015 20:45:49 +0000
Message-Id: <E1a23QL-0000RI-NG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] acpi/NUMA: build NUMA for x86 only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 975efe17970a9a7a4c279be55677097a7b351544
Author:     Naresh Bhat <naresh.bhat@linaro.org>
AuthorDate: Tue Nov 24 12:18:02 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:18:02 2015 +0100

    acpi/NUMA: build NUMA for x86 only
    
    NUMA is currently not supported for ARM in Xen. Add a new compilation
    option HAS_NUMA for NUMA. Configure and build NUMA only for x86
    architecture now.
    
    Signed-off-by: Naresh Bhat <naresh.bhat@linaro.org>
    Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/arch/x86/Rules.mk     |    1 +
 xen/drivers/acpi/Makefile |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 42de328..5b8eaed 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -3,6 +3,7 @@
 
 HAS_IOPORTS := y
 HAS_ACPI := y
+HAS_NUMA := y
 HAS_VGA  := y
 HAS_VIDEO  := y
 HAS_CPUFREQ := y
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index bbb06a7..3bb626e 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -3,7 +3,7 @@ subdir-y += utilities
 subdir-$(x86) += apei
 
 obj-bin-y += tables.init.o
-obj-y += numa.o
+obj-$(HAS_NUMA) += numa.o
 obj-y += osl.o
 obj-y += pmstat.o
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:45:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:45: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 1a23QP-00048k-A6; Thu, 26 Nov 2015 20:45:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QO-00048a-2o
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:52 +0000
Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id
	6F/29-09570-F7F67565; Thu, 26 Nov 2015 20:45:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1448570750!239127!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 55893 invoked from network); 26 Nov 2015 20:45:50 -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;
	26 Nov 2015 20:45:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QL-00036S-Py
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QL-0000RI-NG
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:45:49 +0000
Date: Thu, 26 Nov 2015 20:45:49 +0000
Message-Id: <E1a23QL-0000RI-NG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] acpi/NUMA: build NUMA for x86 only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 975efe17970a9a7a4c279be55677097a7b351544
Author:     Naresh Bhat <naresh.bhat@linaro.org>
AuthorDate: Tue Nov 24 12:18:02 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:18:02 2015 +0100

    acpi/NUMA: build NUMA for x86 only
    
    NUMA is currently not supported for ARM in Xen. Add a new compilation
    option HAS_NUMA for NUMA. Configure and build NUMA only for x86
    architecture now.
    
    Signed-off-by: Naresh Bhat <naresh.bhat@linaro.org>
    Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 xen/arch/x86/Rules.mk     |    1 +
 xen/drivers/acpi/Makefile |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 42de328..5b8eaed 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -3,6 +3,7 @@
 
 HAS_IOPORTS := y
 HAS_ACPI := y
+HAS_NUMA := y
 HAS_VGA  := y
 HAS_VIDEO  := y
 HAS_CPUFREQ := y
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index bbb06a7..3bb626e 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -3,7 +3,7 @@ subdir-y += utilities
 subdir-$(x86) += apei
 
 obj-bin-y += tables.init.o
-obj-y += numa.o
+obj-$(HAS_NUMA) += numa.o
 obj-y += osl.o
 obj-y += pmstat.o
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:46:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23QZ-0004AZ-Ee; Thu, 26 Nov 2015 20:46: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 1a23QY-0004AP-HF
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:02 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	20/7A-03235-98F67565; Thu, 26 Nov 2015 20:46:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1448570760!6803254!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64930 invoked from network); 26 Nov 2015 20:46:01 -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;
	26 Nov 2015 20:46:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QW-00036f-5R
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QW-0000Rj-2w
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:00 +0000
Date: Thu, 26 Nov 2015 20:46:00 +0000
Message-Id: <E1a23QW-0000Rj-2w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI 6.0: Add changes for FADT table
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bbe5009f9c7206623d801d13e1dfabda91d5e07
Author:     Bob Moore <robert.moore@intel.com>
AuthorDate: Tue Nov 24 12:25:37 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:25:37 2015 +0100

    ACPI 6.0: Add changes for FADT table
    
    ACPICA commit 72b0b6741990f619f6aaa915302836b7cbb41ac4
    
    One new 64-bit field at the end of the table.
    FADT version is now 6.
    
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    [Linux commit aeb823bbacc2a3aaee29eda5875b58a049fa1f78]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl.h |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/include/acpi/actbl.h b/xen/include/acpi/actbl.h
index 856945d..401bc9d 100644
--- a/xen/include/acpi/actbl.h
+++ b/xen/include/acpi/actbl.h
@@ -257,6 +257,7 @@ struct acpi_table_fadt {
 	struct acpi_generic_address xgpe1_block;	/* 64-bit Extended General Purpose Event 1 Reg Blk address */
 	struct acpi_generic_address sleep_control;	/* 64-bit Sleep Control register */
 	struct acpi_generic_address sleep_status;	/* 64-bit Sleep Status register */
+	u64 hypervisor_id;      /* Hypervisor Vendor ID (ACPI 6.0) */
 };
 
 /* Masks for FADT Boot Architecture Flags (boot_flags) */
@@ -309,7 +310,7 @@ enum acpi_prefered_pm_profiles {
 	PM_TABLET = 8
 };
 
-/* Values for sleep_status and sleep_control registers (V5 FADT) */
+/* Values for sleep_status and sleep_control registers (V5+ FADT) */
 
 #define ACPI_X_WAKE_STATUS          0x80
 #define ACPI_X_SLEEP_TYPE_MASK      0x1C
@@ -338,15 +339,17 @@ enum acpi_prefered_pm_profiles {
  * FADT is the bottom line as to what the version really is.
  *
  * For reference, the values below are as follows:
- *     FADT V1  size: 0x074
- *     FADT V2  size: 0x084
- *     FADT V3  size: 0x0F4
- *     FADT V4  size: 0x0F4
- *     FADT V5  size: 0x10C
+ *     FADT V1 size: 0x074
+ *     FADT V2 size: 0x084
+ *     FADT V3 size: 0x0F4
+ *     FADT V4 size: 0x0F4
+ *     FADT V5 size: 0x10C
+ *     FADT V6 size: 0x114
  */
 #define ACPI_FADT_V1_SIZE       (u32) (ACPI_FADT_OFFSET (flags) + 4)
 #define ACPI_FADT_V2_SIZE       (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3)
 #define ACPI_FADT_V3_SIZE       (u32) (ACPI_FADT_OFFSET (sleep_control))
-#define ACPI_FADT_V5_SIZE       (u32) (sizeof (struct acpi_table_fadt))
+#define ACPI_FADT_V5_SIZE       (u32) (ACPI_FADT_OFFSET (hypervisor_id))
+#define ACPI_FADT_V6_SIZE       (u32) (sizeof (struct acpi_table_fadt))
 
 #endif				/* __ACTBL_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 Thu Nov 26 20:46:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23QZ-0004AZ-Ee; Thu, 26 Nov 2015 20:46: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 1a23QY-0004AP-HF
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:02 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	20/7A-03235-98F67565; Thu, 26 Nov 2015 20:46:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1448570760!6803254!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64930 invoked from network); 26 Nov 2015 20:46:01 -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;
	26 Nov 2015 20:46:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QW-00036f-5R
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23QW-0000Rj-2w
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:00 +0000
Date: Thu, 26 Nov 2015 20:46:00 +0000
Message-Id: <E1a23QW-0000Rj-2w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI 6.0: Add changes for FADT table
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bbe5009f9c7206623d801d13e1dfabda91d5e07
Author:     Bob Moore <robert.moore@intel.com>
AuthorDate: Tue Nov 24 12:25:37 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:25:37 2015 +0100

    ACPI 6.0: Add changes for FADT table
    
    ACPICA commit 72b0b6741990f619f6aaa915302836b7cbb41ac4
    
    One new 64-bit field at the end of the table.
    FADT version is now 6.
    
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    [Linux commit aeb823bbacc2a3aaee29eda5875b58a049fa1f78]
    Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/acpi/actbl.h |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/include/acpi/actbl.h b/xen/include/acpi/actbl.h
index 856945d..401bc9d 100644
--- a/xen/include/acpi/actbl.h
+++ b/xen/include/acpi/actbl.h
@@ -257,6 +257,7 @@ struct acpi_table_fadt {
 	struct acpi_generic_address xgpe1_block;	/* 64-bit Extended General Purpose Event 1 Reg Blk address */
 	struct acpi_generic_address sleep_control;	/* 64-bit Sleep Control register */
 	struct acpi_generic_address sleep_status;	/* 64-bit Sleep Status register */
+	u64 hypervisor_id;      /* Hypervisor Vendor ID (ACPI 6.0) */
 };
 
 /* Masks for FADT Boot Architecture Flags (boot_flags) */
@@ -309,7 +310,7 @@ enum acpi_prefered_pm_profiles {
 	PM_TABLET = 8
 };
 
-/* Values for sleep_status and sleep_control registers (V5 FADT) */
+/* Values for sleep_status and sleep_control registers (V5+ FADT) */
 
 #define ACPI_X_WAKE_STATUS          0x80
 #define ACPI_X_SLEEP_TYPE_MASK      0x1C
@@ -338,15 +339,17 @@ enum acpi_prefered_pm_profiles {
  * FADT is the bottom line as to what the version really is.
  *
  * For reference, the values below are as follows:
- *     FADT V1  size: 0x074
- *     FADT V2  size: 0x084
- *     FADT V3  size: 0x0F4
- *     FADT V4  size: 0x0F4
- *     FADT V5  size: 0x10C
+ *     FADT V1 size: 0x074
+ *     FADT V2 size: 0x084
+ *     FADT V3 size: 0x0F4
+ *     FADT V4 size: 0x0F4
+ *     FADT V5 size: 0x10C
+ *     FADT V6 size: 0x114
  */
 #define ACPI_FADT_V1_SIZE       (u32) (ACPI_FADT_OFFSET (flags) + 4)
 #define ACPI_FADT_V2_SIZE       (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3)
 #define ACPI_FADT_V3_SIZE       (u32) (ACPI_FADT_OFFSET (sleep_control))
-#define ACPI_FADT_V5_SIZE       (u32) (sizeof (struct acpi_table_fadt))
+#define ACPI_FADT_V5_SIZE       (u32) (ACPI_FADT_OFFSET (hypervisor_id))
+#define ACPI_FADT_V6_SIZE       (u32) (sizeof (struct acpi_table_fadt))
 
 #endif				/* __ACTBL_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 Thu Nov 26 20:46:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:46: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 1a23Qk-0004C5-Il; Thu, 26 Nov 2015 20:46: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 1a23Qj-0004Bt-1d
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:13 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	D4/9E-17090-49F67565; Thu, 26 Nov 2015 20:46:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448570770!6809402!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14141 invoked from network); 26 Nov 2015 20:46:11 -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;
	26 Nov 2015 20:46:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Qg-00037G-Ea
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Qg-0000Sr-Cj
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:10 +0000
Date: Thu, 26 Nov 2015 20:46:10 +0000
Message-Id: <E1a23Qg-0000Sr-Cj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: fix/adjust trap injection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81a28f14009f4d8577a81b28dd06f6828112054b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 12:30:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:30:31 2015 +0100

    VMX: fix/adjust trap injection
    
    In the course of investigating the 4.1.6 backport issue of the XSA-156
    patch I realized that #DB injection has always been broken, but with it
    now getting always intercepted the problem has got worse: Documentation
    clearly states that neither DR7.GD nor DebugCtl.LBR get cleared before
    the intercept, so this is something we need to do before reflecting the
    intercepted exception.
    
    While adjusting this (and also with 4.1.6's strange use of
    X86_EVENTTYPE_SW_EXCEPTION for #DB in mind) I further realized that
    the special casing of individual vectors shouldn't be done for
    software interrupts (resulting from INT $nn).
    
    And then some code movement: Setting of CR2 for #PF can be done in the
    same switch() statement (no need for a separate if()), and reading of
    intr_info is better done close the the consumption of the variable
    (allowing the compiler to generate better code / use fewer registers
    for variables).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 4b8d2fa..326d803 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1506,16 +1506,7 @@ static void vmx_inject_trap(struct hvm_trap *trap)
     struct vcpu *curr = current;
     struct hvm_trap _trap = *trap;
 
-    if ( (_trap.vector == TRAP_page_fault) &&
-         (_trap.type == X86_EVENTTYPE_HW_EXCEPTION) )
-        curr->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
-
-    if ( nestedhvm_vcpu_in_guestmode(curr) )
-        intr_info = vcpu_2_nvmx(curr).intr.intr_info;
-    else
-        __vmread(VM_ENTRY_INTR_INFO, &intr_info);
-
-    switch ( _trap.vector )
+    switch ( _trap.vector | -(_trap.type == X86_EVENTTYPE_SW_INTERRUPT) )
     {
     case TRAP_debug:
         if ( guest_cpu_user_regs()->eflags & X86_EFLAGS_TF )
@@ -1523,6 +1514,16 @@ static void vmx_inject_trap(struct hvm_trap *trap)
             __restore_debug_registers(curr);
             write_debugreg(6, read_debugreg(6) | DR_STEP);
         }
+        if ( !nestedhvm_vcpu_in_guestmode(curr) ||
+             !nvmx_intercepts_exception(curr, TRAP_debug, _trap.error_code) )
+        {
+            unsigned long val;
+
+            __vmread(GUEST_DR7, &val);
+            __vmwrite(GUEST_DR7, val & ~DR_GENERAL_DETECT);
+            __vmread(GUEST_IA32_DEBUGCTL, &val);
+            __vmwrite(GUEST_IA32_DEBUGCTL, val & ~IA32_DEBUGCTLMSR_LBR);
+        }
         if ( cpu_has_monitor_trap_flag )
             break;
         /* fall through */
@@ -1533,8 +1534,19 @@ static void vmx_inject_trap(struct hvm_trap *trap)
             domain_pause_for_debugger();
             return;
         }
+        break;
+
+    case TRAP_page_fault:
+        ASSERT(_trap.type == X86_EVENTTYPE_HW_EXCEPTION);
+        curr->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
+        break;
     }
 
+    if ( nestedhvm_vcpu_in_guestmode(curr) )
+        intr_info = vcpu_2_nvmx(curr).intr.intr_info;
+    else
+        __vmread(VM_ENTRY_INTR_INFO, &intr_info);
+
     if ( unlikely(intr_info & INTR_INFO_VALID_MASK) &&
          (MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) ==
           X86_EVENTTYPE_HW_EXCEPTION) )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:46:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:46: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 1a23Qk-0004C5-Il; Thu, 26 Nov 2015 20:46: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 1a23Qj-0004Bt-1d
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:13 +0000
Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id
	D4/9E-17090-49F67565; Thu, 26 Nov 2015 20:46:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448570770!6809402!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14141 invoked from network); 26 Nov 2015 20:46:11 -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;
	26 Nov 2015 20:46:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Qg-00037G-Ea
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Qg-0000Sr-Cj
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:10 +0000
Date: Thu, 26 Nov 2015 20:46:10 +0000
Message-Id: <E1a23Qg-0000Sr-Cj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: fix/adjust trap injection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81a28f14009f4d8577a81b28dd06f6828112054b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 12:30:31 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:30:31 2015 +0100

    VMX: fix/adjust trap injection
    
    In the course of investigating the 4.1.6 backport issue of the XSA-156
    patch I realized that #DB injection has always been broken, but with it
    now getting always intercepted the problem has got worse: Documentation
    clearly states that neither DR7.GD nor DebugCtl.LBR get cleared before
    the intercept, so this is something we need to do before reflecting the
    intercepted exception.
    
    While adjusting this (and also with 4.1.6's strange use of
    X86_EVENTTYPE_SW_EXCEPTION for #DB in mind) I further realized that
    the special casing of individual vectors shouldn't be done for
    software interrupts (resulting from INT $nn).
    
    And then some code movement: Setting of CR2 for #PF can be done in the
    same switch() statement (no need for a separate if()), and reading of
    intr_info is better done close the the consumption of the variable
    (allowing the compiler to generate better code / use fewer registers
    for variables).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 4b8d2fa..326d803 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1506,16 +1506,7 @@ static void vmx_inject_trap(struct hvm_trap *trap)
     struct vcpu *curr = current;
     struct hvm_trap _trap = *trap;
 
-    if ( (_trap.vector == TRAP_page_fault) &&
-         (_trap.type == X86_EVENTTYPE_HW_EXCEPTION) )
-        curr->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
-
-    if ( nestedhvm_vcpu_in_guestmode(curr) )
-        intr_info = vcpu_2_nvmx(curr).intr.intr_info;
-    else
-        __vmread(VM_ENTRY_INTR_INFO, &intr_info);
-
-    switch ( _trap.vector )
+    switch ( _trap.vector | -(_trap.type == X86_EVENTTYPE_SW_INTERRUPT) )
     {
     case TRAP_debug:
         if ( guest_cpu_user_regs()->eflags & X86_EFLAGS_TF )
@@ -1523,6 +1514,16 @@ static void vmx_inject_trap(struct hvm_trap *trap)
             __restore_debug_registers(curr);
             write_debugreg(6, read_debugreg(6) | DR_STEP);
         }
+        if ( !nestedhvm_vcpu_in_guestmode(curr) ||
+             !nvmx_intercepts_exception(curr, TRAP_debug, _trap.error_code) )
+        {
+            unsigned long val;
+
+            __vmread(GUEST_DR7, &val);
+            __vmwrite(GUEST_DR7, val & ~DR_GENERAL_DETECT);
+            __vmread(GUEST_IA32_DEBUGCTL, &val);
+            __vmwrite(GUEST_IA32_DEBUGCTL, val & ~IA32_DEBUGCTLMSR_LBR);
+        }
         if ( cpu_has_monitor_trap_flag )
             break;
         /* fall through */
@@ -1533,8 +1534,19 @@ static void vmx_inject_trap(struct hvm_trap *trap)
             domain_pause_for_debugger();
             return;
         }
+        break;
+
+    case TRAP_page_fault:
+        ASSERT(_trap.type == X86_EVENTTYPE_HW_EXCEPTION);
+        curr->arch.hvm_vcpu.guest_cr[2] = _trap.cr2;
+        break;
     }
 
+    if ( nestedhvm_vcpu_in_guestmode(curr) )
+        intr_info = vcpu_2_nvmx(curr).intr.intr_info;
+    else
+        __vmread(VM_ENTRY_INTR_INFO, &intr_info);
+
     if ( unlikely(intr_info & INTR_INFO_VALID_MASK) &&
          (MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK) ==
           X86_EVENTTYPE_HW_EXCEPTION) )
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:46:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:46: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 1a23Qu-0004DY-NC; Thu, 26 Nov 2015 20:46:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Qt-0004DJ-ES
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:23 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	C4/53-03763-E9F67565; Thu, 26 Nov 2015 20:46:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448570781!6937413!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12303 invoked from network); 26 Nov 2015 20:46:21 -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;
	26 Nov 2015 20:46:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Qr-00037O-1F
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Qq-0000TL-P6
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:20 +0000
Date: Thu, 26 Nov 2015 20:46:20 +0000
Message-Id: <E1a23Qq-0000TL-P6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: type adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e4fd700e06c116f6198888a90552349b67aa64fa
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 12:31:13 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:31:13 2015 +0100

    x86/HVM: type adjustments
    
    - constify struct hvm_trap * function parameters
    - width reduce and shuffle some struct hvm_trap members
    - use bool_t for boolean fields struct hvm_function_table
    - use unsigned for struct hvm_function_table's hap_capabilities field
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Boris Ostrovsky<boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/hvm.c                  |    2 +-
 xen/arch/x86/hvm/svm/nestedsvm.c        |    2 +-
 xen/arch/x86/hvm/svm/svm.c              |    4 ++--
 xen/arch/x86/hvm/vmx/vmx.c              |    4 ++--
 xen/include/asm-x86/hvm/hvm.h           |   24 ++++++++++++------------
 xen/include/asm-x86/hvm/support.h       |    2 +-
 xen/include/asm-x86/hvm/svm/nestedsvm.h |    2 +-
 7 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index ea982e2..141a130 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2826,7 +2826,7 @@ void hvm_triple_fault(void)
     domain_shutdown(d, reason);
 }
 
-void hvm_inject_trap(struct hvm_trap *trap)
+void hvm_inject_trap(const struct hvm_trap *trap)
 {
     struct vcpu *curr = current;
 
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 46f2532..9d2ac09 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -821,7 +821,7 @@ nsvm_vcpu_vmexit_inject(struct vcpu *v, struct cpu_user_regs *regs,
 }
 
 int
-nsvm_vcpu_vmexit_trap(struct vcpu *v, struct hvm_trap *trap)
+nsvm_vcpu_vmexit_trap(struct vcpu *v, const struct hvm_trap *trap)
 {
     ASSERT(vcpu_nestedhvm(v).nv_vvmcx != NULL);
 
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index d9bd97e..e2db4db 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1181,7 +1181,7 @@ static void svm_vcpu_destroy(struct vcpu *v)
     passive_domain_destroy(v);
 }
 
-static void svm_inject_trap(struct hvm_trap *trap)
+static void svm_inject_trap(const struct hvm_trap *trap)
 {
     struct vcpu *curr = current;
     struct vmcb_struct *vmcb = curr->arch.hvm_svm.vmcb;
@@ -1442,7 +1442,7 @@ const struct hvm_function_table * __init start_svm(void)
     if ( !printed )
         printk(" - none\n");
 
-    svm_function_table.hap_supported = cpu_has_svm_npt;
+    svm_function_table.hap_supported = !!cpu_has_svm_npt;
     svm_function_table.hap_capabilities = HVM_HAP_SUPERPAGE_2MB |
         ((cpuid_edx(0x80000001) & 0x04000000) ? HVM_HAP_SUPERPAGE_1GB : 0);
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 326d803..374eebf 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1416,7 +1416,7 @@ void nvmx_enqueue_n2_exceptions(struct vcpu *v,
                  nvmx->intr.intr_info, nvmx->intr.error_code);
 }
 
-static int nvmx_vmexit_trap(struct vcpu *v, struct hvm_trap *trap)
+static int nvmx_vmexit_trap(struct vcpu *v, const struct hvm_trap *trap)
 {
     nvmx_enqueue_n2_exceptions(v, trap->vector, trap->error_code,
                                hvm_intsrc_none);
@@ -1500,7 +1500,7 @@ void vmx_inject_nmi(void)
  *  - #DB is X86_EVENTTYPE_HW_EXCEPTION, except when generated by
  *    opcode 0xf1 (which is X86_EVENTTYPE_PRI_SW_EXCEPTION)
  */
-static void vmx_inject_trap(struct hvm_trap *trap)
+static void vmx_inject_trap(const struct hvm_trap *trap)
 {
     unsigned long intr_info;
     struct vcpu *curr = current;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index da799a0..f80e143 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -72,10 +72,10 @@ enum hvm_intblk {
 #define HVM_HAP_SUPERPAGE_1GB   0x00000002
 
 struct hvm_trap {
-    int           vector;
-    unsigned int  type;         /* X86_EVENTTYPE_* */
-    int           error_code;   /* HVM_DELIVER_NO_ERROR_CODE if n/a */
-    int           insn_len;     /* Instruction length */ 
+    int16_t       vector;
+    uint8_t       type;         /* X86_EVENTTYPE_* */
+    uint8_t       insn_len;     /* Instruction length */
+    uint32_t      error_code;   /* HVM_DELIVER_NO_ERROR_CODE if n/a */
     unsigned long cr2;          /* Only for TRAP_page_fault h/w exception */
 };
 
@@ -88,17 +88,16 @@ struct hvm_function_table {
     char *name;
 
     /* Support Hardware-Assisted Paging? */
-    int hap_supported;
+    bool_t hap_supported;
 
     /* Necessary hardware support for PVH mode? */
-    int pvh_supported;
+    bool_t pvh_supported;
 
     /* Necessary hardware support for alternate p2m's? */
     bool_t altp2m_supported;
 
     /* Indicate HAP capabilities. */
-    int hap_capabilities;
-
+    unsigned int hap_capabilities;
 
     /*
      * Initialise/destroy HVM domain/vcpu resources
@@ -142,7 +141,7 @@ struct hvm_function_table {
 
     void (*set_tsc_offset)(struct vcpu *v, u64 offset, u64 at_tsc);
 
-    void (*inject_trap)(struct hvm_trap *trap);
+    void (*inject_trap)(const struct hvm_trap *trap);
 
     void (*init_hypercall_page)(struct domain *d, void *hypercall_page);
 
@@ -175,7 +174,7 @@ struct hvm_function_table {
     int (*nhvm_vcpu_initialise)(struct vcpu *v);
     void (*nhvm_vcpu_destroy)(struct vcpu *v);
     int (*nhvm_vcpu_reset)(struct vcpu *v);
-    int (*nhvm_vcpu_vmexit_trap)(struct vcpu *v, struct hvm_trap *trap);
+    int (*nhvm_vcpu_vmexit_trap)(struct vcpu *v, const struct hvm_trap *trap);
     uint64_t (*nhvm_vcpu_p2m_base)(struct vcpu *v);
     bool_t (*nhvm_vmcx_guest_intercepts_trap)(struct vcpu *v,
                                               unsigned int trapnr,
@@ -371,7 +370,7 @@ bool_t hvm_io_pending(struct vcpu *v);
 void hvm_do_resume(struct vcpu *v);
 void hvm_migrate_pirqs(struct vcpu *v);
 
-void hvm_inject_trap(struct hvm_trap *trap);
+void hvm_inject_trap(const struct hvm_trap *trap);
 void hvm_inject_hw_exception(unsigned int trapnr, int errcode);
 void hvm_inject_page_fault(int errcode, unsigned long cr2);
 
@@ -495,7 +494,8 @@ int hvm_x2apic_msr_write(struct vcpu *v, unsigned int msr, uint64_t msr_content)
 /* inject vmexit into l1 guest. l1 guest will see a VMEXIT due to
  * 'trapnr' exception.
  */ 
-static inline int nhvm_vcpu_vmexit_trap(struct vcpu *v, struct hvm_trap *trap)
+static inline int nhvm_vcpu_vmexit_trap(struct vcpu *v,
+                                        const struct hvm_trap *trap)
 {
     return hvm_funcs.nhvm_vcpu_vmexit_trap(v, trap);
 }
diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h
index 2d51186..2984abc 100644
--- a/xen/include/asm-x86/hvm/support.h
+++ b/xen/include/asm-x86/hvm/support.h
@@ -25,7 +25,7 @@
 #include <xen/hvm/save.h>
 #include <asm/processor.h>
 
-#define HVM_DELIVER_NO_ERROR_CODE  -1
+#define HVM_DELIVER_NO_ERROR_CODE  (~0U)
 
 #ifndef NDEBUG
 #define DBG_LEVEL_0                 (1 << 0)
diff --git a/xen/include/asm-x86/hvm/svm/nestedsvm.h b/xen/include/asm-x86/hvm/svm/nestedsvm.h
index 974a7d4..0dbc5ec 100644
--- a/xen/include/asm-x86/hvm/svm/nestedsvm.h
+++ b/xen/include/asm-x86/hvm/svm/nestedsvm.h
@@ -110,7 +110,7 @@ void nsvm_vcpu_destroy(struct vcpu *v);
 int nsvm_vcpu_initialise(struct vcpu *v);
 int nsvm_vcpu_reset(struct vcpu *v);
 int nsvm_vcpu_vmrun(struct vcpu *v, struct cpu_user_regs *regs);
-int nsvm_vcpu_vmexit_trap(struct vcpu *v, struct hvm_trap *trap);
+int nsvm_vcpu_vmexit_trap(struct vcpu *v, const struct hvm_trap *trap);
 uint64_t nsvm_vcpu_hostcr3(struct vcpu *v);
 bool_t nsvm_vmcb_guest_intercepts_trap(struct vcpu *v, unsigned int trapnr,
                                        int errcode);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:46:24 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:46: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 1a23Qu-0004DY-NC; Thu, 26 Nov 2015 20:46:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Qt-0004DJ-ES
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:23 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	C4/53-03763-E9F67565; Thu, 26 Nov 2015 20:46:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448570781!6937413!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12303 invoked from network); 26 Nov 2015 20:46:21 -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;
	26 Nov 2015 20:46:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Qr-00037O-1F
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Qq-0000TL-P6
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:20 +0000
Date: Thu, 26 Nov 2015 20:46:20 +0000
Message-Id: <E1a23Qq-0000TL-P6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: type adjustments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e4fd700e06c116f6198888a90552349b67aa64fa
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 12:31:13 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 12:31:13 2015 +0100

    x86/HVM: type adjustments
    
    - constify struct hvm_trap * function parameters
    - width reduce and shuffle some struct hvm_trap members
    - use bool_t for boolean fields struct hvm_function_table
    - use unsigned for struct hvm_function_table's hap_capabilities field
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Boris Ostrovsky<boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/hvm/hvm.c                  |    2 +-
 xen/arch/x86/hvm/svm/nestedsvm.c        |    2 +-
 xen/arch/x86/hvm/svm/svm.c              |    4 ++--
 xen/arch/x86/hvm/vmx/vmx.c              |    4 ++--
 xen/include/asm-x86/hvm/hvm.h           |   24 ++++++++++++------------
 xen/include/asm-x86/hvm/support.h       |    2 +-
 xen/include/asm-x86/hvm/svm/nestedsvm.h |    2 +-
 7 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index ea982e2..141a130 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2826,7 +2826,7 @@ void hvm_triple_fault(void)
     domain_shutdown(d, reason);
 }
 
-void hvm_inject_trap(struct hvm_trap *trap)
+void hvm_inject_trap(const struct hvm_trap *trap)
 {
     struct vcpu *curr = current;
 
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 46f2532..9d2ac09 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -821,7 +821,7 @@ nsvm_vcpu_vmexit_inject(struct vcpu *v, struct cpu_user_regs *regs,
 }
 
 int
-nsvm_vcpu_vmexit_trap(struct vcpu *v, struct hvm_trap *trap)
+nsvm_vcpu_vmexit_trap(struct vcpu *v, const struct hvm_trap *trap)
 {
     ASSERT(vcpu_nestedhvm(v).nv_vvmcx != NULL);
 
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index d9bd97e..e2db4db 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1181,7 +1181,7 @@ static void svm_vcpu_destroy(struct vcpu *v)
     passive_domain_destroy(v);
 }
 
-static void svm_inject_trap(struct hvm_trap *trap)
+static void svm_inject_trap(const struct hvm_trap *trap)
 {
     struct vcpu *curr = current;
     struct vmcb_struct *vmcb = curr->arch.hvm_svm.vmcb;
@@ -1442,7 +1442,7 @@ const struct hvm_function_table * __init start_svm(void)
     if ( !printed )
         printk(" - none\n");
 
-    svm_function_table.hap_supported = cpu_has_svm_npt;
+    svm_function_table.hap_supported = !!cpu_has_svm_npt;
     svm_function_table.hap_capabilities = HVM_HAP_SUPERPAGE_2MB |
         ((cpuid_edx(0x80000001) & 0x04000000) ? HVM_HAP_SUPERPAGE_1GB : 0);
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 326d803..374eebf 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1416,7 +1416,7 @@ void nvmx_enqueue_n2_exceptions(struct vcpu *v,
                  nvmx->intr.intr_info, nvmx->intr.error_code);
 }
 
-static int nvmx_vmexit_trap(struct vcpu *v, struct hvm_trap *trap)
+static int nvmx_vmexit_trap(struct vcpu *v, const struct hvm_trap *trap)
 {
     nvmx_enqueue_n2_exceptions(v, trap->vector, trap->error_code,
                                hvm_intsrc_none);
@@ -1500,7 +1500,7 @@ void vmx_inject_nmi(void)
  *  - #DB is X86_EVENTTYPE_HW_EXCEPTION, except when generated by
  *    opcode 0xf1 (which is X86_EVENTTYPE_PRI_SW_EXCEPTION)
  */
-static void vmx_inject_trap(struct hvm_trap *trap)
+static void vmx_inject_trap(const struct hvm_trap *trap)
 {
     unsigned long intr_info;
     struct vcpu *curr = current;
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index da799a0..f80e143 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -72,10 +72,10 @@ enum hvm_intblk {
 #define HVM_HAP_SUPERPAGE_1GB   0x00000002
 
 struct hvm_trap {
-    int           vector;
-    unsigned int  type;         /* X86_EVENTTYPE_* */
-    int           error_code;   /* HVM_DELIVER_NO_ERROR_CODE if n/a */
-    int           insn_len;     /* Instruction length */ 
+    int16_t       vector;
+    uint8_t       type;         /* X86_EVENTTYPE_* */
+    uint8_t       insn_len;     /* Instruction length */
+    uint32_t      error_code;   /* HVM_DELIVER_NO_ERROR_CODE if n/a */
     unsigned long cr2;          /* Only for TRAP_page_fault h/w exception */
 };
 
@@ -88,17 +88,16 @@ struct hvm_function_table {
     char *name;
 
     /* Support Hardware-Assisted Paging? */
-    int hap_supported;
+    bool_t hap_supported;
 
     /* Necessary hardware support for PVH mode? */
-    int pvh_supported;
+    bool_t pvh_supported;
 
     /* Necessary hardware support for alternate p2m's? */
     bool_t altp2m_supported;
 
     /* Indicate HAP capabilities. */
-    int hap_capabilities;
-
+    unsigned int hap_capabilities;
 
     /*
      * Initialise/destroy HVM domain/vcpu resources
@@ -142,7 +141,7 @@ struct hvm_function_table {
 
     void (*set_tsc_offset)(struct vcpu *v, u64 offset, u64 at_tsc);
 
-    void (*inject_trap)(struct hvm_trap *trap);
+    void (*inject_trap)(const struct hvm_trap *trap);
 
     void (*init_hypercall_page)(struct domain *d, void *hypercall_page);
 
@@ -175,7 +174,7 @@ struct hvm_function_table {
     int (*nhvm_vcpu_initialise)(struct vcpu *v);
     void (*nhvm_vcpu_destroy)(struct vcpu *v);
     int (*nhvm_vcpu_reset)(struct vcpu *v);
-    int (*nhvm_vcpu_vmexit_trap)(struct vcpu *v, struct hvm_trap *trap);
+    int (*nhvm_vcpu_vmexit_trap)(struct vcpu *v, const struct hvm_trap *trap);
     uint64_t (*nhvm_vcpu_p2m_base)(struct vcpu *v);
     bool_t (*nhvm_vmcx_guest_intercepts_trap)(struct vcpu *v,
                                               unsigned int trapnr,
@@ -371,7 +370,7 @@ bool_t hvm_io_pending(struct vcpu *v);
 void hvm_do_resume(struct vcpu *v);
 void hvm_migrate_pirqs(struct vcpu *v);
 
-void hvm_inject_trap(struct hvm_trap *trap);
+void hvm_inject_trap(const struct hvm_trap *trap);
 void hvm_inject_hw_exception(unsigned int trapnr, int errcode);
 void hvm_inject_page_fault(int errcode, unsigned long cr2);
 
@@ -495,7 +494,8 @@ int hvm_x2apic_msr_write(struct vcpu *v, unsigned int msr, uint64_t msr_content)
 /* inject vmexit into l1 guest. l1 guest will see a VMEXIT due to
  * 'trapnr' exception.
  */ 
-static inline int nhvm_vcpu_vmexit_trap(struct vcpu *v, struct hvm_trap *trap)
+static inline int nhvm_vcpu_vmexit_trap(struct vcpu *v,
+                                        const struct hvm_trap *trap)
 {
     return hvm_funcs.nhvm_vcpu_vmexit_trap(v, trap);
 }
diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h
index 2d51186..2984abc 100644
--- a/xen/include/asm-x86/hvm/support.h
+++ b/xen/include/asm-x86/hvm/support.h
@@ -25,7 +25,7 @@
 #include <xen/hvm/save.h>
 #include <asm/processor.h>
 
-#define HVM_DELIVER_NO_ERROR_CODE  -1
+#define HVM_DELIVER_NO_ERROR_CODE  (~0U)
 
 #ifndef NDEBUG
 #define DBG_LEVEL_0                 (1 << 0)
diff --git a/xen/include/asm-x86/hvm/svm/nestedsvm.h b/xen/include/asm-x86/hvm/svm/nestedsvm.h
index 974a7d4..0dbc5ec 100644
--- a/xen/include/asm-x86/hvm/svm/nestedsvm.h
+++ b/xen/include/asm-x86/hvm/svm/nestedsvm.h
@@ -110,7 +110,7 @@ void nsvm_vcpu_destroy(struct vcpu *v);
 int nsvm_vcpu_initialise(struct vcpu *v);
 int nsvm_vcpu_reset(struct vcpu *v);
 int nsvm_vcpu_vmrun(struct vcpu *v, struct cpu_user_regs *regs);
-int nsvm_vcpu_vmexit_trap(struct vcpu *v, struct hvm_trap *trap);
+int nsvm_vcpu_vmexit_trap(struct vcpu *v, const struct hvm_trap *trap);
 uint64_t nsvm_vcpu_hostcr3(struct vcpu *v);
 bool_t nsvm_vmcb_guest_intercepts_trap(struct vcpu *v, unsigned int trapnr,
                                        int errcode);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:46:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:46: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 1a23R4-0004FY-RN; Thu, 26 Nov 2015 20:46: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 1a23R3-0004FI-Li
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:33 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	81/06-10715-8AF67565; Thu, 26 Nov 2015 20:46:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1448570791!6651298!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20279 invoked from network); 26 Nov 2015 20:46:32 -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;
	26 Nov 2015 20:46:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23R1-00037W-Cf
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23R1-0000UT-9w
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:31 +0000
Date: Thu, 26 Nov 2015 20:46:31 +0000
Message-Id: <E1a23R1-0000UT-9w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: fix locking for insert_vcpu()
	in credit1 and RTDS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae2f41e3d7e7798537b7ea6dbb9a0c6aeb1179e3
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Nov 24 14:48:34 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 14:48:34 2015 +0100

    sched: fix locking for insert_vcpu() in credit1 and RTDS
    
    The insert_vcpu() hook is handled with inconsistent locking.
    In fact, schedule_cpu_switch() calls the hook with runqueue
    lock held, while sched_move_domain() relies on the hook
    implementations to take the lock themselves (and, since that
    is not done in Credit1 and RTDS, such operation is not safe
    in those cases).
    
    This is fixed as follows:
     - take the lock in the hook implementations, in specific
       schedulers' code;
     - avoid calling insert_vcpu(), for the idle vCPU, in
       schedule_cpu_switch(). In fact, idle vCPUs are set to run
       immediately, and the various schedulers won't insert them
       in their runqueues anyway, even when explicitly asked to.
    
    While there, still in schedule_cpu_switch(), locking with
    _irq() is enough (there's no need to do *_irqsave()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit.c |    6 ++++++
 xen/common/sched_rt.c     |    3 +++
 xen/common/schedule.c     |    6 ++----
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 72a2109..496cc45 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -910,10 +910,16 @@ static void
 csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct csched_vcpu *svc = vc->sched_priv;
+    spinlock_t *lock;
+    unsigned long flags;
+
+    lock = vcpu_schedule_lock_irqsave(vc, &flags);
 
     if ( !__vcpu_on_runq(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(svc);
 
+    vcpu_schedule_unlock_irqrestore(lock, flags, vc);
+
     SCHED_STAT_CRANK(vcpu_insert);
 }
 
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 822f23c..3a66c9a 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -622,16 +622,19 @@ rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct rt_vcpu *svc = rt_vcpu(vc);
     s_time_t now = NOW();
+    spinlock_t *lock;
 
     /* not addlocate idle vcpu to dom vcpu list */
     if ( is_idle_vcpu(vc) )
         return;
 
+    lock = vcpu_schedule_lock_irq(vc);
     if ( now >= svc->cur_deadline )
         rt_update_deadline(now, svc);
 
     if ( !__vcpu_on_q(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(ops, svc);
+    vcpu_schedule_unlock_irq(lock, vc);
 
     /* add rt_vcpu svc to scheduler-specific vcpu list of the dom */
     list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 20f5f56..f38df71 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1487,7 +1487,6 @@ void __init scheduler_init(void)
 
 int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
 {
-    unsigned long flags;
     struct vcpu *idle;
     spinlock_t *lock;
     void *ppriv, *ppriv_old, *vpriv, *vpriv_old;
@@ -1508,7 +1507,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
         return -ENOMEM;
     }
 
-    lock = pcpu_schedule_lock_irqsave(cpu, &flags);
+    lock = pcpu_schedule_lock_irq(cpu);
 
     SCHED_OP(old_ops, tick_suspend, cpu);
     vpriv_old = idle->sched_priv;
@@ -1517,9 +1516,8 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
     ppriv_old = per_cpu(schedule_data, cpu).sched_priv;
     per_cpu(schedule_data, cpu).sched_priv = ppriv;
     SCHED_OP(new_ops, tick_resume, cpu);
-    SCHED_OP(new_ops, insert_vcpu, idle);
 
-    pcpu_schedule_unlock_irqrestore(lock, flags, cpu);
+    pcpu_schedule_unlock_irq(lock, cpu);
 
     SCHED_OP(old_ops, free_vdata, vpriv_old);
     SCHED_OP(old_ops, free_pdata, ppriv_old, 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 Thu Nov 26 20:46:34 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:46: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 1a23R4-0004FY-RN; Thu, 26 Nov 2015 20:46: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 1a23R3-0004FI-Li
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:33 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	81/06-10715-8AF67565; Thu, 26 Nov 2015 20:46:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1448570791!6651298!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20279 invoked from network); 26 Nov 2015 20:46:32 -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;
	26 Nov 2015 20:46:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23R1-00037W-Cf
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23R1-0000UT-9w
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:31 +0000
Date: Thu, 26 Nov 2015 20:46:31 +0000
Message-Id: <E1a23R1-0000UT-9w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: fix locking for insert_vcpu()
	in credit1 and RTDS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae2f41e3d7e7798537b7ea6dbb9a0c6aeb1179e3
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Nov 24 14:48:34 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 14:48:34 2015 +0100

    sched: fix locking for insert_vcpu() in credit1 and RTDS
    
    The insert_vcpu() hook is handled with inconsistent locking.
    In fact, schedule_cpu_switch() calls the hook with runqueue
    lock held, while sched_move_domain() relies on the hook
    implementations to take the lock themselves (and, since that
    is not done in Credit1 and RTDS, such operation is not safe
    in those cases).
    
    This is fixed as follows:
     - take the lock in the hook implementations, in specific
       schedulers' code;
     - avoid calling insert_vcpu(), for the idle vCPU, in
       schedule_cpu_switch(). In fact, idle vCPUs are set to run
       immediately, and the various schedulers won't insert them
       in their runqueues anyway, even when explicitly asked to.
    
    While there, still in schedule_cpu_switch(), locking with
    _irq() is enough (there's no need to do *_irqsave()).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 xen/common/sched_credit.c |    6 ++++++
 xen/common/sched_rt.c     |    3 +++
 xen/common/schedule.c     |    6 ++----
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 72a2109..496cc45 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -910,10 +910,16 @@ static void
 csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct csched_vcpu *svc = vc->sched_priv;
+    spinlock_t *lock;
+    unsigned long flags;
+
+    lock = vcpu_schedule_lock_irqsave(vc, &flags);
 
     if ( !__vcpu_on_runq(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(svc);
 
+    vcpu_schedule_unlock_irqrestore(lock, flags, vc);
+
     SCHED_STAT_CRANK(vcpu_insert);
 }
 
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 822f23c..3a66c9a 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -622,16 +622,19 @@ rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct rt_vcpu *svc = rt_vcpu(vc);
     s_time_t now = NOW();
+    spinlock_t *lock;
 
     /* not addlocate idle vcpu to dom vcpu list */
     if ( is_idle_vcpu(vc) )
         return;
 
+    lock = vcpu_schedule_lock_irq(vc);
     if ( now >= svc->cur_deadline )
         rt_update_deadline(now, svc);
 
     if ( !__vcpu_on_q(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(ops, svc);
+    vcpu_schedule_unlock_irq(lock, vc);
 
     /* add rt_vcpu svc to scheduler-specific vcpu list of the dom */
     list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 20f5f56..f38df71 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1487,7 +1487,6 @@ void __init scheduler_init(void)
 
 int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
 {
-    unsigned long flags;
     struct vcpu *idle;
     spinlock_t *lock;
     void *ppriv, *ppriv_old, *vpriv, *vpriv_old;
@@ -1508,7 +1507,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
         return -ENOMEM;
     }
 
-    lock = pcpu_schedule_lock_irqsave(cpu, &flags);
+    lock = pcpu_schedule_lock_irq(cpu);
 
     SCHED_OP(old_ops, tick_suspend, cpu);
     vpriv_old = idle->sched_priv;
@@ -1517,9 +1516,8 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
     ppriv_old = per_cpu(schedule_data, cpu).sched_priv;
     per_cpu(schedule_data, cpu).sched_priv = ppriv;
     SCHED_OP(new_ops, tick_resume, cpu);
-    SCHED_OP(new_ops, insert_vcpu, idle);
 
-    pcpu_schedule_unlock_irqrestore(lock, flags, cpu);
+    pcpu_schedule_unlock_irq(lock, cpu);
 
     SCHED_OP(old_ops, free_vdata, vpriv_old);
     SCHED_OP(old_ops, free_pdata, ppriv_old, 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 Thu Nov 26 20:46:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:46:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23RG-0004HQ-3i; Thu, 26 Nov 2015 20:46:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RE-0004HA-1z
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:44 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	F8/3F-16870-3BF67565; Thu, 26 Nov 2015 20:46:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1448570801!6809465!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39830 invoked from network); 26 Nov 2015 20:46:42 -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;
	26 Nov 2015 20:46:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RB-00037f-Nc
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RB-0000Uw-Lf
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:41 +0000
Date: Thu, 26 Nov 2015 20:46:41 +0000
Message-Id: <E1a23RB-0000Uw-Lf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: clarify use cases of
	schedule_cpu_switch()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a8c6c623192e3610033e8c79533bd0995038c4dc
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Nov 24 14:49:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 14:49:09 2015 +0100

    sched: clarify use cases of schedule_cpu_switch()
    
    schedule_cpu_switch() is meant to be only used for moving
    pCPUs from a cpupool to no cpupool, and from there back
    to a cpupool, *not* to move them directly from one cpupool
    to another.
    
    This is something inherent to the way the function is
    implemented and called, but is not that clear, just by the
    look of it.
    
    Make it more evident by:
     - adding commentary and ASSERT()s;
     - update the cpupool per-CPU variable (mapping pCPUs to
       pools) directly in schedule_cpu_switch(), rather than
       in various places in cpupool.c.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/common/cpupool.c  |    7 -------
 xen/common/schedule.c |   31 ++++++++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index e79850b..8e7b723 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -261,19 +261,13 @@ int cpupool_move_domain(struct domain *d, struct cpupool *c)
 static int cpupool_assign_cpu_locked(struct cpupool *c, unsigned int cpu)
 {
     int ret;
-    struct cpupool *old;
     struct domain *d;
 
     if ( (cpupool_moving_cpu == cpu) && (c != cpupool_cpu_moving) )
         return -EBUSY;
-    old = per_cpu(cpupool, cpu);
-    per_cpu(cpupool, cpu) = c;
     ret = schedule_cpu_switch(cpu, c);
     if ( ret )
-    {
-        per_cpu(cpupool, cpu) = old;
         return ret;
-    }
 
     cpumask_clear_cpu(cpu, &cpupool_free_cpus);
     if (cpupool_moving_cpu == cpu)
@@ -326,7 +320,6 @@ static long cpupool_unassign_cpu_helper(void *info)
             cpumask_clear_cpu(cpu, &cpupool_free_cpus);
             goto out;
         }
-        per_cpu(cpupool, cpu) = NULL;
         cpupool_moving_cpu = -1;
         cpupool_put(cpupool_cpu_moving);
         cpupool_cpu_moving = NULL;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index f38df71..92057eb 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1485,6 +1485,17 @@ void __init scheduler_init(void)
         BUG();
 }
 
+/*
+ * Move a pCPU outside of the influence of the scheduler of its current
+ * cpupool, or subject it to the scheduler of a new cpupool.
+ *
+ * For the pCPUs that are removed from their cpupool, their scheduler becomes
+ * &ops (the default scheduler, selected at boot, which also services the
+ * default cpupool). However, as these pCPUs are not really part of any pool,
+ * there won't be any scheduling event on them, not even from the default
+ * scheduler. Basically, they will just sit idle until they are explicitly
+ * added back to a cpupool.
+ */
 int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
 {
     struct vcpu *idle;
@@ -1492,9 +1503,24 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
     void *ppriv, *ppriv_old, *vpriv, *vpriv_old;
     struct scheduler *old_ops = per_cpu(scheduler, cpu);
     struct scheduler *new_ops = (c == NULL) ? &ops : c->sched;
+    struct cpupool *old_pool = per_cpu(cpupool, cpu);
+
+    /*
+     * pCPUs only move from a valid cpupool to free (i.e., out of any pool),
+     * or from free to a valid cpupool. In the former case (which happens when
+     * c is NULL), we want the CPU to have been marked as free already, as
+     * well as to not be valid for the source pool any longer, when we get to
+     * here. In the latter case (which happens when c is a valid cpupool), we
+     * want the CPU to still be marked as free, as well as to not yet be valid
+     * for the destination pool.
+     */
+    ASSERT(c != old_pool && (c != NULL || old_pool != NULL));
+    ASSERT(cpumask_test_cpu(cpu, &cpupool_free_cpus));
+    ASSERT((c == NULL && !cpumask_test_cpu(cpu, old_pool->cpu_valid)) ||
+           (c != NULL && !cpumask_test_cpu(cpu, c->cpu_valid)));
 
     if ( old_ops == new_ops )
-        return 0;
+        goto out;
 
     idle = idle_vcpu[cpu];
     ppriv = SCHED_OP(new_ops, alloc_pdata, cpu);
@@ -1522,6 +1548,9 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
     SCHED_OP(old_ops, free_vdata, vpriv_old);
     SCHED_OP(old_ops, free_pdata, ppriv_old, cpu);
 
+ out:
+    per_cpu(cpupool, cpu) = c;
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:46:46 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:46:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23RG-0004HQ-3i; Thu, 26 Nov 2015 20:46:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RE-0004HA-1z
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:44 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	F8/3F-16870-3BF67565; Thu, 26 Nov 2015 20:46:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1448570801!6809465!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39830 invoked from network); 26 Nov 2015 20:46:42 -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;
	26 Nov 2015 20:46:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RB-00037f-Nc
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RB-0000Uw-Lf
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:41 +0000
Date: Thu, 26 Nov 2015 20:46:41 +0000
Message-Id: <E1a23RB-0000Uw-Lf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: clarify use cases of
	schedule_cpu_switch()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a8c6c623192e3610033e8c79533bd0995038c4dc
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Nov 24 14:49:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 14:49:09 2015 +0100

    sched: clarify use cases of schedule_cpu_switch()
    
    schedule_cpu_switch() is meant to be only used for moving
    pCPUs from a cpupool to no cpupool, and from there back
    to a cpupool, *not* to move them directly from one cpupool
    to another.
    
    This is something inherent to the way the function is
    implemented and called, but is not that clear, just by the
    look of it.
    
    Make it more evident by:
     - adding commentary and ASSERT()s;
     - update the cpupool per-CPU variable (mapping pCPUs to
       pools) directly in schedule_cpu_switch(), rather than
       in various places in cpupool.c.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/common/cpupool.c  |    7 -------
 xen/common/schedule.c |   31 ++++++++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index e79850b..8e7b723 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -261,19 +261,13 @@ int cpupool_move_domain(struct domain *d, struct cpupool *c)
 static int cpupool_assign_cpu_locked(struct cpupool *c, unsigned int cpu)
 {
     int ret;
-    struct cpupool *old;
     struct domain *d;
 
     if ( (cpupool_moving_cpu == cpu) && (c != cpupool_cpu_moving) )
         return -EBUSY;
-    old = per_cpu(cpupool, cpu);
-    per_cpu(cpupool, cpu) = c;
     ret = schedule_cpu_switch(cpu, c);
     if ( ret )
-    {
-        per_cpu(cpupool, cpu) = old;
         return ret;
-    }
 
     cpumask_clear_cpu(cpu, &cpupool_free_cpus);
     if (cpupool_moving_cpu == cpu)
@@ -326,7 +320,6 @@ static long cpupool_unassign_cpu_helper(void *info)
             cpumask_clear_cpu(cpu, &cpupool_free_cpus);
             goto out;
         }
-        per_cpu(cpupool, cpu) = NULL;
         cpupool_moving_cpu = -1;
         cpupool_put(cpupool_cpu_moving);
         cpupool_cpu_moving = NULL;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index f38df71..92057eb 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1485,6 +1485,17 @@ void __init scheduler_init(void)
         BUG();
 }
 
+/*
+ * Move a pCPU outside of the influence of the scheduler of its current
+ * cpupool, or subject it to the scheduler of a new cpupool.
+ *
+ * For the pCPUs that are removed from their cpupool, their scheduler becomes
+ * &ops (the default scheduler, selected at boot, which also services the
+ * default cpupool). However, as these pCPUs are not really part of any pool,
+ * there won't be any scheduling event on them, not even from the default
+ * scheduler. Basically, they will just sit idle until they are explicitly
+ * added back to a cpupool.
+ */
 int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
 {
     struct vcpu *idle;
@@ -1492,9 +1503,24 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
     void *ppriv, *ppriv_old, *vpriv, *vpriv_old;
     struct scheduler *old_ops = per_cpu(scheduler, cpu);
     struct scheduler *new_ops = (c == NULL) ? &ops : c->sched;
+    struct cpupool *old_pool = per_cpu(cpupool, cpu);
+
+    /*
+     * pCPUs only move from a valid cpupool to free (i.e., out of any pool),
+     * or from free to a valid cpupool. In the former case (which happens when
+     * c is NULL), we want the CPU to have been marked as free already, as
+     * well as to not be valid for the source pool any longer, when we get to
+     * here. In the latter case (which happens when c is a valid cpupool), we
+     * want the CPU to still be marked as free, as well as to not yet be valid
+     * for the destination pool.
+     */
+    ASSERT(c != old_pool && (c != NULL || old_pool != NULL));
+    ASSERT(cpumask_test_cpu(cpu, &cpupool_free_cpus));
+    ASSERT((c == NULL && !cpumask_test_cpu(cpu, old_pool->cpu_valid)) ||
+           (c != NULL && !cpumask_test_cpu(cpu, c->cpu_valid)));
 
     if ( old_ops == new_ops )
-        return 0;
+        goto out;
 
     idle = idle_vcpu[cpu];
     ppriv = SCHED_OP(new_ops, alloc_pdata, cpu);
@@ -1522,6 +1548,9 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c)
     SCHED_OP(old_ops, free_vdata, vpriv_old);
     SCHED_OP(old_ops, free_pdata, ppriv_old, cpu);
 
+ out:
+    per_cpu(cpupool, cpu) = c;
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:46:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:46:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23RQ-0004Iz-8K; Thu, 26 Nov 2015 20:46:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RO-0004Il-Gb
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:54 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	21/11-00475-DBF67565; Thu, 26 Nov 2015 20:46:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448570812!6648989!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62957 invoked from network); 26 Nov 2015 20:46:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:46:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RL-00037n-Vs
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RL-0000VQ-Uo
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:51 +0000
Date: Thu, 26 Nov 2015 20:46:51 +0000
Message-Id: <E1a23RL-0000VQ-Uo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: better handle (not) inserting
	idle vCPUs in runqueues
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b53bb4ab3c9bd5eccde88a5175cf72589ba6d52
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Nov 24 14:49:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 14:49:47 2015 +0100

    sched: better handle (not) inserting idle vCPUs in runqueues
    
    Idle vCPUs are set to run immediately, as a part of their
    own initialization, so we shouldn't even try to put them
    in a runqueue. In fact, no scheduler does that, even when
    asked to (that is rather explicit in Credit2 and RTDS, a
    bit less evident in Credit1).
    
    Let's make things look as follows:
     - in generic code, explicitly avoid even trying to
       insert idle vCPUs in runqueues;
     - in specific schedulers' code, enforce that.
    
    Note that, as csched_vcpu_insert() is no longer being
    called, during boot (from sched_init_vcpu()) we can
    safely avoid saving the flags when taking the runqueue
    lock.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched_credit.c  |    7 ++++---
 xen/common/sched_credit2.c |   25 ++++++++++---------------
 xen/common/sched_rt.c      |    4 +---
 xen/common/schedule.c      |   20 +++++++++++---------
 4 files changed, 26 insertions(+), 30 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 496cc45..0dce790 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -911,14 +911,15 @@ csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct csched_vcpu *svc = vc->sched_priv;
     spinlock_t *lock;
-    unsigned long flags;
 
-    lock = vcpu_schedule_lock_irqsave(vc, &flags);
+    BUG_ON( is_idle_vcpu(vc) );
+
+    lock = vcpu_schedule_lock_irq(vc);
 
     if ( !__vcpu_on_runq(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(svc);
 
-    vcpu_schedule_unlock_irqrestore(lock, flags, vc);
+    vcpu_schedule_unlock_irq(lock, vc);
 
     SCHED_STAT_CRANK(vcpu_insert);
 }
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index fc51a75..556ca0f 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -868,30 +868,25 @@ csched2_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct csched2_vcpu *svc = vc->sched_priv;
     struct csched2_dom * const sdom = svc->sdom;
+    spinlock_t *lock;
 
     printk("%s: Inserting %pv\n", __func__, vc);
 
-    /* NB: On boot, idle vcpus are inserted before alloc_pdata() has
-     * been called for that cpu.
-     */
-    if ( ! is_idle_vcpu(vc) )
-    {
-        spinlock_t *lock;
+    BUG_ON(is_idle_vcpu(vc));
 
-        /* FIXME: Do we need the private lock here? */
-        list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
+    /* FIXME: Do we need the private lock here? */
+    list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
 
-        /* Add vcpu to runqueue of initial processor */
-        lock = vcpu_schedule_lock_irq(vc);
+    /* Add vcpu to runqueue of initial processor */
+    lock = vcpu_schedule_lock_irq(vc);
 
-        runq_assign(ops, vc);
+    runq_assign(ops, vc);
 
-        vcpu_schedule_unlock_irq(lock, vc);
+    vcpu_schedule_unlock_irq(lock, vc);
 
-        sdom->nr_vcpus++;
+    sdom->nr_vcpus++;
 
-        SCHED_STAT_CRANK(vcpu_insert);
-    }
+    SCHED_STAT_CRANK(vcpu_insert);
 
     CSCHED2_VCPU_CHECK(vc);
 }
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 3a66c9a..cbe7b17 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -624,9 +624,7 @@ rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
     s_time_t now = NOW();
     spinlock_t *lock;
 
-    /* not addlocate idle vcpu to dom vcpu list */
-    if ( is_idle_vcpu(vc) )
-        return;
+    BUG_ON( is_idle_vcpu(vc) );
 
     lock = vcpu_schedule_lock_irq(vc);
     if ( now >= svc->cur_deadline )
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 92057eb..c195129 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -240,20 +240,22 @@ int sched_init_vcpu(struct vcpu *v, unsigned int processor)
     init_timer(&v->poll_timer, poll_timer_fn,
                v, v->processor);
 
-    /* Idle VCPUs are scheduled immediately. */
+    v->sched_priv = SCHED_OP(DOM2OP(d), alloc_vdata, v, d->sched_priv);
+    if ( v->sched_priv == NULL )
+        return 1;
+
+    TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id);
+
+    /* Idle VCPUs are scheduled immediately, so don't put them in runqueue. */
     if ( is_idle_domain(d) )
     {
         per_cpu(schedule_data, v->processor).curr = v;
         v->is_running = 1;
     }
-
-    TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id);
-
-    v->sched_priv = SCHED_OP(DOM2OP(d), alloc_vdata, v, d->sched_priv);
-    if ( v->sched_priv == NULL )
-        return 1;
-
-    SCHED_OP(DOM2OP(d), insert_vcpu, v);
+    else
+    {
+        SCHED_OP(DOM2OP(d), insert_vcpu, v);
+    }
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:46:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:46:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23RQ-0004Iz-8K; Thu, 26 Nov 2015 20:46:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RO-0004Il-Gb
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:54 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	21/11-00475-DBF67565; Thu, 26 Nov 2015 20:46:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448570812!6648989!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62957 invoked from network); 26 Nov 2015 20:46:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:46:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RL-00037n-Vs
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RL-0000VQ-Uo
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:46:51 +0000
Date: Thu, 26 Nov 2015 20:46:51 +0000
Message-Id: <E1a23RL-0000VQ-Uo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: better handle (not) inserting
	idle vCPUs in runqueues
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b53bb4ab3c9bd5eccde88a5175cf72589ba6d52
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Nov 24 14:49:47 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 14:49:47 2015 +0100

    sched: better handle (not) inserting idle vCPUs in runqueues
    
    Idle vCPUs are set to run immediately, as a part of their
    own initialization, so we shouldn't even try to put them
    in a runqueue. In fact, no scheduler does that, even when
    asked to (that is rather explicit in Credit2 and RTDS, a
    bit less evident in Credit1).
    
    Let's make things look as follows:
     - in generic code, explicitly avoid even trying to
       insert idle vCPUs in runqueues;
     - in specific schedulers' code, enforce that.
    
    Note that, as csched_vcpu_insert() is no longer being
    called, during boot (from sched_init_vcpu()) we can
    safely avoid saving the flags when taking the runqueue
    lock.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched_credit.c  |    7 ++++---
 xen/common/sched_credit2.c |   25 ++++++++++---------------
 xen/common/sched_rt.c      |    4 +---
 xen/common/schedule.c      |   20 +++++++++++---------
 4 files changed, 26 insertions(+), 30 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 496cc45..0dce790 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -911,14 +911,15 @@ csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct csched_vcpu *svc = vc->sched_priv;
     spinlock_t *lock;
-    unsigned long flags;
 
-    lock = vcpu_schedule_lock_irqsave(vc, &flags);
+    BUG_ON( is_idle_vcpu(vc) );
+
+    lock = vcpu_schedule_lock_irq(vc);
 
     if ( !__vcpu_on_runq(svc) && vcpu_runnable(vc) && !vc->is_running )
         __runq_insert(svc);
 
-    vcpu_schedule_unlock_irqrestore(lock, flags, vc);
+    vcpu_schedule_unlock_irq(lock, vc);
 
     SCHED_STAT_CRANK(vcpu_insert);
 }
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index fc51a75..556ca0f 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -868,30 +868,25 @@ csched2_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 {
     struct csched2_vcpu *svc = vc->sched_priv;
     struct csched2_dom * const sdom = svc->sdom;
+    spinlock_t *lock;
 
     printk("%s: Inserting %pv\n", __func__, vc);
 
-    /* NB: On boot, idle vcpus are inserted before alloc_pdata() has
-     * been called for that cpu.
-     */
-    if ( ! is_idle_vcpu(vc) )
-    {
-        spinlock_t *lock;
+    BUG_ON(is_idle_vcpu(vc));
 
-        /* FIXME: Do we need the private lock here? */
-        list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
+    /* FIXME: Do we need the private lock here? */
+    list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
 
-        /* Add vcpu to runqueue of initial processor */
-        lock = vcpu_schedule_lock_irq(vc);
+    /* Add vcpu to runqueue of initial processor */
+    lock = vcpu_schedule_lock_irq(vc);
 
-        runq_assign(ops, vc);
+    runq_assign(ops, vc);
 
-        vcpu_schedule_unlock_irq(lock, vc);
+    vcpu_schedule_unlock_irq(lock, vc);
 
-        sdom->nr_vcpus++;
+    sdom->nr_vcpus++;
 
-        SCHED_STAT_CRANK(vcpu_insert);
-    }
+    SCHED_STAT_CRANK(vcpu_insert);
 
     CSCHED2_VCPU_CHECK(vc);
 }
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index 3a66c9a..cbe7b17 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -624,9 +624,7 @@ rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
     s_time_t now = NOW();
     spinlock_t *lock;
 
-    /* not addlocate idle vcpu to dom vcpu list */
-    if ( is_idle_vcpu(vc) )
-        return;
+    BUG_ON( is_idle_vcpu(vc) );
 
     lock = vcpu_schedule_lock_irq(vc);
     if ( now >= svc->cur_deadline )
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 92057eb..c195129 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -240,20 +240,22 @@ int sched_init_vcpu(struct vcpu *v, unsigned int processor)
     init_timer(&v->poll_timer, poll_timer_fn,
                v, v->processor);
 
-    /* Idle VCPUs are scheduled immediately. */
+    v->sched_priv = SCHED_OP(DOM2OP(d), alloc_vdata, v, d->sched_priv);
+    if ( v->sched_priv == NULL )
+        return 1;
+
+    TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id);
+
+    /* Idle VCPUs are scheduled immediately, so don't put them in runqueue. */
     if ( is_idle_domain(d) )
     {
         per_cpu(schedule_data, v->processor).curr = v;
         v->is_running = 1;
     }
-
-    TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id);
-
-    v->sched_priv = SCHED_OP(DOM2OP(d), alloc_vdata, v, d->sched_priv);
-    if ( v->sched_priv == NULL )
-        return 1;
-
-    SCHED_OP(DOM2OP(d), insert_vcpu, v);
+    else
+    {
+        SCHED_OP(DOM2OP(d), insert_vcpu, v);
+    }
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:47:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:47: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 1a23Rd-0004Ka-CP; Thu, 26 Nov 2015 20:47: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 1a23Rb-0004KR-J8
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:07 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	4F/36-10715-ACF67565; Thu, 26 Nov 2015 20:47:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1448570825!3792289!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45859 invoked from network); 26 Nov 2015 20:47:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:47:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RW-00038N-BA
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RW-0000W2-6g
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:02 +0000
Date: Thu, 26 Nov 2015 20:47:02 +0000
Message-Id: <E1a23RW-0000W2-6g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: get rid of the per domain vCPU
	list in RTDS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6042257390500f445980d6b1c98aaa660741cc5
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Nov 24 14:50:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 14:50:09 2015 +0100

    sched: get rid of the per domain vCPU list in RTDS
    
    As, curently, there is no reason for bothering having
    it and keeping it updated.
    
    In fact, it is only used for dumping and changing
    vCPUs parameters, but that can be achieved easily with
    for_each_vcpu.
    
    While there, take care of the case when
    XEN_DOMCTL_SCHEDOP_getinfo is called but no vCPUs have
    been allocated yet (by returning the default scheduling
    parameters).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
---
 xen/common/sched_rt.c |   54 +++++++++++++++++++++++-------------------------
 1 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index cbe7b17..3f1d047 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -160,7 +160,6 @@ struct rt_private {
  */
 struct rt_vcpu {
     struct list_head q_elem;    /* on the runq/depletedq list */
-    struct list_head sdom_elem; /* on the domain VCPU list */
 
     /* Up-pointers */
     struct rt_dom *sdom;
@@ -182,7 +181,6 @@ struct rt_vcpu {
  * Domain
  */
 struct rt_dom {
-    struct list_head vcpu;      /* link its VCPUs */
     struct list_head sdom_elem; /* link list on rt_priv */
     struct domain *dom;         /* pointer to upper domain */
 };
@@ -290,7 +288,7 @@ rt_dump_pcpu(const struct scheduler *ops, int cpu)
 static void
 rt_dump(const struct scheduler *ops)
 {
-    struct list_head *iter_sdom, *iter_svc, *runq, *depletedq, *iter;
+    struct list_head *runq, *depletedq, *iter;
     struct rt_private *prv = rt_priv(ops);
     struct rt_vcpu *svc;
     struct rt_dom *sdom;
@@ -319,14 +317,16 @@ rt_dump(const struct scheduler *ops)
     }
 
     printk("Domain info:\n");
-    list_for_each( iter_sdom, &prv->sdom )
+    list_for_each( iter, &prv->sdom )
     {
-        sdom = list_entry(iter_sdom, struct rt_dom, sdom_elem);
+        struct vcpu *v;
+
+        sdom = list_entry(iter, struct rt_dom, sdom_elem);
         printk("\tdomain: %d\n", sdom->dom->domain_id);
 
-        list_for_each( iter_svc, &sdom->vcpu )
+        for_each_vcpu ( sdom->dom, v )
         {
-            svc = list_entry(iter_svc, struct rt_vcpu, sdom_elem);
+            svc = rt_vcpu(v);
             rt_dump_vcpu(ops, svc);
         }
     }
@@ -527,7 +527,6 @@ rt_alloc_domdata(const struct scheduler *ops, struct domain *dom)
     if ( sdom == NULL )
         return NULL;
 
-    INIT_LIST_HEAD(&sdom->vcpu);
     INIT_LIST_HEAD(&sdom->sdom_elem);
     sdom->dom = dom;
 
@@ -587,7 +586,6 @@ rt_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
         return NULL;
 
     INIT_LIST_HEAD(&svc->q_elem);
-    INIT_LIST_HEAD(&svc->sdom_elem);
     svc->flags = 0U;
     svc->sdom = dd;
     svc->vcpu = vc;
@@ -614,8 +612,7 @@ rt_free_vdata(const struct scheduler *ops, void *priv)
  * This function is called in sched_move_domain() in schedule.c
  * When move a domain to a new cpupool.
  * It inserts vcpus of moving domain to the scheduler's RunQ in
- * dest. cpupool; and insert rt_vcpu svc to scheduler-specific
- * vcpu list of the dom
+ * dest. cpupool.
  */
 static void
 rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
@@ -634,15 +631,11 @@ rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
         __runq_insert(ops, svc);
     vcpu_schedule_unlock_irq(lock, vc);
 
-    /* add rt_vcpu svc to scheduler-specific vcpu list of the dom */
-    list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
-
     SCHED_STAT_CRANK(vcpu_insert);
 }
 
 /*
- * Remove rt_vcpu svc from the old scheduler in source cpupool; and
- * Remove rt_vcpu svc from scheduler-specific vcpu list of the dom
+ * Remove rt_vcpu svc from the old scheduler in source cpupool.
  */
 static void
 rt_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
@@ -659,9 +652,6 @@ rt_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     if ( __vcpu_on_q(svc) )
         __q_remove(svc);
     vcpu_schedule_unlock_irq(lock, vc);
-
-    if ( !is_idle_vcpu(vc) )
-        list_del_init(&svc->sdom_elem);
 }
 
 /*
@@ -1135,20 +1125,28 @@ rt_dom_cntl(
     struct xen_domctl_scheduler_op *op)
 {
     struct rt_private *prv = rt_priv(ops);
-    struct rt_dom * const sdom = rt_dom(d);
     struct rt_vcpu *svc;
-    struct list_head *iter;
+    struct vcpu *v;
     unsigned long flags;
     int rc = 0;
 
     switch ( op->cmd )
     {
     case XEN_DOMCTL_SCHEDOP_getinfo:
-        spin_lock_irqsave(&prv->lock, flags);
-        svc = list_entry(sdom->vcpu.next, struct rt_vcpu, sdom_elem);
-        op->u.rtds.period = svc->period / MICROSECS(1); /* transfer to us */
-        op->u.rtds.budget = svc->budget / MICROSECS(1);
-        spin_unlock_irqrestore(&prv->lock, flags);
+        if ( d->max_vcpus > 0 )
+        {
+            spin_lock_irqsave(&prv->lock, flags);
+            svc = rt_vcpu(d->vcpu[0]);
+            op->u.rtds.period = svc->period / MICROSECS(1);
+            op->u.rtds.budget = svc->budget / MICROSECS(1);
+            spin_unlock_irqrestore(&prv->lock, flags);
+        }
+        else
+        {
+            /* If we don't have vcpus yet, let's just return the defaults. */
+            op->u.rtds.period = RTDS_DEFAULT_PERIOD;
+            op->u.rtds.budget = RTDS_DEFAULT_BUDGET;
+        }
         break;
     case XEN_DOMCTL_SCHEDOP_putinfo:
         if ( op->u.rtds.period == 0 || op->u.rtds.budget == 0 )
@@ -1157,9 +1155,9 @@ rt_dom_cntl(
             break;
         }
         spin_lock_irqsave(&prv->lock, flags);
-        list_for_each( iter, &sdom->vcpu )
+        for_each_vcpu ( d, v )
         {
-            svc = list_entry(iter, struct rt_vcpu, sdom_elem);
+            svc = rt_vcpu(v);
             svc->period = MICROSECS(op->u.rtds.period); /* transfer to nanosec */
             svc->budget = MICROSECS(op->u.rtds.budget);
         }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:47:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:47: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 1a23Rd-0004Ka-CP; Thu, 26 Nov 2015 20:47: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 1a23Rb-0004KR-J8
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:07 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	4F/36-10715-ACF67565; Thu, 26 Nov 2015 20:47:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1448570825!3792289!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 45859 invoked from network); 26 Nov 2015 20:47:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:47:06 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RW-00038N-BA
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23RW-0000W2-6g
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:02 +0000
Date: Thu, 26 Nov 2015 20:47:02 +0000
Message-Id: <E1a23RW-0000W2-6g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: get rid of the per domain vCPU
	list in RTDS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6042257390500f445980d6b1c98aaa660741cc5
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Nov 24 14:50:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 14:50:09 2015 +0100

    sched: get rid of the per domain vCPU list in RTDS
    
    As, curently, there is no reason for bothering having
    it and keeping it updated.
    
    In fact, it is only used for dumping and changing
    vCPUs parameters, but that can be achieved easily with
    for_each_vcpu.
    
    While there, take care of the case when
    XEN_DOMCTL_SCHEDOP_getinfo is called but no vCPUs have
    been allocated yet (by returning the default scheduling
    parameters).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
---
 xen/common/sched_rt.c |   54 +++++++++++++++++++++++-------------------------
 1 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index cbe7b17..3f1d047 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -160,7 +160,6 @@ struct rt_private {
  */
 struct rt_vcpu {
     struct list_head q_elem;    /* on the runq/depletedq list */
-    struct list_head sdom_elem; /* on the domain VCPU list */
 
     /* Up-pointers */
     struct rt_dom *sdom;
@@ -182,7 +181,6 @@ struct rt_vcpu {
  * Domain
  */
 struct rt_dom {
-    struct list_head vcpu;      /* link its VCPUs */
     struct list_head sdom_elem; /* link list on rt_priv */
     struct domain *dom;         /* pointer to upper domain */
 };
@@ -290,7 +288,7 @@ rt_dump_pcpu(const struct scheduler *ops, int cpu)
 static void
 rt_dump(const struct scheduler *ops)
 {
-    struct list_head *iter_sdom, *iter_svc, *runq, *depletedq, *iter;
+    struct list_head *runq, *depletedq, *iter;
     struct rt_private *prv = rt_priv(ops);
     struct rt_vcpu *svc;
     struct rt_dom *sdom;
@@ -319,14 +317,16 @@ rt_dump(const struct scheduler *ops)
     }
 
     printk("Domain info:\n");
-    list_for_each( iter_sdom, &prv->sdom )
+    list_for_each( iter, &prv->sdom )
     {
-        sdom = list_entry(iter_sdom, struct rt_dom, sdom_elem);
+        struct vcpu *v;
+
+        sdom = list_entry(iter, struct rt_dom, sdom_elem);
         printk("\tdomain: %d\n", sdom->dom->domain_id);
 
-        list_for_each( iter_svc, &sdom->vcpu )
+        for_each_vcpu ( sdom->dom, v )
         {
-            svc = list_entry(iter_svc, struct rt_vcpu, sdom_elem);
+            svc = rt_vcpu(v);
             rt_dump_vcpu(ops, svc);
         }
     }
@@ -527,7 +527,6 @@ rt_alloc_domdata(const struct scheduler *ops, struct domain *dom)
     if ( sdom == NULL )
         return NULL;
 
-    INIT_LIST_HEAD(&sdom->vcpu);
     INIT_LIST_HEAD(&sdom->sdom_elem);
     sdom->dom = dom;
 
@@ -587,7 +586,6 @@ rt_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
         return NULL;
 
     INIT_LIST_HEAD(&svc->q_elem);
-    INIT_LIST_HEAD(&svc->sdom_elem);
     svc->flags = 0U;
     svc->sdom = dd;
     svc->vcpu = vc;
@@ -614,8 +612,7 @@ rt_free_vdata(const struct scheduler *ops, void *priv)
  * This function is called in sched_move_domain() in schedule.c
  * When move a domain to a new cpupool.
  * It inserts vcpus of moving domain to the scheduler's RunQ in
- * dest. cpupool; and insert rt_vcpu svc to scheduler-specific
- * vcpu list of the dom
+ * dest. cpupool.
  */
 static void
 rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
@@ -634,15 +631,11 @@ rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
         __runq_insert(ops, svc);
     vcpu_schedule_unlock_irq(lock, vc);
 
-    /* add rt_vcpu svc to scheduler-specific vcpu list of the dom */
-    list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
-
     SCHED_STAT_CRANK(vcpu_insert);
 }
 
 /*
- * Remove rt_vcpu svc from the old scheduler in source cpupool; and
- * Remove rt_vcpu svc from scheduler-specific vcpu list of the dom
+ * Remove rt_vcpu svc from the old scheduler in source cpupool.
  */
 static void
 rt_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
@@ -659,9 +652,6 @@ rt_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     if ( __vcpu_on_q(svc) )
         __q_remove(svc);
     vcpu_schedule_unlock_irq(lock, vc);
-
-    if ( !is_idle_vcpu(vc) )
-        list_del_init(&svc->sdom_elem);
 }
 
 /*
@@ -1135,20 +1125,28 @@ rt_dom_cntl(
     struct xen_domctl_scheduler_op *op)
 {
     struct rt_private *prv = rt_priv(ops);
-    struct rt_dom * const sdom = rt_dom(d);
     struct rt_vcpu *svc;
-    struct list_head *iter;
+    struct vcpu *v;
     unsigned long flags;
     int rc = 0;
 
     switch ( op->cmd )
     {
     case XEN_DOMCTL_SCHEDOP_getinfo:
-        spin_lock_irqsave(&prv->lock, flags);
-        svc = list_entry(sdom->vcpu.next, struct rt_vcpu, sdom_elem);
-        op->u.rtds.period = svc->period / MICROSECS(1); /* transfer to us */
-        op->u.rtds.budget = svc->budget / MICROSECS(1);
-        spin_unlock_irqrestore(&prv->lock, flags);
+        if ( d->max_vcpus > 0 )
+        {
+            spin_lock_irqsave(&prv->lock, flags);
+            svc = rt_vcpu(d->vcpu[0]);
+            op->u.rtds.period = svc->period / MICROSECS(1);
+            op->u.rtds.budget = svc->budget / MICROSECS(1);
+            spin_unlock_irqrestore(&prv->lock, flags);
+        }
+        else
+        {
+            /* If we don't have vcpus yet, let's just return the defaults. */
+            op->u.rtds.period = RTDS_DEFAULT_PERIOD;
+            op->u.rtds.budget = RTDS_DEFAULT_BUDGET;
+        }
         break;
     case XEN_DOMCTL_SCHEDOP_putinfo:
         if ( op->u.rtds.period == 0 || op->u.rtds.budget == 0 )
@@ -1157,9 +1155,9 @@ rt_dom_cntl(
             break;
         }
         spin_lock_irqsave(&prv->lock, flags);
-        list_for_each( iter, &sdom->vcpu )
+        for_each_vcpu ( d, v )
         {
-            svc = list_entry(iter, struct rt_vcpu, sdom_elem);
+            svc = rt_vcpu(v);
             svc->period = MICROSECS(op->u.rtds.period); /* transfer to nanosec */
             svc->budget = MICROSECS(op->u.rtds.budget);
         }
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:47:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:47: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 1a23Rm-0004Lw-H3; Thu, 26 Nov 2015 20:47:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rl-0004Ln-Qr
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:18 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	BF/AF-16870-5DF67565; Thu, 26 Nov 2015 20:47:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1448570835!6810104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46851 invoked from network); 26 Nov 2015 20:47:16 -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;
	26 Nov 2015 20:47:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rj-00038V-Bq
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rj-0000WZ-A1
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:15 +0000
Date: Thu, 26 Nov 2015 20:47:15 +0000
Message-Id: <E1a23Rj-0000WZ-A1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: get rid of the per domain vCPU
	list in Credit2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb6be0d5c7e9837154077e737e97e68849d1ab4c
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Nov 24 14:50:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 14:50:30 2015 +0100

    sched: get rid of the per domain vCPU list in Credit2
    
    As, curently, there is no reason for bothering having
    it and keeping it updated.
    
    In fact, it is only used for dumping and changing
    vCPUs parameters, but that can be achieved easily with
    for_each_vcpu.
    
    While there, improve alignment of comments, ad
    add a const qualifier to a pointer, making things
    more consistent with what happens everywhere else
    in the source file.
    
    This also allows us to kill one of the remaining
    FIXMEs in the code, which is always good.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/common/sched_credit2.c |   34 +++++++++++-----------------------
 1 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 556ca0f..3c49ffa 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -234,9 +234,8 @@ struct csched2_private {
  * Virtual CPU
  */
 struct csched2_vcpu {
-    struct list_head rqd_elem;  /* On the runqueue data list */
-    struct list_head sdom_elem; /* On the domain vcpu list */
-    struct list_head runq_elem; /* On the runqueue         */
+    struct list_head rqd_elem;         /* On the runqueue data list  */
+    struct list_head runq_elem;        /* On the runqueue            */
     struct csched2_runqueue_data *rqd; /* Up-pointer to the runqueue */
 
     /* Up-pointers */
@@ -261,7 +260,6 @@ struct csched2_vcpu {
  * Domain
  */
 struct csched2_dom {
-    struct list_head vcpu;
     struct list_head sdom_elem;
     struct domain *dom;
     uint16_t weight;
@@ -770,7 +768,6 @@ csched2_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
         return NULL;
 
     INIT_LIST_HEAD(&svc->rqd_elem);
-    INIT_LIST_HEAD(&svc->sdom_elem);
     INIT_LIST_HEAD(&svc->runq_elem);
 
     svc->sdom = dd;
@@ -874,9 +871,6 @@ csched2_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 
     BUG_ON(is_idle_vcpu(vc));
 
-    /* FIXME: Do we need the private lock here? */
-    list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
-
     /* Add vcpu to runqueue of initial processor */
     lock = vcpu_schedule_lock_irq(vc);
 
@@ -921,10 +915,6 @@ csched2_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
 
         vcpu_schedule_unlock_irq(lock, vc);
 
-        /* Remove from sdom list.  Don't need a lock for this, as it's called
-         * syncronously when nothing else can happen. */
-        list_del_init(&svc->sdom_elem);
-
         svc->sdom->nr_vcpus--;
     }
 }
@@ -1441,7 +1431,7 @@ csched2_dom_cntl(
 
         if ( op->u.credit2.weight != 0 )
         {
-            struct list_head *iter;
+            struct vcpu *v;
             int old_weight;
 
             old_weight = sdom->weight;
@@ -1449,9 +1439,9 @@ csched2_dom_cntl(
             sdom->weight = op->u.credit2.weight;
 
             /* Update weights for vcpus, and max_weight for runqueues on which they reside */
-            list_for_each ( iter, &sdom->vcpu )
+            for_each_vcpu ( d, v )
             {
-                struct csched2_vcpu *svc = list_entry(iter, struct csched2_vcpu, sdom_elem);
+                struct csched2_vcpu *svc = CSCHED2_VCPU(v);
 
                 /* NB: Locking order is important here.  Because we grab this lock here, we
                  * must never lock csched2_priv.lock if we're holding a runqueue lock.
@@ -1485,7 +1475,6 @@ csched2_alloc_domdata(const struct scheduler *ops, struct domain *dom)
         return NULL;
 
     /* Initialize credit and weight */
-    INIT_LIST_HEAD(&sdom->vcpu);
     INIT_LIST_HEAD(&sdom->sdom_elem);
     sdom->dom = dom;
     sdom->weight = CSCHED2_DEFAULT_WEIGHT;
@@ -1537,9 +1526,7 @@ csched2_free_domdata(const struct scheduler *ops, void *data)
 static void
 csched2_dom_destroy(const struct scheduler *ops, struct domain *dom)
 {
-    struct csched2_dom *sdom = CSCHED2_DOM(dom);
-
-    BUG_ON(!list_empty(&sdom->vcpu));
+    BUG_ON(CSCHED2_DOM(dom)->nr_vcpus > 0);
 
     csched2_free_domdata(ops, CSCHED2_DOM(dom));
 }
@@ -1879,7 +1866,7 @@ csched2_dump_pcpu(const struct scheduler *ops, int cpu)
 static void
 csched2_dump(const struct scheduler *ops)
 {
-    struct list_head *iter_sdom, *iter_svc;
+    struct list_head *iter_sdom;
     struct csched2_private *prv = CSCHED2_PRIV(ops);
     unsigned long flags;
     int i, loop;
@@ -1924,6 +1911,8 @@ csched2_dump(const struct scheduler *ops)
     list_for_each( iter_sdom, &prv->sdom )
     {
         struct csched2_dom *sdom;
+        struct vcpu *v;
+
         sdom = list_entry(iter_sdom, struct csched2_dom, sdom_elem);
 
         printk("\tDomain: %d w %d v %d\n",
@@ -1931,12 +1920,11 @@ csched2_dump(const struct scheduler *ops)
                sdom->weight,
                sdom->nr_vcpus);
 
-        list_for_each( iter_svc, &sdom->vcpu )
+        for_each_vcpu( sdom->dom, v )
         {
-            struct csched2_vcpu *svc;
+            struct csched2_vcpu * const svc = CSCHED2_VCPU(v);
             spinlock_t *lock;
 
-            svc = list_entry(iter_svc, struct csched2_vcpu, sdom_elem);
             lock = vcpu_schedule_lock(svc->vcpu);
 
             printk("\t%3d: ", ++loop);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:47:18 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:47: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 1a23Rm-0004Lw-H3; Thu, 26 Nov 2015 20:47:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rl-0004Ln-Qr
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:18 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	BF/AF-16870-5DF67565; Thu, 26 Nov 2015 20:47:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1448570835!6810104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46851 invoked from network); 26 Nov 2015 20:47:16 -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;
	26 Nov 2015 20:47:16 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rj-00038V-Bq
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rj-0000WZ-A1
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:15 +0000
Date: Thu, 26 Nov 2015 20:47:15 +0000
Message-Id: <E1a23Rj-0000WZ-A1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: get rid of the per domain vCPU
	list in Credit2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb6be0d5c7e9837154077e737e97e68849d1ab4c
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Tue Nov 24 14:50:30 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 14:50:30 2015 +0100

    sched: get rid of the per domain vCPU list in Credit2
    
    As, curently, there is no reason for bothering having
    it and keeping it updated.
    
    In fact, it is only used for dumping and changing
    vCPUs parameters, but that can be achieved easily with
    for_each_vcpu.
    
    While there, improve alignment of comments, ad
    add a const qualifier to a pointer, making things
    more consistent with what happens everywhere else
    in the source file.
    
    This also allows us to kill one of the remaining
    FIXMEs in the code, which is always good.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/common/sched_credit2.c |   34 +++++++++++-----------------------
 1 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 556ca0f..3c49ffa 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -234,9 +234,8 @@ struct csched2_private {
  * Virtual CPU
  */
 struct csched2_vcpu {
-    struct list_head rqd_elem;  /* On the runqueue data list */
-    struct list_head sdom_elem; /* On the domain vcpu list */
-    struct list_head runq_elem; /* On the runqueue         */
+    struct list_head rqd_elem;         /* On the runqueue data list  */
+    struct list_head runq_elem;        /* On the runqueue            */
     struct csched2_runqueue_data *rqd; /* Up-pointer to the runqueue */
 
     /* Up-pointers */
@@ -261,7 +260,6 @@ struct csched2_vcpu {
  * Domain
  */
 struct csched2_dom {
-    struct list_head vcpu;
     struct list_head sdom_elem;
     struct domain *dom;
     uint16_t weight;
@@ -770,7 +768,6 @@ csched2_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
         return NULL;
 
     INIT_LIST_HEAD(&svc->rqd_elem);
-    INIT_LIST_HEAD(&svc->sdom_elem);
     INIT_LIST_HEAD(&svc->runq_elem);
 
     svc->sdom = dd;
@@ -874,9 +871,6 @@ csched2_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
 
     BUG_ON(is_idle_vcpu(vc));
 
-    /* FIXME: Do we need the private lock here? */
-    list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
-
     /* Add vcpu to runqueue of initial processor */
     lock = vcpu_schedule_lock_irq(vc);
 
@@ -921,10 +915,6 @@ csched2_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
 
         vcpu_schedule_unlock_irq(lock, vc);
 
-        /* Remove from sdom list.  Don't need a lock for this, as it's called
-         * syncronously when nothing else can happen. */
-        list_del_init(&svc->sdom_elem);
-
         svc->sdom->nr_vcpus--;
     }
 }
@@ -1441,7 +1431,7 @@ csched2_dom_cntl(
 
         if ( op->u.credit2.weight != 0 )
         {
-            struct list_head *iter;
+            struct vcpu *v;
             int old_weight;
 
             old_weight = sdom->weight;
@@ -1449,9 +1439,9 @@ csched2_dom_cntl(
             sdom->weight = op->u.credit2.weight;
 
             /* Update weights for vcpus, and max_weight for runqueues on which they reside */
-            list_for_each ( iter, &sdom->vcpu )
+            for_each_vcpu ( d, v )
             {
-                struct csched2_vcpu *svc = list_entry(iter, struct csched2_vcpu, sdom_elem);
+                struct csched2_vcpu *svc = CSCHED2_VCPU(v);
 
                 /* NB: Locking order is important here.  Because we grab this lock here, we
                  * must never lock csched2_priv.lock if we're holding a runqueue lock.
@@ -1485,7 +1475,6 @@ csched2_alloc_domdata(const struct scheduler *ops, struct domain *dom)
         return NULL;
 
     /* Initialize credit and weight */
-    INIT_LIST_HEAD(&sdom->vcpu);
     INIT_LIST_HEAD(&sdom->sdom_elem);
     sdom->dom = dom;
     sdom->weight = CSCHED2_DEFAULT_WEIGHT;
@@ -1537,9 +1526,7 @@ csched2_free_domdata(const struct scheduler *ops, void *data)
 static void
 csched2_dom_destroy(const struct scheduler *ops, struct domain *dom)
 {
-    struct csched2_dom *sdom = CSCHED2_DOM(dom);
-
-    BUG_ON(!list_empty(&sdom->vcpu));
+    BUG_ON(CSCHED2_DOM(dom)->nr_vcpus > 0);
 
     csched2_free_domdata(ops, CSCHED2_DOM(dom));
 }
@@ -1879,7 +1866,7 @@ csched2_dump_pcpu(const struct scheduler *ops, int cpu)
 static void
 csched2_dump(const struct scheduler *ops)
 {
-    struct list_head *iter_sdom, *iter_svc;
+    struct list_head *iter_sdom;
     struct csched2_private *prv = CSCHED2_PRIV(ops);
     unsigned long flags;
     int i, loop;
@@ -1924,6 +1911,8 @@ csched2_dump(const struct scheduler *ops)
     list_for_each( iter_sdom, &prv->sdom )
     {
         struct csched2_dom *sdom;
+        struct vcpu *v;
+
         sdom = list_entry(iter_sdom, struct csched2_dom, sdom_elem);
 
         printk("\tDomain: %d w %d v %d\n",
@@ -1931,12 +1920,11 @@ csched2_dump(const struct scheduler *ops)
                sdom->weight,
                sdom->nr_vcpus);
 
-        list_for_each( iter_svc, &sdom->vcpu )
+        for_each_vcpu( sdom->dom, v )
         {
-            struct csched2_vcpu *svc;
+            struct csched2_vcpu * const svc = CSCHED2_VCPU(v);
             spinlock_t *lock;
 
-            svc = list_entry(iter_svc, struct csched2_vcpu, sdom_elem);
             lock = vcpu_schedule_lock(svc->vcpu);
 
             printk("\t%3d: ", ++loop);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:47:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:47: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 1a23Rw-0004O3-Ks; Thu, 26 Nov 2015 20:47:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rv-0004N8-Qo
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:27 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	D8/C3-03763-FDF67565; Thu, 26 Nov 2015 20:47:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1448570845!6868586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57102 invoked from network); 26 Nov 2015 20:47:26 -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;
	26 Nov 2015 20:47:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rt-00038d-IW
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rt-0000Wy-HP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:25 +0000
Date: Thu, 26 Nov 2015 20:47:25 +0000
Message-Id: <E1a23Rt-0000Wy-HP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Config.mk: Update SEABIOS_UPSTREAM_TAG
	to rel-1.9.0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 032dbbae93e717bfb818395774191a75d87a891a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 18 12:01:33 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:08:55 2015 +0000

    Config.mk: Update SEABIOS_UPSTREAM_TAG to rel-1.9.0
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index c982d1c..1742907 100644
--- a/Config.mk
+++ b/Config.mk
@@ -259,9 +259,9 @@ MINIOS_UPSTREAM_REVISION ?= 8d84345a20d8a46ea26379c9f19961f6aa3e6e83
 # Fri Nov 20 19:32:42 2015 +0100
 # minios: don't rely on specific page table allocation scheme
 
-SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
-# Tue Mar 17 10:52:16 2015 -0400
-# vgabios: On bda_save_restore() the saved vbe_mode also has flags in it
+SEABIOS_UPSTREAM_REVISION ?= rel-1.9.0
+# Tue Nov 17 09:18:44 2015 -0500
+# docs: Note v1.9.0 release
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:47:28 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:47: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 1a23Rw-0004O3-Ks; Thu, 26 Nov 2015 20:47:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rv-0004N8-Qo
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:27 +0000
Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id
	D8/C3-03763-FDF67565; Thu, 26 Nov 2015 20:47:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1448570845!6868586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57102 invoked from network); 26 Nov 2015 20:47:26 -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;
	26 Nov 2015 20:47:26 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rt-00038d-IW
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Rt-0000Wy-HP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:25 +0000
Date: Thu, 26 Nov 2015 20:47:25 +0000
Message-Id: <E1a23Rt-0000Wy-HP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Config.mk: Update SEABIOS_UPSTREAM_TAG
	to rel-1.9.0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 032dbbae93e717bfb818395774191a75d87a891a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Nov 18 12:01:33 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:08:55 2015 +0000

    Config.mk: Update SEABIOS_UPSTREAM_TAG to rel-1.9.0
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index c982d1c..1742907 100644
--- a/Config.mk
+++ b/Config.mk
@@ -259,9 +259,9 @@ MINIOS_UPSTREAM_REVISION ?= 8d84345a20d8a46ea26379c9f19961f6aa3e6e83
 # Fri Nov 20 19:32:42 2015 +0100
 # minios: don't rely on specific page table allocation scheme
 
-SEABIOS_UPSTREAM_REVISION ?= rel-1.8.2
-# Tue Mar 17 10:52:16 2015 -0400
-# vgabios: On bda_save_restore() the saved vbe_mode also has flags in it
+SEABIOS_UPSTREAM_REVISION ?= rel-1.9.0
+# Tue Nov 17 09:18:44 2015 -0500
+# docs: Note v1.9.0 release
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:47:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:47: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 1a23S7-0004Q7-Rt; Thu, 26 Nov 2015 20:47: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 1a23S6-0004Pv-Fo
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:38 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	C3/67-02804-9EF67565; Thu, 26 Nov 2015 20:47:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1448570856!6806009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22110 invoked from network); 26 Nov 2015 20:47:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:47:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23S3-00038l-U8
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23S3-0000Xx-Qg
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:35 +0000
Date: Thu, 26 Nov 2015 20:47:35 +0000
Message-Id: <E1a23S3-0000Xx-Qg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MINIOS_UPSTREAM_REVISION 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 969eb34abdc5aefbe89adc12be7dcac696dac685
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Nov 24 16:10:32 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:10:32 2015 +0000

    MINIOS_UPSTREAM_REVISION Update
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1742907..64fcf1b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= 8d84345a20d8a46ea26379c9f19961f6aa3e6e83
-# Fri Nov 20 19:32:42 2015 +0100
-# minios: don't rely on specific page table allocation scheme
+MINIOS_UPSTREAM_REVISION ?= bccd90071e863ec22216a000f1a07035e2f226ff
+# Mon Nov 23 16:34:31 2015 +0000
+# Add a .gitignore
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.9.0
 # Tue Nov 17 09:18:44 2015 -0500
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:47:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:47: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 1a23S7-0004Q7-Rt; Thu, 26 Nov 2015 20:47: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 1a23S6-0004Pv-Fo
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:38 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	C3/67-02804-9EF67565; Thu, 26 Nov 2015 20:47:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1448570856!6806009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22110 invoked from network); 26 Nov 2015 20:47:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:47:36 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23S3-00038l-U8
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23S3-0000Xx-Qg
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:35 +0000
Date: Thu, 26 Nov 2015 20:47:35 +0000
Message-Id: <E1a23S3-0000Xx-Qg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MINIOS_UPSTREAM_REVISION 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 969eb34abdc5aefbe89adc12be7dcac696dac685
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Nov 24 16:10:32 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:10:32 2015 +0000

    MINIOS_UPSTREAM_REVISION Update
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Config.mk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1742907..64fcf1b 100644
--- a/Config.mk
+++ b/Config.mk
@@ -255,9 +255,9 @@ MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
 QEMU_UPSTREAM_REVISION ?= master
-MINIOS_UPSTREAM_REVISION ?= 8d84345a20d8a46ea26379c9f19961f6aa3e6e83
-# Fri Nov 20 19:32:42 2015 +0100
-# minios: don't rely on specific page table allocation scheme
+MINIOS_UPSTREAM_REVISION ?= bccd90071e863ec22216a000f1a07035e2f226ff
+# Mon Nov 23 16:34:31 2015 +0000
+# Add a .gitignore
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.9.0
 # Tue Nov 17 09:18:44 2015 -0500
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:47:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:47: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 1a23SI-0004RU-0H; Thu, 26 Nov 2015 20:47: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 1a23SG-0004RG-Jw
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:48 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	B2/81-00475-3FF67565; Thu, 26 Nov 2015 20:47:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1448570866!3792396!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48906 invoked from network); 26 Nov 2015 20:47:47 -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;
	26 Nov 2015 20:47:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SE-00038t-8l
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SE-0000YO-6l
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:46 +0000
Date: Thu, 26 Nov 2015 20:47:46 +0000
Message-Id: <E1a23SE-0000YO-6l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: mini-os patches should be
	copied to minios-devel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bb4b673ace1313d3af94c0c7350b4c27788144af
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Nov 20 14:22:11 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:12:28 2015 +0000

    MAINTAINERS: mini-os patches should be copied to minios-devel
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: samuel.thibault@ens-lyon.org
    Cc: stefano.stabellini@eu.citrix.com
    Cc: minios-devel@lists.xenproject.org
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 759de1b..e376646 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -234,6 +234,7 @@ MINI-OS
 M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
 M:	Samuel Thibault <samuel.thibault@ens-lyon.org>
 S:	Supported
+L:	minios-devel@lists.xenproject.org
 F:	config/MiniOS.mk
 F:	extras/mini-os/
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:47:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:47: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 1a23SI-0004RU-0H; Thu, 26 Nov 2015 20:47: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 1a23SG-0004RG-Jw
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:48 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	B2/81-00475-3FF67565; Thu, 26 Nov 2015 20:47:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1448570866!3792396!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48906 invoked from network); 26 Nov 2015 20:47:47 -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;
	26 Nov 2015 20:47:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SE-00038t-8l
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SE-0000YO-6l
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:46 +0000
Date: Thu, 26 Nov 2015 20:47:46 +0000
Message-Id: <E1a23SE-0000YO-6l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: mini-os patches should be
	copied to minios-devel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bb4b673ace1313d3af94c0c7350b4c27788144af
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Nov 20 14:22:11 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:12:28 2015 +0000

    MAINTAINERS: mini-os patches should be copied to minios-devel
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: samuel.thibault@ens-lyon.org
    Cc: stefano.stabellini@eu.citrix.com
    Cc: minios-devel@lists.xenproject.org
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 759de1b..e376646 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -234,6 +234,7 @@ MINI-OS
 M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
 M:	Samuel Thibault <samuel.thibault@ens-lyon.org>
 S:	Supported
+L:	minios-devel@lists.xenproject.org
 F:	config/MiniOS.mk
 F:	extras/mini-os/
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:48:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:48: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 1a23ST-0004Sw-4y; Thu, 26 Nov 2015 20:48:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SR-0004Sj-PG
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:59 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	2D/9B-30270-FFF67565; Thu, 26 Nov 2015 20:47:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448570877!6814828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27818 invoked from network); 26 Nov 2015 20:47:58 -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;
	26 Nov 2015 20:47:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SP-000391-JR
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SO-0000Yo-HC
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:56 +0000
Date: Thu, 26 Nov 2015 20:47:56 +0000
Message-Id: <E1a23SO-0000Yo-HC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: use masking operation instead
	of test_bit for MCSF bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 01884154ce0b97bf70e2bb128b4eeeaf3fed630a
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Nov 19 12:46:09 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:14:50 2015 +0000

    xen/arm: use masking operation instead of test_bit for MCSF bits
    
    This is a follow of commit 90f2e2a307fc6a6258c39cc87b3b2bf9441c0fa7 "use
    masking operation instead of test_bit for MCSF bits" where the ARM
    changes were missing.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 880d0a6..1b0f9eb 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -327,7 +327,7 @@ void hypercall_cancel_continuation(void)
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     struct mc_state *mcs = &current->mc_state;
 
-    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    if ( mcs->flags & MCSF_in_multicall )
     {
         __clear_bit(_MCSF_call_preempted, &mcs->flags);
     }
@@ -352,7 +352,7 @@ unsigned long hypercall_create_continuation(
 
     va_start(args, format);
 
-    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    if ( mcs->flags & MCSF_in_multicall )
     {
         __set_bit(_MCSF_call_preempted, &mcs->flags);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:48:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:48: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 1a23ST-0004Sw-4y; Thu, 26 Nov 2015 20:48:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SR-0004Sj-PG
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:59 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	2D/9B-30270-FFF67565; Thu, 26 Nov 2015 20:47:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448570877!6814828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27818 invoked from network); 26 Nov 2015 20:47:58 -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;
	26 Nov 2015 20:47:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SP-000391-JR
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SO-0000Yo-HC
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:47:56 +0000
Date: Thu, 26 Nov 2015 20:47:56 +0000
Message-Id: <E1a23SO-0000Yo-HC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: use masking operation instead
	of test_bit for MCSF bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 01884154ce0b97bf70e2bb128b4eeeaf3fed630a
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Nov 19 12:46:09 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:14:50 2015 +0000

    xen/arm: use masking operation instead of test_bit for MCSF bits
    
    This is a follow of commit 90f2e2a307fc6a6258c39cc87b3b2bf9441c0fa7 "use
    masking operation instead of test_bit for MCSF bits" where the ARM
    changes were missing.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 880d0a6..1b0f9eb 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -327,7 +327,7 @@ void hypercall_cancel_continuation(void)
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     struct mc_state *mcs = &current->mc_state;
 
-    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    if ( mcs->flags & MCSF_in_multicall )
     {
         __clear_bit(_MCSF_call_preempted, &mcs->flags);
     }
@@ -352,7 +352,7 @@ unsigned long hypercall_create_continuation(
 
     va_start(args, format);
 
-    if ( test_bit(_MCSF_in_multicall, &mcs->flags) )
+    if ( mcs->flags & MCSF_in_multicall )
     {
         __set_bit(_MCSF_call_preempted, &mcs->flags);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:48:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:48: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 1a23Sd-0004UO-9K; Thu, 26 Nov 2015 20:48: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 1a23Sc-0004UG-Cd
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:10 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	EC/A1-00475-90077565; Thu, 26 Nov 2015 20:48:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448570888!6649124!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2698 invoked from network); 26 Nov 2015 20:48: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;
	26 Nov 2015 20:48:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SZ-00039g-V6
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SZ-0000ZX-TI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:07 +0000
Date: Thu, 26 Nov 2015 20:48:07 +0000
Message-Id: <E1a23SZ-0000ZX-TI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Drop dead code following
	calls to libxl__exec()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2dd7eaf2e66eda7849c6b1a9f994aa391250ab7f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Nov 19 12:43:52 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:16:34 2015 +0000

    tools/libxl: Drop dead code following calls to libxl__exec()
    
    libxl__exec() doesn't ever return.  Inform the compiler of this, and
    remove all dead code.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c            |    1 -
 tools/libxl/libxl_aoutils.c    |    2 --
 tools/libxl/libxl_bootloader.c |    1 -
 tools/libxl/libxl_internal.h   |    2 +-
 4 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 854e957..6ad9e13 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1983,7 +1983,6 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
     }
 
     libxl__exec(gc, autopass_fd, -1, -1, args[0], args, NULL);
-    abort();
 
  x_fail:
     GC_FREE;
diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c
index d5fbc4d..9e493cd 100644
--- a/tools/libxl/libxl_aoutils.c
+++ b/tools/libxl/libxl_aoutils.c
@@ -603,8 +603,6 @@ int libxl__async_exec_start(libxl__async_exec_state *aes)
         /* child */
         libxl__exec(gc, aes->stdfds[0], aes->stdfds[1],
                     aes->stdfds[2], args[0], args, aes->env);
-        /* notreached */
-        abort();
     }
 
     return 0;
diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index 95dde98..9caf212 100644
--- a/tools/libxl/libxl_bootloader.c
+++ b/tools/libxl/libxl_bootloader.c
@@ -556,7 +556,6 @@ static void bootloader_gotptys(libxl__egc *egc, libxl__openpty_state *op)
         r = login_tty(libxl__carefd_fd(bl->ptys[0].slave));
         if (r) { LOGE(ERROR, "login_tty failed"); exit(-1); }
         libxl__exec(gc, -1, -1, -1, bl->args[0], (char **) bl->args, env);
-        exit(-1);
     }
 
     /* parent */
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 590870a..58d07cd 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1578,7 +1578,7 @@ _hidden int libxl__xenstore_child_wait_deprecated(libxl__gc *gc,
  */
 _hidden  void libxl__exec(libxl__gc *gc, int stdinfd, int stdoutfd,
                           int stderrfd, const char *arg0, char *const args[],
-                          char *const env[]);
+                          char *const env[]) __attribute__((noreturn));
 
 /* from xl_create */
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:48:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:48: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 1a23Sd-0004UO-9K; Thu, 26 Nov 2015 20:48: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 1a23Sc-0004UG-Cd
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:10 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	EC/A1-00475-90077565; Thu, 26 Nov 2015 20:48:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1448570888!6649124!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2698 invoked from network); 26 Nov 2015 20:48: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;
	26 Nov 2015 20:48:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SZ-00039g-V6
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23SZ-0000ZX-TI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:07 +0000
Date: Thu, 26 Nov 2015 20:48:07 +0000
Message-Id: <E1a23SZ-0000ZX-TI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Drop dead code following
	calls to libxl__exec()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2dd7eaf2e66eda7849c6b1a9f994aa391250ab7f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Nov 19 12:43:52 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:16:34 2015 +0000

    tools/libxl: Drop dead code following calls to libxl__exec()
    
    libxl__exec() doesn't ever return.  Inform the compiler of this, and
    remove all dead code.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c            |    1 -
 tools/libxl/libxl_aoutils.c    |    2 --
 tools/libxl/libxl_bootloader.c |    1 -
 tools/libxl/libxl_internal.h   |    2 +-
 4 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 854e957..6ad9e13 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1983,7 +1983,6 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
     }
 
     libxl__exec(gc, autopass_fd, -1, -1, args[0], args, NULL);
-    abort();
 
  x_fail:
     GC_FREE;
diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c
index d5fbc4d..9e493cd 100644
--- a/tools/libxl/libxl_aoutils.c
+++ b/tools/libxl/libxl_aoutils.c
@@ -603,8 +603,6 @@ int libxl__async_exec_start(libxl__async_exec_state *aes)
         /* child */
         libxl__exec(gc, aes->stdfds[0], aes->stdfds[1],
                     aes->stdfds[2], args[0], args, aes->env);
-        /* notreached */
-        abort();
     }
 
     return 0;
diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index 95dde98..9caf212 100644
--- a/tools/libxl/libxl_bootloader.c
+++ b/tools/libxl/libxl_bootloader.c
@@ -556,7 +556,6 @@ static void bootloader_gotptys(libxl__egc *egc, libxl__openpty_state *op)
         r = login_tty(libxl__carefd_fd(bl->ptys[0].slave));
         if (r) { LOGE(ERROR, "login_tty failed"); exit(-1); }
         libxl__exec(gc, -1, -1, -1, bl->args[0], (char **) bl->args, env);
-        exit(-1);
     }
 
     /* parent */
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 590870a..58d07cd 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1578,7 +1578,7 @@ _hidden int libxl__xenstore_child_wait_deprecated(libxl__gc *gc,
  */
 _hidden  void libxl__exec(libxl__gc *gc, int stdinfd, int stdoutfd,
                           int stderrfd, const char *arg0, char *const args[],
-                          char *const env[]);
+                          char *const env[]) __attribute__((noreturn));
 
 /* from xl_create */
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:48:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:48: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 1a23So-0004Vk-CW; Thu, 26 Nov 2015 20:48: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 1a23Sm-0004VZ-SK
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:20 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	44/38-12831-41077565; Thu, 26 Nov 2015 20:48:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1448570898!6807703!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54587 invoked from network); 26 Nov 2015 20:48:19 -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;
	26 Nov 2015 20:48:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Sk-00039o-BA
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Sk-0000a9-9B
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:18 +0000
Date: Thu, 26 Nov 2015 20:48:18 +0000
Message-Id: <E1a23Sk-0000a9-9B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] get_maintainer: fix perl 5.22/5.24
	deprecated/incompatible "\C" use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 31aa8113a81d0b17b4aa3e4f8c61840aca2cf1ec
Author:     Joe Perches <joe@perches.com>
AuthorDate: Thu Nov 19 08:43:53 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:18:16 2015 +0000

    get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use
    
    Perl 5.22 emits a deprecated message when "\C" is used in a regex.  Perl
    5.24 will disallow it altogether.
    
    Fix it by using [A-Z] instead of \C.
    
     [ Upstream commit ce8155f7a3d59ce868ea16d8891edda4d865e873 ]
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 scripts/get_maintainer.pl |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index cc445cd..9fda278 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -277,7 +277,7 @@ open (my $maint, '<', "${xen_path}MAINTAINERS")
 while (<$maint>) {
     my $line = $_;
 
-    if ($line =~ m/^(\C):\s*(.*)/) {
+    if ($line =~ m/^([A-Z]):\s*(.*)/) {
 	my $type = $1;
 	my $value = $2;
 
@@ -512,7 +512,7 @@ sub range_is_maintained {
 
     for (my $i = $start; $i < $end; $i++) {
 	my $line = $typevalue[$i];
-	if ($line =~ m/^(\C):\s*(.*)/) {
+	if ($line =~ m/^([A-Z]):\s*(.*)/) {
 	    my $type = $1;
 	    my $value = $2;
 	    if ($type eq 'S') {
@@ -530,7 +530,7 @@ sub range_has_maintainer {
 
     for (my $i = $start; $i < $end; $i++) {
 	my $line = $typevalue[$i];
-	if ($line =~ m/^(\C):\s*(.*)/) {
+	if ($line =~ m/^([A-Z]):\s*(.*)/) {
 	    my $type = $1;
 	    my $value = $2;
 	    if ($type eq 'M') {
@@ -579,7 +579,7 @@ sub get_maintainers {
 
 	    for ($i = $start; $i < $end; $i++) {
 		my $line = $typevalue[$i];
-		if ($line =~ m/^(\C):\s*(.*)/) {
+		if ($line =~ m/^([A-Z]):\s*(.*)/) {
 		    my $type = $1;
 		    my $value = $2;
 		    if ($type eq 'X') {
@@ -594,7 +594,7 @@ sub get_maintainers {
 	    if (!$exclude) {
 		for ($i = $start; $i < $end; $i++) {
 		    my $line = $typevalue[$i];
-		    if ($line =~ m/^(\C):\s*(.*)/) {
+		    if ($line =~ m/^([A-Z]):\s*(.*)/) {
 			my $type = $1;
 			my $value = $2;
 			if ($type eq 'F') {
@@ -897,7 +897,7 @@ sub find_first_section {
 
     while ($index < @typevalue) {
 	my $tv = $typevalue[$index];
-	if (($tv =~ m/^(\C):\s*(.*)/)) {
+	if (($tv =~ m/^([A-Z]):\s*(.*)/)) {
 	    last;
 	}
 	$index++;
@@ -911,7 +911,7 @@ sub find_starting_index {
 
     while ($index > 0) {
 	my $tv = $typevalue[$index];
-	if (!($tv =~ m/^(\C):\s*(.*)/)) {
+	if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
 	    last;
 	}
 	$index--;
@@ -925,7 +925,7 @@ sub find_ending_index {
 
     while ($index < @typevalue) {
 	my $tv = $typevalue[$index];
-	if (!($tv =~ m/^(\C):\s*(.*)/)) {
+	if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
 	    last;
 	}
 	$index++;
@@ -951,7 +951,7 @@ sub get_maintainer_role {
 
     for ($i = $start + 1; $i < $end; $i++) {
 	my $tv = $typevalue[$i];
-	if ($tv =~ m/^(\C):\s*(.*)/) {
+	if ($tv =~ m/^([A-Z]):\s*(.*)/) {
 	    my $ptype = $1;
 	    my $pvalue = $2;
 	    if ($ptype eq "S") {
@@ -1010,7 +1010,7 @@ sub add_categories {
 
     for ($i = $start + 1; $i < $end; $i++) {
 	my $tv = $typevalue[$i];
-	if ($tv =~ m/^(\C):\s*(.*)/) {
+	if ($tv =~ m/^([A-Z]):\s*(.*)/) {
 	    my $ptype = $1;
 	    my $pvalue = $2;
 	    if ($ptype eq "L") {
@@ -1052,7 +1052,7 @@ sub add_categories {
 		if ($name eq "") {
 		    if ($i > 0) {
 			my $tv = $typevalue[$i - 1];
-			if ($tv =~ m/^(\C):\s*(.*)/) {
+			if ($tv =~ m/^([A-Z]):\s*(.*)/) {
 			    if ($1 eq "P") {
 				$name = $2;
 				$pvalue = format_email($name, $address, $email_usename);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:48:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:48: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 1a23So-0004Vk-CW; Thu, 26 Nov 2015 20:48: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 1a23Sm-0004VZ-SK
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:20 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	44/38-12831-41077565; Thu, 26 Nov 2015 20:48:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1448570898!6807703!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 54587 invoked from network); 26 Nov 2015 20:48:19 -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;
	26 Nov 2015 20:48:19 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Sk-00039o-BA
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Sk-0000a9-9B
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:18 +0000
Date: Thu, 26 Nov 2015 20:48:18 +0000
Message-Id: <E1a23Sk-0000a9-9B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] get_maintainer: fix perl 5.22/5.24
	deprecated/incompatible "\C" use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 31aa8113a81d0b17b4aa3e4f8c61840aca2cf1ec
Author:     Joe Perches <joe@perches.com>
AuthorDate: Thu Nov 19 08:43:53 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:18:16 2015 +0000

    get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use
    
    Perl 5.22 emits a deprecated message when "\C" is used in a regex.  Perl
    5.24 will disallow it altogether.
    
    Fix it by using [A-Z] instead of \C.
    
     [ Upstream commit ce8155f7a3d59ce868ea16d8891edda4d865e873 ]
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 scripts/get_maintainer.pl |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index cc445cd..9fda278 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -277,7 +277,7 @@ open (my $maint, '<', "${xen_path}MAINTAINERS")
 while (<$maint>) {
     my $line = $_;
 
-    if ($line =~ m/^(\C):\s*(.*)/) {
+    if ($line =~ m/^([A-Z]):\s*(.*)/) {
 	my $type = $1;
 	my $value = $2;
 
@@ -512,7 +512,7 @@ sub range_is_maintained {
 
     for (my $i = $start; $i < $end; $i++) {
 	my $line = $typevalue[$i];
-	if ($line =~ m/^(\C):\s*(.*)/) {
+	if ($line =~ m/^([A-Z]):\s*(.*)/) {
 	    my $type = $1;
 	    my $value = $2;
 	    if ($type eq 'S') {
@@ -530,7 +530,7 @@ sub range_has_maintainer {
 
     for (my $i = $start; $i < $end; $i++) {
 	my $line = $typevalue[$i];
-	if ($line =~ m/^(\C):\s*(.*)/) {
+	if ($line =~ m/^([A-Z]):\s*(.*)/) {
 	    my $type = $1;
 	    my $value = $2;
 	    if ($type eq 'M') {
@@ -579,7 +579,7 @@ sub get_maintainers {
 
 	    for ($i = $start; $i < $end; $i++) {
 		my $line = $typevalue[$i];
-		if ($line =~ m/^(\C):\s*(.*)/) {
+		if ($line =~ m/^([A-Z]):\s*(.*)/) {
 		    my $type = $1;
 		    my $value = $2;
 		    if ($type eq 'X') {
@@ -594,7 +594,7 @@ sub get_maintainers {
 	    if (!$exclude) {
 		for ($i = $start; $i < $end; $i++) {
 		    my $line = $typevalue[$i];
-		    if ($line =~ m/^(\C):\s*(.*)/) {
+		    if ($line =~ m/^([A-Z]):\s*(.*)/) {
 			my $type = $1;
 			my $value = $2;
 			if ($type eq 'F') {
@@ -897,7 +897,7 @@ sub find_first_section {
 
     while ($index < @typevalue) {
 	my $tv = $typevalue[$index];
-	if (($tv =~ m/^(\C):\s*(.*)/)) {
+	if (($tv =~ m/^([A-Z]):\s*(.*)/)) {
 	    last;
 	}
 	$index++;
@@ -911,7 +911,7 @@ sub find_starting_index {
 
     while ($index > 0) {
 	my $tv = $typevalue[$index];
-	if (!($tv =~ m/^(\C):\s*(.*)/)) {
+	if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
 	    last;
 	}
 	$index--;
@@ -925,7 +925,7 @@ sub find_ending_index {
 
     while ($index < @typevalue) {
 	my $tv = $typevalue[$index];
-	if (!($tv =~ m/^(\C):\s*(.*)/)) {
+	if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
 	    last;
 	}
 	$index++;
@@ -951,7 +951,7 @@ sub get_maintainer_role {
 
     for ($i = $start + 1; $i < $end; $i++) {
 	my $tv = $typevalue[$i];
-	if ($tv =~ m/^(\C):\s*(.*)/) {
+	if ($tv =~ m/^([A-Z]):\s*(.*)/) {
 	    my $ptype = $1;
 	    my $pvalue = $2;
 	    if ($ptype eq "S") {
@@ -1010,7 +1010,7 @@ sub add_categories {
 
     for ($i = $start + 1; $i < $end; $i++) {
 	my $tv = $typevalue[$i];
-	if ($tv =~ m/^(\C):\s*(.*)/) {
+	if ($tv =~ m/^([A-Z]):\s*(.*)/) {
 	    my $ptype = $1;
 	    my $pvalue = $2;
 	    if ($ptype eq "L") {
@@ -1052,7 +1052,7 @@ sub add_categories {
 		if ($name eq "") {
 		    if ($i > 0) {
 			my $tv = $typevalue[$i - 1];
-			if ($tv =~ m/^(\C):\s*(.*)/) {
+			if ($tv =~ m/^([A-Z]):\s*(.*)/) {
 			    if ($1 eq "P") {
 				$name = $2;
 				$pvalue = format_email($name, $address, $email_usename);
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:48:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23Sy-0004Xq-GF; Thu, 26 Nov 2015 20:48: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 1a23Sx-0004XX-8r
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:31 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	00/6C-03235-E1077565; Thu, 26 Nov 2015 20:48:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1448570908!6809056!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26293 invoked from network); 26 Nov 2015 20:48:29 -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;
	26 Nov 2015 20:48:29 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Su-0003A1-NB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Su-0000bQ-Je
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:28 +0000
Date: Thu, 26 Nov 2015 20:48:28 +0000
Message-Id: <E1a23Su-0000bQ-Je@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Introduce xenstore paths for PV
	control features
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85e3b08eb73cd7ea0578807e4fd666ecbbca143e
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Nov 17 11:32:02 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:19:00 2015 +0000

    docs: Introduce xenstore paths for PV control features
    
    XenServer already makes use of ~/control/feature-suspend being written
    to advertise guest capability of responding to 'suspend' when written to
    ~/control/shutdown and, since they are derived from XenServer drivers,
    the Xen Project Windows PV drivers attempt to write this value. The write
    currently fails for libxl provisioned VMs because ~/control is read-only
    to the guest (only ~/control/shutdown is writable, for ackowledgement
    purposes).
    
    This patch documents feature-suspend and also a set of similar control
    feature flags, so that that they may be added to libxl provisioned
    guests by subsequent patches:
    
    feature-poweroff: PV drivers/agent can shut down the guest
    feature-reboot: PV drivers/agent can reboot the guest
    feature-s3: PV drivers/agent can trigger guest sleep (HVM only)
    feature-s4: PV drivers/agent can trigger guest hibernate (HVM only)
    
    The patch (bacause it adds features relating to S3 and S4 power states)
    also clarifies that the initial set of platform properties mentioned are
    booleans, and updates the specifier accordingly.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
---
 docs/misc/xenstore-paths.markdown |   39 +++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xenstore-paths.markdown b/docs/misc/xenstore-paths.markdown
index d94ea9d..2d2ce46 100644
--- a/docs/misc/xenstore-paths.markdown
+++ b/docs/misc/xenstore-paths.markdown
@@ -178,9 +178,9 @@ will not relocate guest memory.
 
 The BIOS used by this domain.
 
-#### ~/platform/* [HVM,INTERNAL]
+#### ~/platform/* = ("0"|"1") [HVM,INTERNAL]
 
-Various platform properties.
+Various boolean platform properties.
 
 * acpi -- is ACPI enabled for this domain
 * acpi_s3 -- is ACPI S3 support enabled for this domain
@@ -327,6 +327,41 @@ string back to the command node.
 
 The precise protocol is not yet documented.
 
+#### ~/control/feature-poweroff = (""|"0"|"1") [w]
+#### ~/control/feature-reboot = (""|"0"|"1") [w]
+#### ~/control/feature-suspend = (""|"0"|"1") [w]
+
+These may be initialized to "" by the toolstack and may then be set
+to 0 or 1 by a guest to indicate whether it is capable or incapable,
+respectively, of responding to the corresponding command when written
+to ~/control/shutdown.
+A toolstack may then sample the feature- value at the point of issuing
+a PV control command and respond accordingly:
+
+"0" -> the frontend should not be expected to respond, so fail the
+       control operation
+"1" -> the frontend should be expected to respond, so wait for it to
+       do so and maybe fail the control operation after some reasonable
+       timeout.
+""  -> the frontend may or may not respond, so wait for it to do so and
+       then maybe try an alternative control mechanism after some
+       reasonable timeout.
+
+Since a toolstack may not initialize these paths, and the parent
+~/control path is read-only to a guest, a guest should not expect a
+write to succeed. If it fails the guest may log the failure but should
+continue to process the corresponding command when written to
+~/control/shutdown regardless.
+
+#### ~/control/feature-s3 = (""|"0"|"1") [w,HVM]
+#### ~/control/feature-s4 = (""|"0"|"1") [w,HVM]
+
+These purpose of these feature flags is identical to feature-poweroff,
+feature-reboot and feature-suspend above but concern triggering the
+S3 or S4 power states of HVM guests.
+A toolstack may create these values, but should not sample them unless
+the corresponding acpi_ feature flag is set in ~/platform.
+
 #### ~/control/platform-feature-multiprocessor-suspend = (0|1) []
 
 Indicates to the guest that this platform supports the multiprocessor
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:48:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23Sy-0004Xq-GF; Thu, 26 Nov 2015 20:48: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 1a23Sx-0004XX-8r
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:31 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	00/6C-03235-E1077565; Thu, 26 Nov 2015 20:48:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1448570908!6809056!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26293 invoked from network); 26 Nov 2015 20:48:29 -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;
	26 Nov 2015 20:48:29 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Su-0003A1-NB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Su-0000bQ-Je
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:28 +0000
Date: Thu, 26 Nov 2015 20:48:28 +0000
Message-Id: <E1a23Su-0000bQ-Je@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Introduce xenstore paths for PV
	control features
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85e3b08eb73cd7ea0578807e4fd666ecbbca143e
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Nov 17 11:32:02 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:19:00 2015 +0000

    docs: Introduce xenstore paths for PV control features
    
    XenServer already makes use of ~/control/feature-suspend being written
    to advertise guest capability of responding to 'suspend' when written to
    ~/control/shutdown and, since they are derived from XenServer drivers,
    the Xen Project Windows PV drivers attempt to write this value. The write
    currently fails for libxl provisioned VMs because ~/control is read-only
    to the guest (only ~/control/shutdown is writable, for ackowledgement
    purposes).
    
    This patch documents feature-suspend and also a set of similar control
    feature flags, so that that they may be added to libxl provisioned
    guests by subsequent patches:
    
    feature-poweroff: PV drivers/agent can shut down the guest
    feature-reboot: PV drivers/agent can reboot the guest
    feature-s3: PV drivers/agent can trigger guest sleep (HVM only)
    feature-s4: PV drivers/agent can trigger guest hibernate (HVM only)
    
    The patch (bacause it adds features relating to S3 and S4 power states)
    also clarifies that the initial set of platform properties mentioned are
    booleans, and updates the specifier accordingly.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
---
 docs/misc/xenstore-paths.markdown |   39 +++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xenstore-paths.markdown b/docs/misc/xenstore-paths.markdown
index d94ea9d..2d2ce46 100644
--- a/docs/misc/xenstore-paths.markdown
+++ b/docs/misc/xenstore-paths.markdown
@@ -178,9 +178,9 @@ will not relocate guest memory.
 
 The BIOS used by this domain.
 
-#### ~/platform/* [HVM,INTERNAL]
+#### ~/platform/* = ("0"|"1") [HVM,INTERNAL]
 
-Various platform properties.
+Various boolean platform properties.
 
 * acpi -- is ACPI enabled for this domain
 * acpi_s3 -- is ACPI S3 support enabled for this domain
@@ -327,6 +327,41 @@ string back to the command node.
 
 The precise protocol is not yet documented.
 
+#### ~/control/feature-poweroff = (""|"0"|"1") [w]
+#### ~/control/feature-reboot = (""|"0"|"1") [w]
+#### ~/control/feature-suspend = (""|"0"|"1") [w]
+
+These may be initialized to "" by the toolstack and may then be set
+to 0 or 1 by a guest to indicate whether it is capable or incapable,
+respectively, of responding to the corresponding command when written
+to ~/control/shutdown.
+A toolstack may then sample the feature- value at the point of issuing
+a PV control command and respond accordingly:
+
+"0" -> the frontend should not be expected to respond, so fail the
+       control operation
+"1" -> the frontend should be expected to respond, so wait for it to
+       do so and maybe fail the control operation after some reasonable
+       timeout.
+""  -> the frontend may or may not respond, so wait for it to do so and
+       then maybe try an alternative control mechanism after some
+       reasonable timeout.
+
+Since a toolstack may not initialize these paths, and the parent
+~/control path is read-only to a guest, a guest should not expect a
+write to succeed. If it fails the guest may log the failure but should
+continue to process the corresponding command when written to
+~/control/shutdown regardless.
+
+#### ~/control/feature-s3 = (""|"0"|"1") [w,HVM]
+#### ~/control/feature-s4 = (""|"0"|"1") [w,HVM]
+
+These purpose of these feature flags is identical to feature-poweroff,
+feature-reboot and feature-suspend above but concern triggering the
+S3 or S4 power states of HVM guests.
+A toolstack may create these values, but should not sample them unless
+the corresponding acpi_ feature flag is set in ~/platform.
+
 #### ~/control/platform-feature-multiprocessor-suspend = (0|1) []
 
 Indicates to the guest that this platform supports the multiprocessor
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:48:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:48: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 1a23T9-0004ZH-Kh; Thu, 26 Nov 2015 20:48:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23T7-0004Yy-Gp
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:41 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	BC/71-07165-82077565; Thu, 26 Nov 2015 20:48:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1448570919!6650975!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.2 required=7.0 tests=HOT_NASTY
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31481 invoked from network); 26 Nov 2015 20:48:39 -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;
	26 Nov 2015 20:48:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23T4-0003A9-VG
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23T4-0000bw-Tt
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:38 +0000
Date: Thu, 26 Nov 2015 20:48:38 +0000
Message-Id: <E1a23T4-0000bw-Tt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Introduce xenstore paths for PV
	driver information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71e64e163b2dae7d08f7d77ee942749663f484d5
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Nov 17 11:32:03 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:19:00 2015 +0000

    docs: Introduce xenstore paths for PV driver information
    
    For domain management purposes it is convenient to be able to see
    information about PV drivers in xenstore. The XAPI toolstack in
    XenServer has always created a ~/drivers path for this purpose.
    
    This patch documents that path and also adds a specification of how
    it should be used.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/misc/xenstore-paths.markdown |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xenstore-paths.markdown b/docs/misc/xenstore-paths.markdown
index 2d2ce46..b8788f2 100644
--- a/docs/misc/xenstore-paths.markdown
+++ b/docs/misc/xenstore-paths.markdown
@@ -37,6 +37,8 @@ before regexp expansion:
   the "other" domain. i.e. ~ refers to the domain providing a service
   while $DOMID is the consumer of that service.
 * $UUID -- a UUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+* $INDEX -- an integer used as part of a path when listing a set of
+            values. Typically these integers are contiguous.
 
 VALUES are strings and can take the following forms:
 
@@ -51,6 +53,28 @@ VALUES are strings and can take the following forms:
 * (VALUE | VALUE | ... ) -- a set of alternatives. Alternatives are
   separated by a "|" and all the alternatives are enclosed in "(" and
   ")".
+* DISTRIBUTION -- information about a software distribution, comprised
+                  of 3 or 4 space separated UTF-8 strings as follows:
+
+                  VENDOR -- Commonly used vendor short name,
+                            e.g "Citrix" rather than "Citrix Systems
+                            Inc."
+
+                  PRODUCT -- Commonly used product (e.g. driver) name
+                             without version information.
+
+                  If the toolstack needs to match on either of the above
+                  values it should support Unix glob style matching.
+
+                  VERSION -- A version number that will sort properly
+                             under coreutils version sorting (sort -V)
+                             rules.
+
+                  ATTRIBUTES -- Optional human readable text to denote
+                                attributes of the software, e.g. "debug".
+                                This text is freeform and no meaning
+                                should be inferred. It is intended for
+                                display purposes only.
 
 Additional TAGS may follow as a comma separated set of the following
 tags enclosed in square brackets.
@@ -380,6 +404,11 @@ protocol definition.
 
 A domain writable path. Available for arbitrary domain use.
 
+#### ~/drivers/$INDEX = DISTRIBUTION [w]
+
+A domain may write information about installed PV drivers using
+paths of this form.
+
 ### Paths private to the toolstack
 
 #### ~/device-model/$DOMID/state [w]
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:48:43 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:48: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 1a23T9-0004ZH-Kh; Thu, 26 Nov 2015 20:48:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23T7-0004Yy-Gp
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:41 +0000
Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id
	BC/71-07165-82077565; Thu, 26 Nov 2015 20:48:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1448570919!6650975!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.2 required=7.0 tests=HOT_NASTY
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31481 invoked from network); 26 Nov 2015 20:48:39 -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;
	26 Nov 2015 20:48:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23T4-0003A9-VG
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23T4-0000bw-Tt
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:38 +0000
Date: Thu, 26 Nov 2015 20:48:38 +0000
Message-Id: <E1a23T4-0000bw-Tt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Introduce xenstore paths for PV
	driver information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71e64e163b2dae7d08f7d77ee942749663f484d5
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Nov 17 11:32:03 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:19:00 2015 +0000

    docs: Introduce xenstore paths for PV driver information
    
    For domain management purposes it is convenient to be able to see
    information about PV drivers in xenstore. The XAPI toolstack in
    XenServer has always created a ~/drivers path for this purpose.
    
    This patch documents that path and also adds a specification of how
    it should be used.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/misc/xenstore-paths.markdown |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xenstore-paths.markdown b/docs/misc/xenstore-paths.markdown
index 2d2ce46..b8788f2 100644
--- a/docs/misc/xenstore-paths.markdown
+++ b/docs/misc/xenstore-paths.markdown
@@ -37,6 +37,8 @@ before regexp expansion:
   the "other" domain. i.e. ~ refers to the domain providing a service
   while $DOMID is the consumer of that service.
 * $UUID -- a UUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+* $INDEX -- an integer used as part of a path when listing a set of
+            values. Typically these integers are contiguous.
 
 VALUES are strings and can take the following forms:
 
@@ -51,6 +53,28 @@ VALUES are strings and can take the following forms:
 * (VALUE | VALUE | ... ) -- a set of alternatives. Alternatives are
   separated by a "|" and all the alternatives are enclosed in "(" and
   ")".
+* DISTRIBUTION -- information about a software distribution, comprised
+                  of 3 or 4 space separated UTF-8 strings as follows:
+
+                  VENDOR -- Commonly used vendor short name,
+                            e.g "Citrix" rather than "Citrix Systems
+                            Inc."
+
+                  PRODUCT -- Commonly used product (e.g. driver) name
+                             without version information.
+
+                  If the toolstack needs to match on either of the above
+                  values it should support Unix glob style matching.
+
+                  VERSION -- A version number that will sort properly
+                             under coreutils version sorting (sort -V)
+                             rules.
+
+                  ATTRIBUTES -- Optional human readable text to denote
+                                attributes of the software, e.g. "debug".
+                                This text is freeform and no meaning
+                                should be inferred. It is intended for
+                                display purposes only.
 
 Additional TAGS may follow as a comma separated set of the following
 tags enclosed in square brackets.
@@ -380,6 +404,11 @@ protocol definition.
 
 A domain writable path. Available for arbitrary domain use.
 
+#### ~/drivers/$INDEX = DISTRIBUTION [w]
+
+A domain may write information about installed PV drivers using
+paths of this form.
+
 ### Paths private to the toolstack
 
 #### ~/device-model/$DOMID/state [w]
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:48:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:48: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 1a23TL-0004b4-Sk; Thu, 26 Nov 2015 20:48:55 +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 1a23TJ-0004au-P1
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:53 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	DD/7A-08347-53077565; Thu, 26 Nov 2015 20:48:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1448570929!6654150!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51124 invoked from network); 26 Nov 2015 20:48:50 -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;
	26 Nov 2015 20:48:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23TF-0003AH-A9
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23TF-0000cM-7o
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:49 +0000
Date: Thu, 26 Nov 2015 20:48:49 +0000
Message-Id: <E1a23TF-0000cM-7o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Introduce xenstore paths for
	hotplug features
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8f98cb2d4112d08add03caecf9d53da7e92b6f3
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Nov 17 11:32:04 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:19:00 2015 +0000

    docs: Introduce xenstore paths for hotplug features
    
    Without some indication from a guest it is not possible for a
    toolstack to know whether instantiation of a new vbd or vif should
    result in a new PV device of the appropriate type being brought online.
    (In other words whether guest PV drivers are present and functioning).
    
    This patch documents two paths which vif and vbd frontend drivers can
    use to advertise their ability to respond to new vif or vbd
    instantiations.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/misc/xenstore-paths.markdown |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xenstore-paths.markdown b/docs/misc/xenstore-paths.markdown
index b8788f2..624b7fd 100644
--- a/docs/misc/xenstore-paths.markdown
+++ b/docs/misc/xenstore-paths.markdown
@@ -409,6 +409,18 @@ A domain writable path. Available for arbitrary domain use.
 A domain may write information about installed PV drivers using
 paths of this form.
 
+#### ~/feature/hotplug/vif = ("0"|"1") [w]
+#### ~/feature/hotplug/vbd = ("0"|"1") [w]
+
+By setting these paths to "1" a guest can indicate to a toolstack
+that it is capable of responding immediately to instantiation of,
+respectively, new vif by bringing online a new PV network device or
+a new vbd by bringing online a new PV block device.
+If the guest sets this path to "0" then it is indicating that it is
+definitely unable to respond immediately and hence the toolstack should
+defer instantiaton to the next VM start. However, if the path is absent
+then the toolstack may attempt the operation.
+
 ### Paths private to the toolstack
 
 #### ~/device-model/$DOMID/state [w]
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:48:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:48: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 1a23TL-0004b4-Sk; Thu, 26 Nov 2015 20:48:55 +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 1a23TJ-0004au-P1
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:53 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	DD/7A-08347-53077565; Thu, 26 Nov 2015 20:48:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1448570929!6654150!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 51124 invoked from network); 26 Nov 2015 20:48:50 -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;
	26 Nov 2015 20:48:50 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23TF-0003AH-A9
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23TF-0000cM-7o
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:49 +0000
Date: Thu, 26 Nov 2015 20:48:49 +0000
Message-Id: <E1a23TF-0000cM-7o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Introduce xenstore paths for
	hotplug features
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8f98cb2d4112d08add03caecf9d53da7e92b6f3
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Nov 17 11:32:04 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:19:00 2015 +0000

    docs: Introduce xenstore paths for hotplug features
    
    Without some indication from a guest it is not possible for a
    toolstack to know whether instantiation of a new vbd or vif should
    result in a new PV device of the appropriate type being brought online.
    (In other words whether guest PV drivers are present and functioning).
    
    This patch documents two paths which vif and vbd frontend drivers can
    use to advertise their ability to respond to new vif or vbd
    instantiations.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/misc/xenstore-paths.markdown |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xenstore-paths.markdown b/docs/misc/xenstore-paths.markdown
index b8788f2..624b7fd 100644
--- a/docs/misc/xenstore-paths.markdown
+++ b/docs/misc/xenstore-paths.markdown
@@ -409,6 +409,18 @@ A domain writable path. Available for arbitrary domain use.
 A domain may write information about installed PV drivers using
 paths of this form.
 
+#### ~/feature/hotplug/vif = ("0"|"1") [w]
+#### ~/feature/hotplug/vbd = ("0"|"1") [w]
+
+By setting these paths to "1" a guest can indicate to a toolstack
+that it is capable of responding immediately to instantiation of,
+respectively, new vif by bringing online a new PV network device or
+a new vbd by bringing online a new PV block device.
+If the guest sets this path to "0" then it is indicating that it is
+definitely unable to respond immediately and hence the toolstack should
+defer instantiaton to the next VM start. However, if the path is absent
+then the toolstack may attempt the operation.
+
 ### Paths private to the toolstack
 
 #### ~/device-model/$DOMID/state [w]
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:49:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49: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 1a23TZ-0004cq-3D; Thu, 26 Nov 2015 20:49: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 1a23TX-0004c6-6E
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:07 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	E7/94-13487-D3077565; Thu, 26 Nov 2015 20:49:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1448570940!6807773!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57593 invoked from network); 26 Nov 2015 20:49:00 -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;
	26 Nov 2015 20:49:00 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23TP-0003AP-Qu
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23TP-0000d2-LB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:59 +0000
Date: Thu, 26 Nov 2015 20:48:59 +0000
Message-Id: <E1a23TP-0000d2-LB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Introduce xenstore paths for
	guest network address information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26b4f4da890e6d829390a8a1ecaec6ce10ecf57d
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Nov 17 11:32:05 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:19:00 2015 +0000

    docs: Introduce xenstore paths for guest network address information
    
    It is useful for a toolstack to be able to see the network addresses
    in use by a domain for a particular vif in xenstore for display
    purposes and, for example, so that a VNC session can be established
    to the guest GUI.
    
    This patch documents paths to allow a domain to advertise an interface
    name, MAC (unicast and multicast) and IP (version 4 and 6) address
    information.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/misc/xenstore-paths.markdown |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xenstore-paths.markdown b/docs/misc/xenstore-paths.markdown
index 624b7fd..197bb0f 100644
--- a/docs/misc/xenstore-paths.markdown
+++ b/docs/misc/xenstore-paths.markdown
@@ -76,6 +76,15 @@ VALUES are strings and can take the following forms:
                                 should be inferred. It is intended for
                                 display purposes only.
 
+* MAC_ADDRESS -- 6 integers, in hexadecimal form, separated by ':',
+                 specifying an IEEE 802.3 ethernet MAC address.
+* IPV4_ADDRESS -- 4 integers, in decimal form, separated by '.',
+                  specifying an IP version 4 address as described
+                  IETF RFC 791.
+* IPV6_ADDRESS -- Up to 8 integers, in hexadecimal form, separated
+                  by ':', specifying an IP version 6 address as
+                  described in IETF RFC 4291.
+
 Additional TAGS may follow as a comma separated set of the following
 tags enclosed in square brackets.
 
@@ -421,6 +430,33 @@ definitely unable to respond immediately and hence the toolstack should
 defer instantiaton to the next VM start. However, if the path is absent
 then the toolstack may attempt the operation.
 
+#### ~/attr/vif/$DEVID/name = STRING [w]
+
+A domain may write its internal 'friendly' name for a network device
+using this path using UTF-8 encoding. A toolstack or UI may use this
+for display purposes. No particular meaning should be inferred from the
+name.
+
+#### ~/attr/vif/$DEVID/mac/$INDEX = MAC_ADDRESS [w]
+
+Paths of this form may be written by the guest to indicate MAC addresses
+it is currently using. These may be multicast or unicast addresses. For
+any of the paths the value of $INDEX is arbitrary.
+The values written are primarily for display purposes and must not be used
+for packet filtering or routing purposes.
+
+#### ~/attr/vif/$DEVID/ipv4/$INDEX = IPV4_ADDRESS [w]
+#### ~/attr/vif/$DEVID/ipv6/$INDEX = IPV6_ADDRESS [w]
+
+Paths of this form may be written by the guest to indicate IP addresses
+in use by the stack bound to the network frontend. For any of the paths
+the value of $INDEX is arbitrary.
+The values written are primarily for display purposes and must not be used
+for packet filtering or routing purposes. A toolstack may attempt to use an
+address written in one of these paths to, for example, establish a VNC
+session to the guest (although clearly some level of trust is placed
+in the value supplied by the guest in this case).
+
 ### Paths private to the toolstack
 
 #### ~/device-model/$DOMID/state [w]
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:49:09 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49: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 1a23TZ-0004cq-3D; Thu, 26 Nov 2015 20:49: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 1a23TX-0004c6-6E
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:07 +0000
Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id
	E7/94-13487-D3077565; Thu, 26 Nov 2015 20:49:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1448570940!6807773!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 57593 invoked from network); 26 Nov 2015 20:49:00 -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;
	26 Nov 2015 20:49:00 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23TP-0003AP-Qu
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23TP-0000d2-LB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:48:59 +0000
Date: Thu, 26 Nov 2015 20:48:59 +0000
Message-Id: <E1a23TP-0000d2-LB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Introduce xenstore paths for
	guest network address information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26b4f4da890e6d829390a8a1ecaec6ce10ecf57d
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Tue Nov 17 11:32:05 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:19:00 2015 +0000

    docs: Introduce xenstore paths for guest network address information
    
    It is useful for a toolstack to be able to see the network addresses
    in use by a domain for a particular vif in xenstore for display
    purposes and, for example, so that a VNC session can be established
    to the guest GUI.
    
    This patch documents paths to allow a domain to advertise an interface
    name, MAC (unicast and multicast) and IP (version 4 and 6) address
    information.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/misc/xenstore-paths.markdown |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/docs/misc/xenstore-paths.markdown b/docs/misc/xenstore-paths.markdown
index 624b7fd..197bb0f 100644
--- a/docs/misc/xenstore-paths.markdown
+++ b/docs/misc/xenstore-paths.markdown
@@ -76,6 +76,15 @@ VALUES are strings and can take the following forms:
                                 should be inferred. It is intended for
                                 display purposes only.
 
+* MAC_ADDRESS -- 6 integers, in hexadecimal form, separated by ':',
+                 specifying an IEEE 802.3 ethernet MAC address.
+* IPV4_ADDRESS -- 4 integers, in decimal form, separated by '.',
+                  specifying an IP version 4 address as described
+                  IETF RFC 791.
+* IPV6_ADDRESS -- Up to 8 integers, in hexadecimal form, separated
+                  by ':', specifying an IP version 6 address as
+                  described in IETF RFC 4291.
+
 Additional TAGS may follow as a comma separated set of the following
 tags enclosed in square brackets.
 
@@ -421,6 +430,33 @@ definitely unable to respond immediately and hence the toolstack should
 defer instantiaton to the next VM start. However, if the path is absent
 then the toolstack may attempt the operation.
 
+#### ~/attr/vif/$DEVID/name = STRING [w]
+
+A domain may write its internal 'friendly' name for a network device
+using this path using UTF-8 encoding. A toolstack or UI may use this
+for display purposes. No particular meaning should be inferred from the
+name.
+
+#### ~/attr/vif/$DEVID/mac/$INDEX = MAC_ADDRESS [w]
+
+Paths of this form may be written by the guest to indicate MAC addresses
+it is currently using. These may be multicast or unicast addresses. For
+any of the paths the value of $INDEX is arbitrary.
+The values written are primarily for display purposes and must not be used
+for packet filtering or routing purposes.
+
+#### ~/attr/vif/$DEVID/ipv4/$INDEX = IPV4_ADDRESS [w]
+#### ~/attr/vif/$DEVID/ipv6/$INDEX = IPV6_ADDRESS [w]
+
+Paths of this form may be written by the guest to indicate IP addresses
+in use by the stack bound to the network frontend. For any of the paths
+the value of $INDEX is arbitrary.
+The values written are primarily for display purposes and must not be used
+for packet filtering or routing purposes. A toolstack may attempt to use an
+address written in one of these paths to, for example, establish a VNC
+session to the guest (although clearly some level of trust is placed
+in the value supplied by the guest in this case).
+
 ### Paths private to the toolstack
 
 #### ~/device-model/$DOMID/state [w]
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:49:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49: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 1a23Td-0004dk-6r; Thu, 26 Nov 2015 20:49: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 1a23Tc-0004dU-IZ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:12 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	64/46-14422-74077565; Thu, 26 Nov 2015 20:49:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1448570950!6793959!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25253 invoked from network); 26 Nov 2015 20:49:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:49:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ta-0003B0-5d
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ta-0000dj-2z
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:10 +0000
Date: Thu, 26 Nov 2015 20:49:10 +0000
Message-Id: <E1a23Ta-0000dj-2z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: quote all variables in
	vif-bridge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a627988c15011f84ec576cfa8db5006a82d1591
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Nov 19 08:32:52 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:19:47 2015 +0000

    tools/hotplug: quote all variables in vif-bridge
    
    Cosmetics: most of the variables used in vif-bridge are already quoted.
    Add quoting also to the remaining shell variables.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/Linux/vif-bridge |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index 3d72ca4..6956dea 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -68,7 +68,7 @@ else
 fi
 
 RET=0
-ip link show dev $bridge 1>/dev/null 2>&1 || RET=1
+ip link show dev "$bridge" 1>/dev/null 2>&1 || RET=1
 if [ "$RET" -eq 1 ]
 then
     fatal "Could not find bridge device $bridge"
@@ -77,7 +77,7 @@ fi
 case "$command" in
     online)
         setup_virtual_bridge_port "$dev"
-        set_mtu $bridge $dev
+        set_mtu "$bridge" "$dev"
         add_to_bridge "$bridge" "$dev"
         ;;
 
@@ -88,7 +88,7 @@ case "$command" in
 
     add)
         setup_virtual_bridge_port "$dev"
-        set_mtu $bridge $dev
+        set_mtu "$bridge" "$dev"
         add_to_bridge "$bridge" "$dev"
         ;;
 esac
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:49:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49: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 1a23Td-0004dk-6r; Thu, 26 Nov 2015 20:49: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 1a23Tc-0004dU-IZ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:12 +0000
Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id
	64/46-14422-74077565; Thu, 26 Nov 2015 20:49:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1448570950!6793959!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25253 invoked from network); 26 Nov 2015 20:49:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:49:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ta-0003B0-5d
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ta-0000dj-2z
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:10 +0000
Date: Thu, 26 Nov 2015 20:49:10 +0000
Message-Id: <E1a23Ta-0000dj-2z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/hotplug: quote all variables in
	vif-bridge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a627988c15011f84ec576cfa8db5006a82d1591
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Nov 19 08:32:52 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:19:47 2015 +0000

    tools/hotplug: quote all variables in vif-bridge
    
    Cosmetics: most of the variables used in vif-bridge are already quoted.
    Add quoting also to the remaining shell variables.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/Linux/vif-bridge |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index 3d72ca4..6956dea 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -68,7 +68,7 @@ else
 fi
 
 RET=0
-ip link show dev $bridge 1>/dev/null 2>&1 || RET=1
+ip link show dev "$bridge" 1>/dev/null 2>&1 || RET=1
 if [ "$RET" -eq 1 ]
 then
     fatal "Could not find bridge device $bridge"
@@ -77,7 +77,7 @@ fi
 case "$command" in
     online)
         setup_virtual_bridge_port "$dev"
-        set_mtu $bridge $dev
+        set_mtu "$bridge" "$dev"
         add_to_bridge "$bridge" "$dev"
         ;;
 
@@ -88,7 +88,7 @@ case "$command" in
 
     add)
         setup_virtual_bridge_port "$dev"
-        set_mtu $bridge $dev
+        set_mtu "$bridge" "$dev"
         add_to_bridge "$bridge" "$dev"
         ;;
 esac
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:49:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49: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 1a23Tq-0004fc-DC; Thu, 26 Nov 2015 20:49: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 1a23To-0004fI-Ga
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:25 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	AA/D3-01748-35077565; Thu, 26 Nov 2015 20:49:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1448570960!6937887!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44225 invoked from network); 26 Nov 2015 20:49:21 -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;
	26 Nov 2015 20:49:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Tk-0003BC-LD
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Tk-0000eF-G2
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:20 +0000
Date: Thu, 26 Nov 2015 20:49:20 +0000
Message-Id: <E1a23Tk-0000eF-G2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: convert libxl__sprintf(gc) to
	GCSPRINTF
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91cee732e31ff9f93a4515fbd5da003f618d8535
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Nov 17 16:19:19 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:21:02 2015 +0000

    libxl: convert libxl__sprintf(gc) to GCSPRINTF
    
    The rune used is:
    
      sed -i 's/libxl__sprintf(gc,\s*/GCSPRINTF(/g' libxl*.c
    
    This rune is simple and better than trying to match every possible
    patterns.
    
    Two instances in libxl_dm.c need fixing up. They are in fact better to just
    use libxl__strdup.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c            |  194 ++++++++++++++++++++--------------------
 tools/libxl/libxl_blktap2.c    |    4 +-
 tools/libxl/libxl_bootloader.c |   10 +-
 tools/libxl/libxl_create.c     |   42 +++++-----
 tools/libxl/libxl_dm.c         |  104 +++++++++++-----------
 tools/libxl/libxl_event.c      |    2 +-
 tools/libxl/libxl_internal.c   |    4 +-
 tools/libxl/libxl_pci.c        |  124 +++++++++++++-------------
 tools/libxl/libxl_xshelp.c     |    4 +-
 9 files changed, 244 insertions(+), 244 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 6ad9e13..cb8c932 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -389,7 +389,7 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
     dom_path = libxl__xs_get_dompath(gc, domid);
     if (!dom_path) goto x_nomem;
 
-    name_path= libxl__sprintf(gc, "%s/name", dom_path);
+    name_path= GCSPRINTF("%s/name", dom_path);
     if (!name_path) goto x_nomem;
 
     stub_dm_domid = libxl_get_stubdom_id(CTX, domid);
@@ -557,7 +557,7 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid,
 
     int rc;
 
-    preserved_name = libxl__sprintf(gc, "%s%s", info->name, name_suffix);
+    preserved_name = GCSPRINTF("%s%s", info->name, name_suffix);
     if (!preserved_name) {
         GC_FREE;
         return ERROR_NOMEM;
@@ -575,7 +575,7 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid,
         return ERROR_FAIL;
     }
 
-    vm_path = libxl__sprintf(gc, "/vm/%s", uuid_string);
+    vm_path = GCSPRINTF("/vm/%s", uuid_string);
     if (!vm_path) {
         GC_FREE;
         return ERROR_FAIL;
@@ -593,14 +593,14 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid,
     xs_mkdir(ctx->xsh, t, vm_path);
     xs_set_permissions(ctx->xsh, t, vm_path, roperm, ARRAY_SIZE(roperm));
 
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/vm", dom_path), vm_path, strlen(vm_path));
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/vm", dom_path), vm_path, strlen(vm_path));
     rc = libxl__domain_rename(gc, domid, info->name, preserved_name, t);
     if (rc) {
         GC_FREE;
         return rc;
     }
 
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/uuid", vm_path), uuid_string, strlen(uuid_string));
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/uuid", vm_path), uuid_string, strlen(uuid_string));
 
     if (!xs_transaction_end(ctx->xsh, t, 0))
         if (errno == EAGAIN)
@@ -1374,7 +1374,7 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
     libxl_device_disk *disk = &ev->u.disk_eject.disk;
     
     backend = libxl__xs_read(gc, XBT_NULL,
-                             libxl__sprintf(gc, "%.*s/backend",
+                             GCSPRINTF("%.*s/backend",
                                             (int)strlen(wpath)-6, wpath));
 
     sscanf(backend,
@@ -1393,7 +1393,7 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
     disk->format = LIBXL_DISK_FORMAT_EMPTY;
     /* this value is returned to the user: do not free right away */
     disk->vdev = xs_read(CTX->xsh, XBT_NULL,
-                         libxl__sprintf(gc, "%s/dev", backend), NULL);
+                         GCSPRINTF("%s/dev", backend), NULL);
     disk->removable = 1;
     disk->readwrite = 0;
     disk->is_cdrom = 1;
@@ -1424,7 +1424,7 @@ int libxl_evenable_disk_eject(libxl_ctx *ctx, uint32_t guest_domid,
     if (!domid)
         domid = guest_domid;
 
-    path = libxl__sprintf(gc, "%s/device/vbd/%d/eject",
+    path = GCSPRINTF("%s/device/vbd/%d/eject",
                  libxl__xs_get_dompath(gc, domid),
                  libxl__device_disk_dev_number(vdev, NULL, NULL));
     if (!path) { rc = ERROR_NOMEM; goto out; }
@@ -1622,7 +1622,7 @@ void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis)
             dm_present = 0;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
-        pid = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "/local/domain/%d/image/device-model-pid", domid));
+        pid = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("/local/domain/%d/image/device-model-pid", domid));
         dm_present = (pid != NULL);
         break;
     case LIBXL_DOMAIN_TYPE_INVALID:
@@ -1684,7 +1684,7 @@ static void devices_destroy_cb(libxl__egc *egc,
     if (rc < 0)
         LOG(ERROR, "libxl__devices_destroy failed for %d", domid);
 
-    vm_path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/vm", dom_path));
+    vm_path = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/vm", dom_path));
     if (vm_path)
         if (!xs_rm(ctx->xsh, XBT_NULL, vm_path))
             LOGE(ERROR, "xs_rm failed for %s", vm_path);
@@ -1693,7 +1693,7 @@ static void devices_destroy_cb(libxl__egc *egc,
         LOGE(ERROR, "xs_rm failed for %s", dom_path);
 
     xs_rm(ctx->xsh, XBT_NULL, libxl__xs_libxl_path(gc, domid));
-    xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc,
+    xs_rm(ctx->xsh, XBT_NULL, GCSPRINTF(
                                 "/local/domain/%d/hvmloader", domid));
 
     /* This is async operation, we already hold CTX lock */
@@ -1786,9 +1786,9 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
                        libxl_console_type type)
 {
     GC_INIT(ctx);
-    char *p = libxl__sprintf(gc, "%s/xenconsole", libxl__private_bindir_path());
-    char *domid_s = libxl__sprintf(gc, "%d", domid);
-    char *cons_num_s = libxl__sprintf(gc, "%d", cons_num);
+    char *p = GCSPRINTF("%s/xenconsole", libxl__private_bindir_path());
+    char *domid_s = GCSPRINTF("%d", domid);
+    char *cons_num_s = GCSPRINTF("%d", cons_num);
     char *cons_type_s;
 
     switch (type) {
@@ -1930,7 +1930,7 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
     };
 
     vnc_port = libxl__xs_read(gc, XBT_NULL,
-                            libxl__sprintf(gc,
+                            GCSPRINTF(
                             "/local/domain/%d/console/vnc-port", domid));
     if (!vnc_port) {
         LOG(ERROR, "Cannot get vnc-port of domain %d", domid);
@@ -1940,12 +1940,12 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
     port = atoi(vnc_port) - 5900;
 
     vnc_listen = libxl__xs_read(gc, XBT_NULL,
-                                libxl__sprintf(gc,
+                                GCSPRINTF(
                             "/local/domain/%d/console/vnc-listen", domid));
 
     if ( autopass )
         vnc_pass = libxl__xs_read(gc, XBT_NULL,
-                                  libxl__sprintf(gc,
+                                  GCSPRINTF(
                             "/local/domain/%d/console/vnc-pass", domid));
 
     if ( NULL == vnc_listen )
@@ -1954,7 +1954,7 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
     if ( (vnc_bin = getenv("VNCVIEWER")) )
         args[0] = vnc_bin;
 
-    args[1] = libxl__sprintf(gc, "%s:%d", vnc_listen, port);
+    args[1] = GCSPRINTF("%s:%d", vnc_listen, port);
 
     if ( vnc_pass ) {
         char tmpname[] = "/tmp/vncautopass.XXXXXX";
@@ -2213,7 +2213,7 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *n
 
     *num = 0;
 
-    fe_path = libxl__sprintf(gc, "%s/device/vtpm", libxl__xs_get_dompath(gc, domid));
+    fe_path = GCSPRINTF("%s/device/vtpm", libxl__xs_get_dompath(gc, domid));
     dir = libxl__xs_directory(gc, XBT_NULL, fe_path, &ndirs);
     if (dir && ndirs) {
        vtpms = malloc(sizeof(*vtpms) * ndirs);
@@ -2521,7 +2521,7 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                     int major, minor;
                     if (!libxl__device_physdisk_major_minor(dev, &major, &minor))
                         flexarray_append_pair(back, "physical-device",
-                                              libxl__sprintf(gc, "%x:%x", major, minor));
+                                              GCSPRINTF("%x:%x", major, minor));
                 }
 
                 assert(device->backend_kind == LIBXL__DEVICE_KIND_VBD);
@@ -2539,7 +2539,7 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                     }
                 }
                 flexarray_append(back, "tapdisk-params");
-                flexarray_append(back, libxl__sprintf(gc, "%s:%s",
+                flexarray_append(back, GCSPRINTF("%s:%s",
                     libxl__device_disk_string_of_format(disk->format),
                     disk->pdev_path));
 
@@ -2551,7 +2551,7 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                 goto do_backend_phy;
             case LIBXL_DISK_BACKEND_QDISK:
                 flexarray_append(back, "params");
-                flexarray_append(back, libxl__sprintf(gc, "%s:%s",
+                flexarray_append(back, GCSPRINTF("%s:%s",
                               libxl__device_disk_string_of_format(disk->format), disk->pdev_path));
                 assert(device->backend_kind == LIBXL__DEVICE_KIND_QDISK);
                 break;
@@ -2563,13 +2563,13 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
         }
 
         flexarray_append(back, "frontend-id");
-        flexarray_append(back, libxl__sprintf(gc, "%d", domid));
+        flexarray_append(back, GCSPRINTF("%d", domid));
         flexarray_append(back, "online");
         flexarray_append(back, "1");
         flexarray_append(back, "removable");
-        flexarray_append(back, libxl__sprintf(gc, "%d", (disk->removable) ? 1 : 0));
+        flexarray_append(back, GCSPRINTF("%d", (disk->removable) ? 1 : 0));
         flexarray_append(back, "bootable");
-        flexarray_append(back, libxl__sprintf(gc, "%d", 1));
+        flexarray_append(back, GCSPRINTF("%d", 1));
         flexarray_append(back, "state");
         flexarray_append(back, GCSPRINTF("%d", XenbusStateInitialising));
         flexarray_append(back, "dev");
@@ -2589,11 +2589,11 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                               "1" : "0");
 
         flexarray_append(front, "backend-id");
-        flexarray_append(front, libxl__sprintf(gc, "%d", disk->backend_domid));
+        flexarray_append(front, GCSPRINTF("%d", disk->backend_domid));
         flexarray_append(front, "state");
         flexarray_append(front, GCSPRINTF("%d", XenbusStateInitialising));
         flexarray_append(front, "virtual-device");
-        flexarray_append(front, libxl__sprintf(gc, "%d", device->devid));
+        flexarray_append(front, GCSPRINTF("%d", device->devid));
         flexarray_append(front, "device-type");
         flexarray_append(front, disk->is_cdrom ? "cdrom" : "disk");
 
@@ -2670,7 +2670,7 @@ static int libxl__device_disk_from_xs_be(libxl__gc *gc,
 
     /* "params" may not be present; but everything else must be. */
     tmp = xs_read(ctx->xsh, XBT_NULL,
-                  libxl__sprintf(gc, "%s/params", be_path), &len);
+                  GCSPRINTF("%s/params", be_path), &len);
     if (tmp && strchr(tmp, ':')) {
         disk->pdev_path = strdup(strchr(tmp, ':') + 1);
         free(tmp);
@@ -2680,7 +2680,7 @@ static int libxl__device_disk_from_xs_be(libxl__gc *gc,
 
 
     tmp = libxl__xs_read(gc, XBT_NULL,
-                         libxl__sprintf(gc, "%s/type", be_path));
+                         GCSPRINTF("%s/type", be_path));
     if (!tmp) {
         LOG(ERROR, "Missing xenstore node %s/type", be_path);
         goto cleanup;
@@ -2688,7 +2688,7 @@ static int libxl__device_disk_from_xs_be(libxl__gc *gc,
     libxl_string_to_backend(ctx, tmp, &(disk->backend));
 
     disk->vdev = xs_read(ctx->xsh, XBT_NULL,
-                         libxl__sprintf(gc, "%s/dev", be_path), &len);
+                         GCSPRINTF("%s/dev", be_path), &len);
     if (!disk->vdev) {
         LOG(ERROR, "Missing xenstore node %s/dev", be_path);
         goto cleanup;
@@ -2702,7 +2702,7 @@ static int libxl__device_disk_from_xs_be(libxl__gc *gc,
     }
     disk->removable = atoi(tmp);
 
-    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
+    tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/mode", be_path));
     if (!tmp) {
         LOG(ERROR, "Missing xenstore node %s/mode", be_path);
         goto cleanup;
@@ -2713,7 +2713,7 @@ static int libxl__device_disk_from_xs_be(libxl__gc *gc,
         disk->readwrite = 0;
 
     tmp = libxl__xs_read(gc, XBT_NULL,
-                         libxl__sprintf(gc, "%s/device-type", be_path));
+                         GCSPRINTF("%s/device-type", be_path));
     if (!tmp) {
         LOG(ERROR, "Missing xenstore node %s/device-type", be_path);
         goto cleanup;
@@ -2746,7 +2746,7 @@ int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
         goto out;
     }
     path = libxl__xs_read(gc, XBT_NULL,
-                          libxl__sprintf(gc, "%s/device/vbd/%d/backend",
+                          GCSPRINTF("%s/device/vbd/%d/backend",
                                          dompath, devid));
     if (!path)
         goto out;
@@ -2771,7 +2771,7 @@ static int libxl__append_disk_list_of_type(libxl__gc *gc,
     int rc=0;
     int initial_disks = *ndisks;
 
-    be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
+    be_path = GCSPRINTF("%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
     dir = libxl__xs_directory(gc, XBT_NULL, be_path, &n);
     if (dir && n) {
@@ -2784,7 +2784,7 @@ static int libxl__append_disk_list_of_type(libxl__gc *gc,
         pdisk_end = *disks + initial_disks + n;
         for (; pdisk < pdisk_end; pdisk++, dir++) {
             const char *p;
-            p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
+            p = GCSPRINTF("%s/%s", be_path, *dir);
             if ((rc=libxl__device_disk_from_xs_be(gc, p, pdisk)))
                 goto out;
             pdisk->backend_domid = 0;
@@ -2836,24 +2836,24 @@ int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid,
     diskinfo->devid = libxl__device_disk_dev_number(disk->vdev, NULL, NULL);
 
     /* tap devices entries in xenstore are written as vbd devices. */
-    diskpath = libxl__sprintf(gc, "%s/device/vbd/%d", dompath, diskinfo->devid);
+    diskpath = GCSPRINTF("%s/device/vbd/%d", dompath, diskinfo->devid);
     diskinfo->backend = xs_read(ctx->xsh, XBT_NULL,
-                                libxl__sprintf(gc, "%s/backend", diskpath), NULL);
+                                GCSPRINTF("%s/backend", diskpath), NULL);
     if (!diskinfo->backend) {
         GC_FREE;
         return ERROR_FAIL;
     }
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/backend-id", diskpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/backend-id", diskpath));
     diskinfo->backend_id = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/state", diskpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/state", diskpath));
     diskinfo->state = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/event-channel", diskpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/event-channel", diskpath));
     diskinfo->evtch = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/ring-ref", diskpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/ring-ref", diskpath));
     diskinfo->rref = val ? strtoul(val, NULL, 10) : -1;
     diskinfo->frontend = xs_read(ctx->xsh, XBT_NULL,
-                                 libxl__sprintf(gc, "%s/frontend", diskinfo->backend), NULL);
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend-id", diskinfo->backend));
+                                 GCSPRINTF("%s/frontend", diskinfo->backend), NULL);
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/frontend-id", diskinfo->backend));
     diskinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
 
     GC_FREE;
@@ -2976,11 +2976,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
         rc = libxl__xs_transaction_start(gc, &t);
         if (rc) goto out;
         /* Sanity check: make sure the backend exists before writing here */
-        tmp = libxl__xs_read(gc, t, libxl__sprintf(gc, "%s/frontend", path));
+        tmp = libxl__xs_read(gc, t, GCSPRINTF("%s/frontend", path));
         if (!tmp)
         {
             LOG(ERROR, "Internal error: %s does not exist",
-                libxl__sprintf(gc, "%s/frontend", path));
+                GCSPRINTF("%s/frontend", path));
             rc = ERROR_FAIL;
             goto out;
         }
@@ -3008,11 +3008,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
         rc = libxl__xs_transaction_start(gc, &t);
         if (rc) goto out;
         /* Sanity check: make sure the backend exists before writing here */
-        tmp = libxl__xs_read(gc, t, libxl__sprintf(gc, "%s/frontend", path));
+        tmp = libxl__xs_read(gc, t, GCSPRINTF("%s/frontend", path));
         if (!tmp)
         {
             LOG(ERROR, "Internal error: %s does not exist",
-                libxl__sprintf(gc, "%s/frontend", path));
+                GCSPRINTF("%s/frontend", path));
             rc = ERROR_FAIL;
             goto out;
         }
@@ -3070,7 +3070,7 @@ static char * libxl__alloc_vdev(libxl__gc *gc, void *get_vdev_user,
         if (devid < 0)
             return NULL;
         if (libxl__xs_read(gc, t,
-                    libxl__sprintf(gc, "%s/device/vbd/%d/backend",
+                    GCSPRINTF("%s/device/vbd/%d/backend",
                         dompath, devid)) == NULL) {
             if (errno == ENOENT)
                 return libxl__devid_to_localdev(gc, devid);
@@ -3348,7 +3348,7 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
     if ( rc != 0 ) goto out;
 
     flexarray_append(back, "frontend-id");
-    flexarray_append(back, libxl__sprintf(gc, "%d", domid));
+    flexarray_append(back, GCSPRINTF("%d", domid));
     flexarray_append(back, "online");
     flexarray_append(back, "1");
     flexarray_append(back, "state");
@@ -3364,7 +3364,7 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
     }
 
     flexarray_append(back, "mac");
-    flexarray_append(back,libxl__sprintf(gc,
+    flexarray_append(back,GCSPRINTF(
                                     LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));
     if (nic->ip) {
         flexarray_append(back, "ip");
@@ -3377,7 +3377,7 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
 
     if (nic->rate_interval_usecs > 0) {
         flexarray_append(back, "rate");
-        flexarray_append(back, libxl__sprintf(gc, "%"PRIu64",%"PRIu32"",
+        flexarray_append(back, GCSPRINTF("%"PRIu64",%"PRIu32"",
                             nic->rate_bytes_per_interval,
                             nic->rate_interval_usecs));
     }
@@ -3385,19 +3385,19 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
     flexarray_append(back, "bridge");
     flexarray_append(back, libxl__strdup(gc, nic->bridge));
     flexarray_append(back, "handle");
-    flexarray_append(back, libxl__sprintf(gc, "%d", nic->devid));
+    flexarray_append(back, GCSPRINTF("%d", nic->devid));
     flexarray_append(back, "type");
     flexarray_append(back, libxl__strdup(gc,
                                      libxl_nic_type_to_string(nic->nictype)));
 
     flexarray_append(front, "backend-id");
-    flexarray_append(front, libxl__sprintf(gc, "%d", nic->backend_domid));
+    flexarray_append(front, GCSPRINTF("%d", nic->backend_domid));
     flexarray_append(front, "state");
     flexarray_append(front, GCSPRINTF("%d", XenbusStateInitialising));
     flexarray_append(front, "handle");
-    flexarray_append(front, libxl__sprintf(gc, "%d", nic->devid));
+    flexarray_append(front, GCSPRINTF("%d", nic->devid));
     flexarray_append(front, "mac");
-    flexarray_append(front, libxl__sprintf(gc,
+    flexarray_append(front, GCSPRINTF(
                                     LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));
 
     if (aodev->update_json) {
@@ -3516,7 +3516,7 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
         goto out;
 
     path = libxl__xs_read(gc, XBT_NULL,
-                          libxl__sprintf(gc, "%s/device/vif/%d/backend",
+                          GCSPRINTF("%s/device/vif/%d/backend",
                                          dompath, devid));
     if (!path)
         goto out;
@@ -3542,7 +3542,7 @@ static int libxl__append_nic_list_of_type(libxl__gc *gc,
     libxl_device_nic *pnic = NULL, *pnic_end = NULL;
     int rc;
 
-    be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
+    be_path = GCSPRINTF("%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
     dir = libxl__xs_directory(gc, XBT_NULL, be_path, &n);
     if (dir && n) {
@@ -3555,7 +3555,7 @@ static int libxl__append_nic_list_of_type(libxl__gc *gc,
         pnic_end = *nics + *nnics + n;
         for (; pnic < pnic_end; pnic++, dir++) {
             const char *p;
-            p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
+            p = GCSPRINTF("%s/%s", be_path, *dir);
             rc = libxl__device_nic_from_xs_be(gc, p, pnic);
             if (rc) goto out;
             pnic->backend_domid = 0;
@@ -3602,26 +3602,26 @@ int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
     dompath = libxl__xs_get_dompath(gc, domid);
     nicinfo->devid = nic->devid;
 
-    nicpath = libxl__sprintf(gc, "%s/device/vif/%d", dompath, nicinfo->devid);
+    nicpath = GCSPRINTF("%s/device/vif/%d", dompath, nicinfo->devid);
     nicinfo->backend = xs_read(ctx->xsh, XBT_NULL,
-                                libxl__sprintf(gc, "%s/backend", nicpath), NULL);
+                                GCSPRINTF("%s/backend", nicpath), NULL);
     if (!nicinfo->backend) {
         GC_FREE;
         return ERROR_FAIL;
     }
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/backend-id", nicpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/backend-id", nicpath));
     nicinfo->backend_id = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/state", nicpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/state", nicpath));
     nicinfo->state = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/event-channel", nicpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/event-channel", nicpath));
     nicinfo->evtch = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/tx-ring-ref", nicpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/tx-ring-ref", nicpath));
     nicinfo->rref_tx = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/rx-ring-ref", nicpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/rx-ring-ref", nicpath));
     nicinfo->rref_rx = val ? strtoul(val, NULL, 10) : -1;
     nicinfo->frontend = xs_read(ctx->xsh, XBT_NULL,
-                                 libxl__sprintf(gc, "%s/frontend", nicinfo->backend), NULL);
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend-id", nicinfo->backend));
+                                 GCSPRINTF("%s/frontend", nicinfo->backend), NULL);
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/frontend-id", nicinfo->backend));
     nicinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
 
     GC_FREE;
@@ -3675,7 +3675,7 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
     device->kind = LIBXL__DEVICE_KIND_CONSOLE;
 
     flexarray_append(back, "frontend-id");
-    flexarray_append(back, libxl__sprintf(gc, "%d", domid));
+    flexarray_append(back, GCSPRINTF("%d", domid));
     flexarray_append(back, "online");
     flexarray_append(back, "1");
     flexarray_append(back, "state");
@@ -3697,10 +3697,10 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
     }
 
     flexarray_append(front, "backend-id");
-    flexarray_append(front, libxl__sprintf(gc, "%d", console->backend_domid));
+    flexarray_append(front, GCSPRINTF("%d", console->backend_domid));
 
     flexarray_append(ro_front, "limit");
-    flexarray_append(ro_front, libxl__sprintf(gc, "%d", LIBXL_XENCONSOLE_LIMIT));
+    flexarray_append(ro_front, GCSPRINTF("%d", LIBXL_XENCONSOLE_LIMIT));
     flexarray_append(ro_front, "type");
     if (console->consback == LIBXL__CONSOLE_BACKEND_XENCONSOLED)
         flexarray_append(ro_front, "xenconsoled");
@@ -3713,9 +3713,9 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
 
     if (state) {
         flexarray_append(ro_front, "port");
-        flexarray_append(ro_front, libxl__sprintf(gc, "%"PRIu32, state->console_port));
+        flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->console_port));
         flexarray_append(ro_front, "ring-ref");
-        flexarray_append(ro_front, libxl__sprintf(gc, "%lu", state->console_mfn));
+        flexarray_append(ro_front, GCSPRINTF("%lu", state->console_mfn));
     } else {
         flexarray_append(front, "state");
         flexarray_append(front, GCSPRINTF("%d", XenbusStateInitialising));
@@ -3846,7 +3846,7 @@ static int libxl__append_channel_list_of_type(libxl__gc *gc,
         const char *p, *name;
         libxl_device_channel *tmp;
 
-        p = libxl__sprintf(gc, "%s/%s", fe_path, dir[i]);
+        p = GCSPRINTF("%s/%s", fe_path, dir[i]);
         name = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/name", p));
         /* 'channels' are consoles with names, so ignore all consoles
            without names */
@@ -3909,10 +3909,10 @@ int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
     dompath = libxl__xs_get_dompath(gc, domid);
     channelinfo->devid = channel->devid;
 
-    fe_path = libxl__sprintf(gc, "%s/device/console/%d", dompath,
+    fe_path = GCSPRINTF("%s/device/console/%d", dompath,
                              channelinfo->devid + 1);
     channelinfo->backend = xs_read(ctx->xsh, XBT_NULL,
-                                   libxl__sprintf(gc, "%s/backend",
+                                   GCSPRINTF("%s/backend",
                                    fe_path), NULL);
     if (!channelinfo->backend) {
         GC_FREE;
@@ -4011,14 +4011,14 @@ int libxl__device_vkb_add(libxl__gc *gc, uint32_t domid,
     if (rc != 0) goto out;
 
     flexarray_append(back, "frontend-id");
-    flexarray_append(back, libxl__sprintf(gc, "%d", domid));
+    flexarray_append(back, GCSPRINTF("%d", domid));
     flexarray_append(back, "online");
     flexarray_append(back, "1");
     flexarray_append(back, "state");
     flexarray_append(back, GCSPRINTF("%d", XenbusStateInitialising));
 
     flexarray_append(front, "backend-id");
-    flexarray_append(front, libxl__sprintf(gc, "%d", vkb->backend_domid));
+    flexarray_append(front, GCSPRINTF("%d", vkb->backend_domid));
     flexarray_append(front, "state");
     flexarray_append(front, GCSPRINTF("%d", XenbusStateInitialising));
 
@@ -4109,7 +4109,7 @@ int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid, libxl_device_vfb *vfb)
     rc = libxl__device_from_vfb(gc, domid, vfb, &device);
     if (rc != 0) goto out;
 
-    flexarray_append_pair(back, "frontend-id", libxl__sprintf(gc, "%d", domid));
+    flexarray_append_pair(back, "frontend-id", GCSPRINTF("%d", domid));
     flexarray_append_pair(back, "online", "1");
     flexarray_append_pair(back, "state", GCSPRINTF("%d", XenbusStateInitialising));
     flexarray_append_pair(back, "vnc",
@@ -4117,7 +4117,7 @@ int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid, libxl_device_vfb *vfb)
     flexarray_append_pair(back, "vnclisten", vfb->vnc.listen);
     flexarray_append_pair(back, "vncpasswd", vfb->vnc.passwd);
     flexarray_append_pair(back, "vncdisplay",
-                          libxl__sprintf(gc, "%d", vfb->vnc.display));
+                          GCSPRINTF("%d", vfb->vnc.display));
     flexarray_append_pair(back, "vncunused",
                           libxl_defbool_val(vfb->vnc.findunused) ? "1" : "0");
     flexarray_append_pair(back, "sdl",
@@ -4132,7 +4132,7 @@ int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid, libxl_device_vfb *vfb)
     }
 
     flexarray_append_pair(front, "backend-id",
-                          libxl__sprintf(gc, "%d", vfb->backend_domid));
+                          GCSPRINTF("%d", vfb->backend_domid));
     flexarray_append_pair(front, "state", GCSPRINTF("%d", XenbusStateInitialising));
 
     libxl__device_generic_add(gc, XBT_NULL, &device,
@@ -4613,7 +4613,7 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint32_t max_memkb)
         goto out;
     }
 
-    mem = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/memory/target", dompath));
+    mem = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/memory/target", dompath));
     if (!mem) {
         LOGE(ERROR, "cannot get memory info from %s/memory/target", dompath);
         goto out;
@@ -4751,7 +4751,7 @@ int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid,
 retry_transaction:
     t = xs_transaction_start(ctx->xsh);
 
-    target = libxl__xs_read(gc, t, libxl__sprintf(gc,
+    target = libxl__xs_read(gc, t, GCSPRINTF(
                 "%s/memory/target", dompath));
     if (!target && !domid) {
         if (!xs_transaction_end(ctx->xsh, t, 1))
@@ -4775,7 +4775,7 @@ retry_transaction:
             goto out;
         }
     }
-    memmax = libxl__xs_read(gc, t, libxl__sprintf(gc,
+    memmax = libxl__xs_read(gc, t, GCSPRINTF(
                 "%s/memory/static-max", dompath));
     if (!memmax) {
         LOGE(ERROR, "cannot get memory info from %s/memory/static-max",
@@ -4791,7 +4791,7 @@ retry_transaction:
         goto out;
     }
 
-    videoram_s = libxl__xs_read(gc, t, libxl__sprintf(gc,
+    videoram_s = libxl__xs_read(gc, t, GCSPRINTF(
                 "%s/memory/videoram", dompath));
     videoram = videoram_s ? atoi(videoram_s) : 0;
 
@@ -4844,7 +4844,7 @@ retry_transaction:
         goto out;
     }
 
-    libxl__xs_write(gc, t, libxl__sprintf(gc, "%s/memory/target",
+    libxl__xs_write(gc, t, GCSPRINTF("%s/memory/target",
                 dompath), "%"PRIu32, new_target_memkb);
     rc = xc_domain_getinfolist(ctx->xch, domid, 1, &info);
     if (rc != 1 || info.domain != domid) {
@@ -4855,7 +4855,7 @@ retry_transaction:
     libxl_dominfo_init(&ptr);
     xcinfo2xlinfo(ctx, &info, &ptr);
     uuid = libxl__uuid2string(gc, ptr.uuid);
-    libxl__xs_write(gc, t, libxl__sprintf(gc, "/vm/%s/memory", uuid),
+    libxl__xs_write(gc, t, GCSPRINTF("/vm/%s/memory", uuid),
             "%"PRIu32, new_target_memkb / 1024);
     libxl_dominfo_dispose(&ptr);
 
@@ -4882,9 +4882,9 @@ static int libxl__get_memory_target(libxl__gc *gc, uint32_t domid,
     char *dompath = libxl__xs_get_dompath(gc, domid);
     uint32_t target_memkb, max_memkb;
 
-    target = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc,
+    target = libxl__xs_read(gc, XBT_NULL, GCSPRINTF(
                     "%s/memory/target", dompath));
-    static_max = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc,
+    static_max = libxl__xs_read(gc, XBT_NULL, GCSPRINTF(
                     "%s/memory/static-max", dompath));
 
     rc = ERROR_FAIL;
@@ -5492,7 +5492,7 @@ retry_transaction:
     t = xs_transaction_start(CTX->xsh);
     for (i = 0; i <= info->vcpu_max_id; i++)
         libxl__xs_write(gc, t,
-                       libxl__sprintf(gc, "%s/cpu/%u/availability", dompath, i),
+                       GCSPRINTF("%s/cpu/%u/availability", dompath, i),
                        "%s", libxl_bitmap_test(cpumap, i) ? "online" : "offline");
     if (!xs_transaction_end(CTX->xsh, t, 0)) {
         if (errno == EAGAIN)
@@ -5989,7 +5989,7 @@ int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq)
     GC_INIT(ctx);
     char *dompath = libxl__xs_get_dompath(gc, domid);
 
-    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/control/sysrq", dompath), "%c", sysrq);
+    libxl__xs_write(gc, XBT_NULL, GCSPRINTF("%s/control/sysrq", dompath), "%c", sysrq);
 
     GC_FREE;
     return 0;
@@ -6079,9 +6079,9 @@ uint32_t libxl_vm_get_start_time(libxl_ctx *ctx, uint32_t domid)
     uint32_t ret;
 
     vm_path = libxl__xs_read(
-        gc, XBT_NULL, libxl__sprintf(gc, "%s/vm", dompath));
+        gc, XBT_NULL, GCSPRINTF("%s/vm", dompath));
     start_time = libxl__xs_read(
-        gc, XBT_NULL, libxl__sprintf(gc, "%s/start_time", vm_path));
+        gc, XBT_NULL, GCSPRINTF("%s/start_time", vm_path));
     if (start_time == NULL) {
         LOGEV(ERROR, -1, "Can't get start time of domain '%d'", domid);
         ret = -1;
@@ -6266,12 +6266,12 @@ int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
     for (;;) {
         t = xs_transaction_start(ctx->xsh);
 
-        xs_mkdir(ctx->xsh, t, libxl__sprintf(gc, "/local/pool/%d", *poolid));
+        xs_mkdir(ctx->xsh, t, GCSPRINTF("/local/pool/%d", *poolid));
         libxl__xs_write(gc, t,
-                        libxl__sprintf(gc, "/local/pool/%d/uuid", *poolid),
+                        GCSPRINTF("/local/pool/%d/uuid", *poolid),
                         "%s", uuid_string);
         libxl__xs_write(gc, t,
-                        libxl__sprintf(gc, "/local/pool/%d/name", *poolid),
+                        GCSPRINTF("/local/pool/%d/name", *poolid),
                         "%s", name);
 
         if (xs_transaction_end(ctx->xsh, t, 0) || (errno != EAGAIN)) {
@@ -6324,7 +6324,7 @@ int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid)
     for (;;) {
         t = xs_transaction_start(ctx->xsh);
 
-        xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/pool/%d", poolid));
+        xs_rm(ctx->xsh, XBT_NULL, GCSPRINTF("/local/pool/%d", poolid));
 
         if (xs_transaction_end(ctx->xsh, t, 0) || (errno != EAGAIN))
             break;
@@ -6364,7 +6364,7 @@ int libxl_cpupool_rename(libxl_ctx *ctx, const char *name, uint32_t poolid)
         t = xs_transaction_start(ctx->xsh);
 
         libxl__xs_write(gc, t,
-                        libxl__sprintf(gc, "/local/pool/%d/name", poolid),
+                        GCSPRINTF("/local/pool/%d/name", poolid),
                         "%s", name);
 
         if (xs_transaction_end(ctx->xsh, t, 0))
diff --git a/tools/libxl/libxl_blktap2.c b/tools/libxl/libxl_blktap2.c
index 2053403..4f5e522 100644
--- a/tools/libxl/libxl_blktap2.c
+++ b/tools/libxl/libxl_blktap2.c
@@ -35,12 +35,12 @@ char *libxl__blktap_devpath(libxl__gc *gc,
     type = libxl__device_disk_string_of_format(format);
     err = tap_ctl_find(type, disk, &tap);
     if (err == 0) {
-        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", tap.minor);
+        devname = GCSPRINTF("/dev/xen/blktap-2/tapdev%d", tap.minor);
         if (devname)
             return devname;
     }
 
-    params = libxl__sprintf(gc, "%s:%s", type, disk);
+    params = GCSPRINTF("%s:%s", type, disk);
     err = tap_ctl_create(params, &devname);
     if (!err) {
         libxl__ptr_add(gc, devname);
diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index 9caf212..343fc30 100644
--- a/tools/libxl/libxl_bootloader.c
+++ b/tools/libxl/libxl_bootloader.c
@@ -60,15 +60,15 @@ static void make_bootloader_args(libxl__gc *gc, libxl__bootloader_state *bl,
     ARG(bootloader_path);
 
     if (info->kernel)
-        ARG(libxl__sprintf(gc, "--kernel=%s", info->kernel));
+        ARG(GCSPRINTF("--kernel=%s", info->kernel));
     if (info->ramdisk)
-        ARG(libxl__sprintf(gc, "--ramdisk=%s", info->ramdisk));
+        ARG(GCSPRINTF("--ramdisk=%s", info->ramdisk));
     if (info->cmdline && *info->cmdline != '\0')
-        ARG(libxl__sprintf(gc, "--args=%s", info->cmdline));
+        ARG(GCSPRINTF("--args=%s", info->cmdline));
 
-    ARG(libxl__sprintf(gc, "--output=%s", bl->outputpath));
+    ARG(GCSPRINTF("--output=%s", bl->outputpath));
     ARG("--output-format=simple0");
-    ARG(libxl__sprintf(gc, "--output-directory=%s", bl->outputdir));
+    ARG(GCSPRINTF("--output-directory=%s", bl->outputdir));
 
     if (info->u.pv.bootloader_args) {
         char **p = info->u.pv.bootloader_args;
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index f0fee00..8770486 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -421,7 +421,7 @@ int libxl__domain_build(libxl__gc *gc,
         vments[2] = "image/ostype";
         vments[3] = "hvm";
         vments[4] = "start_time";
-        vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
+        vments[5] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
 
         localents = libxl__calloc(gc, 9, sizeof(char *));
         i = 0;
@@ -438,7 +438,7 @@ int libxl__domain_build(libxl__gc *gc,
             if (max_ram_below_4g <= HVM_BELOW_4G_MMIO_START) {
                 localents[i++] = "platform/mmio_hole_size";
                 localents[i++] =
-                    libxl__sprintf(gc, "%"PRIu64,
+                    GCSPRINTF("%"PRIu64,
                                    info->u.hvm.mmio_hole_memkb << 10);
             }
         }
@@ -458,7 +458,7 @@ int libxl__domain_build(libxl__gc *gc,
         vments[i++] = "image/kernel";
         vments[i++] = (char *) state->pv_kernel.path;
         vments[i++] = "start_time";
-        vments[i++] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
+        vments[i++] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
         if (state->pv_ramdisk.path) {
             vments[i++] = "image/ramdisk";
             vments[i++] = (char *) state->pv_ramdisk.path;
@@ -555,7 +555,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
         goto out;
     }
 
-    vm_path = libxl__sprintf(gc, "/vm/%s", uuid_string);
+    vm_path = GCSPRINTF("/vm/%s", uuid_string);
     if (!vm_path) {
         LOG(ERROR, "cannot allocate create paths");
         rc = ERROR_FAIL;
@@ -591,36 +591,36 @@ retry_transaction:
     xs_rm(ctx->xsh, t, libxl_path);
     libxl__xs_mkdir(gc, t, libxl_path, noperm, ARRAY_SIZE(noperm));
 
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/vm", dom_path), vm_path, strlen(vm_path));
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/vm", dom_path), vm_path, strlen(vm_path));
     rc = libxl__domain_rename(gc, *domid, 0, info->name, t);
     if (rc)
         goto out;
 
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/cpu", dom_path),
+                    GCSPRINTF("%s/cpu", dom_path),
                     roperm, ARRAY_SIZE(roperm));
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/memory", dom_path),
+                    GCSPRINTF("%s/memory", dom_path),
                     roperm, ARRAY_SIZE(roperm));
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/device", dom_path),
+                    GCSPRINTF("%s/device", dom_path),
                     roperm, ARRAY_SIZE(roperm));
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/control", dom_path),
+                    GCSPRINTF("%s/control", dom_path),
                     roperm, ARRAY_SIZE(roperm));
     if (info->type == LIBXL_DOMAIN_TYPE_HVM)
         libxl__xs_mkdir(gc, t,
-                        libxl__sprintf(gc, "%s/hvmloader", dom_path),
+                        GCSPRINTF("%s/hvmloader", dom_path),
                         roperm, ARRAY_SIZE(roperm));
 
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/control/shutdown", dom_path),
+                    GCSPRINTF("%s/control/shutdown", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/device/suspend/event-channel", dom_path),
+                    GCSPRINTF("%s/device/suspend/event-channel", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/data", dom_path),
+                    GCSPRINTF("%s/data", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));
 
     if (libxl_defbool_val(info->driver_domain)) {
@@ -646,14 +646,14 @@ retry_transaction:
     }
     libxl_vminfo_list_free(vm_list, nb_vm);
 
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/uuid", vm_path), uuid_string, strlen(uuid_string));
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/name", vm_path), info->name, strlen(info->name));
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/uuid", vm_path), uuid_string, strlen(uuid_string));
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/name", vm_path), info->name, strlen(info->name));
 
     libxl__xs_writev(gc, t, dom_path, info->xsdata);
-    libxl__xs_writev(gc, t, libxl__sprintf(gc, "%s/platform", dom_path), info->platformdata);
+    libxl__xs_writev(gc, t, GCSPRINTF("%s/platform", dom_path), info->platformdata);
 
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/control/platform-feature-multiprocessor-suspend", dom_path), "1", 1);
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/control/platform-feature-xs_reset_watches", dom_path), "1", 1);
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/control/platform-feature-multiprocessor-suspend", dom_path), "1", 1);
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/control/platform-feature-xs_reset_watches", dom_path), "1", 1);
     if (!xs_transaction_end(ctx->xsh, t, 0)) {
         if (errno == EAGAIN) {
             t = 0;
@@ -677,7 +677,7 @@ static int store_libxl_entry(libxl__gc *gc, uint32_t domid,
     char *path = NULL;
 
     path = libxl__xs_libxl_path(gc, domid);
-    path = libxl__sprintf(gc, "%s/dm-version", path);
+    path = GCSPRINTF("%s/dm-version", path);
     return libxl__xs_write(gc, XBT_NULL, path, "%s",
         libxl_device_model_version_to_string(b_info->device_model_version));
 }
@@ -1081,7 +1081,7 @@ static void domcreate_stream_done(libxl__egc *egc,
         vments[2] = "image/ostype";
         vments[3] = "hvm";
         vments[4] = "start_time";
-        vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
+        vments[5] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         vments = libxl__calloc(gc, 11, sizeof(char *));
@@ -1091,7 +1091,7 @@ static void domcreate_stream_done(libxl__egc *egc,
         vments[i++] = "image/kernel";
         vments[i++] = (char *) state->pv_kernel.path;
         vments[i++] = "start_time";
-        vments[i++] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
+        vments[i++] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
         if (state->pv_ramdisk.path) {
             vments[i++] = "image/ramdisk";
             vments[i++] = (char *) state->pv_ramdisk.path;
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 175accd..ca39f41 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -29,13 +29,13 @@ static const char *libxl_tapif_script(libxl__gc *gc)
 #if defined(__linux__) || defined(__FreeBSD__)
     return libxl__strdup(gc, "no");
 #else
-    return libxl__sprintf(gc, "%s/qemu-ifup", libxl__xen_script_dir_path());
+    return GCSPRINTF("%s/qemu-ifup", libxl__xen_script_dir_path());
 #endif
 }
 
 const char *libxl__device_model_savefile(libxl__gc *gc, uint32_t domid)
 {
-    return libxl__sprintf(gc, LIBXL_DEVICE_MODEL_SAVE_FILE".%d", domid);
+    return GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d", domid);
 }
 
 static const char *qemu_xen_path(libxl__gc *gc)
@@ -416,7 +416,7 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
     dm_envs = flexarray_make(gc, 16, 1);
 
     flexarray_vappend(dm_args, dm,
-                      "-d", libxl__sprintf(gc, "%d", domid), NULL);
+                      "-d", GCSPRINTF("%d", domid), NULL);
 
     if (c_info->name)
         flexarray_vappend(dm_args, "-domain-name", c_info->name, NULL);
@@ -442,14 +442,14 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
                 }
                 vncarg = vnc->listen;
             } else {
-                vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen,
+                vncarg = GCSPRINTF("%s:%d", vnc->listen,
                                         vnc->display);
             }
         } else
-            vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
+            vncarg = GCSPRINTF("127.0.0.1:%d", vnc->display);
 
         if (vnc->passwd && vnc->passwd[0]) {
-            vncarg = libxl__sprintf(gc, "%s,password", vncarg);
+            vncarg = GCSPRINTF("%s,password", vncarg);
         }
 
         flexarray_append(dm_args, vncarg);
@@ -517,7 +517,7 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
 
         if (b_info->video_memkb) {
             flexarray_vappend(dm_args, "-videoram",
-                    libxl__sprintf(gc, "%d",
+                    GCSPRINTF("%d",
                                    libxl__sizekb_to_mb(b_info->video_memkb)),
                     NULL);
         }
@@ -569,19 +569,19 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
         }
         if (b_info->max_vcpus > 1) {
             flexarray_vappend(dm_args, "-vcpus",
-                              libxl__sprintf(gc, "%d", b_info->max_vcpus),
+                              GCSPRINTF("%d", b_info->max_vcpus),
                               NULL);
         }
 
         nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
         s = libxl_bitmap_to_hex_string(CTX, &b_info->avail_vcpus);
         flexarray_vappend(dm_args, "-vcpu_avail",
-                              libxl__sprintf(gc, "%s", s), NULL);
+                              GCSPRINTF("%s", s), NULL);
         free(s);
 
         for (i = 0; i < num_nics; i++) {
             if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
-                char *smac = libxl__sprintf(gc,
+                char *smac = GCSPRINTF(
                                    LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nics[i].mac));
                 const char *ifname = libxl__device_nic_devname(gc,
                                                 domid, nics[i].devid,
@@ -683,26 +683,26 @@ static char *dm_spice_options(libxl__gc *gc,
             return NULL;
         }
     }
-    opt = libxl__sprintf(gc, "port=%d,tls-port=%d",
+    opt = GCSPRINTF("port=%d,tls-port=%d",
                          spice->port, spice->tls_port);
     if (spice->host)
-        opt = libxl__sprintf(gc, "%s,addr=%s", opt, spice->host);
+        opt = GCSPRINTF("%s,addr=%s", opt, spice->host);
     if (libxl_defbool_val(spice->disable_ticketing))
-        opt = libxl__sprintf(gc, "%s,disable-ticketing", opt);
+        opt = GCSPRINTF("%s,disable-ticketing", opt);
     else
-        opt = libxl__sprintf(gc, "%s,password=%s", opt, spice->passwd);
-    opt = libxl__sprintf(gc, "%s,agent-mouse=%s", opt,
+        opt = GCSPRINTF("%s,password=%s", opt, spice->passwd);
+    opt = GCSPRINTF("%s,agent-mouse=%s", opt,
                          libxl_defbool_val(spice->agent_mouse) ? "on" : "off");
 
     if (!libxl_defbool_val(spice->clipboard_sharing))
-        opt = libxl__sprintf(gc, "%s,disable-copy-paste", opt);
+        opt = GCSPRINTF("%s,disable-copy-paste", opt);
 
     if (spice->image_compression)
-        opt = libxl__sprintf(gc, "%s,image-compression=%s", opt,
+        opt = GCSPRINTF("%s,image-compression=%s", opt,
                              spice->image_compression);
 
     if (spice->streaming_video)
-        opt = libxl__sprintf(gc, "%s,streaming-video=%s", opt,
+        opt = GCSPRINTF("%s,streaming-video=%s", opt,
                              spice->streaming_video);
 
     return opt;
@@ -782,11 +782,11 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 
     flexarray_vappend(dm_args, dm,
                       "-xen-domid",
-                      libxl__sprintf(gc, "%d", guest_domid), NULL);
+                      GCSPRINTF("%d", guest_domid), NULL);
 
     flexarray_append(dm_args, "-chardev");
     flexarray_append(dm_args,
-                     libxl__sprintf(gc, "socket,id=libxl-cmd,"
+                     GCSPRINTF("socket,id=libxl-cmd,"
                                     "path=%s/qmp-libxl-%d,server,nowait",
                                     libxl__run_dir_path(), guest_domid));
 
@@ -796,7 +796,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 
     flexarray_append(dm_args, "-chardev");
     flexarray_append(dm_args,
-                     libxl__sprintf(gc, "socket,id=libxenstat-cmd,"
+                     GCSPRINTF("socket,id=libxenstat-cmd,"
                                     "path=%s/qmp-libxenstat-%d,server,nowait",
                                     libxl__run_dir_path(), guest_domid));
 
@@ -860,21 +860,21 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                 }
                 vncarg = vnc->listen;
             } else {
-                vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen,
+                vncarg = GCSPRINTF("%s:%d", vnc->listen,
                                         vnc->display);
             }
         } else
-            vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
+            vncarg = GCSPRINTF("127.0.0.1:%d", vnc->display);
 
         if (vnc->passwd && vnc->passwd[0]) {
-            vncarg = libxl__sprintf(gc, "%s,password", vncarg);
+            vncarg = GCSPRINTF("%s,password", vncarg);
         }
 
         if (libxl_defbool_val(vnc->findunused)) {
             /* This option asks to QEMU to try this number of port before to
              * give up.  So QEMU will try ports between $display and $display +
              * 99.  This option needs to be the last one of the vnc options. */
-            vncarg = libxl__sprintf(gc, "%s,to=99", vncarg);
+            vncarg = GCSPRINTF("%s,to=99", vncarg);
         }
 
         flexarray_append(dm_args, vncarg);
@@ -978,7 +978,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 
         if (b_info->u.hvm.boot) {
             flexarray_vappend(dm_args, "-boot",
-                    libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot), NULL);
+                    GCSPRINTF("order=%s", b_info->u.hvm.boot), NULL);
         }
         if (libxl_defbool_val(b_info->u.hvm.usb)
             || b_info->u.hvm.usbdevice
@@ -1029,9 +1029,9 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             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,
+                    flexarray_vappend(dm_args, "-chardev", GCSPRINTF(
                         "spicevmc,name=usbredir,id=usbrc%d", i), "-device",
-                        libxl__sprintf(gc, "usb-redir,chardev=usbrc%d,"
+                        GCSPRINTF("usb-redir,chardev=usbrc%d,"
                         "id=usbrc%d", i, i), NULL);
             } else {
                 LOG(ERROR, "usbredirection parameter is invalid, "
@@ -1051,23 +1051,23 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                 int nr_set_cpus = 0;
                 nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
 
-                flexarray_append(dm_args, libxl__sprintf(gc, "%d,maxcpus=%d",
+                flexarray_append(dm_args, GCSPRINTF("%d,maxcpus=%d",
                                                          nr_set_cpus,
                                                          b_info->max_vcpus));
             } else
-                flexarray_append(dm_args, libxl__sprintf(gc, "%d",
+                flexarray_append(dm_args, GCSPRINTF("%d",
                                                          b_info->max_vcpus));
         }
         for (i = 0; i < num_nics; i++) {
             if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
-                char *smac = libxl__sprintf(gc,
+                char *smac = GCSPRINTF(
                                 LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nics[i].mac));
                 const char *ifname = libxl__device_nic_devname(gc,
                                                 guest_domid, nics[i].devid,
                                                 LIBXL_NIC_TYPE_VIF_IOEMU);
                 flexarray_append(dm_args, "-device");
                 flexarray_append(dm_args,
-                   libxl__sprintf(gc, "%s,id=nic%d,netdev=net%d,mac=%s",
+                   GCSPRINTF("%s,id=nic%d,netdev=net%d,mac=%s",
                                                 nics[i].model, nics[i].devid,
                                                 nics[i].devid, smac));
                 flexarray_append(dm_args, "-netdev");
@@ -1112,9 +1112,9 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             /* Switching here to the machine "pc" which does not add
              * the xen-platform device instead of the default "xenfv" machine.
              */
-            machinearg = libxl__sprintf(gc, "pc,accel=xen");
+            machinearg = libxl__strdup(gc, "pc,accel=xen");
         } else {
-            machinearg = libxl__sprintf(gc, "xenfv");
+            machinearg = libxl__strdup(gc, "xenfv");
         }
         if (b_info->u.hvm.mmio_hole_memkb) {
             uint64_t max_ram_below_4g = (1ULL << 32) -
@@ -1125,7 +1125,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                     " invalid ignored.\n",
                     b_info->u.hvm.mmio_hole_memkb);
             } else {
-                machinearg = libxl__sprintf(gc, "%s,max-ram-below-4g=%"PRIu64,
+                machinearg = GCSPRINTF("%s,max-ram-below-4g=%"PRIu64,
                                             machinearg, max_ram_below_4g);
             }
         }
@@ -1156,7 +1156,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 
     ram_size = libxl__sizekb_to_mb(b_info->max_memkb - b_info->video_memkb);
     flexarray_append(dm_args, "-m");
-    flexarray_append(dm_args, libxl__sprintf(gc, "%"PRId64, ram_size));
+    flexarray_append(dm_args, GCSPRINTF("%"PRId64, ram_size));
 
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         if (b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI)
@@ -1264,7 +1264,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             goto end_search;
         }
 
-        user = libxl__sprintf(gc, "%s%d", LIBXL_QEMU_USER_BASE, guest_domid);
+        user = GCSPRINTF("%s%d", LIBXL_QEMU_USER_BASE, guest_domid);
         ret = libxl__dm_runas_helper(gc, user);
         if (ret < 0)
             return ret;
@@ -1388,7 +1388,7 @@ static int libxl__write_stub_dmargs(libxl__gc *gc,
     roperm[1].id = dm_domid;
     roperm[1].perms = XS_PERM_READ;
 
-    vm_path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "/local/domain/%d/vm", guest_domid));
+    vm_path = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("/local/domain/%d/vm", guest_domid));
 
     i = 0;
     dmargs_size = 0;
@@ -1407,13 +1407,13 @@ static int libxl__write_stub_dmargs(libxl__gc *gc,
         }
         i++;
     }
-    path = libxl__sprintf(gc, "%s/image/dmargs", vm_path);
+    path = GCSPRINTF("%s/image/dmargs", vm_path);
 
 retry_transaction:
     t = xs_transaction_start(ctx->xsh);
     xs_write(ctx->xsh, t, path, dmargs, strlen(dmargs));
     xs_set_permissions(ctx->xsh, t, path, roperm, ARRAY_SIZE(roperm));
-    xs_set_permissions(ctx->xsh, t, libxl__sprintf(gc, "%s/rtc/timeoffset", vm_path), roperm, ARRAY_SIZE(roperm));
+    xs_set_permissions(ctx->xsh, t, GCSPRINTF("%s/rtc/timeoffset", vm_path), roperm, ARRAY_SIZE(roperm));
     if (!xs_transaction_end(ctx->xsh, t, 0))
         if (errno == EAGAIN)
             goto retry_transaction;
@@ -1436,7 +1436,7 @@ static void stubdom_xswait_cb(libxl__egc *egc, libxl__xswait_state *xswait,
 
 char *libxl__stub_dm_name(libxl__gc *gc, const char *guest_name)
 {
-    return libxl__sprintf(gc, "%s-dm", guest_name);
+    return GCSPRINTF("%s-dm", guest_name);
 }
 
 void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
@@ -1518,7 +1518,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
 
     stubdom_state->pv_kernel.path
         = libxl__abs_path(gc, "ioemu-stubdom.gz", libxl__xenfirmwaredir_path());
-    stubdom_state->pv_cmdline = libxl__sprintf(gc, " -d %d", guest_domid);
+    stubdom_state->pv_cmdline = GCSPRINTF(" -d %d", guest_domid);
     stubdom_state->pv_ramdisk.path = "";
 
     /* fixme: this function can leak the stubdom if it fails */
@@ -1541,11 +1541,11 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
 
     libxl__write_stub_dmargs(gc, dm_domid, guest_domid, args);
     libxl__xs_write(gc, XBT_NULL,
-                   libxl__sprintf(gc, "%s/image/device-model-domid",
+                   GCSPRINTF("%s/image/device-model-domid",
                                   libxl__xs_get_dompath(gc, guest_domid)),
                    "%d", dm_domid);
     libxl__xs_write(gc, XBT_NULL,
-                   libxl__sprintf(gc, "%s/target",
+                   GCSPRINTF("%s/target",
                                   libxl__xs_get_dompath(gc, dm_domid)),
                    "%d", guest_domid);
     ret = xc_domain_set_target(ctx->xch, dm_domid, guest_domid);
@@ -1639,21 +1639,21 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
             char *filename;
             char *name;
             case STUBDOM_CONSOLE_LOGGING:
-                name = libxl__sprintf(gc, "qemu-dm-%s",
+                name = GCSPRINTF("qemu-dm-%s",
                                       libxl_domid_to_name(ctx, guest_domid));
                 ret = libxl_create_logfile(ctx, name, &filename);
                 if (ret) goto out;
-                console[i].output = libxl__sprintf(gc, "file:%s", filename);
+                console[i].output = GCSPRINTF("file:%s", filename);
                 free(filename);
                 break;
             case STUBDOM_CONSOLE_SAVE:
-                console[i].output = libxl__sprintf(gc, "file:%s",
+                console[i].output = GCSPRINTF("file:%s",
                                 libxl__device_model_savefile(gc, guest_domid));
                 break;
             case STUBDOM_CONSOLE_RESTORE:
                 if (d_state->saved_state)
                     console[i].output =
-                        libxl__sprintf(gc, "pipe:%s", d_state->saved_state);
+                        GCSPRINTF("pipe:%s", d_state->saved_state);
                 break;
             default:
                 console[i].output = "pty";
@@ -1822,13 +1822,13 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         path = xs_get_domain_path(ctx->xsh, domid);
         libxl__xs_write(gc, XBT_NULL,
-                        libxl__sprintf(gc, "%s/hvmloader/bios", path),
+                        GCSPRINTF("%s/hvmloader/bios", path),
                         "%s", libxl_bios_type_to_string(b_info->u.hvm.bios));
         /* Disable relocating memory to make the MMIO hole larger
          * unless we're running qemu-traditional and vNUMA is not
          * configured. */
         libxl__xs_write(gc, XBT_NULL,
-                        libxl__sprintf(gc,
+                        GCSPRINTF(
                                        "%s/hvmloader/allow-memory-relocate",
                                        path),
                         "%d",
@@ -1843,7 +1843,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM &&
         b_info->device_model_version
         == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL)
-        libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/disable_pf", path),
+        libxl__xs_write(gc, XBT_NULL, GCSPRINTF("%s/disable_pf", path),
                     "%d", !libxl_defbool_val(b_info->u.hvm.xen_platform_pci));
 
     logfile_w = libxl__create_qemu_logfile(gc, GCSPRINTF("qemu-dm-%s",
@@ -1868,7 +1868,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
 retry_transaction:
         /* Find uuid and the write the vnc password to xenstore for qemu. */
         t = xs_transaction_start(ctx->xsh);
-        vm_path = libxl__xs_read(gc,t,libxl__sprintf(gc, "%s/vm", dom_path));
+        vm_path = libxl__xs_read(gc,t,GCSPRINTF("%s/vm", dom_path));
         if (vm_path) {
             /* Now write the vncpassword into it. */
             pass_stuff = libxl__calloc(gc, 3, sizeof(char *));
diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 0df6d6c..139e49a 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -580,7 +580,7 @@ static void watchfd_callback(libxl__egc *egc, libxl__ev_fd *ev,
 
 static char *watch_token(libxl__gc *gc, int slotnum, uint32_t counterval)
 {
-    return libxl__sprintf(gc, "%d/%"PRIx32, slotnum, counterval);
+    return GCSPRINTF("%d/%"PRIx32, slotnum, counterval);
 }
 
 static void watches_check_fd_deregister(libxl__gc *gc)
diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
index c69d6f9..328046b 100644
--- a/tools/libxl/libxl_internal.c
+++ b/tools/libxl/libxl_internal.c
@@ -242,7 +242,7 @@ void libxl__log(libxl_ctx *ctx, xentoollog_level msglevel, int errnoval,
 char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path)
 {
     if (s[0] == '/') return libxl__strdup(gc, s);
-    return libxl__sprintf(gc, "%s/%s", path, s);
+    return GCSPRINTF("%s/%s", path, s);
 }
 
 
@@ -368,7 +368,7 @@ int libxl__device_model_version_running(libxl__gc *gc, uint32_t domid)
     libxl_device_model_version value;
 
     path = libxl__xs_libxl_path(gc, domid);
-    path = libxl__sprintf(gc, "%s/dm-version", path);
+    path = GCSPRINTF("%s/dm-version", path);
     dm_version = libxl__xs_read(gc, XBT_NULL, path);
     if (!dm_version) {
         return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index fad2eb6..bb49e88 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -50,18 +50,18 @@ static int pcidev_struct_fill(libxl_device_pci *pcidev, unsigned int domain,
 
 static void libxl_create_pci_backend_device(libxl__gc *gc, flexarray_t *back, int num, libxl_device_pci *pcidev)
 {
-    flexarray_append(back, libxl__sprintf(gc, "key-%d", num));
-    flexarray_append(back, libxl__sprintf(gc, PCI_BDF, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func));
-    flexarray_append(back, libxl__sprintf(gc, "dev-%d", num));
-    flexarray_append(back, libxl__sprintf(gc, PCI_BDF, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func));
+    flexarray_append(back, GCSPRINTF("key-%d", num));
+    flexarray_append(back, GCSPRINTF(PCI_BDF, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func));
+    flexarray_append(back, GCSPRINTF("dev-%d", num));
+    flexarray_append(back, GCSPRINTF(PCI_BDF, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func));
     if (pcidev->vdevfn)
-        flexarray_append_pair(back, libxl__sprintf(gc, "vdevfn-%d", num), libxl__sprintf(gc, "%x", pcidev->vdevfn));
-    flexarray_append(back, libxl__sprintf(gc, "opts-%d", num));
+        flexarray_append_pair(back, GCSPRINTF("vdevfn-%d", num), GCSPRINTF("%x", pcidev->vdevfn));
+    flexarray_append(back, GCSPRINTF("opts-%d", num));
     flexarray_append(back,
-              libxl__sprintf(gc, "msitranslate=%d,power_mgmt=%d,permissive=%d",
+              GCSPRINTF("msitranslate=%d,power_mgmt=%d,permissive=%d",
                              pcidev->msitranslate, pcidev->power_mgmt,
                              pcidev->permissive));
-    flexarray_append_pair(back, libxl__sprintf(gc, "state-%d", num), GCSPRINTF("%d", XenbusStateInitialising));
+    flexarray_append_pair(back, GCSPRINTF("state-%d", num), GCSPRINTF("%d", XenbusStateInitialising));
 }
 
 static int libxl__device_from_pcidev(libxl__gc *gc, uint32_t domid,
@@ -96,7 +96,7 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
     /* add pci device */
     libxl__device_from_pcidev(gc, domid, pcidev, &device);
 
-    flexarray_append_pair(back, "frontend-id", libxl__sprintf(gc, "%d", domid));
+    flexarray_append_pair(back, "frontend-id", GCSPRINTF("%d", domid));
     flexarray_append_pair(back, "online", "1");
     flexarray_append_pair(back, "state", GCSPRINTF("%d", XenbusStateInitialising));
     flexarray_append_pair(back, "domain", libxl__domid_to_name(gc, domid));
@@ -104,8 +104,8 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
     for (i = 0; i < num; i++, pcidev++)
         libxl_create_pci_backend_device(gc, back, i, pcidev);
 
-    flexarray_append_pair(back, "num_devs", libxl__sprintf(gc, "%d", num));
-    flexarray_append_pair(front, "backend-id", libxl__sprintf(gc, "%d", 0));
+    flexarray_append_pair(back, "num_devs", GCSPRINTF("%d", num));
+    flexarray_append_pair(front, "backend-id", GCSPRINTF("%d", 0));
     flexarray_append_pair(front, "state", GCSPRINTF("%d", XenbusStateInitialising));
 
     libxl__device_generic_add(gc, XBT_NULL, &device,
@@ -132,8 +132,8 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_d
     libxl_device_pci_init(&pcidev_saved);
     libxl_device_pci_copy(CTX, &pcidev_saved, pcidev);
 
-    be_path = libxl__sprintf(gc, "%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
-    num_devs = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/num_devs", be_path));
+    be_path = GCSPRINTF("%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
+    num_devs = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/num_devs", be_path));
     if (!num_devs)
         return libxl__create_pci_backend(gc, domid, pcidev, 1);
 
@@ -151,7 +151,7 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_d
     LOG(DEBUG, "Adding new pci device to xenstore");
     num = atoi(num_devs);
     libxl_create_pci_backend_device(gc, back, num, pcidev);
-    flexarray_append_pair(back, "num_devs", libxl__sprintf(gc, "%d", num + 1));
+    flexarray_append_pair(back, "num_devs", GCSPRINTF("%d", num + 1));
     if (!starting)
         flexarray_append_pair(back, "state", GCSPRINTF("%d", XenbusStateReconfiguring));
 
@@ -199,8 +199,8 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx
     int num, i, j;
     xs_transaction_t t;
 
-    be_path = libxl__sprintf(gc, "%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
-    num_devs_path = libxl__sprintf(gc, "%s/num_devs", be_path);
+    be_path = GCSPRINTF("%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
+    num_devs_path = GCSPRINTF("%s/num_devs", be_path);
     num_devs = libxl__xs_read(gc, XBT_NULL, num_devs_path);
     if (!num_devs)
         return ERROR_INVAL;
@@ -219,7 +219,7 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx
 
     for (i = 0; i < num; i++) {
         unsigned int domain = 0, bus = 0, dev = 0, func = 0;
-        xsdev = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/dev-%d", be_path, i));
+        xsdev = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/dev-%d", be_path, i));
         sscanf(xsdev, PCI_BDF, &domain, &bus, &dev, &func);
         if (domain == pcidev->domain && bus == pcidev->bus &&
             pcidev->dev == dev && pcidev->func == func) {
@@ -233,8 +233,8 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx
 
 retry_transaction:
     t = xs_transaction_start(ctx->xsh);
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/state-%d", be_path, i), GCSPRINTF("%d", XenbusStateClosing), 1);
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/state", be_path), GCSPRINTF("%d", XenbusStateReconfiguring), 1);
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/state-%d", be_path, i), GCSPRINTF("%d", XenbusStateClosing), 1);
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/state", be_path), GCSPRINTF("%d", XenbusStateReconfiguring), 1);
     if (!xs_transaction_end(ctx->xsh, t, 0))
         if (errno == EAGAIN)
             goto retry_transaction;
@@ -248,42 +248,42 @@ retry_transaction:
 
 retry_transaction2:
     t = xs_transaction_start(ctx->xsh);
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/state-%d", be_path, i));
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/key-%d", be_path, i));
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/dev-%d", be_path, i));
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/vdev-%d", be_path, i));
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/opts-%d", be_path, i));
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/vdevfn-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/state-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/key-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/dev-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/vdev-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/opts-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/vdevfn-%d", be_path, i));
     libxl__xs_write(gc, t, num_devs_path, "%d", num - 1);
     for (j = i + 1; j < num; j++) {
-        tmppath = libxl__sprintf(gc, "%s/state-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/state-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
-        xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/state-%d", be_path, j - 1), tmp, strlen(tmp));
+        xs_write(ctx->xsh, t, GCSPRINTF("%s/state-%d", be_path, j - 1), tmp, strlen(tmp));
         xs_rm(ctx->xsh, t, tmppath);
-        tmppath = libxl__sprintf(gc, "%s/dev-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/dev-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
-        xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/dev-%d", be_path, j - 1), tmp, strlen(tmp));
+        xs_write(ctx->xsh, t, GCSPRINTF("%s/dev-%d", be_path, j - 1), tmp, strlen(tmp));
         xs_rm(ctx->xsh, t, tmppath);
-        tmppath = libxl__sprintf(gc, "%s/key-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/key-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
-        xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/key-%d", be_path, j - 1), tmp, strlen(tmp));
+        xs_write(ctx->xsh, t, GCSPRINTF("%s/key-%d", be_path, j - 1), tmp, strlen(tmp));
         xs_rm(ctx->xsh, t, tmppath);
-        tmppath = libxl__sprintf(gc, "%s/vdev-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/vdev-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
         if (tmp) {
-            xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/vdev-%d", be_path, j - 1), tmp, strlen(tmp));
+            xs_write(ctx->xsh, t, GCSPRINTF("%s/vdev-%d", be_path, j - 1), tmp, strlen(tmp));
             xs_rm(ctx->xsh, t, tmppath);
         }
-        tmppath = libxl__sprintf(gc, "%s/opts-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/opts-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
         if (tmp) {
-            xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/opts-%d", be_path, j - 1), tmp, strlen(tmp));
+            xs_write(ctx->xsh, t, GCSPRINTF("%s/opts-%d", be_path, j - 1), tmp, strlen(tmp));
             xs_rm(ctx->xsh, t, tmppath);
         }
-        tmppath = libxl__sprintf(gc, "%s/vdevfn-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/vdevfn-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
         if (tmp) {
-            xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/vdevfn-%d", be_path, j - 1), tmp, strlen(tmp));
+            xs_write(ctx->xsh, t, GCSPRINTF("%s/vdevfn-%d", be_path, j - 1), tmp, strlen(tmp));
             xs_rm(ctx->xsh, t, tmppath);
         }
     }
@@ -319,14 +319,14 @@ static int get_all_assigned_devices(libxl__gc *gc, libxl_device_pci **list, int
     for(i = 0; i < nd; i++) {
         char *path, *num_devs;
 
-        path = libxl__sprintf(gc, "/local/domain/0/backend/pci/%s/0/num_devs", domlist[i]);
+        path = GCSPRINTF("/local/domain/0/backend/pci/%s/0/num_devs", domlist[i]);
         num_devs = libxl__xs_read(gc, XBT_NULL, path);
         if ( num_devs ) {
             int ndev = atoi(num_devs), j;
             char *devpath, *bdf;
 
             for(j = 0; j < ndev; j++) {
-                devpath = libxl__sprintf(gc, "/local/domain/0/backend/pci/%s/0/dev-%u",
+                devpath = GCSPRINTF("/local/domain/0/backend/pci/%s/0/dev-%u",
                                         domlist[i], j);
                 bdf = libxl__xs_read(gc, XBT_NULL, devpath);
                 if ( bdf ) {
@@ -381,7 +381,7 @@ static int sysfs_write_bdf(libxl__gc *gc, const char * sysfs_path,
         return ERROR_FAIL;
     }
 
-    buf = libxl__sprintf(gc, PCI_BDF, pcidev->domain, pcidev->bus,
+    buf = GCSPRINTF(PCI_BDF, pcidev->domain, pcidev->bus,
                          pcidev->dev, pcidev->func);
     rc = write(fd, buf, strlen(buf));
     /* Annoying to have two if's, but we need the errno */
@@ -454,7 +454,7 @@ static int sysfs_dev_unbind(libxl__gc *gc, libxl_device_pci *pcidev,
     char * spath, *dp = NULL;
     struct stat st;
 
-    spath = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/driver",
+    spath = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/driver",
                            pcidev->domain,
                            pcidev->bus,
                            pcidev->dev,
@@ -471,7 +471,7 @@ static int sysfs_dev_unbind(libxl__gc *gc, libxl_device_pci *pcidev,
         LOG(DEBUG, "Driver re-plug path: %s", dp);
 
         /* Unbind from the old driver */
-        spath = libxl__sprintf(gc, "%s/unbind", dp);
+        spath = GCSPRINTF("%s/unbind", dp);
         if ( sysfs_write_bdf(gc, spath, pcidev) < 0 ) {
             LOGE(ERROR, "Couldn't unbind device");
             return -1;
@@ -666,7 +666,7 @@ static int pciback_dev_is_assigned(libxl__gc *gc, libxl_device_pci *pcidev)
         return -1;
     }
 
-    spath = libxl__sprintf(gc, SYSFS_PCIBACK_DRIVER"/"PCI_BDF,
+    spath = GCSPRINTF(SYSFS_PCIBACK_DRIVER"/"PCI_BDF,
                            pcidev->domain, pcidev->bus,
                            pcidev->dev, pcidev->func);
     rc = lstat(spath, &st);
@@ -728,7 +728,7 @@ static void pci_assignable_driver_path_write(libxl__gc *gc,
 {
     char *path;
 
-    path = libxl__sprintf(gc, PCIBACK_INFO_PATH"/"PCI_BDF_XSPATH"/driver_path",
+    path = GCSPRINTF(PCIBACK_INFO_PATH"/"PCI_BDF_XSPATH"/driver_path",
                           pcidev->domain,
                           pcidev->bus,
                           pcidev->dev,
@@ -742,7 +742,7 @@ static char * pci_assignable_driver_path_read(libxl__gc *gc,
                                               libxl_device_pci *pcidev)
 {
     return libxl__xs_read(gc, XBT_NULL,
-                          libxl__sprintf(gc,
+                          GCSPRINTF(
                            PCIBACK_INFO_PATH "/" PCI_BDF_XSPATH "/driver_path",
                            pcidev->domain,
                            pcidev->bus,
@@ -757,7 +757,7 @@ static void pci_assignable_driver_path_remove(libxl__gc *gc,
 
     /* Remove the xenstore entry */
     xs_rm(ctx->xsh, XBT_NULL,
-          libxl__sprintf(gc, PCIBACK_INFO_PATH "/" PCI_BDF_XSPATH,
+          GCSPRINTF(PCIBACK_INFO_PATH "/" PCI_BDF_XSPATH,
                          pcidev->domain,
                          pcidev->bus,
                          pcidev->dev,
@@ -780,7 +780,7 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
     func = pcidev->func;
 
     /* See if the device exists */
-    spath = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF, dom, bus, dev, func);
+    spath = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF, dom, bus, dev, func);
     if ( lstat(spath, &st) ) {
         LOGE(ERROR, "Couldn't lstat %s", spath);
         return ERROR_FAIL;
@@ -851,7 +851,7 @@ static int libxl__device_pci_assignable_remove(libxl__gc *gc,
             LOG(INFO, "Rebinding to driver at %s", driver_path);
 
             if ( sysfs_write_bdf(gc,
-                                 libxl__sprintf(gc, "%s/bind", driver_path),
+                                 GCSPRINTF("%s/bind", driver_path),
                                  pcidev) < 0 ) {
                 LOGE(ERROR, "Couldn't bind device to %s", driver_path);
                 return -1;
@@ -926,7 +926,7 @@ static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsi
         if ( pcidev->dev != dev )
             continue;
 
-        path = libxl__sprintf(gc, "%s/" PCI_BDF, SYSFS_PCIBACK_DRIVER, dom, bus, dev, func);
+        path = GCSPRINTF("%s/" PCI_BDF, SYSFS_PCIBACK_DRIVER, dom, bus, dev, func);
         if ( lstat(path, &st) ) {
             if ( errno == ENOENT )
                 LOG(ERROR, PCI_BDF " is not assigned to pciback driver",
@@ -1031,7 +1031,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
             return ERROR_FAIL;
     }
 
-    sysfs_path = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
+    sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
                                 pcidev->bus, pcidev->dev, pcidev->func);
     f = fopen(sysfs_path, "r");
     start = end = flags = size = 0;
@@ -1071,7 +1071,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
         }
     }
     fclose(f);
-    sysfs_path = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/irq", pcidev->domain,
+    sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pcidev->domain,
                                 pcidev->bus, pcidev->dev, pcidev->func);
     f = fopen(sysfs_path, "r");
     if (f == NULL) {
@@ -1131,10 +1131,10 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
     char *reset;
     int fd, rc;
 
-    reset = libxl__sprintf(gc, "%s/do_flr", SYSFS_PCIBACK_DRIVER);
+    reset = GCSPRINTF("%s/do_flr", SYSFS_PCIBACK_DRIVER);
     fd = open(reset, O_WRONLY);
     if (fd >= 0) {
-        char *buf = libxl__sprintf(gc, PCI_BDF, domain, bus, dev, func);
+        char *buf = GCSPRINTF(PCI_BDF, domain, bus, dev, func);
         rc = write(fd, buf, strlen(buf));
         if (rc < 0)
             LOG(ERROR, "write to %s returned %d", reset, rc);
@@ -1143,7 +1143,7 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
     }
     if (errno != ENOENT)
         LOGE(ERROR, "Failed to access pciback path %s", reset);
-    reset = libxl__sprintf(gc, "%s/"PCI_BDF"/reset", SYSFS_PCI_DEV, domain, bus, dev, func);
+    reset = GCSPRINTF("%s/"PCI_BDF"/reset", SYSFS_PCI_DEV, domain, bus, dev, func);
     fd = open(reset, O_WRONLY);
     if (fd >= 0) {
         rc = write(fd, "1", 1);
@@ -1381,7 +1381,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
     } else {
         assert(type == LIBXL_DOMAIN_TYPE_PV);
 
-        char *sysfs_path = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
+        char *sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
                                          pcidev->bus, pcidev->dev, pcidev->func);
         FILE *f = fopen(sysfs_path, "r");
         unsigned int start = 0, end = 0, flags = 0, size = 0;
@@ -1417,7 +1417,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
         }
         fclose(f);
 skip1:
-        sysfs_path = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/irq", pcidev->domain,
+        sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pcidev->domain,
                                    pcidev->bus, pcidev->dev, pcidev->func);
         f = fopen(sysfs_path, "r");
         if (f == NULL) {
@@ -1533,16 +1533,16 @@ static void libxl__device_pci_from_xs_be(libxl__gc *gc,
     char *s;
     unsigned int domain = 0, bus = 0, dev = 0, func = 0, vdevfn = 0;
 
-    s = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/dev-%d", be_path, nr));
+    s = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/dev-%d", be_path, nr));
     sscanf(s, PCI_BDF, &domain, &bus, &dev, &func);
 
-    s = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/vdevfn-%d", be_path, nr));
+    s = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/vdevfn-%d", be_path, nr));
     if (s)
         vdevfn = strtol(s, (char **) NULL, 16);
 
     pcidev_struct_fill(pci, domain, bus, dev, func, vdevfn);
 
-    s = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/opts-%d", be_path, nr));
+    s = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/opts-%d", be_path, nr));
     if (s) {
         char *saveptr;
         char *p = strtok_r(s, ",=", &saveptr);
@@ -1572,8 +1572,8 @@ libxl_device_pci *libxl_device_pci_list(libxl_ctx *ctx, uint32_t domid, int *num
 
     *num = 0;
 
-    be_path = libxl__sprintf(gc, "%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
-    num_devs = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/num_devs", be_path));
+    be_path = GCSPRINTF("%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
+    num_devs = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/num_devs", be_path));
     if (!num_devs)
         goto out;
 
@@ -1625,7 +1625,7 @@ int libxl__grant_vga_iomem_permission(libxl__gc *gc, const uint32_t domid,
         uint32_t stubdom_domid;
         libxl_device_pci *pcidev = &d_config->pcidevs[i];
         char *pci_device_class_path =
-            libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/class",
+            GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/class",
                            pcidev->domain, pcidev->bus, pcidev->dev,
                            pcidev->func);
         int read_items;
diff --git a/tools/libxl/libxl_xshelp.c b/tools/libxl/libxl_xshelp.c
index b0db062..bc60b9a 100644
--- a/tools/libxl/libxl_xshelp.c
+++ b/tools/libxl/libxl_xshelp.c
@@ -54,7 +54,7 @@ int libxl__xs_writev_perms(libxl__gc *gc, xs_transaction_t t,
         return 0;
 
     for (i = 0; kvs[i] != NULL; i += 2) {
-        path = libxl__sprintf(gc, "%s/%s", dir, kvs[i]);
+        path = GCSPRINTF("%s/%s", dir, kvs[i]);
         if (path && kvs[i + 1]) {
             int length = strlen(kvs[i + 1]);
             xs_write(ctx->xsh, t, path, kvs[i + 1], length);
@@ -159,7 +159,7 @@ bool libxl__xs_mkdir(libxl__gc *gc, xs_transaction_t t,
 
 char *libxl__xs_libxl_path(libxl__gc *gc, uint32_t domid)
 {
-    char *s = libxl__sprintf(gc, "/libxl/%i", domid);
+    char *s = GCSPRINTF("/libxl/%i", domid);
     if (!s)
         LOG(ERROR, "cannot allocate create paths");
     return s;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:49:26 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49: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 1a23Tq-0004fc-DC; Thu, 26 Nov 2015 20:49: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 1a23To-0004fI-Ga
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:25 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	AA/D3-01748-35077565; Thu, 26 Nov 2015 20:49:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1448570960!6937887!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 44225 invoked from network); 26 Nov 2015 20:49:21 -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;
	26 Nov 2015 20:49:21 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Tk-0003BC-LD
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Tk-0000eF-G2
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:20 +0000
Date: Thu, 26 Nov 2015 20:49:20 +0000
Message-Id: <E1a23Tk-0000eF-G2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: convert libxl__sprintf(gc) to
	GCSPRINTF
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91cee732e31ff9f93a4515fbd5da003f618d8535
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Nov 17 16:19:19 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:21:02 2015 +0000

    libxl: convert libxl__sprintf(gc) to GCSPRINTF
    
    The rune used is:
    
      sed -i 's/libxl__sprintf(gc,\s*/GCSPRINTF(/g' libxl*.c
    
    This rune is simple and better than trying to match every possible
    patterns.
    
    Two instances in libxl_dm.c need fixing up. They are in fact better to just
    use libxl__strdup.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c            |  194 ++++++++++++++++++++--------------------
 tools/libxl/libxl_blktap2.c    |    4 +-
 tools/libxl/libxl_bootloader.c |   10 +-
 tools/libxl/libxl_create.c     |   42 +++++-----
 tools/libxl/libxl_dm.c         |  104 +++++++++++-----------
 tools/libxl/libxl_event.c      |    2 +-
 tools/libxl/libxl_internal.c   |    4 +-
 tools/libxl/libxl_pci.c        |  124 +++++++++++++-------------
 tools/libxl/libxl_xshelp.c     |    4 +-
 9 files changed, 244 insertions(+), 244 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 6ad9e13..cb8c932 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -389,7 +389,7 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
     dom_path = libxl__xs_get_dompath(gc, domid);
     if (!dom_path) goto x_nomem;
 
-    name_path= libxl__sprintf(gc, "%s/name", dom_path);
+    name_path= GCSPRINTF("%s/name", dom_path);
     if (!name_path) goto x_nomem;
 
     stub_dm_domid = libxl_get_stubdom_id(CTX, domid);
@@ -557,7 +557,7 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid,
 
     int rc;
 
-    preserved_name = libxl__sprintf(gc, "%s%s", info->name, name_suffix);
+    preserved_name = GCSPRINTF("%s%s", info->name, name_suffix);
     if (!preserved_name) {
         GC_FREE;
         return ERROR_NOMEM;
@@ -575,7 +575,7 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid,
         return ERROR_FAIL;
     }
 
-    vm_path = libxl__sprintf(gc, "/vm/%s", uuid_string);
+    vm_path = GCSPRINTF("/vm/%s", uuid_string);
     if (!vm_path) {
         GC_FREE;
         return ERROR_FAIL;
@@ -593,14 +593,14 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid,
     xs_mkdir(ctx->xsh, t, vm_path);
     xs_set_permissions(ctx->xsh, t, vm_path, roperm, ARRAY_SIZE(roperm));
 
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/vm", dom_path), vm_path, strlen(vm_path));
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/vm", dom_path), vm_path, strlen(vm_path));
     rc = libxl__domain_rename(gc, domid, info->name, preserved_name, t);
     if (rc) {
         GC_FREE;
         return rc;
     }
 
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/uuid", vm_path), uuid_string, strlen(uuid_string));
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/uuid", vm_path), uuid_string, strlen(uuid_string));
 
     if (!xs_transaction_end(ctx->xsh, t, 0))
         if (errno == EAGAIN)
@@ -1374,7 +1374,7 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
     libxl_device_disk *disk = &ev->u.disk_eject.disk;
     
     backend = libxl__xs_read(gc, XBT_NULL,
-                             libxl__sprintf(gc, "%.*s/backend",
+                             GCSPRINTF("%.*s/backend",
                                             (int)strlen(wpath)-6, wpath));
 
     sscanf(backend,
@@ -1393,7 +1393,7 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
     disk->format = LIBXL_DISK_FORMAT_EMPTY;
     /* this value is returned to the user: do not free right away */
     disk->vdev = xs_read(CTX->xsh, XBT_NULL,
-                         libxl__sprintf(gc, "%s/dev", backend), NULL);
+                         GCSPRINTF("%s/dev", backend), NULL);
     disk->removable = 1;
     disk->readwrite = 0;
     disk->is_cdrom = 1;
@@ -1424,7 +1424,7 @@ int libxl_evenable_disk_eject(libxl_ctx *ctx, uint32_t guest_domid,
     if (!domid)
         domid = guest_domid;
 
-    path = libxl__sprintf(gc, "%s/device/vbd/%d/eject",
+    path = GCSPRINTF("%s/device/vbd/%d/eject",
                  libxl__xs_get_dompath(gc, domid),
                  libxl__device_disk_dev_number(vdev, NULL, NULL));
     if (!path) { rc = ERROR_NOMEM; goto out; }
@@ -1622,7 +1622,7 @@ void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis)
             dm_present = 0;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
-        pid = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "/local/domain/%d/image/device-model-pid", domid));
+        pid = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("/local/domain/%d/image/device-model-pid", domid));
         dm_present = (pid != NULL);
         break;
     case LIBXL_DOMAIN_TYPE_INVALID:
@@ -1684,7 +1684,7 @@ static void devices_destroy_cb(libxl__egc *egc,
     if (rc < 0)
         LOG(ERROR, "libxl__devices_destroy failed for %d", domid);
 
-    vm_path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/vm", dom_path));
+    vm_path = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/vm", dom_path));
     if (vm_path)
         if (!xs_rm(ctx->xsh, XBT_NULL, vm_path))
             LOGE(ERROR, "xs_rm failed for %s", vm_path);
@@ -1693,7 +1693,7 @@ static void devices_destroy_cb(libxl__egc *egc,
         LOGE(ERROR, "xs_rm failed for %s", dom_path);
 
     xs_rm(ctx->xsh, XBT_NULL, libxl__xs_libxl_path(gc, domid));
-    xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc,
+    xs_rm(ctx->xsh, XBT_NULL, GCSPRINTF(
                                 "/local/domain/%d/hvmloader", domid));
 
     /* This is async operation, we already hold CTX lock */
@@ -1786,9 +1786,9 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
                        libxl_console_type type)
 {
     GC_INIT(ctx);
-    char *p = libxl__sprintf(gc, "%s/xenconsole", libxl__private_bindir_path());
-    char *domid_s = libxl__sprintf(gc, "%d", domid);
-    char *cons_num_s = libxl__sprintf(gc, "%d", cons_num);
+    char *p = GCSPRINTF("%s/xenconsole", libxl__private_bindir_path());
+    char *domid_s = GCSPRINTF("%d", domid);
+    char *cons_num_s = GCSPRINTF("%d", cons_num);
     char *cons_type_s;
 
     switch (type) {
@@ -1930,7 +1930,7 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
     };
 
     vnc_port = libxl__xs_read(gc, XBT_NULL,
-                            libxl__sprintf(gc,
+                            GCSPRINTF(
                             "/local/domain/%d/console/vnc-port", domid));
     if (!vnc_port) {
         LOG(ERROR, "Cannot get vnc-port of domain %d", domid);
@@ -1940,12 +1940,12 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
     port = atoi(vnc_port) - 5900;
 
     vnc_listen = libxl__xs_read(gc, XBT_NULL,
-                                libxl__sprintf(gc,
+                                GCSPRINTF(
                             "/local/domain/%d/console/vnc-listen", domid));
 
     if ( autopass )
         vnc_pass = libxl__xs_read(gc, XBT_NULL,
-                                  libxl__sprintf(gc,
+                                  GCSPRINTF(
                             "/local/domain/%d/console/vnc-pass", domid));
 
     if ( NULL == vnc_listen )
@@ -1954,7 +1954,7 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
     if ( (vnc_bin = getenv("VNCVIEWER")) )
         args[0] = vnc_bin;
 
-    args[1] = libxl__sprintf(gc, "%s:%d", vnc_listen, port);
+    args[1] = GCSPRINTF("%s:%d", vnc_listen, port);
 
     if ( vnc_pass ) {
         char tmpname[] = "/tmp/vncautopass.XXXXXX";
@@ -2213,7 +2213,7 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *n
 
     *num = 0;
 
-    fe_path = libxl__sprintf(gc, "%s/device/vtpm", libxl__xs_get_dompath(gc, domid));
+    fe_path = GCSPRINTF("%s/device/vtpm", libxl__xs_get_dompath(gc, domid));
     dir = libxl__xs_directory(gc, XBT_NULL, fe_path, &ndirs);
     if (dir && ndirs) {
        vtpms = malloc(sizeof(*vtpms) * ndirs);
@@ -2521,7 +2521,7 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                     int major, minor;
                     if (!libxl__device_physdisk_major_minor(dev, &major, &minor))
                         flexarray_append_pair(back, "physical-device",
-                                              libxl__sprintf(gc, "%x:%x", major, minor));
+                                              GCSPRINTF("%x:%x", major, minor));
                 }
 
                 assert(device->backend_kind == LIBXL__DEVICE_KIND_VBD);
@@ -2539,7 +2539,7 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                     }
                 }
                 flexarray_append(back, "tapdisk-params");
-                flexarray_append(back, libxl__sprintf(gc, "%s:%s",
+                flexarray_append(back, GCSPRINTF("%s:%s",
                     libxl__device_disk_string_of_format(disk->format),
                     disk->pdev_path));
 
@@ -2551,7 +2551,7 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                 goto do_backend_phy;
             case LIBXL_DISK_BACKEND_QDISK:
                 flexarray_append(back, "params");
-                flexarray_append(back, libxl__sprintf(gc, "%s:%s",
+                flexarray_append(back, GCSPRINTF("%s:%s",
                               libxl__device_disk_string_of_format(disk->format), disk->pdev_path));
                 assert(device->backend_kind == LIBXL__DEVICE_KIND_QDISK);
                 break;
@@ -2563,13 +2563,13 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
         }
 
         flexarray_append(back, "frontend-id");
-        flexarray_append(back, libxl__sprintf(gc, "%d", domid));
+        flexarray_append(back, GCSPRINTF("%d", domid));
         flexarray_append(back, "online");
         flexarray_append(back, "1");
         flexarray_append(back, "removable");
-        flexarray_append(back, libxl__sprintf(gc, "%d", (disk->removable) ? 1 : 0));
+        flexarray_append(back, GCSPRINTF("%d", (disk->removable) ? 1 : 0));
         flexarray_append(back, "bootable");
-        flexarray_append(back, libxl__sprintf(gc, "%d", 1));
+        flexarray_append(back, GCSPRINTF("%d", 1));
         flexarray_append(back, "state");
         flexarray_append(back, GCSPRINTF("%d", XenbusStateInitialising));
         flexarray_append(back, "dev");
@@ -2589,11 +2589,11 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                               "1" : "0");
 
         flexarray_append(front, "backend-id");
-        flexarray_append(front, libxl__sprintf(gc, "%d", disk->backend_domid));
+        flexarray_append(front, GCSPRINTF("%d", disk->backend_domid));
         flexarray_append(front, "state");
         flexarray_append(front, GCSPRINTF("%d", XenbusStateInitialising));
         flexarray_append(front, "virtual-device");
-        flexarray_append(front, libxl__sprintf(gc, "%d", device->devid));
+        flexarray_append(front, GCSPRINTF("%d", device->devid));
         flexarray_append(front, "device-type");
         flexarray_append(front, disk->is_cdrom ? "cdrom" : "disk");
 
@@ -2670,7 +2670,7 @@ static int libxl__device_disk_from_xs_be(libxl__gc *gc,
 
     /* "params" may not be present; but everything else must be. */
     tmp = xs_read(ctx->xsh, XBT_NULL,
-                  libxl__sprintf(gc, "%s/params", be_path), &len);
+                  GCSPRINTF("%s/params", be_path), &len);
     if (tmp && strchr(tmp, ':')) {
         disk->pdev_path = strdup(strchr(tmp, ':') + 1);
         free(tmp);
@@ -2680,7 +2680,7 @@ static int libxl__device_disk_from_xs_be(libxl__gc *gc,
 
 
     tmp = libxl__xs_read(gc, XBT_NULL,
-                         libxl__sprintf(gc, "%s/type", be_path));
+                         GCSPRINTF("%s/type", be_path));
     if (!tmp) {
         LOG(ERROR, "Missing xenstore node %s/type", be_path);
         goto cleanup;
@@ -2688,7 +2688,7 @@ static int libxl__device_disk_from_xs_be(libxl__gc *gc,
     libxl_string_to_backend(ctx, tmp, &(disk->backend));
 
     disk->vdev = xs_read(ctx->xsh, XBT_NULL,
-                         libxl__sprintf(gc, "%s/dev", be_path), &len);
+                         GCSPRINTF("%s/dev", be_path), &len);
     if (!disk->vdev) {
         LOG(ERROR, "Missing xenstore node %s/dev", be_path);
         goto cleanup;
@@ -2702,7 +2702,7 @@ static int libxl__device_disk_from_xs_be(libxl__gc *gc,
     }
     disk->removable = atoi(tmp);
 
-    tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
+    tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/mode", be_path));
     if (!tmp) {
         LOG(ERROR, "Missing xenstore node %s/mode", be_path);
         goto cleanup;
@@ -2713,7 +2713,7 @@ static int libxl__device_disk_from_xs_be(libxl__gc *gc,
         disk->readwrite = 0;
 
     tmp = libxl__xs_read(gc, XBT_NULL,
-                         libxl__sprintf(gc, "%s/device-type", be_path));
+                         GCSPRINTF("%s/device-type", be_path));
     if (!tmp) {
         LOG(ERROR, "Missing xenstore node %s/device-type", be_path);
         goto cleanup;
@@ -2746,7 +2746,7 @@ int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
         goto out;
     }
     path = libxl__xs_read(gc, XBT_NULL,
-                          libxl__sprintf(gc, "%s/device/vbd/%d/backend",
+                          GCSPRINTF("%s/device/vbd/%d/backend",
                                          dompath, devid));
     if (!path)
         goto out;
@@ -2771,7 +2771,7 @@ static int libxl__append_disk_list_of_type(libxl__gc *gc,
     int rc=0;
     int initial_disks = *ndisks;
 
-    be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
+    be_path = GCSPRINTF("%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
     dir = libxl__xs_directory(gc, XBT_NULL, be_path, &n);
     if (dir && n) {
@@ -2784,7 +2784,7 @@ static int libxl__append_disk_list_of_type(libxl__gc *gc,
         pdisk_end = *disks + initial_disks + n;
         for (; pdisk < pdisk_end; pdisk++, dir++) {
             const char *p;
-            p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
+            p = GCSPRINTF("%s/%s", be_path, *dir);
             if ((rc=libxl__device_disk_from_xs_be(gc, p, pdisk)))
                 goto out;
             pdisk->backend_domid = 0;
@@ -2836,24 +2836,24 @@ int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid,
     diskinfo->devid = libxl__device_disk_dev_number(disk->vdev, NULL, NULL);
 
     /* tap devices entries in xenstore are written as vbd devices. */
-    diskpath = libxl__sprintf(gc, "%s/device/vbd/%d", dompath, diskinfo->devid);
+    diskpath = GCSPRINTF("%s/device/vbd/%d", dompath, diskinfo->devid);
     diskinfo->backend = xs_read(ctx->xsh, XBT_NULL,
-                                libxl__sprintf(gc, "%s/backend", diskpath), NULL);
+                                GCSPRINTF("%s/backend", diskpath), NULL);
     if (!diskinfo->backend) {
         GC_FREE;
         return ERROR_FAIL;
     }
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/backend-id", diskpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/backend-id", diskpath));
     diskinfo->backend_id = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/state", diskpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/state", diskpath));
     diskinfo->state = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/event-channel", diskpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/event-channel", diskpath));
     diskinfo->evtch = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/ring-ref", diskpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/ring-ref", diskpath));
     diskinfo->rref = val ? strtoul(val, NULL, 10) : -1;
     diskinfo->frontend = xs_read(ctx->xsh, XBT_NULL,
-                                 libxl__sprintf(gc, "%s/frontend", diskinfo->backend), NULL);
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend-id", diskinfo->backend));
+                                 GCSPRINTF("%s/frontend", diskinfo->backend), NULL);
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/frontend-id", diskinfo->backend));
     diskinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
 
     GC_FREE;
@@ -2976,11 +2976,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
         rc = libxl__xs_transaction_start(gc, &t);
         if (rc) goto out;
         /* Sanity check: make sure the backend exists before writing here */
-        tmp = libxl__xs_read(gc, t, libxl__sprintf(gc, "%s/frontend", path));
+        tmp = libxl__xs_read(gc, t, GCSPRINTF("%s/frontend", path));
         if (!tmp)
         {
             LOG(ERROR, "Internal error: %s does not exist",
-                libxl__sprintf(gc, "%s/frontend", path));
+                GCSPRINTF("%s/frontend", path));
             rc = ERROR_FAIL;
             goto out;
         }
@@ -3008,11 +3008,11 @@ int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
         rc = libxl__xs_transaction_start(gc, &t);
         if (rc) goto out;
         /* Sanity check: make sure the backend exists before writing here */
-        tmp = libxl__xs_read(gc, t, libxl__sprintf(gc, "%s/frontend", path));
+        tmp = libxl__xs_read(gc, t, GCSPRINTF("%s/frontend", path));
         if (!tmp)
         {
             LOG(ERROR, "Internal error: %s does not exist",
-                libxl__sprintf(gc, "%s/frontend", path));
+                GCSPRINTF("%s/frontend", path));
             rc = ERROR_FAIL;
             goto out;
         }
@@ -3070,7 +3070,7 @@ static char * libxl__alloc_vdev(libxl__gc *gc, void *get_vdev_user,
         if (devid < 0)
             return NULL;
         if (libxl__xs_read(gc, t,
-                    libxl__sprintf(gc, "%s/device/vbd/%d/backend",
+                    GCSPRINTF("%s/device/vbd/%d/backend",
                         dompath, devid)) == NULL) {
             if (errno == ENOENT)
                 return libxl__devid_to_localdev(gc, devid);
@@ -3348,7 +3348,7 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
     if ( rc != 0 ) goto out;
 
     flexarray_append(back, "frontend-id");
-    flexarray_append(back, libxl__sprintf(gc, "%d", domid));
+    flexarray_append(back, GCSPRINTF("%d", domid));
     flexarray_append(back, "online");
     flexarray_append(back, "1");
     flexarray_append(back, "state");
@@ -3364,7 +3364,7 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
     }
 
     flexarray_append(back, "mac");
-    flexarray_append(back,libxl__sprintf(gc,
+    flexarray_append(back,GCSPRINTF(
                                     LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));
     if (nic->ip) {
         flexarray_append(back, "ip");
@@ -3377,7 +3377,7 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
 
     if (nic->rate_interval_usecs > 0) {
         flexarray_append(back, "rate");
-        flexarray_append(back, libxl__sprintf(gc, "%"PRIu64",%"PRIu32"",
+        flexarray_append(back, GCSPRINTF("%"PRIu64",%"PRIu32"",
                             nic->rate_bytes_per_interval,
                             nic->rate_interval_usecs));
     }
@@ -3385,19 +3385,19 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
     flexarray_append(back, "bridge");
     flexarray_append(back, libxl__strdup(gc, nic->bridge));
     flexarray_append(back, "handle");
-    flexarray_append(back, libxl__sprintf(gc, "%d", nic->devid));
+    flexarray_append(back, GCSPRINTF("%d", nic->devid));
     flexarray_append(back, "type");
     flexarray_append(back, libxl__strdup(gc,
                                      libxl_nic_type_to_string(nic->nictype)));
 
     flexarray_append(front, "backend-id");
-    flexarray_append(front, libxl__sprintf(gc, "%d", nic->backend_domid));
+    flexarray_append(front, GCSPRINTF("%d", nic->backend_domid));
     flexarray_append(front, "state");
     flexarray_append(front, GCSPRINTF("%d", XenbusStateInitialising));
     flexarray_append(front, "handle");
-    flexarray_append(front, libxl__sprintf(gc, "%d", nic->devid));
+    flexarray_append(front, GCSPRINTF("%d", nic->devid));
     flexarray_append(front, "mac");
-    flexarray_append(front, libxl__sprintf(gc,
+    flexarray_append(front, GCSPRINTF(
                                     LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));
 
     if (aodev->update_json) {
@@ -3516,7 +3516,7 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
         goto out;
 
     path = libxl__xs_read(gc, XBT_NULL,
-                          libxl__sprintf(gc, "%s/device/vif/%d/backend",
+                          GCSPRINTF("%s/device/vif/%d/backend",
                                          dompath, devid));
     if (!path)
         goto out;
@@ -3542,7 +3542,7 @@ static int libxl__append_nic_list_of_type(libxl__gc *gc,
     libxl_device_nic *pnic = NULL, *pnic_end = NULL;
     int rc;
 
-    be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
+    be_path = GCSPRINTF("%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
     dir = libxl__xs_directory(gc, XBT_NULL, be_path, &n);
     if (dir && n) {
@@ -3555,7 +3555,7 @@ static int libxl__append_nic_list_of_type(libxl__gc *gc,
         pnic_end = *nics + *nnics + n;
         for (; pnic < pnic_end; pnic++, dir++) {
             const char *p;
-            p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
+            p = GCSPRINTF("%s/%s", be_path, *dir);
             rc = libxl__device_nic_from_xs_be(gc, p, pnic);
             if (rc) goto out;
             pnic->backend_domid = 0;
@@ -3602,26 +3602,26 @@ int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
     dompath = libxl__xs_get_dompath(gc, domid);
     nicinfo->devid = nic->devid;
 
-    nicpath = libxl__sprintf(gc, "%s/device/vif/%d", dompath, nicinfo->devid);
+    nicpath = GCSPRINTF("%s/device/vif/%d", dompath, nicinfo->devid);
     nicinfo->backend = xs_read(ctx->xsh, XBT_NULL,
-                                libxl__sprintf(gc, "%s/backend", nicpath), NULL);
+                                GCSPRINTF("%s/backend", nicpath), NULL);
     if (!nicinfo->backend) {
         GC_FREE;
         return ERROR_FAIL;
     }
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/backend-id", nicpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/backend-id", nicpath));
     nicinfo->backend_id = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/state", nicpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/state", nicpath));
     nicinfo->state = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/event-channel", nicpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/event-channel", nicpath));
     nicinfo->evtch = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/tx-ring-ref", nicpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/tx-ring-ref", nicpath));
     nicinfo->rref_tx = val ? strtoul(val, NULL, 10) : -1;
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/rx-ring-ref", nicpath));
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/rx-ring-ref", nicpath));
     nicinfo->rref_rx = val ? strtoul(val, NULL, 10) : -1;
     nicinfo->frontend = xs_read(ctx->xsh, XBT_NULL,
-                                 libxl__sprintf(gc, "%s/frontend", nicinfo->backend), NULL);
-    val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend-id", nicinfo->backend));
+                                 GCSPRINTF("%s/frontend", nicinfo->backend), NULL);
+    val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/frontend-id", nicinfo->backend));
     nicinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
 
     GC_FREE;
@@ -3675,7 +3675,7 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
     device->kind = LIBXL__DEVICE_KIND_CONSOLE;
 
     flexarray_append(back, "frontend-id");
-    flexarray_append(back, libxl__sprintf(gc, "%d", domid));
+    flexarray_append(back, GCSPRINTF("%d", domid));
     flexarray_append(back, "online");
     flexarray_append(back, "1");
     flexarray_append(back, "state");
@@ -3697,10 +3697,10 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
     }
 
     flexarray_append(front, "backend-id");
-    flexarray_append(front, libxl__sprintf(gc, "%d", console->backend_domid));
+    flexarray_append(front, GCSPRINTF("%d", console->backend_domid));
 
     flexarray_append(ro_front, "limit");
-    flexarray_append(ro_front, libxl__sprintf(gc, "%d", LIBXL_XENCONSOLE_LIMIT));
+    flexarray_append(ro_front, GCSPRINTF("%d", LIBXL_XENCONSOLE_LIMIT));
     flexarray_append(ro_front, "type");
     if (console->consback == LIBXL__CONSOLE_BACKEND_XENCONSOLED)
         flexarray_append(ro_front, "xenconsoled");
@@ -3713,9 +3713,9 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
 
     if (state) {
         flexarray_append(ro_front, "port");
-        flexarray_append(ro_front, libxl__sprintf(gc, "%"PRIu32, state->console_port));
+        flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->console_port));
         flexarray_append(ro_front, "ring-ref");
-        flexarray_append(ro_front, libxl__sprintf(gc, "%lu", state->console_mfn));
+        flexarray_append(ro_front, GCSPRINTF("%lu", state->console_mfn));
     } else {
         flexarray_append(front, "state");
         flexarray_append(front, GCSPRINTF("%d", XenbusStateInitialising));
@@ -3846,7 +3846,7 @@ static int libxl__append_channel_list_of_type(libxl__gc *gc,
         const char *p, *name;
         libxl_device_channel *tmp;
 
-        p = libxl__sprintf(gc, "%s/%s", fe_path, dir[i]);
+        p = GCSPRINTF("%s/%s", fe_path, dir[i]);
         name = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/name", p));
         /* 'channels' are consoles with names, so ignore all consoles
            without names */
@@ -3909,10 +3909,10 @@ int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
     dompath = libxl__xs_get_dompath(gc, domid);
     channelinfo->devid = channel->devid;
 
-    fe_path = libxl__sprintf(gc, "%s/device/console/%d", dompath,
+    fe_path = GCSPRINTF("%s/device/console/%d", dompath,
                              channelinfo->devid + 1);
     channelinfo->backend = xs_read(ctx->xsh, XBT_NULL,
-                                   libxl__sprintf(gc, "%s/backend",
+                                   GCSPRINTF("%s/backend",
                                    fe_path), NULL);
     if (!channelinfo->backend) {
         GC_FREE;
@@ -4011,14 +4011,14 @@ int libxl__device_vkb_add(libxl__gc *gc, uint32_t domid,
     if (rc != 0) goto out;
 
     flexarray_append(back, "frontend-id");
-    flexarray_append(back, libxl__sprintf(gc, "%d", domid));
+    flexarray_append(back, GCSPRINTF("%d", domid));
     flexarray_append(back, "online");
     flexarray_append(back, "1");
     flexarray_append(back, "state");
     flexarray_append(back, GCSPRINTF("%d", XenbusStateInitialising));
 
     flexarray_append(front, "backend-id");
-    flexarray_append(front, libxl__sprintf(gc, "%d", vkb->backend_domid));
+    flexarray_append(front, GCSPRINTF("%d", vkb->backend_domid));
     flexarray_append(front, "state");
     flexarray_append(front, GCSPRINTF("%d", XenbusStateInitialising));
 
@@ -4109,7 +4109,7 @@ int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid, libxl_device_vfb *vfb)
     rc = libxl__device_from_vfb(gc, domid, vfb, &device);
     if (rc != 0) goto out;
 
-    flexarray_append_pair(back, "frontend-id", libxl__sprintf(gc, "%d", domid));
+    flexarray_append_pair(back, "frontend-id", GCSPRINTF("%d", domid));
     flexarray_append_pair(back, "online", "1");
     flexarray_append_pair(back, "state", GCSPRINTF("%d", XenbusStateInitialising));
     flexarray_append_pair(back, "vnc",
@@ -4117,7 +4117,7 @@ int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid, libxl_device_vfb *vfb)
     flexarray_append_pair(back, "vnclisten", vfb->vnc.listen);
     flexarray_append_pair(back, "vncpasswd", vfb->vnc.passwd);
     flexarray_append_pair(back, "vncdisplay",
-                          libxl__sprintf(gc, "%d", vfb->vnc.display));
+                          GCSPRINTF("%d", vfb->vnc.display));
     flexarray_append_pair(back, "vncunused",
                           libxl_defbool_val(vfb->vnc.findunused) ? "1" : "0");
     flexarray_append_pair(back, "sdl",
@@ -4132,7 +4132,7 @@ int libxl__device_vfb_add(libxl__gc *gc, uint32_t domid, libxl_device_vfb *vfb)
     }
 
     flexarray_append_pair(front, "backend-id",
-                          libxl__sprintf(gc, "%d", vfb->backend_domid));
+                          GCSPRINTF("%d", vfb->backend_domid));
     flexarray_append_pair(front, "state", GCSPRINTF("%d", XenbusStateInitialising));
 
     libxl__device_generic_add(gc, XBT_NULL, &device,
@@ -4613,7 +4613,7 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint32_t max_memkb)
         goto out;
     }
 
-    mem = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/memory/target", dompath));
+    mem = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/memory/target", dompath));
     if (!mem) {
         LOGE(ERROR, "cannot get memory info from %s/memory/target", dompath);
         goto out;
@@ -4751,7 +4751,7 @@ int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid,
 retry_transaction:
     t = xs_transaction_start(ctx->xsh);
 
-    target = libxl__xs_read(gc, t, libxl__sprintf(gc,
+    target = libxl__xs_read(gc, t, GCSPRINTF(
                 "%s/memory/target", dompath));
     if (!target && !domid) {
         if (!xs_transaction_end(ctx->xsh, t, 1))
@@ -4775,7 +4775,7 @@ retry_transaction:
             goto out;
         }
     }
-    memmax = libxl__xs_read(gc, t, libxl__sprintf(gc,
+    memmax = libxl__xs_read(gc, t, GCSPRINTF(
                 "%s/memory/static-max", dompath));
     if (!memmax) {
         LOGE(ERROR, "cannot get memory info from %s/memory/static-max",
@@ -4791,7 +4791,7 @@ retry_transaction:
         goto out;
     }
 
-    videoram_s = libxl__xs_read(gc, t, libxl__sprintf(gc,
+    videoram_s = libxl__xs_read(gc, t, GCSPRINTF(
                 "%s/memory/videoram", dompath));
     videoram = videoram_s ? atoi(videoram_s) : 0;
 
@@ -4844,7 +4844,7 @@ retry_transaction:
         goto out;
     }
 
-    libxl__xs_write(gc, t, libxl__sprintf(gc, "%s/memory/target",
+    libxl__xs_write(gc, t, GCSPRINTF("%s/memory/target",
                 dompath), "%"PRIu32, new_target_memkb);
     rc = xc_domain_getinfolist(ctx->xch, domid, 1, &info);
     if (rc != 1 || info.domain != domid) {
@@ -4855,7 +4855,7 @@ retry_transaction:
     libxl_dominfo_init(&ptr);
     xcinfo2xlinfo(ctx, &info, &ptr);
     uuid = libxl__uuid2string(gc, ptr.uuid);
-    libxl__xs_write(gc, t, libxl__sprintf(gc, "/vm/%s/memory", uuid),
+    libxl__xs_write(gc, t, GCSPRINTF("/vm/%s/memory", uuid),
             "%"PRIu32, new_target_memkb / 1024);
     libxl_dominfo_dispose(&ptr);
 
@@ -4882,9 +4882,9 @@ static int libxl__get_memory_target(libxl__gc *gc, uint32_t domid,
     char *dompath = libxl__xs_get_dompath(gc, domid);
     uint32_t target_memkb, max_memkb;
 
-    target = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc,
+    target = libxl__xs_read(gc, XBT_NULL, GCSPRINTF(
                     "%s/memory/target", dompath));
-    static_max = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc,
+    static_max = libxl__xs_read(gc, XBT_NULL, GCSPRINTF(
                     "%s/memory/static-max", dompath));
 
     rc = ERROR_FAIL;
@@ -5492,7 +5492,7 @@ retry_transaction:
     t = xs_transaction_start(CTX->xsh);
     for (i = 0; i <= info->vcpu_max_id; i++)
         libxl__xs_write(gc, t,
-                       libxl__sprintf(gc, "%s/cpu/%u/availability", dompath, i),
+                       GCSPRINTF("%s/cpu/%u/availability", dompath, i),
                        "%s", libxl_bitmap_test(cpumap, i) ? "online" : "offline");
     if (!xs_transaction_end(CTX->xsh, t, 0)) {
         if (errno == EAGAIN)
@@ -5989,7 +5989,7 @@ int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq)
     GC_INIT(ctx);
     char *dompath = libxl__xs_get_dompath(gc, domid);
 
-    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/control/sysrq", dompath), "%c", sysrq);
+    libxl__xs_write(gc, XBT_NULL, GCSPRINTF("%s/control/sysrq", dompath), "%c", sysrq);
 
     GC_FREE;
     return 0;
@@ -6079,9 +6079,9 @@ uint32_t libxl_vm_get_start_time(libxl_ctx *ctx, uint32_t domid)
     uint32_t ret;
 
     vm_path = libxl__xs_read(
-        gc, XBT_NULL, libxl__sprintf(gc, "%s/vm", dompath));
+        gc, XBT_NULL, GCSPRINTF("%s/vm", dompath));
     start_time = libxl__xs_read(
-        gc, XBT_NULL, libxl__sprintf(gc, "%s/start_time", vm_path));
+        gc, XBT_NULL, GCSPRINTF("%s/start_time", vm_path));
     if (start_time == NULL) {
         LOGEV(ERROR, -1, "Can't get start time of domain '%d'", domid);
         ret = -1;
@@ -6266,12 +6266,12 @@ int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
     for (;;) {
         t = xs_transaction_start(ctx->xsh);
 
-        xs_mkdir(ctx->xsh, t, libxl__sprintf(gc, "/local/pool/%d", *poolid));
+        xs_mkdir(ctx->xsh, t, GCSPRINTF("/local/pool/%d", *poolid));
         libxl__xs_write(gc, t,
-                        libxl__sprintf(gc, "/local/pool/%d/uuid", *poolid),
+                        GCSPRINTF("/local/pool/%d/uuid", *poolid),
                         "%s", uuid_string);
         libxl__xs_write(gc, t,
-                        libxl__sprintf(gc, "/local/pool/%d/name", *poolid),
+                        GCSPRINTF("/local/pool/%d/name", *poolid),
                         "%s", name);
 
         if (xs_transaction_end(ctx->xsh, t, 0) || (errno != EAGAIN)) {
@@ -6324,7 +6324,7 @@ int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid)
     for (;;) {
         t = xs_transaction_start(ctx->xsh);
 
-        xs_rm(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "/local/pool/%d", poolid));
+        xs_rm(ctx->xsh, XBT_NULL, GCSPRINTF("/local/pool/%d", poolid));
 
         if (xs_transaction_end(ctx->xsh, t, 0) || (errno != EAGAIN))
             break;
@@ -6364,7 +6364,7 @@ int libxl_cpupool_rename(libxl_ctx *ctx, const char *name, uint32_t poolid)
         t = xs_transaction_start(ctx->xsh);
 
         libxl__xs_write(gc, t,
-                        libxl__sprintf(gc, "/local/pool/%d/name", poolid),
+                        GCSPRINTF("/local/pool/%d/name", poolid),
                         "%s", name);
 
         if (xs_transaction_end(ctx->xsh, t, 0))
diff --git a/tools/libxl/libxl_blktap2.c b/tools/libxl/libxl_blktap2.c
index 2053403..4f5e522 100644
--- a/tools/libxl/libxl_blktap2.c
+++ b/tools/libxl/libxl_blktap2.c
@@ -35,12 +35,12 @@ char *libxl__blktap_devpath(libxl__gc *gc,
     type = libxl__device_disk_string_of_format(format);
     err = tap_ctl_find(type, disk, &tap);
     if (err == 0) {
-        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", tap.minor);
+        devname = GCSPRINTF("/dev/xen/blktap-2/tapdev%d", tap.minor);
         if (devname)
             return devname;
     }
 
-    params = libxl__sprintf(gc, "%s:%s", type, disk);
+    params = GCSPRINTF("%s:%s", type, disk);
     err = tap_ctl_create(params, &devname);
     if (!err) {
         libxl__ptr_add(gc, devname);
diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index 9caf212..343fc30 100644
--- a/tools/libxl/libxl_bootloader.c
+++ b/tools/libxl/libxl_bootloader.c
@@ -60,15 +60,15 @@ static void make_bootloader_args(libxl__gc *gc, libxl__bootloader_state *bl,
     ARG(bootloader_path);
 
     if (info->kernel)
-        ARG(libxl__sprintf(gc, "--kernel=%s", info->kernel));
+        ARG(GCSPRINTF("--kernel=%s", info->kernel));
     if (info->ramdisk)
-        ARG(libxl__sprintf(gc, "--ramdisk=%s", info->ramdisk));
+        ARG(GCSPRINTF("--ramdisk=%s", info->ramdisk));
     if (info->cmdline && *info->cmdline != '\0')
-        ARG(libxl__sprintf(gc, "--args=%s", info->cmdline));
+        ARG(GCSPRINTF("--args=%s", info->cmdline));
 
-    ARG(libxl__sprintf(gc, "--output=%s", bl->outputpath));
+    ARG(GCSPRINTF("--output=%s", bl->outputpath));
     ARG("--output-format=simple0");
-    ARG(libxl__sprintf(gc, "--output-directory=%s", bl->outputdir));
+    ARG(GCSPRINTF("--output-directory=%s", bl->outputdir));
 
     if (info->u.pv.bootloader_args) {
         char **p = info->u.pv.bootloader_args;
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index f0fee00..8770486 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -421,7 +421,7 @@ int libxl__domain_build(libxl__gc *gc,
         vments[2] = "image/ostype";
         vments[3] = "hvm";
         vments[4] = "start_time";
-        vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
+        vments[5] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
 
         localents = libxl__calloc(gc, 9, sizeof(char *));
         i = 0;
@@ -438,7 +438,7 @@ int libxl__domain_build(libxl__gc *gc,
             if (max_ram_below_4g <= HVM_BELOW_4G_MMIO_START) {
                 localents[i++] = "platform/mmio_hole_size";
                 localents[i++] =
-                    libxl__sprintf(gc, "%"PRIu64,
+                    GCSPRINTF("%"PRIu64,
                                    info->u.hvm.mmio_hole_memkb << 10);
             }
         }
@@ -458,7 +458,7 @@ int libxl__domain_build(libxl__gc *gc,
         vments[i++] = "image/kernel";
         vments[i++] = (char *) state->pv_kernel.path;
         vments[i++] = "start_time";
-        vments[i++] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
+        vments[i++] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
         if (state->pv_ramdisk.path) {
             vments[i++] = "image/ramdisk";
             vments[i++] = (char *) state->pv_ramdisk.path;
@@ -555,7 +555,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
         goto out;
     }
 
-    vm_path = libxl__sprintf(gc, "/vm/%s", uuid_string);
+    vm_path = GCSPRINTF("/vm/%s", uuid_string);
     if (!vm_path) {
         LOG(ERROR, "cannot allocate create paths");
         rc = ERROR_FAIL;
@@ -591,36 +591,36 @@ retry_transaction:
     xs_rm(ctx->xsh, t, libxl_path);
     libxl__xs_mkdir(gc, t, libxl_path, noperm, ARRAY_SIZE(noperm));
 
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/vm", dom_path), vm_path, strlen(vm_path));
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/vm", dom_path), vm_path, strlen(vm_path));
     rc = libxl__domain_rename(gc, *domid, 0, info->name, t);
     if (rc)
         goto out;
 
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/cpu", dom_path),
+                    GCSPRINTF("%s/cpu", dom_path),
                     roperm, ARRAY_SIZE(roperm));
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/memory", dom_path),
+                    GCSPRINTF("%s/memory", dom_path),
                     roperm, ARRAY_SIZE(roperm));
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/device", dom_path),
+                    GCSPRINTF("%s/device", dom_path),
                     roperm, ARRAY_SIZE(roperm));
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/control", dom_path),
+                    GCSPRINTF("%s/control", dom_path),
                     roperm, ARRAY_SIZE(roperm));
     if (info->type == LIBXL_DOMAIN_TYPE_HVM)
         libxl__xs_mkdir(gc, t,
-                        libxl__sprintf(gc, "%s/hvmloader", dom_path),
+                        GCSPRINTF("%s/hvmloader", dom_path),
                         roperm, ARRAY_SIZE(roperm));
 
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/control/shutdown", dom_path),
+                    GCSPRINTF("%s/control/shutdown", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/device/suspend/event-channel", dom_path),
+                    GCSPRINTF("%s/device/suspend/event-channel", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));
     libxl__xs_mkdir(gc, t,
-                    libxl__sprintf(gc, "%s/data", dom_path),
+                    GCSPRINTF("%s/data", dom_path),
                     rwperm, ARRAY_SIZE(rwperm));
 
     if (libxl_defbool_val(info->driver_domain)) {
@@ -646,14 +646,14 @@ retry_transaction:
     }
     libxl_vminfo_list_free(vm_list, nb_vm);
 
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/uuid", vm_path), uuid_string, strlen(uuid_string));
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/name", vm_path), info->name, strlen(info->name));
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/uuid", vm_path), uuid_string, strlen(uuid_string));
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/name", vm_path), info->name, strlen(info->name));
 
     libxl__xs_writev(gc, t, dom_path, info->xsdata);
-    libxl__xs_writev(gc, t, libxl__sprintf(gc, "%s/platform", dom_path), info->platformdata);
+    libxl__xs_writev(gc, t, GCSPRINTF("%s/platform", dom_path), info->platformdata);
 
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/control/platform-feature-multiprocessor-suspend", dom_path), "1", 1);
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/control/platform-feature-xs_reset_watches", dom_path), "1", 1);
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/control/platform-feature-multiprocessor-suspend", dom_path), "1", 1);
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/control/platform-feature-xs_reset_watches", dom_path), "1", 1);
     if (!xs_transaction_end(ctx->xsh, t, 0)) {
         if (errno == EAGAIN) {
             t = 0;
@@ -677,7 +677,7 @@ static int store_libxl_entry(libxl__gc *gc, uint32_t domid,
     char *path = NULL;
 
     path = libxl__xs_libxl_path(gc, domid);
-    path = libxl__sprintf(gc, "%s/dm-version", path);
+    path = GCSPRINTF("%s/dm-version", path);
     return libxl__xs_write(gc, XBT_NULL, path, "%s",
         libxl_device_model_version_to_string(b_info->device_model_version));
 }
@@ -1081,7 +1081,7 @@ static void domcreate_stream_done(libxl__egc *egc,
         vments[2] = "image/ostype";
         vments[3] = "hvm";
         vments[4] = "start_time";
-        vments[5] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
+        vments[5] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         vments = libxl__calloc(gc, 11, sizeof(char *));
@@ -1091,7 +1091,7 @@ static void domcreate_stream_done(libxl__egc *egc,
         vments[i++] = "image/kernel";
         vments[i++] = (char *) state->pv_kernel.path;
         vments[i++] = "start_time";
-        vments[i++] = libxl__sprintf(gc, "%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
+        vments[i++] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
         if (state->pv_ramdisk.path) {
             vments[i++] = "image/ramdisk";
             vments[i++] = (char *) state->pv_ramdisk.path;
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 175accd..ca39f41 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -29,13 +29,13 @@ static const char *libxl_tapif_script(libxl__gc *gc)
 #if defined(__linux__) || defined(__FreeBSD__)
     return libxl__strdup(gc, "no");
 #else
-    return libxl__sprintf(gc, "%s/qemu-ifup", libxl__xen_script_dir_path());
+    return GCSPRINTF("%s/qemu-ifup", libxl__xen_script_dir_path());
 #endif
 }
 
 const char *libxl__device_model_savefile(libxl__gc *gc, uint32_t domid)
 {
-    return libxl__sprintf(gc, LIBXL_DEVICE_MODEL_SAVE_FILE".%d", domid);
+    return GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d", domid);
 }
 
 static const char *qemu_xen_path(libxl__gc *gc)
@@ -416,7 +416,7 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
     dm_envs = flexarray_make(gc, 16, 1);
 
     flexarray_vappend(dm_args, dm,
-                      "-d", libxl__sprintf(gc, "%d", domid), NULL);
+                      "-d", GCSPRINTF("%d", domid), NULL);
 
     if (c_info->name)
         flexarray_vappend(dm_args, "-domain-name", c_info->name, NULL);
@@ -442,14 +442,14 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
                 }
                 vncarg = vnc->listen;
             } else {
-                vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen,
+                vncarg = GCSPRINTF("%s:%d", vnc->listen,
                                         vnc->display);
             }
         } else
-            vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
+            vncarg = GCSPRINTF("127.0.0.1:%d", vnc->display);
 
         if (vnc->passwd && vnc->passwd[0]) {
-            vncarg = libxl__sprintf(gc, "%s,password", vncarg);
+            vncarg = GCSPRINTF("%s,password", vncarg);
         }
 
         flexarray_append(dm_args, vncarg);
@@ -517,7 +517,7 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
 
         if (b_info->video_memkb) {
             flexarray_vappend(dm_args, "-videoram",
-                    libxl__sprintf(gc, "%d",
+                    GCSPRINTF("%d",
                                    libxl__sizekb_to_mb(b_info->video_memkb)),
                     NULL);
         }
@@ -569,19 +569,19 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
         }
         if (b_info->max_vcpus > 1) {
             flexarray_vappend(dm_args, "-vcpus",
-                              libxl__sprintf(gc, "%d", b_info->max_vcpus),
+                              GCSPRINTF("%d", b_info->max_vcpus),
                               NULL);
         }
 
         nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
         s = libxl_bitmap_to_hex_string(CTX, &b_info->avail_vcpus);
         flexarray_vappend(dm_args, "-vcpu_avail",
-                              libxl__sprintf(gc, "%s", s), NULL);
+                              GCSPRINTF("%s", s), NULL);
         free(s);
 
         for (i = 0; i < num_nics; i++) {
             if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
-                char *smac = libxl__sprintf(gc,
+                char *smac = GCSPRINTF(
                                    LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nics[i].mac));
                 const char *ifname = libxl__device_nic_devname(gc,
                                                 domid, nics[i].devid,
@@ -683,26 +683,26 @@ static char *dm_spice_options(libxl__gc *gc,
             return NULL;
         }
     }
-    opt = libxl__sprintf(gc, "port=%d,tls-port=%d",
+    opt = GCSPRINTF("port=%d,tls-port=%d",
                          spice->port, spice->tls_port);
     if (spice->host)
-        opt = libxl__sprintf(gc, "%s,addr=%s", opt, spice->host);
+        opt = GCSPRINTF("%s,addr=%s", opt, spice->host);
     if (libxl_defbool_val(spice->disable_ticketing))
-        opt = libxl__sprintf(gc, "%s,disable-ticketing", opt);
+        opt = GCSPRINTF("%s,disable-ticketing", opt);
     else
-        opt = libxl__sprintf(gc, "%s,password=%s", opt, spice->passwd);
-    opt = libxl__sprintf(gc, "%s,agent-mouse=%s", opt,
+        opt = GCSPRINTF("%s,password=%s", opt, spice->passwd);
+    opt = GCSPRINTF("%s,agent-mouse=%s", opt,
                          libxl_defbool_val(spice->agent_mouse) ? "on" : "off");
 
     if (!libxl_defbool_val(spice->clipboard_sharing))
-        opt = libxl__sprintf(gc, "%s,disable-copy-paste", opt);
+        opt = GCSPRINTF("%s,disable-copy-paste", opt);
 
     if (spice->image_compression)
-        opt = libxl__sprintf(gc, "%s,image-compression=%s", opt,
+        opt = GCSPRINTF("%s,image-compression=%s", opt,
                              spice->image_compression);
 
     if (spice->streaming_video)
-        opt = libxl__sprintf(gc, "%s,streaming-video=%s", opt,
+        opt = GCSPRINTF("%s,streaming-video=%s", opt,
                              spice->streaming_video);
 
     return opt;
@@ -782,11 +782,11 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 
     flexarray_vappend(dm_args, dm,
                       "-xen-domid",
-                      libxl__sprintf(gc, "%d", guest_domid), NULL);
+                      GCSPRINTF("%d", guest_domid), NULL);
 
     flexarray_append(dm_args, "-chardev");
     flexarray_append(dm_args,
-                     libxl__sprintf(gc, "socket,id=libxl-cmd,"
+                     GCSPRINTF("socket,id=libxl-cmd,"
                                     "path=%s/qmp-libxl-%d,server,nowait",
                                     libxl__run_dir_path(), guest_domid));
 
@@ -796,7 +796,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 
     flexarray_append(dm_args, "-chardev");
     flexarray_append(dm_args,
-                     libxl__sprintf(gc, "socket,id=libxenstat-cmd,"
+                     GCSPRINTF("socket,id=libxenstat-cmd,"
                                     "path=%s/qmp-libxenstat-%d,server,nowait",
                                     libxl__run_dir_path(), guest_domid));
 
@@ -860,21 +860,21 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                 }
                 vncarg = vnc->listen;
             } else {
-                vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen,
+                vncarg = GCSPRINTF("%s:%d", vnc->listen,
                                         vnc->display);
             }
         } else
-            vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
+            vncarg = GCSPRINTF("127.0.0.1:%d", vnc->display);
 
         if (vnc->passwd && vnc->passwd[0]) {
-            vncarg = libxl__sprintf(gc, "%s,password", vncarg);
+            vncarg = GCSPRINTF("%s,password", vncarg);
         }
 
         if (libxl_defbool_val(vnc->findunused)) {
             /* This option asks to QEMU to try this number of port before to
              * give up.  So QEMU will try ports between $display and $display +
              * 99.  This option needs to be the last one of the vnc options. */
-            vncarg = libxl__sprintf(gc, "%s,to=99", vncarg);
+            vncarg = GCSPRINTF("%s,to=99", vncarg);
         }
 
         flexarray_append(dm_args, vncarg);
@@ -978,7 +978,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 
         if (b_info->u.hvm.boot) {
             flexarray_vappend(dm_args, "-boot",
-                    libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot), NULL);
+                    GCSPRINTF("order=%s", b_info->u.hvm.boot), NULL);
         }
         if (libxl_defbool_val(b_info->u.hvm.usb)
             || b_info->u.hvm.usbdevice
@@ -1029,9 +1029,9 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             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,
+                    flexarray_vappend(dm_args, "-chardev", GCSPRINTF(
                         "spicevmc,name=usbredir,id=usbrc%d", i), "-device",
-                        libxl__sprintf(gc, "usb-redir,chardev=usbrc%d,"
+                        GCSPRINTF("usb-redir,chardev=usbrc%d,"
                         "id=usbrc%d", i, i), NULL);
             } else {
                 LOG(ERROR, "usbredirection parameter is invalid, "
@@ -1051,23 +1051,23 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                 int nr_set_cpus = 0;
                 nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
 
-                flexarray_append(dm_args, libxl__sprintf(gc, "%d,maxcpus=%d",
+                flexarray_append(dm_args, GCSPRINTF("%d,maxcpus=%d",
                                                          nr_set_cpus,
                                                          b_info->max_vcpus));
             } else
-                flexarray_append(dm_args, libxl__sprintf(gc, "%d",
+                flexarray_append(dm_args, GCSPRINTF("%d",
                                                          b_info->max_vcpus));
         }
         for (i = 0; i < num_nics; i++) {
             if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
-                char *smac = libxl__sprintf(gc,
+                char *smac = GCSPRINTF(
                                 LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nics[i].mac));
                 const char *ifname = libxl__device_nic_devname(gc,
                                                 guest_domid, nics[i].devid,
                                                 LIBXL_NIC_TYPE_VIF_IOEMU);
                 flexarray_append(dm_args, "-device");
                 flexarray_append(dm_args,
-                   libxl__sprintf(gc, "%s,id=nic%d,netdev=net%d,mac=%s",
+                   GCSPRINTF("%s,id=nic%d,netdev=net%d,mac=%s",
                                                 nics[i].model, nics[i].devid,
                                                 nics[i].devid, smac));
                 flexarray_append(dm_args, "-netdev");
@@ -1112,9 +1112,9 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             /* Switching here to the machine "pc" which does not add
              * the xen-platform device instead of the default "xenfv" machine.
              */
-            machinearg = libxl__sprintf(gc, "pc,accel=xen");
+            machinearg = libxl__strdup(gc, "pc,accel=xen");
         } else {
-            machinearg = libxl__sprintf(gc, "xenfv");
+            machinearg = libxl__strdup(gc, "xenfv");
         }
         if (b_info->u.hvm.mmio_hole_memkb) {
             uint64_t max_ram_below_4g = (1ULL << 32) -
@@ -1125,7 +1125,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                     " invalid ignored.\n",
                     b_info->u.hvm.mmio_hole_memkb);
             } else {
-                machinearg = libxl__sprintf(gc, "%s,max-ram-below-4g=%"PRIu64,
+                machinearg = GCSPRINTF("%s,max-ram-below-4g=%"PRIu64,
                                             machinearg, max_ram_below_4g);
             }
         }
@@ -1156,7 +1156,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 
     ram_size = libxl__sizekb_to_mb(b_info->max_memkb - b_info->video_memkb);
     flexarray_append(dm_args, "-m");
-    flexarray_append(dm_args, libxl__sprintf(gc, "%"PRId64, ram_size));
+    flexarray_append(dm_args, GCSPRINTF("%"PRId64, ram_size));
 
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         if (b_info->u.hvm.hdtype == LIBXL_HDTYPE_AHCI)
@@ -1264,7 +1264,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             goto end_search;
         }
 
-        user = libxl__sprintf(gc, "%s%d", LIBXL_QEMU_USER_BASE, guest_domid);
+        user = GCSPRINTF("%s%d", LIBXL_QEMU_USER_BASE, guest_domid);
         ret = libxl__dm_runas_helper(gc, user);
         if (ret < 0)
             return ret;
@@ -1388,7 +1388,7 @@ static int libxl__write_stub_dmargs(libxl__gc *gc,
     roperm[1].id = dm_domid;
     roperm[1].perms = XS_PERM_READ;
 
-    vm_path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "/local/domain/%d/vm", guest_domid));
+    vm_path = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("/local/domain/%d/vm", guest_domid));
 
     i = 0;
     dmargs_size = 0;
@@ -1407,13 +1407,13 @@ static int libxl__write_stub_dmargs(libxl__gc *gc,
         }
         i++;
     }
-    path = libxl__sprintf(gc, "%s/image/dmargs", vm_path);
+    path = GCSPRINTF("%s/image/dmargs", vm_path);
 
 retry_transaction:
     t = xs_transaction_start(ctx->xsh);
     xs_write(ctx->xsh, t, path, dmargs, strlen(dmargs));
     xs_set_permissions(ctx->xsh, t, path, roperm, ARRAY_SIZE(roperm));
-    xs_set_permissions(ctx->xsh, t, libxl__sprintf(gc, "%s/rtc/timeoffset", vm_path), roperm, ARRAY_SIZE(roperm));
+    xs_set_permissions(ctx->xsh, t, GCSPRINTF("%s/rtc/timeoffset", vm_path), roperm, ARRAY_SIZE(roperm));
     if (!xs_transaction_end(ctx->xsh, t, 0))
         if (errno == EAGAIN)
             goto retry_transaction;
@@ -1436,7 +1436,7 @@ static void stubdom_xswait_cb(libxl__egc *egc, libxl__xswait_state *xswait,
 
 char *libxl__stub_dm_name(libxl__gc *gc, const char *guest_name)
 {
-    return libxl__sprintf(gc, "%s-dm", guest_name);
+    return GCSPRINTF("%s-dm", guest_name);
 }
 
 void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
@@ -1518,7 +1518,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
 
     stubdom_state->pv_kernel.path
         = libxl__abs_path(gc, "ioemu-stubdom.gz", libxl__xenfirmwaredir_path());
-    stubdom_state->pv_cmdline = libxl__sprintf(gc, " -d %d", guest_domid);
+    stubdom_state->pv_cmdline = GCSPRINTF(" -d %d", guest_domid);
     stubdom_state->pv_ramdisk.path = "";
 
     /* fixme: this function can leak the stubdom if it fails */
@@ -1541,11 +1541,11 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
 
     libxl__write_stub_dmargs(gc, dm_domid, guest_domid, args);
     libxl__xs_write(gc, XBT_NULL,
-                   libxl__sprintf(gc, "%s/image/device-model-domid",
+                   GCSPRINTF("%s/image/device-model-domid",
                                   libxl__xs_get_dompath(gc, guest_domid)),
                    "%d", dm_domid);
     libxl__xs_write(gc, XBT_NULL,
-                   libxl__sprintf(gc, "%s/target",
+                   GCSPRINTF("%s/target",
                                   libxl__xs_get_dompath(gc, dm_domid)),
                    "%d", guest_domid);
     ret = xc_domain_set_target(ctx->xch, dm_domid, guest_domid);
@@ -1639,21 +1639,21 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
             char *filename;
             char *name;
             case STUBDOM_CONSOLE_LOGGING:
-                name = libxl__sprintf(gc, "qemu-dm-%s",
+                name = GCSPRINTF("qemu-dm-%s",
                                       libxl_domid_to_name(ctx, guest_domid));
                 ret = libxl_create_logfile(ctx, name, &filename);
                 if (ret) goto out;
-                console[i].output = libxl__sprintf(gc, "file:%s", filename);
+                console[i].output = GCSPRINTF("file:%s", filename);
                 free(filename);
                 break;
             case STUBDOM_CONSOLE_SAVE:
-                console[i].output = libxl__sprintf(gc, "file:%s",
+                console[i].output = GCSPRINTF("file:%s",
                                 libxl__device_model_savefile(gc, guest_domid));
                 break;
             case STUBDOM_CONSOLE_RESTORE:
                 if (d_state->saved_state)
                     console[i].output =
-                        libxl__sprintf(gc, "pipe:%s", d_state->saved_state);
+                        GCSPRINTF("pipe:%s", d_state->saved_state);
                 break;
             default:
                 console[i].output = "pty";
@@ -1822,13 +1822,13 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         path = xs_get_domain_path(ctx->xsh, domid);
         libxl__xs_write(gc, XBT_NULL,
-                        libxl__sprintf(gc, "%s/hvmloader/bios", path),
+                        GCSPRINTF("%s/hvmloader/bios", path),
                         "%s", libxl_bios_type_to_string(b_info->u.hvm.bios));
         /* Disable relocating memory to make the MMIO hole larger
          * unless we're running qemu-traditional and vNUMA is not
          * configured. */
         libxl__xs_write(gc, XBT_NULL,
-                        libxl__sprintf(gc,
+                        GCSPRINTF(
                                        "%s/hvmloader/allow-memory-relocate",
                                        path),
                         "%d",
@@ -1843,7 +1843,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM &&
         b_info->device_model_version
         == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL)
-        libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/disable_pf", path),
+        libxl__xs_write(gc, XBT_NULL, GCSPRINTF("%s/disable_pf", path),
                     "%d", !libxl_defbool_val(b_info->u.hvm.xen_platform_pci));
 
     logfile_w = libxl__create_qemu_logfile(gc, GCSPRINTF("qemu-dm-%s",
@@ -1868,7 +1868,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
 retry_transaction:
         /* Find uuid and the write the vnc password to xenstore for qemu. */
         t = xs_transaction_start(ctx->xsh);
-        vm_path = libxl__xs_read(gc,t,libxl__sprintf(gc, "%s/vm", dom_path));
+        vm_path = libxl__xs_read(gc,t,GCSPRINTF("%s/vm", dom_path));
         if (vm_path) {
             /* Now write the vncpassword into it. */
             pass_stuff = libxl__calloc(gc, 3, sizeof(char *));
diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 0df6d6c..139e49a 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -580,7 +580,7 @@ static void watchfd_callback(libxl__egc *egc, libxl__ev_fd *ev,
 
 static char *watch_token(libxl__gc *gc, int slotnum, uint32_t counterval)
 {
-    return libxl__sprintf(gc, "%d/%"PRIx32, slotnum, counterval);
+    return GCSPRINTF("%d/%"PRIx32, slotnum, counterval);
 }
 
 static void watches_check_fd_deregister(libxl__gc *gc)
diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
index c69d6f9..328046b 100644
--- a/tools/libxl/libxl_internal.c
+++ b/tools/libxl/libxl_internal.c
@@ -242,7 +242,7 @@ void libxl__log(libxl_ctx *ctx, xentoollog_level msglevel, int errnoval,
 char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path)
 {
     if (s[0] == '/') return libxl__strdup(gc, s);
-    return libxl__sprintf(gc, "%s/%s", path, s);
+    return GCSPRINTF("%s/%s", path, s);
 }
 
 
@@ -368,7 +368,7 @@ int libxl__device_model_version_running(libxl__gc *gc, uint32_t domid)
     libxl_device_model_version value;
 
     path = libxl__xs_libxl_path(gc, domid);
-    path = libxl__sprintf(gc, "%s/dm-version", path);
+    path = GCSPRINTF("%s/dm-version", path);
     dm_version = libxl__xs_read(gc, XBT_NULL, path);
     if (!dm_version) {
         return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index fad2eb6..bb49e88 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -50,18 +50,18 @@ static int pcidev_struct_fill(libxl_device_pci *pcidev, unsigned int domain,
 
 static void libxl_create_pci_backend_device(libxl__gc *gc, flexarray_t *back, int num, libxl_device_pci *pcidev)
 {
-    flexarray_append(back, libxl__sprintf(gc, "key-%d", num));
-    flexarray_append(back, libxl__sprintf(gc, PCI_BDF, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func));
-    flexarray_append(back, libxl__sprintf(gc, "dev-%d", num));
-    flexarray_append(back, libxl__sprintf(gc, PCI_BDF, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func));
+    flexarray_append(back, GCSPRINTF("key-%d", num));
+    flexarray_append(back, GCSPRINTF(PCI_BDF, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func));
+    flexarray_append(back, GCSPRINTF("dev-%d", num));
+    flexarray_append(back, GCSPRINTF(PCI_BDF, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func));
     if (pcidev->vdevfn)
-        flexarray_append_pair(back, libxl__sprintf(gc, "vdevfn-%d", num), libxl__sprintf(gc, "%x", pcidev->vdevfn));
-    flexarray_append(back, libxl__sprintf(gc, "opts-%d", num));
+        flexarray_append_pair(back, GCSPRINTF("vdevfn-%d", num), GCSPRINTF("%x", pcidev->vdevfn));
+    flexarray_append(back, GCSPRINTF("opts-%d", num));
     flexarray_append(back,
-              libxl__sprintf(gc, "msitranslate=%d,power_mgmt=%d,permissive=%d",
+              GCSPRINTF("msitranslate=%d,power_mgmt=%d,permissive=%d",
                              pcidev->msitranslate, pcidev->power_mgmt,
                              pcidev->permissive));
-    flexarray_append_pair(back, libxl__sprintf(gc, "state-%d", num), GCSPRINTF("%d", XenbusStateInitialising));
+    flexarray_append_pair(back, GCSPRINTF("state-%d", num), GCSPRINTF("%d", XenbusStateInitialising));
 }
 
 static int libxl__device_from_pcidev(libxl__gc *gc, uint32_t domid,
@@ -96,7 +96,7 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
     /* add pci device */
     libxl__device_from_pcidev(gc, domid, pcidev, &device);
 
-    flexarray_append_pair(back, "frontend-id", libxl__sprintf(gc, "%d", domid));
+    flexarray_append_pair(back, "frontend-id", GCSPRINTF("%d", domid));
     flexarray_append_pair(back, "online", "1");
     flexarray_append_pair(back, "state", GCSPRINTF("%d", XenbusStateInitialising));
     flexarray_append_pair(back, "domain", libxl__domid_to_name(gc, domid));
@@ -104,8 +104,8 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid,
     for (i = 0; i < num; i++, pcidev++)
         libxl_create_pci_backend_device(gc, back, i, pcidev);
 
-    flexarray_append_pair(back, "num_devs", libxl__sprintf(gc, "%d", num));
-    flexarray_append_pair(front, "backend-id", libxl__sprintf(gc, "%d", 0));
+    flexarray_append_pair(back, "num_devs", GCSPRINTF("%d", num));
+    flexarray_append_pair(front, "backend-id", GCSPRINTF("%d", 0));
     flexarray_append_pair(front, "state", GCSPRINTF("%d", XenbusStateInitialising));
 
     libxl__device_generic_add(gc, XBT_NULL, &device,
@@ -132,8 +132,8 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_d
     libxl_device_pci_init(&pcidev_saved);
     libxl_device_pci_copy(CTX, &pcidev_saved, pcidev);
 
-    be_path = libxl__sprintf(gc, "%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
-    num_devs = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/num_devs", be_path));
+    be_path = GCSPRINTF("%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
+    num_devs = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/num_devs", be_path));
     if (!num_devs)
         return libxl__create_pci_backend(gc, domid, pcidev, 1);
 
@@ -151,7 +151,7 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_d
     LOG(DEBUG, "Adding new pci device to xenstore");
     num = atoi(num_devs);
     libxl_create_pci_backend_device(gc, back, num, pcidev);
-    flexarray_append_pair(back, "num_devs", libxl__sprintf(gc, "%d", num + 1));
+    flexarray_append_pair(back, "num_devs", GCSPRINTF("%d", num + 1));
     if (!starting)
         flexarray_append_pair(back, "state", GCSPRINTF("%d", XenbusStateReconfiguring));
 
@@ -199,8 +199,8 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx
     int num, i, j;
     xs_transaction_t t;
 
-    be_path = libxl__sprintf(gc, "%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
-    num_devs_path = libxl__sprintf(gc, "%s/num_devs", be_path);
+    be_path = GCSPRINTF("%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
+    num_devs_path = GCSPRINTF("%s/num_devs", be_path);
     num_devs = libxl__xs_read(gc, XBT_NULL, num_devs_path);
     if (!num_devs)
         return ERROR_INVAL;
@@ -219,7 +219,7 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx
 
     for (i = 0; i < num; i++) {
         unsigned int domain = 0, bus = 0, dev = 0, func = 0;
-        xsdev = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/dev-%d", be_path, i));
+        xsdev = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/dev-%d", be_path, i));
         sscanf(xsdev, PCI_BDF, &domain, &bus, &dev, &func);
         if (domain == pcidev->domain && bus == pcidev->bus &&
             pcidev->dev == dev && pcidev->func == func) {
@@ -233,8 +233,8 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx
 
 retry_transaction:
     t = xs_transaction_start(ctx->xsh);
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/state-%d", be_path, i), GCSPRINTF("%d", XenbusStateClosing), 1);
-    xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/state", be_path), GCSPRINTF("%d", XenbusStateReconfiguring), 1);
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/state-%d", be_path, i), GCSPRINTF("%d", XenbusStateClosing), 1);
+    xs_write(ctx->xsh, t, GCSPRINTF("%s/state", be_path), GCSPRINTF("%d", XenbusStateReconfiguring), 1);
     if (!xs_transaction_end(ctx->xsh, t, 0))
         if (errno == EAGAIN)
             goto retry_transaction;
@@ -248,42 +248,42 @@ retry_transaction:
 
 retry_transaction2:
     t = xs_transaction_start(ctx->xsh);
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/state-%d", be_path, i));
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/key-%d", be_path, i));
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/dev-%d", be_path, i));
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/vdev-%d", be_path, i));
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/opts-%d", be_path, i));
-    xs_rm(ctx->xsh, t, libxl__sprintf(gc, "%s/vdevfn-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/state-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/key-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/dev-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/vdev-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/opts-%d", be_path, i));
+    xs_rm(ctx->xsh, t, GCSPRINTF("%s/vdevfn-%d", be_path, i));
     libxl__xs_write(gc, t, num_devs_path, "%d", num - 1);
     for (j = i + 1; j < num; j++) {
-        tmppath = libxl__sprintf(gc, "%s/state-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/state-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
-        xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/state-%d", be_path, j - 1), tmp, strlen(tmp));
+        xs_write(ctx->xsh, t, GCSPRINTF("%s/state-%d", be_path, j - 1), tmp, strlen(tmp));
         xs_rm(ctx->xsh, t, tmppath);
-        tmppath = libxl__sprintf(gc, "%s/dev-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/dev-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
-        xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/dev-%d", be_path, j - 1), tmp, strlen(tmp));
+        xs_write(ctx->xsh, t, GCSPRINTF("%s/dev-%d", be_path, j - 1), tmp, strlen(tmp));
         xs_rm(ctx->xsh, t, tmppath);
-        tmppath = libxl__sprintf(gc, "%s/key-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/key-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
-        xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/key-%d", be_path, j - 1), tmp, strlen(tmp));
+        xs_write(ctx->xsh, t, GCSPRINTF("%s/key-%d", be_path, j - 1), tmp, strlen(tmp));
         xs_rm(ctx->xsh, t, tmppath);
-        tmppath = libxl__sprintf(gc, "%s/vdev-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/vdev-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
         if (tmp) {
-            xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/vdev-%d", be_path, j - 1), tmp, strlen(tmp));
+            xs_write(ctx->xsh, t, GCSPRINTF("%s/vdev-%d", be_path, j - 1), tmp, strlen(tmp));
             xs_rm(ctx->xsh, t, tmppath);
         }
-        tmppath = libxl__sprintf(gc, "%s/opts-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/opts-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
         if (tmp) {
-            xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/opts-%d", be_path, j - 1), tmp, strlen(tmp));
+            xs_write(ctx->xsh, t, GCSPRINTF("%s/opts-%d", be_path, j - 1), tmp, strlen(tmp));
             xs_rm(ctx->xsh, t, tmppath);
         }
-        tmppath = libxl__sprintf(gc, "%s/vdevfn-%d", be_path, j);
+        tmppath = GCSPRINTF("%s/vdevfn-%d", be_path, j);
         tmp = libxl__xs_read(gc, t, tmppath);
         if (tmp) {
-            xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/vdevfn-%d", be_path, j - 1), tmp, strlen(tmp));
+            xs_write(ctx->xsh, t, GCSPRINTF("%s/vdevfn-%d", be_path, j - 1), tmp, strlen(tmp));
             xs_rm(ctx->xsh, t, tmppath);
         }
     }
@@ -319,14 +319,14 @@ static int get_all_assigned_devices(libxl__gc *gc, libxl_device_pci **list, int
     for(i = 0; i < nd; i++) {
         char *path, *num_devs;
 
-        path = libxl__sprintf(gc, "/local/domain/0/backend/pci/%s/0/num_devs", domlist[i]);
+        path = GCSPRINTF("/local/domain/0/backend/pci/%s/0/num_devs", domlist[i]);
         num_devs = libxl__xs_read(gc, XBT_NULL, path);
         if ( num_devs ) {
             int ndev = atoi(num_devs), j;
             char *devpath, *bdf;
 
             for(j = 0; j < ndev; j++) {
-                devpath = libxl__sprintf(gc, "/local/domain/0/backend/pci/%s/0/dev-%u",
+                devpath = GCSPRINTF("/local/domain/0/backend/pci/%s/0/dev-%u",
                                         domlist[i], j);
                 bdf = libxl__xs_read(gc, XBT_NULL, devpath);
                 if ( bdf ) {
@@ -381,7 +381,7 @@ static int sysfs_write_bdf(libxl__gc *gc, const char * sysfs_path,
         return ERROR_FAIL;
     }
 
-    buf = libxl__sprintf(gc, PCI_BDF, pcidev->domain, pcidev->bus,
+    buf = GCSPRINTF(PCI_BDF, pcidev->domain, pcidev->bus,
                          pcidev->dev, pcidev->func);
     rc = write(fd, buf, strlen(buf));
     /* Annoying to have two if's, but we need the errno */
@@ -454,7 +454,7 @@ static int sysfs_dev_unbind(libxl__gc *gc, libxl_device_pci *pcidev,
     char * spath, *dp = NULL;
     struct stat st;
 
-    spath = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/driver",
+    spath = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/driver",
                            pcidev->domain,
                            pcidev->bus,
                            pcidev->dev,
@@ -471,7 +471,7 @@ static int sysfs_dev_unbind(libxl__gc *gc, libxl_device_pci *pcidev,
         LOG(DEBUG, "Driver re-plug path: %s", dp);
 
         /* Unbind from the old driver */
-        spath = libxl__sprintf(gc, "%s/unbind", dp);
+        spath = GCSPRINTF("%s/unbind", dp);
         if ( sysfs_write_bdf(gc, spath, pcidev) < 0 ) {
             LOGE(ERROR, "Couldn't unbind device");
             return -1;
@@ -666,7 +666,7 @@ static int pciback_dev_is_assigned(libxl__gc *gc, libxl_device_pci *pcidev)
         return -1;
     }
 
-    spath = libxl__sprintf(gc, SYSFS_PCIBACK_DRIVER"/"PCI_BDF,
+    spath = GCSPRINTF(SYSFS_PCIBACK_DRIVER"/"PCI_BDF,
                            pcidev->domain, pcidev->bus,
                            pcidev->dev, pcidev->func);
     rc = lstat(spath, &st);
@@ -728,7 +728,7 @@ static void pci_assignable_driver_path_write(libxl__gc *gc,
 {
     char *path;
 
-    path = libxl__sprintf(gc, PCIBACK_INFO_PATH"/"PCI_BDF_XSPATH"/driver_path",
+    path = GCSPRINTF(PCIBACK_INFO_PATH"/"PCI_BDF_XSPATH"/driver_path",
                           pcidev->domain,
                           pcidev->bus,
                           pcidev->dev,
@@ -742,7 +742,7 @@ static char * pci_assignable_driver_path_read(libxl__gc *gc,
                                               libxl_device_pci *pcidev)
 {
     return libxl__xs_read(gc, XBT_NULL,
-                          libxl__sprintf(gc,
+                          GCSPRINTF(
                            PCIBACK_INFO_PATH "/" PCI_BDF_XSPATH "/driver_path",
                            pcidev->domain,
                            pcidev->bus,
@@ -757,7 +757,7 @@ static void pci_assignable_driver_path_remove(libxl__gc *gc,
 
     /* Remove the xenstore entry */
     xs_rm(ctx->xsh, XBT_NULL,
-          libxl__sprintf(gc, PCIBACK_INFO_PATH "/" PCI_BDF_XSPATH,
+          GCSPRINTF(PCIBACK_INFO_PATH "/" PCI_BDF_XSPATH,
                          pcidev->domain,
                          pcidev->bus,
                          pcidev->dev,
@@ -780,7 +780,7 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
     func = pcidev->func;
 
     /* See if the device exists */
-    spath = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF, dom, bus, dev, func);
+    spath = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF, dom, bus, dev, func);
     if ( lstat(spath, &st) ) {
         LOGE(ERROR, "Couldn't lstat %s", spath);
         return ERROR_FAIL;
@@ -851,7 +851,7 @@ static int libxl__device_pci_assignable_remove(libxl__gc *gc,
             LOG(INFO, "Rebinding to driver at %s", driver_path);
 
             if ( sysfs_write_bdf(gc,
-                                 libxl__sprintf(gc, "%s/bind", driver_path),
+                                 GCSPRINTF("%s/bind", driver_path),
                                  pcidev) < 0 ) {
                 LOGE(ERROR, "Couldn't bind device to %s", driver_path);
                 return -1;
@@ -926,7 +926,7 @@ static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsi
         if ( pcidev->dev != dev )
             continue;
 
-        path = libxl__sprintf(gc, "%s/" PCI_BDF, SYSFS_PCIBACK_DRIVER, dom, bus, dev, func);
+        path = GCSPRINTF("%s/" PCI_BDF, SYSFS_PCIBACK_DRIVER, dom, bus, dev, func);
         if ( lstat(path, &st) ) {
             if ( errno == ENOENT )
                 LOG(ERROR, PCI_BDF " is not assigned to pciback driver",
@@ -1031,7 +1031,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
             return ERROR_FAIL;
     }
 
-    sysfs_path = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
+    sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
                                 pcidev->bus, pcidev->dev, pcidev->func);
     f = fopen(sysfs_path, "r");
     start = end = flags = size = 0;
@@ -1071,7 +1071,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
         }
     }
     fclose(f);
-    sysfs_path = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/irq", pcidev->domain,
+    sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pcidev->domain,
                                 pcidev->bus, pcidev->dev, pcidev->func);
     f = fopen(sysfs_path, "r");
     if (f == NULL) {
@@ -1131,10 +1131,10 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
     char *reset;
     int fd, rc;
 
-    reset = libxl__sprintf(gc, "%s/do_flr", SYSFS_PCIBACK_DRIVER);
+    reset = GCSPRINTF("%s/do_flr", SYSFS_PCIBACK_DRIVER);
     fd = open(reset, O_WRONLY);
     if (fd >= 0) {
-        char *buf = libxl__sprintf(gc, PCI_BDF, domain, bus, dev, func);
+        char *buf = GCSPRINTF(PCI_BDF, domain, bus, dev, func);
         rc = write(fd, buf, strlen(buf));
         if (rc < 0)
             LOG(ERROR, "write to %s returned %d", reset, rc);
@@ -1143,7 +1143,7 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned
     }
     if (errno != ENOENT)
         LOGE(ERROR, "Failed to access pciback path %s", reset);
-    reset = libxl__sprintf(gc, "%s/"PCI_BDF"/reset", SYSFS_PCI_DEV, domain, bus, dev, func);
+    reset = GCSPRINTF("%s/"PCI_BDF"/reset", SYSFS_PCI_DEV, domain, bus, dev, func);
     fd = open(reset, O_WRONLY);
     if (fd >= 0) {
         rc = write(fd, "1", 1);
@@ -1381,7 +1381,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
     } else {
         assert(type == LIBXL_DOMAIN_TYPE_PV);
 
-        char *sysfs_path = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
+        char *sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
                                          pcidev->bus, pcidev->dev, pcidev->func);
         FILE *f = fopen(sysfs_path, "r");
         unsigned int start = 0, end = 0, flags = 0, size = 0;
@@ -1417,7 +1417,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
         }
         fclose(f);
 skip1:
-        sysfs_path = libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/irq", pcidev->domain,
+        sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pcidev->domain,
                                    pcidev->bus, pcidev->dev, pcidev->func);
         f = fopen(sysfs_path, "r");
         if (f == NULL) {
@@ -1533,16 +1533,16 @@ static void libxl__device_pci_from_xs_be(libxl__gc *gc,
     char *s;
     unsigned int domain = 0, bus = 0, dev = 0, func = 0, vdevfn = 0;
 
-    s = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/dev-%d", be_path, nr));
+    s = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/dev-%d", be_path, nr));
     sscanf(s, PCI_BDF, &domain, &bus, &dev, &func);
 
-    s = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/vdevfn-%d", be_path, nr));
+    s = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/vdevfn-%d", be_path, nr));
     if (s)
         vdevfn = strtol(s, (char **) NULL, 16);
 
     pcidev_struct_fill(pci, domain, bus, dev, func, vdevfn);
 
-    s = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/opts-%d", be_path, nr));
+    s = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/opts-%d", be_path, nr));
     if (s) {
         char *saveptr;
         char *p = strtok_r(s, ",=", &saveptr);
@@ -1572,8 +1572,8 @@ libxl_device_pci *libxl_device_pci_list(libxl_ctx *ctx, uint32_t domid, int *num
 
     *num = 0;
 
-    be_path = libxl__sprintf(gc, "%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
-    num_devs = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/num_devs", be_path));
+    be_path = GCSPRINTF("%s/backend/pci/%d/0", libxl__xs_get_dompath(gc, 0), domid);
+    num_devs = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/num_devs", be_path));
     if (!num_devs)
         goto out;
 
@@ -1625,7 +1625,7 @@ int libxl__grant_vga_iomem_permission(libxl__gc *gc, const uint32_t domid,
         uint32_t stubdom_domid;
         libxl_device_pci *pcidev = &d_config->pcidevs[i];
         char *pci_device_class_path =
-            libxl__sprintf(gc, SYSFS_PCI_DEV"/"PCI_BDF"/class",
+            GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/class",
                            pcidev->domain, pcidev->bus, pcidev->dev,
                            pcidev->func);
         int read_items;
diff --git a/tools/libxl/libxl_xshelp.c b/tools/libxl/libxl_xshelp.c
index b0db062..bc60b9a 100644
--- a/tools/libxl/libxl_xshelp.c
+++ b/tools/libxl/libxl_xshelp.c
@@ -54,7 +54,7 @@ int libxl__xs_writev_perms(libxl__gc *gc, xs_transaction_t t,
         return 0;
 
     for (i = 0; kvs[i] != NULL; i += 2) {
-        path = libxl__sprintf(gc, "%s/%s", dir, kvs[i]);
+        path = GCSPRINTF("%s/%s", dir, kvs[i]);
         if (path && kvs[i + 1]) {
             int length = strlen(kvs[i + 1]);
             xs_write(ctx->xsh, t, path, kvs[i + 1], length);
@@ -159,7 +159,7 @@ bool libxl__xs_mkdir(libxl__gc *gc, xs_transaction_t t,
 
 char *libxl__xs_libxl_path(libxl__gc *gc, uint32_t domid)
 {
-    char *s = libxl__sprintf(gc, "/libxl/%i", domid);
+    char *s = GCSPRINTF("/libxl/%i", domid);
     if (!s)
         LOG(ERROR, "cannot allocate create paths");
     return s;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:49:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49: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 1a23Tz-0004hw-OM; Thu, 26 Nov 2015 20:49:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ty-0004hm-5N
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:34 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	8A/A5-05979-D5077565; Thu, 26 Nov 2015 20:49:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1448570971!6859985!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49448 invoked from network); 26 Nov 2015 20:49:31 -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;
	26 Nov 2015 20:49:31 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Tv-0003BG-0b
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Tu-0000fL-Ub
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:30 +0000
Date: Thu, 26 Nov 2015 20:49:30 +0000
Message-Id: <E1a23Tu-0000fL-Ub@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix line wrapping issues
	introduced by automatic replacement
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c87303c04738b0e837da6e891eb561de0bf1b64e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Nov 17 16:19:20 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:21:02 2015 +0000

    libxl: fix line wrapping issues introduced by automatic replacement
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c     |   55 ++++++++++++++++++++------------------------
 tools/libxl/libxl_dm.c  |   57 ++++++++++++++++++++--------------------------
 tools/libxl/libxl_pci.c |   33 +++++++++++++--------------
 3 files changed, 66 insertions(+), 79 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index cb8c932..bd3aac8 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1374,8 +1374,8 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
     libxl_device_disk *disk = &ev->u.disk_eject.disk;
     
     backend = libxl__xs_read(gc, XBT_NULL,
-                             GCSPRINTF("%.*s/backend",
-                                            (int)strlen(wpath)-6, wpath));
+                             GCSPRINTF("%.*s/backend", (int)strlen(wpath)-6,
+                                       wpath));
 
     sscanf(backend,
             "/local/domain/%d/backend/%" TOSTRING(BACKEND_STRING_SIZE)
@@ -1693,8 +1693,7 @@ static void devices_destroy_cb(libxl__egc *egc,
         LOGE(ERROR, "xs_rm failed for %s", dom_path);
 
     xs_rm(ctx->xsh, XBT_NULL, libxl__xs_libxl_path(gc, domid));
-    xs_rm(ctx->xsh, XBT_NULL, GCSPRINTF(
-                                "/local/domain/%d/hvmloader", domid));
+    xs_rm(ctx->xsh, XBT_NULL, GCSPRINTF( "/local/domain/%d/hvmloader", domid));
 
     /* This is async operation, we already hold CTX lock */
     lock = libxl__lock_domain_userdata(gc, domid);
@@ -1940,13 +1939,13 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
     port = atoi(vnc_port) - 5900;
 
     vnc_listen = libxl__xs_read(gc, XBT_NULL,
-                                GCSPRINTF(
-                            "/local/domain/%d/console/vnc-listen", domid));
+                                GCSPRINTF("/local/domain/%d/console/vnc-listen",
+                                          domid));
 
     if ( autopass )
         vnc_pass = libxl__xs_read(gc, XBT_NULL,
-                                  GCSPRINTF(
-                            "/local/domain/%d/console/vnc-pass", domid));
+                                  GCSPRINTF("/local/domain/%d/console/vnc-pass",
+					    domid));
 
     if ( NULL == vnc_listen )
         vnc_listen = "localhost";
@@ -2746,8 +2745,8 @@ int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
         goto out;
     }
     path = libxl__xs_read(gc, XBT_NULL,
-                          GCSPRINTF("%s/device/vbd/%d/backend",
-                                         dompath, devid));
+                          GCSPRINTF("%s/device/vbd/%d/backend", dompath,
+                                    devid));
     if (!path)
         goto out;
 
@@ -2772,7 +2771,7 @@ static int libxl__append_disk_list_of_type(libxl__gc *gc,
     int initial_disks = *ndisks;
 
     be_path = GCSPRINTF("%s/backend/%s/%d",
-                             libxl__xs_get_dompath(gc, 0), type, domid);
+                        libxl__xs_get_dompath(gc, 0), type, domid);
     dir = libxl__xs_directory(gc, XBT_NULL, be_path, &n);
     if (dir && n) {
         libxl_device_disk *tmp;
@@ -3364,8 +3363,7 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
     }
 
     flexarray_append(back, "mac");
-    flexarray_append(back,GCSPRINTF(
-                                    LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));
+    flexarray_append(back,GCSPRINTF(LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));
     if (nic->ip) {
         flexarray_append(back, "ip");
         flexarray_append(back, libxl__strdup(gc, nic->ip));
@@ -3516,8 +3514,8 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
         goto out;
 
     path = libxl__xs_read(gc, XBT_NULL,
-                          GCSPRINTF("%s/device/vif/%d/backend",
-                                         dompath, devid));
+                          GCSPRINTF("%s/device/vif/%d/backend", dompath,
+                                    devid));
     if (!path)
         goto out;
 
@@ -3542,8 +3540,8 @@ static int libxl__append_nic_list_of_type(libxl__gc *gc,
     libxl_device_nic *pnic = NULL, *pnic_end = NULL;
     int rc;
 
-    be_path = GCSPRINTF("%s/backend/%s/%d",
-                             libxl__xs_get_dompath(gc, 0), type, domid);
+    be_path = GCSPRINTF("%s/backend/%s/%d", libxl__xs_get_dompath(gc, 0),
+                        type, domid);
     dir = libxl__xs_directory(gc, XBT_NULL, be_path, &n);
     if (dir && n) {
         libxl_device_nic *tmp;
@@ -3910,10 +3908,9 @@ int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
     channelinfo->devid = channel->devid;
 
     fe_path = GCSPRINTF("%s/device/console/%d", dompath,
-                             channelinfo->devid + 1);
+                        channelinfo->devid + 1);
     channelinfo->backend = xs_read(ctx->xsh, XBT_NULL,
-                                   GCSPRINTF("%s/backend",
-                                   fe_path), NULL);
+                                   GCSPRINTF("%s/backend", fe_path), NULL);
     if (!channelinfo->backend) {
         GC_FREE;
         return ERROR_FAIL;
@@ -4751,8 +4748,7 @@ int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid,
 retry_transaction:
     t = xs_transaction_start(ctx->xsh);
 
-    target = libxl__xs_read(gc, t, GCSPRINTF(
-                "%s/memory/target", dompath));
+    target = libxl__xs_read(gc, t, GCSPRINTF("%s/memory/target", dompath));
     if (!target && !domid) {
         if (!xs_transaction_end(ctx->xsh, t, 1))
             goto out_no_transaction;
@@ -4775,8 +4771,7 @@ retry_transaction:
             goto out;
         }
     }
-    memmax = libxl__xs_read(gc, t, GCSPRINTF(
-                "%s/memory/static-max", dompath));
+    memmax = libxl__xs_read(gc, t, GCSPRINTF("%s/memory/static-max", dompath));
     if (!memmax) {
         LOGE(ERROR, "cannot get memory info from %s/memory/static-max",
              dompath);
@@ -4791,8 +4786,8 @@ retry_transaction:
         goto out;
     }
 
-    videoram_s = libxl__xs_read(gc, t, GCSPRINTF(
-                "%s/memory/videoram", dompath));
+    videoram_s = libxl__xs_read(gc, t, GCSPRINTF("%s/memory/videoram",
+                                                 dompath));
     videoram = videoram_s ? atoi(videoram_s) : 0;
 
     if (relative) {
@@ -4882,10 +4877,10 @@ static int libxl__get_memory_target(libxl__gc *gc, uint32_t domid,
     char *dompath = libxl__xs_get_dompath(gc, domid);
     uint32_t target_memkb, max_memkb;
 
-    target = libxl__xs_read(gc, XBT_NULL, GCSPRINTF(
-                    "%s/memory/target", dompath));
-    static_max = libxl__xs_read(gc, XBT_NULL, GCSPRINTF(
-                    "%s/memory/static-max", dompath));
+    target = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/memory/target",
+                                                    dompath));
+    static_max = libxl__xs_read(gc, XBT_NULL,
+                    GCSPRINTF("%s/memory/static-max", dompath));
 
     rc = ERROR_FAIL;
     if ((!target || !static_max) && !domid) {
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index ca39f41..a4934df 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -442,8 +442,7 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
                 }
                 vncarg = vnc->listen;
             } else {
-                vncarg = GCSPRINTF("%s:%d", vnc->listen,
-                                        vnc->display);
+                vncarg = GCSPRINTF("%s:%d", vnc->listen, vnc->display);
             }
         } else
             vncarg = GCSPRINTF("127.0.0.1:%d", vnc->display);
@@ -517,8 +516,7 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
 
         if (b_info->video_memkb) {
             flexarray_vappend(dm_args, "-videoram",
-                    GCSPRINTF("%d",
-                                   libxl__sizekb_to_mb(b_info->video_memkb)),
+                    GCSPRINTF("%d", libxl__sizekb_to_mb(b_info->video_memkb)),
                     NULL);
         }
 
@@ -683,8 +681,7 @@ static char *dm_spice_options(libxl__gc *gc,
             return NULL;
         }
     }
-    opt = GCSPRINTF("port=%d,tls-port=%d",
-                         spice->port, spice->tls_port);
+    opt = GCSPRINTF("port=%d,tls-port=%d", spice->port, spice->tls_port);
     if (spice->host)
         opt = GCSPRINTF("%s,addr=%s", opt, spice->host);
     if (libxl_defbool_val(spice->disable_ticketing))
@@ -692,18 +689,17 @@ static char *dm_spice_options(libxl__gc *gc,
     else
         opt = GCSPRINTF("%s,password=%s", opt, spice->passwd);
     opt = GCSPRINTF("%s,agent-mouse=%s", opt,
-                         libxl_defbool_val(spice->agent_mouse) ? "on" : "off");
+                    libxl_defbool_val(spice->agent_mouse) ? "on" : "off");
 
     if (!libxl_defbool_val(spice->clipboard_sharing))
         opt = GCSPRINTF("%s,disable-copy-paste", opt);
 
     if (spice->image_compression)
         opt = GCSPRINTF("%s,image-compression=%s", opt,
-                             spice->image_compression);
+                        spice->image_compression);
 
     if (spice->streaming_video)
-        opt = GCSPRINTF("%s,streaming-video=%s", opt,
-                             spice->streaming_video);
+        opt = GCSPRINTF("%s,streaming-video=%s", opt, spice->streaming_video);
 
     return opt;
 }
@@ -860,8 +856,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                 }
                 vncarg = vnc->listen;
             } else {
-                vncarg = GCSPRINTF("%s:%d", vnc->listen,
-                                        vnc->display);
+                vncarg = GCSPRINTF("%s:%d", vnc->listen, vnc->display);
             }
         } else
             vncarg = GCSPRINTF("127.0.0.1:%d", vnc->display);
@@ -1029,8 +1024,9 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             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", GCSPRINTF(
-                        "spicevmc,name=usbredir,id=usbrc%d", i), "-device",
+                    flexarray_vappend(dm_args, "-chardev",
+                        GCSPRINTF("spicevmc,name=usbredir,id=usbrc%d", i),
+                        "-device",
                         GCSPRINTF("usb-redir,chardev=usbrc%d,"
                         "id=usbrc%d", i, i), NULL);
             } else {
@@ -1052,31 +1048,30 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                 nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
 
                 flexarray_append(dm_args, GCSPRINTF("%d,maxcpus=%d",
-                                                         nr_set_cpus,
-                                                         b_info->max_vcpus));
+                                                    nr_set_cpus,
+                                                    b_info->max_vcpus));
             } else
-                flexarray_append(dm_args, GCSPRINTF("%d",
-                                                         b_info->max_vcpus));
+                flexarray_append(dm_args, GCSPRINTF("%d", b_info->max_vcpus));
         }
         for (i = 0; i < num_nics; i++) {
             if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
-                char *smac = GCSPRINTF(
-                                LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nics[i].mac));
+                char *smac = GCSPRINTF(LIBXL_MAC_FMT,
+                                       LIBXL_MAC_BYTES(nics[i].mac));
                 const char *ifname = libxl__device_nic_devname(gc,
                                                 guest_domid, nics[i].devid,
                                                 LIBXL_NIC_TYPE_VIF_IOEMU);
                 flexarray_append(dm_args, "-device");
                 flexarray_append(dm_args,
                    GCSPRINTF("%s,id=nic%d,netdev=net%d,mac=%s",
-                                                nics[i].model, nics[i].devid,
-                                                nics[i].devid, smac));
+                             nics[i].model, nics[i].devid,
+                             nics[i].devid, smac));
                 flexarray_append(dm_args, "-netdev");
-                flexarray_append(dm_args, GCSPRINTF(
-                                          "type=tap,id=net%d,ifname=%s,"
-                                          "script=%s,downscript=%s",
-                                          nics[i].devid, ifname,
-                                          libxl_tapif_script(gc),
-                                          libxl_tapif_script(gc)));
+                flexarray_append(dm_args,
+                                 GCSPRINTF("type=tap,id=net%d,ifname=%s,"
+                                           "script=%s,downscript=%s",
+                                           nics[i].devid, ifname,
+                                           libxl_tapif_script(gc),
+                                           libxl_tapif_script(gc)));
                 ioemu_nics++;
             }
         }
@@ -1640,7 +1635,7 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
             char *name;
             case STUBDOM_CONSOLE_LOGGING:
                 name = GCSPRINTF("qemu-dm-%s",
-                                      libxl_domid_to_name(ctx, guest_domid));
+                                 libxl_domid_to_name(ctx, guest_domid));
                 ret = libxl_create_logfile(ctx, name, &filename);
                 if (ret) goto out;
                 console[i].output = GCSPRINTF("file:%s", filename);
@@ -1828,9 +1823,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
          * unless we're running qemu-traditional and vNUMA is not
          * configured. */
         libxl__xs_write(gc, XBT_NULL,
-                        GCSPRINTF(
-                                       "%s/hvmloader/allow-memory-relocate",
-                                       path),
+                        GCSPRINTF("%s/hvmloader/allow-memory-relocate", path),
                         "%d",
                         b_info->device_model_version==LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL &&
                         !libxl__vnuma_configured(b_info));
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index bb49e88..206b300 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -327,7 +327,7 @@ static int get_all_assigned_devices(libxl__gc *gc, libxl_device_pci **list, int
 
             for(j = 0; j < ndev; j++) {
                 devpath = GCSPRINTF("/local/domain/0/backend/pci/%s/0/dev-%u",
-                                        domlist[i], j);
+                                    domlist[i], j);
                 bdf = libxl__xs_read(gc, XBT_NULL, devpath);
                 if ( bdf ) {
                     unsigned dom, bus, dev, func;
@@ -382,7 +382,7 @@ static int sysfs_write_bdf(libxl__gc *gc, const char * sysfs_path,
     }
 
     buf = GCSPRINTF(PCI_BDF, pcidev->domain, pcidev->bus,
-                         pcidev->dev, pcidev->func);
+                    pcidev->dev, pcidev->func);
     rc = write(fd, buf, strlen(buf));
     /* Annoying to have two if's, but we need the errno */
     if (rc < 0)
@@ -667,8 +667,8 @@ static int pciback_dev_is_assigned(libxl__gc *gc, libxl_device_pci *pcidev)
     }
 
     spath = GCSPRINTF(SYSFS_PCIBACK_DRIVER"/"PCI_BDF,
-                           pcidev->domain, pcidev->bus,
-                           pcidev->dev, pcidev->func);
+                      pcidev->domain, pcidev->bus,
+                      pcidev->dev, pcidev->func);
     rc = lstat(spath, &st);
 
     if( rc == 0 )
@@ -729,10 +729,10 @@ static void pci_assignable_driver_path_write(libxl__gc *gc,
     char *path;
 
     path = GCSPRINTF(PCIBACK_INFO_PATH"/"PCI_BDF_XSPATH"/driver_path",
-                          pcidev->domain,
-                          pcidev->bus,
-                          pcidev->dev,
-                          pcidev->func);
+                     pcidev->domain,
+                     pcidev->bus,
+                     pcidev->dev,
+                     pcidev->func);
     if ( libxl__xs_write(gc, XBT_NULL, path, "%s", driver_path) < 0 ) {
         LOGE(WARN, "Write of %s to node %s failed.", driver_path, path);
     }
@@ -758,10 +758,10 @@ static void pci_assignable_driver_path_remove(libxl__gc *gc,
     /* Remove the xenstore entry */
     xs_rm(ctx->xsh, XBT_NULL,
           GCSPRINTF(PCIBACK_INFO_PATH "/" PCI_BDF_XSPATH,
-                         pcidev->domain,
-                         pcidev->bus,
-                         pcidev->dev,
-                         pcidev->func) );
+                    pcidev->domain,
+                    pcidev->bus,
+                    pcidev->dev,
+                    pcidev->func) );
 }
 
 static int libxl__device_pci_assignable_add(libxl__gc *gc,
@@ -1032,7 +1032,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
     }
 
     sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
-                                pcidev->bus, pcidev->dev, pcidev->func);
+                           pcidev->bus, pcidev->dev, pcidev->func);
     f = fopen(sysfs_path, "r");
     start = end = flags = size = 0;
     irq = 0;
@@ -1382,7 +1382,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
         assert(type == LIBXL_DOMAIN_TYPE_PV);
 
         char *sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
-                                         pcidev->bus, pcidev->dev, pcidev->func);
+                                     pcidev->bus, pcidev->dev, pcidev->func);
         FILE *f = fopen(sysfs_path, "r");
         unsigned int start = 0, end = 0, flags = 0, size = 0;
         int irq = 0;
@@ -1418,7 +1418,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
         fclose(f);
 skip1:
         sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pcidev->domain,
-                                   pcidev->bus, pcidev->dev, pcidev->func);
+                               pcidev->bus, pcidev->dev, pcidev->func);
         f = fopen(sysfs_path, "r");
         if (f == NULL) {
             LOGE(ERROR, "Couldn't open %s", sysfs_path);
@@ -1626,8 +1626,7 @@ int libxl__grant_vga_iomem_permission(libxl__gc *gc, const uint32_t domid,
         libxl_device_pci *pcidev = &d_config->pcidevs[i];
         char *pci_device_class_path =
             GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/class",
-                           pcidev->domain, pcidev->bus, pcidev->dev,
-                           pcidev->func);
+                      pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
         int read_items;
         unsigned long pci_device_class;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:49:35 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49: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 1a23Tz-0004hw-OM; Thu, 26 Nov 2015 20:49:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ty-0004hm-5N
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:34 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	8A/A5-05979-D5077565; Thu, 26 Nov 2015 20:49:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1448570971!6859985!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 49448 invoked from network); 26 Nov 2015 20:49:31 -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;
	26 Nov 2015 20:49:31 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Tv-0003BG-0b
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Tu-0000fL-Ub
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:30 +0000
Date: Thu, 26 Nov 2015 20:49:30 +0000
Message-Id: <E1a23Tu-0000fL-Ub@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix line wrapping issues
	introduced by automatic replacement
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c87303c04738b0e837da6e891eb561de0bf1b64e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Nov 17 16:19:20 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:21:02 2015 +0000

    libxl: fix line wrapping issues introduced by automatic replacement
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c     |   55 ++++++++++++++++++++------------------------
 tools/libxl/libxl_dm.c  |   57 ++++++++++++++++++++--------------------------
 tools/libxl/libxl_pci.c |   33 +++++++++++++--------------
 3 files changed, 66 insertions(+), 79 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index cb8c932..bd3aac8 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1374,8 +1374,8 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w,
     libxl_device_disk *disk = &ev->u.disk_eject.disk;
     
     backend = libxl__xs_read(gc, XBT_NULL,
-                             GCSPRINTF("%.*s/backend",
-                                            (int)strlen(wpath)-6, wpath));
+                             GCSPRINTF("%.*s/backend", (int)strlen(wpath)-6,
+                                       wpath));
 
     sscanf(backend,
             "/local/domain/%d/backend/%" TOSTRING(BACKEND_STRING_SIZE)
@@ -1693,8 +1693,7 @@ static void devices_destroy_cb(libxl__egc *egc,
         LOGE(ERROR, "xs_rm failed for %s", dom_path);
 
     xs_rm(ctx->xsh, XBT_NULL, libxl__xs_libxl_path(gc, domid));
-    xs_rm(ctx->xsh, XBT_NULL, GCSPRINTF(
-                                "/local/domain/%d/hvmloader", domid));
+    xs_rm(ctx->xsh, XBT_NULL, GCSPRINTF( "/local/domain/%d/hvmloader", domid));
 
     /* This is async operation, we already hold CTX lock */
     lock = libxl__lock_domain_userdata(gc, domid);
@@ -1940,13 +1939,13 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
     port = atoi(vnc_port) - 5900;
 
     vnc_listen = libxl__xs_read(gc, XBT_NULL,
-                                GCSPRINTF(
-                            "/local/domain/%d/console/vnc-listen", domid));
+                                GCSPRINTF("/local/domain/%d/console/vnc-listen",
+                                          domid));
 
     if ( autopass )
         vnc_pass = libxl__xs_read(gc, XBT_NULL,
-                                  GCSPRINTF(
-                            "/local/domain/%d/console/vnc-pass", domid));
+                                  GCSPRINTF("/local/domain/%d/console/vnc-pass",
+					    domid));
 
     if ( NULL == vnc_listen )
         vnc_listen = "localhost";
@@ -2746,8 +2745,8 @@ int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
         goto out;
     }
     path = libxl__xs_read(gc, XBT_NULL,
-                          GCSPRINTF("%s/device/vbd/%d/backend",
-                                         dompath, devid));
+                          GCSPRINTF("%s/device/vbd/%d/backend", dompath,
+                                    devid));
     if (!path)
         goto out;
 
@@ -2772,7 +2771,7 @@ static int libxl__append_disk_list_of_type(libxl__gc *gc,
     int initial_disks = *ndisks;
 
     be_path = GCSPRINTF("%s/backend/%s/%d",
-                             libxl__xs_get_dompath(gc, 0), type, domid);
+                        libxl__xs_get_dompath(gc, 0), type, domid);
     dir = libxl__xs_directory(gc, XBT_NULL, be_path, &n);
     if (dir && n) {
         libxl_device_disk *tmp;
@@ -3364,8 +3363,7 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
     }
 
     flexarray_append(back, "mac");
-    flexarray_append(back,GCSPRINTF(
-                                    LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));
+    flexarray_append(back,GCSPRINTF(LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));
     if (nic->ip) {
         flexarray_append(back, "ip");
         flexarray_append(back, libxl__strdup(gc, nic->ip));
@@ -3516,8 +3514,8 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
         goto out;
 
     path = libxl__xs_read(gc, XBT_NULL,
-                          GCSPRINTF("%s/device/vif/%d/backend",
-                                         dompath, devid));
+                          GCSPRINTF("%s/device/vif/%d/backend", dompath,
+                                    devid));
     if (!path)
         goto out;
 
@@ -3542,8 +3540,8 @@ static int libxl__append_nic_list_of_type(libxl__gc *gc,
     libxl_device_nic *pnic = NULL, *pnic_end = NULL;
     int rc;
 
-    be_path = GCSPRINTF("%s/backend/%s/%d",
-                             libxl__xs_get_dompath(gc, 0), type, domid);
+    be_path = GCSPRINTF("%s/backend/%s/%d", libxl__xs_get_dompath(gc, 0),
+                        type, domid);
     dir = libxl__xs_directory(gc, XBT_NULL, be_path, &n);
     if (dir && n) {
         libxl_device_nic *tmp;
@@ -3910,10 +3908,9 @@ int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
     channelinfo->devid = channel->devid;
 
     fe_path = GCSPRINTF("%s/device/console/%d", dompath,
-                             channelinfo->devid + 1);
+                        channelinfo->devid + 1);
     channelinfo->backend = xs_read(ctx->xsh, XBT_NULL,
-                                   GCSPRINTF("%s/backend",
-                                   fe_path), NULL);
+                                   GCSPRINTF("%s/backend", fe_path), NULL);
     if (!channelinfo->backend) {
         GC_FREE;
         return ERROR_FAIL;
@@ -4751,8 +4748,7 @@ int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid,
 retry_transaction:
     t = xs_transaction_start(ctx->xsh);
 
-    target = libxl__xs_read(gc, t, GCSPRINTF(
-                "%s/memory/target", dompath));
+    target = libxl__xs_read(gc, t, GCSPRINTF("%s/memory/target", dompath));
     if (!target && !domid) {
         if (!xs_transaction_end(ctx->xsh, t, 1))
             goto out_no_transaction;
@@ -4775,8 +4771,7 @@ retry_transaction:
             goto out;
         }
     }
-    memmax = libxl__xs_read(gc, t, GCSPRINTF(
-                "%s/memory/static-max", dompath));
+    memmax = libxl__xs_read(gc, t, GCSPRINTF("%s/memory/static-max", dompath));
     if (!memmax) {
         LOGE(ERROR, "cannot get memory info from %s/memory/static-max",
              dompath);
@@ -4791,8 +4786,8 @@ retry_transaction:
         goto out;
     }
 
-    videoram_s = libxl__xs_read(gc, t, GCSPRINTF(
-                "%s/memory/videoram", dompath));
+    videoram_s = libxl__xs_read(gc, t, GCSPRINTF("%s/memory/videoram",
+                                                 dompath));
     videoram = videoram_s ? atoi(videoram_s) : 0;
 
     if (relative) {
@@ -4882,10 +4877,10 @@ static int libxl__get_memory_target(libxl__gc *gc, uint32_t domid,
     char *dompath = libxl__xs_get_dompath(gc, domid);
     uint32_t target_memkb, max_memkb;
 
-    target = libxl__xs_read(gc, XBT_NULL, GCSPRINTF(
-                    "%s/memory/target", dompath));
-    static_max = libxl__xs_read(gc, XBT_NULL, GCSPRINTF(
-                    "%s/memory/static-max", dompath));
+    target = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/memory/target",
+                                                    dompath));
+    static_max = libxl__xs_read(gc, XBT_NULL,
+                    GCSPRINTF("%s/memory/static-max", dompath));
 
     rc = ERROR_FAIL;
     if ((!target || !static_max) && !domid) {
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index ca39f41..a4934df 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -442,8 +442,7 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
                 }
                 vncarg = vnc->listen;
             } else {
-                vncarg = GCSPRINTF("%s:%d", vnc->listen,
-                                        vnc->display);
+                vncarg = GCSPRINTF("%s:%d", vnc->listen, vnc->display);
             }
         } else
             vncarg = GCSPRINTF("127.0.0.1:%d", vnc->display);
@@ -517,8 +516,7 @@ static int libxl__build_device_model_args_old(libxl__gc *gc,
 
         if (b_info->video_memkb) {
             flexarray_vappend(dm_args, "-videoram",
-                    GCSPRINTF("%d",
-                                   libxl__sizekb_to_mb(b_info->video_memkb)),
+                    GCSPRINTF("%d", libxl__sizekb_to_mb(b_info->video_memkb)),
                     NULL);
         }
 
@@ -683,8 +681,7 @@ static char *dm_spice_options(libxl__gc *gc,
             return NULL;
         }
     }
-    opt = GCSPRINTF("port=%d,tls-port=%d",
-                         spice->port, spice->tls_port);
+    opt = GCSPRINTF("port=%d,tls-port=%d", spice->port, spice->tls_port);
     if (spice->host)
         opt = GCSPRINTF("%s,addr=%s", opt, spice->host);
     if (libxl_defbool_val(spice->disable_ticketing))
@@ -692,18 +689,17 @@ static char *dm_spice_options(libxl__gc *gc,
     else
         opt = GCSPRINTF("%s,password=%s", opt, spice->passwd);
     opt = GCSPRINTF("%s,agent-mouse=%s", opt,
-                         libxl_defbool_val(spice->agent_mouse) ? "on" : "off");
+                    libxl_defbool_val(spice->agent_mouse) ? "on" : "off");
 
     if (!libxl_defbool_val(spice->clipboard_sharing))
         opt = GCSPRINTF("%s,disable-copy-paste", opt);
 
     if (spice->image_compression)
         opt = GCSPRINTF("%s,image-compression=%s", opt,
-                             spice->image_compression);
+                        spice->image_compression);
 
     if (spice->streaming_video)
-        opt = GCSPRINTF("%s,streaming-video=%s", opt,
-                             spice->streaming_video);
+        opt = GCSPRINTF("%s,streaming-video=%s", opt, spice->streaming_video);
 
     return opt;
 }
@@ -860,8 +856,7 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                 }
                 vncarg = vnc->listen;
             } else {
-                vncarg = GCSPRINTF("%s:%d", vnc->listen,
-                                        vnc->display);
+                vncarg = GCSPRINTF("%s:%d", vnc->listen, vnc->display);
             }
         } else
             vncarg = GCSPRINTF("127.0.0.1:%d", vnc->display);
@@ -1029,8 +1024,9 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
             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", GCSPRINTF(
-                        "spicevmc,name=usbredir,id=usbrc%d", i), "-device",
+                    flexarray_vappend(dm_args, "-chardev",
+                        GCSPRINTF("spicevmc,name=usbredir,id=usbrc%d", i),
+                        "-device",
                         GCSPRINTF("usb-redir,chardev=usbrc%d,"
                         "id=usbrc%d", i, i), NULL);
             } else {
@@ -1052,31 +1048,30 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
                 nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
 
                 flexarray_append(dm_args, GCSPRINTF("%d,maxcpus=%d",
-                                                         nr_set_cpus,
-                                                         b_info->max_vcpus));
+                                                    nr_set_cpus,
+                                                    b_info->max_vcpus));
             } else
-                flexarray_append(dm_args, GCSPRINTF("%d",
-                                                         b_info->max_vcpus));
+                flexarray_append(dm_args, GCSPRINTF("%d", b_info->max_vcpus));
         }
         for (i = 0; i < num_nics; i++) {
             if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
-                char *smac = GCSPRINTF(
-                                LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nics[i].mac));
+                char *smac = GCSPRINTF(LIBXL_MAC_FMT,
+                                       LIBXL_MAC_BYTES(nics[i].mac));
                 const char *ifname = libxl__device_nic_devname(gc,
                                                 guest_domid, nics[i].devid,
                                                 LIBXL_NIC_TYPE_VIF_IOEMU);
                 flexarray_append(dm_args, "-device");
                 flexarray_append(dm_args,
                    GCSPRINTF("%s,id=nic%d,netdev=net%d,mac=%s",
-                                                nics[i].model, nics[i].devid,
-                                                nics[i].devid, smac));
+                             nics[i].model, nics[i].devid,
+                             nics[i].devid, smac));
                 flexarray_append(dm_args, "-netdev");
-                flexarray_append(dm_args, GCSPRINTF(
-                                          "type=tap,id=net%d,ifname=%s,"
-                                          "script=%s,downscript=%s",
-                                          nics[i].devid, ifname,
-                                          libxl_tapif_script(gc),
-                                          libxl_tapif_script(gc)));
+                flexarray_append(dm_args,
+                                 GCSPRINTF("type=tap,id=net%d,ifname=%s,"
+                                           "script=%s,downscript=%s",
+                                           nics[i].devid, ifname,
+                                           libxl_tapif_script(gc),
+                                           libxl_tapif_script(gc)));
                 ioemu_nics++;
             }
         }
@@ -1640,7 +1635,7 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
             char *name;
             case STUBDOM_CONSOLE_LOGGING:
                 name = GCSPRINTF("qemu-dm-%s",
-                                      libxl_domid_to_name(ctx, guest_domid));
+                                 libxl_domid_to_name(ctx, guest_domid));
                 ret = libxl_create_logfile(ctx, name, &filename);
                 if (ret) goto out;
                 console[i].output = GCSPRINTF("file:%s", filename);
@@ -1828,9 +1823,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
          * unless we're running qemu-traditional and vNUMA is not
          * configured. */
         libxl__xs_write(gc, XBT_NULL,
-                        GCSPRINTF(
-                                       "%s/hvmloader/allow-memory-relocate",
-                                       path),
+                        GCSPRINTF("%s/hvmloader/allow-memory-relocate", path),
                         "%d",
                         b_info->device_model_version==LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL &&
                         !libxl__vnuma_configured(b_info));
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index bb49e88..206b300 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -327,7 +327,7 @@ static int get_all_assigned_devices(libxl__gc *gc, libxl_device_pci **list, int
 
             for(j = 0; j < ndev; j++) {
                 devpath = GCSPRINTF("/local/domain/0/backend/pci/%s/0/dev-%u",
-                                        domlist[i], j);
+                                    domlist[i], j);
                 bdf = libxl__xs_read(gc, XBT_NULL, devpath);
                 if ( bdf ) {
                     unsigned dom, bus, dev, func;
@@ -382,7 +382,7 @@ static int sysfs_write_bdf(libxl__gc *gc, const char * sysfs_path,
     }
 
     buf = GCSPRINTF(PCI_BDF, pcidev->domain, pcidev->bus,
-                         pcidev->dev, pcidev->func);
+                    pcidev->dev, pcidev->func);
     rc = write(fd, buf, strlen(buf));
     /* Annoying to have two if's, but we need the errno */
     if (rc < 0)
@@ -667,8 +667,8 @@ static int pciback_dev_is_assigned(libxl__gc *gc, libxl_device_pci *pcidev)
     }
 
     spath = GCSPRINTF(SYSFS_PCIBACK_DRIVER"/"PCI_BDF,
-                           pcidev->domain, pcidev->bus,
-                           pcidev->dev, pcidev->func);
+                      pcidev->domain, pcidev->bus,
+                      pcidev->dev, pcidev->func);
     rc = lstat(spath, &st);
 
     if( rc == 0 )
@@ -729,10 +729,10 @@ static void pci_assignable_driver_path_write(libxl__gc *gc,
     char *path;
 
     path = GCSPRINTF(PCIBACK_INFO_PATH"/"PCI_BDF_XSPATH"/driver_path",
-                          pcidev->domain,
-                          pcidev->bus,
-                          pcidev->dev,
-                          pcidev->func);
+                     pcidev->domain,
+                     pcidev->bus,
+                     pcidev->dev,
+                     pcidev->func);
     if ( libxl__xs_write(gc, XBT_NULL, path, "%s", driver_path) < 0 ) {
         LOGE(WARN, "Write of %s to node %s failed.", driver_path, path);
     }
@@ -758,10 +758,10 @@ static void pci_assignable_driver_path_remove(libxl__gc *gc,
     /* Remove the xenstore entry */
     xs_rm(ctx->xsh, XBT_NULL,
           GCSPRINTF(PCIBACK_INFO_PATH "/" PCI_BDF_XSPATH,
-                         pcidev->domain,
-                         pcidev->bus,
-                         pcidev->dev,
-                         pcidev->func) );
+                    pcidev->domain,
+                    pcidev->bus,
+                    pcidev->dev,
+                    pcidev->func) );
 }
 
 static int libxl__device_pci_assignable_add(libxl__gc *gc,
@@ -1032,7 +1032,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
     }
 
     sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
-                                pcidev->bus, pcidev->dev, pcidev->func);
+                           pcidev->bus, pcidev->dev, pcidev->func);
     f = fopen(sysfs_path, "r");
     start = end = flags = size = 0;
     irq = 0;
@@ -1382,7 +1382,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
         assert(type == LIBXL_DOMAIN_TYPE_PV);
 
         char *sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
-                                         pcidev->bus, pcidev->dev, pcidev->func);
+                                     pcidev->bus, pcidev->dev, pcidev->func);
         FILE *f = fopen(sysfs_path, "r");
         unsigned int start = 0, end = 0, flags = 0, size = 0;
         int irq = 0;
@@ -1418,7 +1418,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
         fclose(f);
 skip1:
         sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pcidev->domain,
-                                   pcidev->bus, pcidev->dev, pcidev->func);
+                               pcidev->bus, pcidev->dev, pcidev->func);
         f = fopen(sysfs_path, "r");
         if (f == NULL) {
             LOGE(ERROR, "Couldn't open %s", sysfs_path);
@@ -1626,8 +1626,7 @@ int libxl__grant_vga_iomem_permission(libxl__gc *gc, const uint32_t domid,
         libxl_device_pci *pcidev = &d_config->pcidevs[i];
         char *pci_device_class_path =
             GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/class",
-                           pcidev->domain, pcidev->bus, pcidev->dev,
-                           pcidev->func);
+                      pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
         int read_items;
         unsigned long pci_device_class;
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:49:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49: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 1a23U8-0004jB-SX; Thu, 26 Nov 2015 20:49: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 1a23U7-0004iz-M8
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:43 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	73/61-16870-76077565; Thu, 26 Nov 2015 20:49:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1448570981!6812934!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19706 invoked from network); 26 Nov 2015 20:49:42 -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;
	26 Nov 2015 20:49:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23U5-0003BS-Hr
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23U5-0000g9-Fl
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:41 +0000
Date: Thu, 26 Nov 2015 20:49:41 +0000
Message-Id: <E1a23U5-0000g9-Fl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: drop MAX_APICID
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0aa684b508ebe97a486de9ec2892120e9697163d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 17:40:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 17:40:18 2015 +0100

    x86: drop MAX_APICID
    
    It's unused and wrong (we already have MAX_LOCAL_APIC and MAX_APICS).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/smp.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h
index 64f510b..33c2c32 100644
--- a/xen/include/asm-x86/smp.h
+++ b/xen/include/asm-x86/smp.h
@@ -37,7 +37,6 @@ extern void (*mtrr_hook) (void);
 
 extern void zap_low_mappings(void);
 
-#define MAX_APICID 256
 extern u32 x86_cpu_to_apicid[];
 
 #define cpu_physical_id(cpu)	x86_cpu_to_apicid[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 Thu Nov 26 20:49:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49: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 1a23U8-0004jB-SX; Thu, 26 Nov 2015 20:49: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 1a23U7-0004iz-M8
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:43 +0000
Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id
	73/61-16870-76077565; Thu, 26 Nov 2015 20:49:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1448570981!6812934!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19706 invoked from network); 26 Nov 2015 20:49:42 -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;
	26 Nov 2015 20:49:42 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23U5-0003BS-Hr
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23U5-0000g9-Fl
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:41 +0000
Date: Thu, 26 Nov 2015 20:49:41 +0000
Message-Id: <E1a23U5-0000g9-Fl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: drop MAX_APICID
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0aa684b508ebe97a486de9ec2892120e9697163d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 17:40:18 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 17:40:18 2015 +0100

    x86: drop MAX_APICID
    
    It's unused and wrong (we already have MAX_LOCAL_APIC and MAX_APICS).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/smp.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h
index 64f510b..33c2c32 100644
--- a/xen/include/asm-x86/smp.h
+++ b/xen/include/asm-x86/smp.h
@@ -37,7 +37,6 @@ extern void (*mtrr_hook) (void);
 
 extern void zap_low_mappings(void);
 
-#define MAX_APICID 256
 extern u32 x86_cpu_to_apicid[];
 
 #define cpu_physical_id(cpu)	x86_cpu_to_apicid[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 Thu Nov 26 20:49:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23UK-0004kg-12; Thu, 26 Nov 2015 20:49:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23UI-0004kR-FR
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:54 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	18/97-10715-17077565; Thu, 26 Nov 2015 20:49:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1448570992!6651690!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33340 invoked from network); 26 Nov 2015 20:49:53 -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;
	26 Nov 2015 20:49:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23UF-0003Ba-Tw
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23UF-0000gd-QP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:51 +0000
Date: Thu, 26 Nov 2015 20:49:51 +0000
Message-Id: <E1a23UF-0000gd-QP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/kexec: hide more kexec
	infrastructure behind CONFIG_KEXEC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9cf5f0affcab74a93e0beb9e64ade446d7d23e1b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 24 17:41:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 17:41:04 2015 +0100

    x86/kexec: hide more kexec infrastructure behind CONFIG_KEXEC
    
    Experimenting with the kconfig series showed that various bits of kexec
    infrastructure were still being unconditionally included.  Make them
    conditional on CONFIG_KEXEC.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/arch/x86/x86_64/Makefile |    4 ++--
 xen/arch/x86/xen.lds.S       |    4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile
index d5af722..5b54c16 100644
--- a/xen/arch/x86/x86_64/Makefile
+++ b/xen/arch/x86/x86_64/Makefile
@@ -3,7 +3,7 @@ subdir-y += compat
 obj-bin-y += entry.o
 obj-bin-y += gpr_switch.o
 obj-y += traps.o
-obj-y += machine_kexec.o
+obj-$(CONFIG_KEXEC) += machine_kexec.o
 obj-y += pci.o
 obj-y += acpi_mmcfg.o
 obj-y += mmconf-fam10h.o
@@ -12,6 +12,6 @@ obj-y += mmconfig-shared.o
 obj-y += domain.o
 obj-y += cpu_idle.o
 obj-y += cpufreq.o
-obj-bin-y += kexec_reloc.o
+obj-bin-$(CONFIG_KEXEC) += kexec_reloc.o
 
 obj-$(crash_debug)   += gdbstub.o
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 6553cff..e18e08f 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -220,5 +220,9 @@ SECTIONS
 ASSERT(__image_base__ > XEN_VIRT_START ||
        _end <= XEN_VIRT_END - NR_CPUS * PAGE_SIZE,
        "Xen image overlaps stubs area")
+
+#ifdef CONFIG_KEXEC
 ASSERT(kexec_reloc_size - kexec_reloc <= PAGE_SIZE, "kexec_reloc is too large")
+#endif
+
 ASSERT((cpu0_stack & (STACK_SIZE - 1)) == 0, "cpu0_stack misaligned")
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:49:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23UK-0004kg-12; Thu, 26 Nov 2015 20:49:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23UI-0004kR-FR
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:54 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	18/97-10715-17077565; Thu, 26 Nov 2015 20:49:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1448570992!6651690!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 33340 invoked from network); 26 Nov 2015 20:49:53 -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;
	26 Nov 2015 20:49:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23UF-0003Ba-Tw
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23UF-0000gd-QP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:49:51 +0000
Date: Thu, 26 Nov 2015 20:49:51 +0000
Message-Id: <E1a23UF-0000gd-QP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/kexec: hide more kexec
	infrastructure behind CONFIG_KEXEC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9cf5f0affcab74a93e0beb9e64ade446d7d23e1b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 24 17:41:04 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 17:41:04 2015 +0100

    x86/kexec: hide more kexec infrastructure behind CONFIG_KEXEC
    
    Experimenting with the kconfig series showed that various bits of kexec
    infrastructure were still being unconditionally included.  Make them
    conditional on CONFIG_KEXEC.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/arch/x86/x86_64/Makefile |    4 ++--
 xen/arch/x86/xen.lds.S       |    4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile
index d5af722..5b54c16 100644
--- a/xen/arch/x86/x86_64/Makefile
+++ b/xen/arch/x86/x86_64/Makefile
@@ -3,7 +3,7 @@ subdir-y += compat
 obj-bin-y += entry.o
 obj-bin-y += gpr_switch.o
 obj-y += traps.o
-obj-y += machine_kexec.o
+obj-$(CONFIG_KEXEC) += machine_kexec.o
 obj-y += pci.o
 obj-y += acpi_mmcfg.o
 obj-y += mmconf-fam10h.o
@@ -12,6 +12,6 @@ obj-y += mmconfig-shared.o
 obj-y += domain.o
 obj-y += cpu_idle.o
 obj-y += cpufreq.o
-obj-bin-y += kexec_reloc.o
+obj-bin-$(CONFIG_KEXEC) += kexec_reloc.o
 
 obj-$(crash_debug)   += gdbstub.o
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 6553cff..e18e08f 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -220,5 +220,9 @@ SECTIONS
 ASSERT(__image_base__ > XEN_VIRT_START ||
        _end <= XEN_VIRT_END - NR_CPUS * PAGE_SIZE,
        "Xen image overlaps stubs area")
+
+#ifdef CONFIG_KEXEC
 ASSERT(kexec_reloc_size - kexec_reloc <= PAGE_SIZE, "kexec_reloc is too large")
+#endif
+
 ASSERT((cpu0_stack & (STACK_SIZE - 1)) == 0, "cpu0_stack misaligned")
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:50:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:50: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 1a23UZ-0004md-6p; Thu, 26 Nov 2015 20:50: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 1a23UX-0004mR-E3
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:09 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	B9/CB-22142-08077565; Thu, 26 Nov 2015 20:50:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448571007!6815037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38241 invoked from network); 26 Nov 2015 20:50:08 -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;
	26 Nov 2015 20:50:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23UV-0003CC-6p
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23UQ-0000hJ-2X
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:02 +0000
Date: Thu, 26 Nov 2015 20:50:02 +0000
Message-Id: <E1a23UQ-0000hJ-2X@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 9b436680f081ae397e8c25ce2c23d3cd1359ce86
Merge: c87303c04738b0e837da6e891eb561de0bf1b64e 9cf5f0affcab74a93e0beb9e64ade446d7d23e1b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Nov 24 16:50:27 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:50:27 2015 +0000

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

 xen/arch/x86/x86_64/Makefile |    4 ++--
 xen/arch/x86/xen.lds.S       |    4 ++++
 xen/include/asm-x86/smp.h    |    1 -
 3 files changed, 6 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 Thu Nov 26 20:50:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:50: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 1a23UZ-0004md-6p; Thu, 26 Nov 2015 20:50: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 1a23UX-0004mR-E3
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:09 +0000
Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id
	B9/CB-22142-08077565; Thu, 26 Nov 2015 20:50:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448571007!6815037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 38241 invoked from network); 26 Nov 2015 20:50:08 -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;
	26 Nov 2015 20:50:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23UV-0003CC-6p
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23UQ-0000hJ-2X
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:02 +0000
Date: Thu, 26 Nov 2015 20:50:02 +0000
Message-Id: <E1a23UQ-0000hJ-2X@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 9b436680f081ae397e8c25ce2c23d3cd1359ce86
Merge: c87303c04738b0e837da6e891eb561de0bf1b64e 9cf5f0affcab74a93e0beb9e64ade446d7d23e1b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Nov 24 16:50:27 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Nov 24 16:50:27 2015 +0000

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

 xen/arch/x86/x86_64/Makefile |    4 ++--
 xen/arch/x86/xen.lds.S       |    4 ++++
 xen/include/asm-x86/smp.h    |    1 -
 3 files changed, 6 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 Thu Nov 26 20:50:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:50: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 1a23Uj-0004oH-Ew; Thu, 26 Nov 2015 20:50: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 1a23Uh-0004o7-PX
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:19 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	0C/2A-16618-B8077565; Thu, 26 Nov 2015 20:50:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1448571017!3792697!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15859 invoked from network); 26 Nov 2015 20:50:18 -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;
	26 Nov 2015 20:50:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Uf-0003CK-E3
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Uf-0000hv-C7
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:17 +0000
Date: Thu, 26 Nov 2015 20:50:17 +0000
Message-Id: <E1a23Uf-0000hv-C7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vPMU: document as unsupported
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c03480cf5c4e96fb4afb2237ad0a3cac7162564a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 18:32:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 18:32:20 2015 +0100

    x86/vPMU: document as unsupported
    
    This is XSA-163.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xen-command-line.markdown |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index afb9548..c103894 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1474,8 +1474,8 @@ feature is switched on on Intel processors supporting this feature.
 Note that if **watchdog** option is also specified vpmu will be turned off.
 
 *Warning:*
-As the BTS virtualisation is not 100% safe and because of the nehalem quirk
-don't use the vpmu flag on production systems with Intel cpus!
+As the virtualisation is not 100% safe, don't use the vpmu flag on
+production systems (see http://xenbits.xen.org/xsa/advisory-163.html)!
 
 ### watchdog
 > `= force | <boolean>`
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:50:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:50: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 1a23Uj-0004oH-Ew; Thu, 26 Nov 2015 20:50: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 1a23Uh-0004o7-PX
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:19 +0000
Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id
	0C/2A-16618-B8077565; Thu, 26 Nov 2015 20:50:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1448571017!3792697!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15859 invoked from network); 26 Nov 2015 20:50:18 -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;
	26 Nov 2015 20:50:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Uf-0003CK-E3
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Uf-0000hv-C7
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:17 +0000
Date: Thu, 26 Nov 2015 20:50:17 +0000
Message-Id: <E1a23Uf-0000hv-C7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vPMU: document as unsupported
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c03480cf5c4e96fb4afb2237ad0a3cac7162564a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Nov 24 18:32:20 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 18:32:20 2015 +0100

    x86/vPMU: document as unsupported
    
    This is XSA-163.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xen-command-line.markdown |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index afb9548..c103894 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1474,8 +1474,8 @@ feature is switched on on Intel processors supporting this feature.
 Note that if **watchdog** option is also specified vpmu will be turned off.
 
 *Warning:*
-As the BTS virtualisation is not 100% safe and because of the nehalem quirk
-don't use the vpmu flag on production systems with Intel cpus!
+As the virtualisation is not 100% safe, don't use the vpmu flag on
+production systems (see http://xenbits.xen.org/xsa/advisory-163.html)!
 
 ### watchdog
 > `= force | <boolean>`
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:50:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:50: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 1a23Us-0004qu-JZ; Thu, 26 Nov 2015 20:50:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ur-0004q2-Vr
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:30 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	FE/98-02804-59077565; Thu, 26 Nov 2015 20:50:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448571027!6857308!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22955 invoked from network); 26 Nov 2015 20:50:28 -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;
	26 Nov 2015 20:50:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Up-0003CP-Nq
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Up-0000iK-M1
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:27 +0000
Date: Thu, 26 Nov 2015 20:50:27 +0000
Message-Id: <E1a23Up-0000iK-M1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: Initialize VPMU's lvtpc
	vector
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c3f24645b07b875bc1294fb4627f01e030690fe
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Nov 24 18:33:08 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 18:33:08 2015 +0100

    x86/VPMU: Initialize VPMU's lvtpc vector
    
    If a guest sets up performance counters so that they can generate
    a PMC interrupt but does not initilaize APIC LVTPC register the
    resulting interrupt will cause an APIC error.
    
    Note that a guest deciding to clear LVTPC in order to unduce the error
    will not be successful in achieving its goal: emulation code only
    looks at the mask bit and always sets the vector to PMU_APIC_VECTOR.
    Only the initial value of LVTPC (which is zero) that gets loaded into
    APIC as result of PMC initialization is the problem.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/cpu/vpmu.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 2f5156a..d870dcc 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -480,6 +480,8 @@ void vpmu_initialise(struct vcpu *v)
         return; /* Don't bother restoring vpmu_count, VPMU is off forever */
     }
 
+    vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
+
     if ( ret )
         printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:50:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:50: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 1a23Us-0004qu-JZ; Thu, 26 Nov 2015 20:50:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ur-0004q2-Vr
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:30 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	FE/98-02804-59077565; Thu, 26 Nov 2015 20:50:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1448571027!6857308!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22955 invoked from network); 26 Nov 2015 20:50:28 -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;
	26 Nov 2015 20:50:28 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Up-0003CP-Nq
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Up-0000iK-M1
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:27 +0000
Date: Thu, 26 Nov 2015 20:50:27 +0000
Message-Id: <E1a23Up-0000iK-M1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: Initialize VPMU's lvtpc
	vector
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c3f24645b07b875bc1294fb4627f01e030690fe
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Tue Nov 24 18:33:08 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Nov 24 18:33:08 2015 +0100

    x86/VPMU: Initialize VPMU's lvtpc vector
    
    If a guest sets up performance counters so that they can generate
    a PMC interrupt but does not initilaize APIC LVTPC register the
    resulting interrupt will cause an APIC error.
    
    Note that a guest deciding to clear LVTPC in order to unduce the error
    will not be successful in achieving its goal: emulation code only
    looks at the mask bit and always sets the vector to PMU_APIC_VECTOR.
    Only the initial value of LVTPC (which is zero) that gets loaded into
    APIC as result of PMC initialization is the problem.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/cpu/vpmu.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 2f5156a..d870dcc 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -480,6 +480,8 @@ void vpmu_initialise(struct vcpu *v)
         return; /* Don't bother restoring vpmu_count, VPMU is off forever */
     }
 
+    vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
+
     if ( ret )
         printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:50:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:50: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 1a23V3-0004uk-OZ; Thu, 26 Nov 2015 20:50: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 1a23V2-0004tl-C4
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:40 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	42/0D-30270-F9077565; Thu, 26 Nov 2015 20:50:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1448571038!6809332!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4162 invoked from network); 26 Nov 2015 20:50:38 -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;
	26 Nov 2015 20:50:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23V0-0003Ca-0k
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Uz-0000jU-Ue
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:37 +0000
Date: Thu, 26 Nov 2015 20:50:37 +0000
Message-Id: <E1a23Uz-0000jU-Ue@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: document the
	reality of netif_rx_request/reponse
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 19167b11606df3c9598566a870ccd312b10d6d4b
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Wed Nov 25 11:12:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 11:12:26 2015 +0100

    public/io/netif.h: document the reality of netif_rx_request/reponse
    
    Because GSO metadata is passed from backend to frontend using
    netif_extra_info segments, which do not carry information stating which
    netif_rx_request_t was consumed to free up their slot, frontends must
    assume some form of identity relation between ring slot and request.
    Hence, so that it is able to use GSO metadata, Linux netfront simply
    assumes rx responses appear in the same ring slot as their corresponding
    request.
    
    This patch documents the assumption made by Linux netfront and the
    necessity of the assumption (to support GSO) so that backends are coded
    to be compatible.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 5c31ae3..04d8026 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -226,15 +226,29 @@
  * flags: NETRXF_*
  * status: -ve: NETIF_RSP_*; +ve: Rx'ed pkt size.
  *
+ * NOTE: Historically, to support GSO on the frontend receive side, Linux
+ *       netfront does not make use of the rx response id (because, as
+ *       described below, extra info structures overlay the id field).
+ *       Instead it assumes that responses always appear in the same ring
+ *       slot as their corresponding request. Thus, to maintain
+ *       compatibilty, backends must make sure this is the case.
+ *
  * Extra Info
  * ==========
  *
- * Can be present if initial request has NET{T,R}XF_extra_info, or
- * previous extra request has XEN_NETIF_EXTRA_MORE.
+ * Can be present if initial request or response has NET{T,R}XF_extra_info,
+ * or previous extra request has XEN_NETIF_EXTRA_MORE.
  *
  * The struct therefore needs to fit into either a tx or rx slot and
  * is therefore limited to 8 octets.
  *
+ * NOTE: Because extra info data overlays the usual request/response
+ *       structures, there is no id information in the opposite direction.
+ *       So, if an extra info overlays an rx response the frontend can
+ *       assume that it is in the same ring slot as the request that was
+ *       consumed to make the slot available, and the backend must ensure
+ *       this assumption is true.
+ *
  * extra info (netif_extra_info_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 Thu Nov 26 20:50:42 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:50: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 1a23V3-0004uk-OZ; Thu, 26 Nov 2015 20:50: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 1a23V2-0004tl-C4
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:40 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	42/0D-30270-F9077565; Thu, 26 Nov 2015 20:50:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1448571038!6809332!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4162 invoked from network); 26 Nov 2015 20:50:38 -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;
	26 Nov 2015 20:50:38 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23V0-0003Ca-0k
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Uz-0000jU-Ue
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:37 +0000
Date: Thu, 26 Nov 2015 20:50:37 +0000
Message-Id: <E1a23Uz-0000jU-Ue@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: document the
	reality of netif_rx_request/reponse
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 19167b11606df3c9598566a870ccd312b10d6d4b
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Wed Nov 25 11:12:26 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 11:12:26 2015 +0100

    public/io/netif.h: document the reality of netif_rx_request/reponse
    
    Because GSO metadata is passed from backend to frontend using
    netif_extra_info segments, which do not carry information stating which
    netif_rx_request_t was consumed to free up their slot, frontends must
    assume some form of identity relation between ring slot and request.
    Hence, so that it is able to use GSO metadata, Linux netfront simply
    assumes rx responses appear in the same ring slot as their corresponding
    request.
    
    This patch documents the assumption made by Linux netfront and the
    necessity of the assumption (to support GSO) so that backends are coded
    to be compatible.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 5c31ae3..04d8026 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -226,15 +226,29 @@
  * flags: NETRXF_*
  * status: -ve: NETIF_RSP_*; +ve: Rx'ed pkt size.
  *
+ * NOTE: Historically, to support GSO on the frontend receive side, Linux
+ *       netfront does not make use of the rx response id (because, as
+ *       described below, extra info structures overlay the id field).
+ *       Instead it assumes that responses always appear in the same ring
+ *       slot as their corresponding request. Thus, to maintain
+ *       compatibilty, backends must make sure this is the case.
+ *
  * Extra Info
  * ==========
  *
- * Can be present if initial request has NET{T,R}XF_extra_info, or
- * previous extra request has XEN_NETIF_EXTRA_MORE.
+ * Can be present if initial request or response has NET{T,R}XF_extra_info,
+ * or previous extra request has XEN_NETIF_EXTRA_MORE.
  *
  * The struct therefore needs to fit into either a tx or rx slot and
  * is therefore limited to 8 octets.
  *
+ * NOTE: Because extra info data overlays the usual request/response
+ *       structures, there is no id information in the opposite direction.
+ *       So, if an extra info overlays an rx response the frontend can
+ *       assume that it is in the same ring slot as the request that was
+ *       consumed to make the slot available, and the backend must ensure
+ *       this assumption is true.
+ *
  * extra info (netif_extra_info_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 Thu Nov 26 20:50:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:50: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 1a23VD-0004w4-TH; Thu, 26 Nov 2015 20:50:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VC-0004vn-Cl
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:50 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	E6/06-18107-9A077565; Thu, 26 Nov 2015 20:50:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1448571048!6809901!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62817 invoked from network); 26 Nov 2015 20:50:49 -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;
	26 Nov 2015 20:50:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VA-0003Ci-7h
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VA-0000jz-5y
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:48 +0000
Date: Thu, 26 Nov 2015 20:50:48 +0000
Message-Id: <E1a23VA-0000jz-5y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: add definition of
	gso_prefix flag
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8267253517d644c9d89d7a04f52a649c0f717957
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Wed Nov 25 11:12:34 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 11:12:34 2015 +0100

    public/io/netif.h: add definition of gso_prefix flag
    
    This flag is defined here only for compatibility with the Linux variant of
    this header. The feature has never been documented and should be
    considered deprecated.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 04d8026..f62a0c8 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -409,6 +409,10 @@ typedef struct netif_rx_request netif_rx_request_t;
 #define _NETRXF_extra_info     (3)
 #define  NETRXF_extra_info     (1U<<_NETRXF_extra_info)
 
+/* Packet has GSO prefix. Deprecated but included for compatibility */
+#define _NETRXF_gso_prefix     (4)
+#define  NETRXF_gso_prefix     (1U<<_NETRXF_gso_prefix)
+
 struct netif_rx_response {
     uint16_t id;
     uint16_t offset;       /* Offset in page of start of received packet  */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:50:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:50: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 1a23VD-0004w4-TH; Thu, 26 Nov 2015 20:50:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VC-0004vn-Cl
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:50 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	E6/06-18107-9A077565; Thu, 26 Nov 2015 20:50:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1448571048!6809901!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62817 invoked from network); 26 Nov 2015 20:50:49 -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;
	26 Nov 2015 20:50:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VA-0003Ci-7h
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VA-0000jz-5y
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:48 +0000
Date: Thu, 26 Nov 2015 20:50:48 +0000
Message-Id: <E1a23VA-0000jz-5y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: add definition of
	gso_prefix flag
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8267253517d644c9d89d7a04f52a649c0f717957
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Wed Nov 25 11:12:34 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 11:12:34 2015 +0100

    public/io/netif.h: add definition of gso_prefix flag
    
    This flag is defined here only for compatibility with the Linux variant of
    this header. The feature has never been documented and should be
    considered deprecated.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index 04d8026..f62a0c8 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -409,6 +409,10 @@ typedef struct netif_rx_request netif_rx_request_t;
 #define _NETRXF_extra_info     (3)
 #define  NETRXF_extra_info     (1U<<_NETRXF_extra_info)
 
+/* Packet has GSO prefix. Deprecated but included for compatibility */
+#define _NETRXF_gso_prefix     (4)
+#define  NETRXF_gso_prefix     (1U<<_NETRXF_gso_prefix)
+
 struct netif_rx_response {
     uint16_t id;
     uint16_t offset;       /* Offset in page of start of received packet  */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:51:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51: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 1a23VO-0004xT-12; Thu, 26 Nov 2015 20:51: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 1a23VM-0004xF-Vw
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:01 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	21/4D-30270-4B077565; Thu, 26 Nov 2015 20:51:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1448571058!6808009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3321 invoked from network); 26 Nov 2015 20:50:59 -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;
	26 Nov 2015 20:50:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VK-0003Cq-Fe
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VK-0000kP-Da
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:58 +0000
Date: Thu, 26 Nov 2015 20:50:58 +0000
Message-Id: <E1a23VK-0000kP-Da@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: tidy up and remove
	duplicate comments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3acb0d6770816441971910ead36025afaea12734
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Wed Nov 25 11:12:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 11:12:40 2015 +0100

    public/io/netif.h: tidy up and remove duplicate comments
    
    Now that requests and response types and extra info segments are
    documented in block comments, we can get rid of the inline comments
    in the structures. This has the happy side-effect of making the Linux
    checkpatch.pl script make fewer complaints after import.
    
    This patch also fixes a small whitespace issue in the initial boiler-
    plate comment, and a typo in one of the ascii-art diagrams.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |   81 ++++++++++++++++-------------------------
 1 files changed, 32 insertions(+), 49 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index f62a0c8..e103cf3 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -1,8 +1,8 @@
 /******************************************************************************
  * netif.h
- * 
+ *
  * Unified network-device I/O interface for Xen guest OSes.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
  * deal in the Software without restriction, including without limitation the
@@ -153,8 +153,10 @@
 /*
  * This is the 'wire' format for packets:
  *  Request 1: netif_tx_request_t -- NETTXF_* (any flags)
- * [Request 2: netif_extra_info_t] (only if request 1 has NETTXF_extra_info)
- * [Request 3: netif_extra_info_t] (only if request 2 has XEN_NETIF_EXTRA_MORE)
+ * [Request 2: netif_extra_info_t] (only if request 1 has
+ *                                  NETTXF_extra_info)
+ * [Request 3: netif_extra_info_t] (only if request 2 has
+ *                                  XEN_NETIF_EXTRA_MORE)
  *  Request 4: netif_tx_request_t -- NETTXF_more_data
  *  Request 5: netif_tx_request_t -- NETTXF_more_data
  *  ...
@@ -256,7 +258,7 @@
  *
  *    0     1     2     3     4     5     6     7  octet
  * +-----+-----+-----+-----+-----+-----+-----+-----+
- * |type |flags| type specfic data                 |
+ * |type |flags| type specific data                |
  * +-----+-----+-----+-----+-----+-----+-----+-----+
  * | padding for tx        |
  * +-----+-----+-----+-----+
@@ -264,7 +266,8 @@
  * type: XEN_NETIF_EXTRA_TYPE_*
  * flags: XEN_NETIF_EXTRA_FLAG_*
  * padding for tx: present only in the tx case due to 8 octet limit
- *     from rx case. Not shown in type specific entries below.
+ *                 from rx case. Not shown in type specific entries
+ *                 below.
  *
  * XEN_NETIF_EXTRA_TYPE_GSO:
  *
@@ -275,9 +278,14 @@
  *
  * type: Must be XEN_NETIF_EXTRA_TYPE_GSO
  * flags: XEN_NETIF_EXTRA_FLAG_*
- * size: Maximum payload size of each segment.
- * type: XEN_NETIF_GSO_TYPE_*
- * features: EN_NETIF_GSO_FEAT_*
+ * size: Maximum payload size of each segment. For example,
+ *       for TCP this is just the path MSS.
+ * type: XEN_NETIF_GSO_TYPE_*: This determines the protocol of
+ *       the packet and any extra features required to segment the
+ *       packet properly.
+ * features: EN_NETIF_GSO_FEAT_*: This specifies any extra GSO
+ *           features required to process this packet, such as ECN
+ *           support for TCPv4.
  *
  * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}:
  *
@@ -309,11 +317,11 @@
 
 #define XEN_NETIF_MAX_TX_SIZE 0xFFFF
 struct netif_tx_request {
-    grant_ref_t gref;      /* Reference to buffer page */
-    uint16_t offset;       /* Offset within buffer page */
-    uint16_t flags;        /* NETTXF_* */
-    uint16_t id;           /* Echoed in response message. */
-    uint16_t size;         /* Packet size in bytes.       */
+    grant_ref_t gref;
+    uint16_t offset;
+    uint16_t flags;
+    uint16_t id;
+    uint16_t size;
 };
 typedef struct netif_tx_request netif_tx_request_t;
 
@@ -338,43 +346,18 @@ typedef struct netif_tx_request netif_tx_request_t;
  * netif_rx_response_t for compatibility.
  */
 struct netif_extra_info {
-    uint8_t type;  /* XEN_NETIF_EXTRA_TYPE_* */
-    uint8_t flags; /* XEN_NETIF_EXTRA_FLAG_* */
-
+    uint8_t type;
+    uint8_t flags;
     union {
-        /*
-         * XEN_NETIF_EXTRA_TYPE_GSO:
-         */
         struct {
-            /*
-             * Maximum payload size of each segment. For example, for TCP this
-             * is just the path MSS.
-             */
             uint16_t size;
-
-            /*
-             * GSO type. This determines the protocol of the packet and any
-             * extra features required to segment the packet properly.
-             */
-            uint8_t type; /* XEN_NETIF_GSO_TYPE_* */
-
-            /* Future expansion. */
+            uint8_t type;
             uint8_t pad;
-
-            /*
-             * GSO features. This specifies any extra GSO features required
-             * to process this packet, such as ECN support for TCPv4.
-             */
-            uint16_t features; /* XEN_NETIF_GSO_FEAT_* */
+            uint16_t features;
         } gso;
-
-        /*
-         * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}:
-         */
         struct {
-            uint8_t addr[6]; /* Address to add/remove. */
+            uint8_t addr[6];
         } mcast;
-
         uint16_t pad[3];
     } u;
 };
@@ -382,14 +365,14 @@ typedef struct netif_extra_info netif_extra_info_t;
 
 struct netif_tx_response {
     uint16_t id;
-    int16_t  status;       /* NETIF_RSP_* */
+    int16_t  status;
 };
 typedef struct netif_tx_response netif_tx_response_t;
 
 struct netif_rx_request {
     uint16_t    id;        /* Echoed in response message.        */
     uint16_t    pad;
-    grant_ref_t gref;      /* Reference to incoming granted frame */
+    grant_ref_t gref;
 };
 typedef struct netif_rx_request netif_rx_request_t;
 
@@ -415,9 +398,9 @@ typedef struct netif_rx_request netif_rx_request_t;
 
 struct netif_rx_response {
     uint16_t id;
-    uint16_t offset;       /* Offset in page of start of received packet  */
-    uint16_t flags;        /* NETRXF_* */
-    int16_t  status;       /* -ve: NETIF_RSP_* ; +ve: Rx'ed pkt size. */
+    uint16_t offset;
+    uint16_t flags;
+    int16_t  status;
 };
 typedef struct netif_rx_response netif_rx_response_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 Thu Nov 26 20:51:02 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51: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 1a23VO-0004xT-12; Thu, 26 Nov 2015 20:51: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 1a23VM-0004xF-Vw
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:01 +0000
Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id
	21/4D-30270-4B077565; Thu, 26 Nov 2015 20:51:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1448571058!6808009!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3321 invoked from network); 26 Nov 2015 20:50:59 -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;
	26 Nov 2015 20:50:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VK-0003Cq-Fe
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VK-0000kP-Da
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:50:58 +0000
Date: Thu, 26 Nov 2015 20:50:58 +0000
Message-Id: <E1a23VK-0000kP-Da@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/io/netif.h: tidy up and remove
	duplicate comments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3acb0d6770816441971910ead36025afaea12734
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Wed Nov 25 11:12:40 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 11:12:40 2015 +0100

    public/io/netif.h: tidy up and remove duplicate comments
    
    Now that requests and response types and extra info segments are
    documented in block comments, we can get rid of the inline comments
    in the structures. This has the happy side-effect of making the Linux
    checkpatch.pl script make fewer complaints after import.
    
    This patch also fixes a small whitespace issue in the initial boiler-
    plate comment, and a typo in one of the ascii-art diagrams.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/public/io/netif.h |   81 ++++++++++++++++-------------------------
 1 files changed, 32 insertions(+), 49 deletions(-)

diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index f62a0c8..e103cf3 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -1,8 +1,8 @@
 /******************************************************************************
  * netif.h
- * 
+ *
  * Unified network-device I/O interface for Xen guest OSes.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
  * deal in the Software without restriction, including without limitation the
@@ -153,8 +153,10 @@
 /*
  * This is the 'wire' format for packets:
  *  Request 1: netif_tx_request_t -- NETTXF_* (any flags)
- * [Request 2: netif_extra_info_t] (only if request 1 has NETTXF_extra_info)
- * [Request 3: netif_extra_info_t] (only if request 2 has XEN_NETIF_EXTRA_MORE)
+ * [Request 2: netif_extra_info_t] (only if request 1 has
+ *                                  NETTXF_extra_info)
+ * [Request 3: netif_extra_info_t] (only if request 2 has
+ *                                  XEN_NETIF_EXTRA_MORE)
  *  Request 4: netif_tx_request_t -- NETTXF_more_data
  *  Request 5: netif_tx_request_t -- NETTXF_more_data
  *  ...
@@ -256,7 +258,7 @@
  *
  *    0     1     2     3     4     5     6     7  octet
  * +-----+-----+-----+-----+-----+-----+-----+-----+
- * |type |flags| type specfic data                 |
+ * |type |flags| type specific data                |
  * +-----+-----+-----+-----+-----+-----+-----+-----+
  * | padding for tx        |
  * +-----+-----+-----+-----+
@@ -264,7 +266,8 @@
  * type: XEN_NETIF_EXTRA_TYPE_*
  * flags: XEN_NETIF_EXTRA_FLAG_*
  * padding for tx: present only in the tx case due to 8 octet limit
- *     from rx case. Not shown in type specific entries below.
+ *                 from rx case. Not shown in type specific entries
+ *                 below.
  *
  * XEN_NETIF_EXTRA_TYPE_GSO:
  *
@@ -275,9 +278,14 @@
  *
  * type: Must be XEN_NETIF_EXTRA_TYPE_GSO
  * flags: XEN_NETIF_EXTRA_FLAG_*
- * size: Maximum payload size of each segment.
- * type: XEN_NETIF_GSO_TYPE_*
- * features: EN_NETIF_GSO_FEAT_*
+ * size: Maximum payload size of each segment. For example,
+ *       for TCP this is just the path MSS.
+ * type: XEN_NETIF_GSO_TYPE_*: This determines the protocol of
+ *       the packet and any extra features required to segment the
+ *       packet properly.
+ * features: EN_NETIF_GSO_FEAT_*: This specifies any extra GSO
+ *           features required to process this packet, such as ECN
+ *           support for TCPv4.
  *
  * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}:
  *
@@ -309,11 +317,11 @@
 
 #define XEN_NETIF_MAX_TX_SIZE 0xFFFF
 struct netif_tx_request {
-    grant_ref_t gref;      /* Reference to buffer page */
-    uint16_t offset;       /* Offset within buffer page */
-    uint16_t flags;        /* NETTXF_* */
-    uint16_t id;           /* Echoed in response message. */
-    uint16_t size;         /* Packet size in bytes.       */
+    grant_ref_t gref;
+    uint16_t offset;
+    uint16_t flags;
+    uint16_t id;
+    uint16_t size;
 };
 typedef struct netif_tx_request netif_tx_request_t;
 
@@ -338,43 +346,18 @@ typedef struct netif_tx_request netif_tx_request_t;
  * netif_rx_response_t for compatibility.
  */
 struct netif_extra_info {
-    uint8_t type;  /* XEN_NETIF_EXTRA_TYPE_* */
-    uint8_t flags; /* XEN_NETIF_EXTRA_FLAG_* */
-
+    uint8_t type;
+    uint8_t flags;
     union {
-        /*
-         * XEN_NETIF_EXTRA_TYPE_GSO:
-         */
         struct {
-            /*
-             * Maximum payload size of each segment. For example, for TCP this
-             * is just the path MSS.
-             */
             uint16_t size;
-
-            /*
-             * GSO type. This determines the protocol of the packet and any
-             * extra features required to segment the packet properly.
-             */
-            uint8_t type; /* XEN_NETIF_GSO_TYPE_* */
-
-            /* Future expansion. */
+            uint8_t type;
             uint8_t pad;
-
-            /*
-             * GSO features. This specifies any extra GSO features required
-             * to process this packet, such as ECN support for TCPv4.
-             */
-            uint16_t features; /* XEN_NETIF_GSO_FEAT_* */
+            uint16_t features;
         } gso;
-
-        /*
-         * XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}:
-         */
         struct {
-            uint8_t addr[6]; /* Address to add/remove. */
+            uint8_t addr[6];
         } mcast;
-
         uint16_t pad[3];
     } u;
 };
@@ -382,14 +365,14 @@ typedef struct netif_extra_info netif_extra_info_t;
 
 struct netif_tx_response {
     uint16_t id;
-    int16_t  status;       /* NETIF_RSP_* */
+    int16_t  status;
 };
 typedef struct netif_tx_response netif_tx_response_t;
 
 struct netif_rx_request {
     uint16_t    id;        /* Echoed in response message.        */
     uint16_t    pad;
-    grant_ref_t gref;      /* Reference to incoming granted frame */
+    grant_ref_t gref;
 };
 typedef struct netif_rx_request netif_rx_request_t;
 
@@ -415,9 +398,9 @@ typedef struct netif_rx_request netif_rx_request_t;
 
 struct netif_rx_response {
     uint16_t id;
-    uint16_t offset;       /* Offset in page of start of received packet  */
-    uint16_t flags;        /* NETRXF_* */
-    int16_t  status;       /* -ve: NETIF_RSP_* ; +ve: Rx'ed pkt size. */
+    uint16_t offset;
+    uint16_t flags;
+    int16_t  status;
 };
 typedef struct netif_rx_response netif_rx_response_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 Thu Nov 26 20:51:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51: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 1a23VZ-0004yz-5B; Thu, 26 Nov 2015 20:51:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VX-0004yd-FB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:11 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	83/15-01748-EB077565; Thu, 26 Nov 2015 20:51:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1448571068!6860149!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14544 invoked from network); 26 Nov 2015 20:51:09 -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;
	26 Nov 2015 20:51:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VU-0003DR-Mx
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VU-0000l8-L9
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:08 +0000
Date: Thu, 26 Nov 2015 20:51:08 +0000
Message-Id: <E1a23VU-0000l8-L9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: return correct fixed PMC
	count
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d596f5ad70969d8171e1eb5b7a39d0dc6c11dc2
Author:     Brendan Gregg <bgregg@netflix.com>
AuthorDate: Wed Nov 25 11:12:55 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 11:12:55 2015 +0100

    x86/VPMU: return correct fixed PMC count
    
    Fixes a register typo.
    
    Signed-off-by: Brendan Gregg <bgregg@netflix.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/vpmu_intel.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 12f80ae..d5ea7fe 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -166,10 +166,9 @@ static int core2_get_arch_pmc_count(void)
  */
 static int core2_get_fixed_pmc_count(void)
 {
-    u32 eax;
+    u32 edx = cpuid_edx(0xa);
 
-    eax = cpuid_eax(0xa);
-    return MASK_EXTR(eax, PMU_FIXED_NR_MASK);
+    return MASK_EXTR(edx, PMU_FIXED_NR_MASK);
 }
 
 /* edx bits 5-12: Bit width of fixed-function performance counters  */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:51:13 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51: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 1a23VZ-0004yz-5B; Thu, 26 Nov 2015 20:51:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VX-0004yd-FB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:11 +0000
Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id
	83/15-01748-EB077565; Thu, 26 Nov 2015 20:51:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1448571068!6860149!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14544 invoked from network); 26 Nov 2015 20:51:09 -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;
	26 Nov 2015 20:51:09 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VU-0003DR-Mx
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23VU-0000l8-L9
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:08 +0000
Date: Thu, 26 Nov 2015 20:51:08 +0000
Message-Id: <E1a23VU-0000l8-L9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: return correct fixed PMC
	count
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d596f5ad70969d8171e1eb5b7a39d0dc6c11dc2
Author:     Brendan Gregg <bgregg@netflix.com>
AuthorDate: Wed Nov 25 11:12:55 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 11:12:55 2015 +0100

    x86/VPMU: return correct fixed PMC count
    
    Fixes a register typo.
    
    Signed-off-by: Brendan Gregg <bgregg@netflix.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/vpmu_intel.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 12f80ae..d5ea7fe 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -166,10 +166,9 @@ static int core2_get_arch_pmc_count(void)
  */
 static int core2_get_fixed_pmc_count(void)
 {
-    u32 eax;
+    u32 edx = cpuid_edx(0xa);
 
-    eax = cpuid_eax(0xa);
-    return MASK_EXTR(eax, PMU_FIXED_NR_MASK);
+    return MASK_EXTR(edx, PMU_FIXED_NR_MASK);
 }
 
 /* edx bits 5-12: Bit width of fixed-function performance counters  */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:51:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51: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 1a23Vj-00050m-Bj; Thu, 26 Nov 2015 20:51:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vh-00050W-PD
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:21 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	AA/A6-21201-8C077565; Thu, 26 Nov 2015 20:51:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1448571079!6871366!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46875 invoked from network); 26 Nov 2015 20:51:20 -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;
	26 Nov 2015 20:51:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vf-0003Dd-30
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ve-0000li-UP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:18 +0000
Date: Thu, 26 Nov 2015 20:51:18 +0000
Message-Id: <E1a23Ve-0000li-UP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move wallclock functions from x86
	to common
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f1e5b11099c0d5cc51d26ba3f85d8fc3581d1cb3
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Nov 12 17:46:02 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 11:26:10 2015 +0000

    xen: move wallclock functions from x86 to common
    
    Remove dummy arm implementation of wallclock_time.
    Use shared_info() in common code rather than x86-ism to access it, when
    possible.
    
    Define the static variable wc_sec, and the local variable sec in
    update_domain_wallclock_time, as uint64_t instead of unsigned long, to
    avoid size issue on arm.
    Take a uint64_t sec parameter in do_settime for the same reason.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    CC: JBeulich@suse.com
    CC: andrew.cooper3@citrix.com
    [ ijc -- typoes in commit message ]
---
 xen/arch/arm/time.c    |    5 --
 xen/arch/x86/time.c    |   96 +-----------------------------------------------
 xen/common/time.c      |   95 +++++++++++++++++++++++++++++++++++++++++++++++-
 xen/include/xen/time.h |    5 ++-
 4 files changed, 99 insertions(+), 102 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 5ded30c..6207615 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -280,11 +280,6 @@ void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds)
     /* XXX update guest visible wallclock time */
 }
 
-struct tm wallclock_time(uint64_t *ns)
-{
-    return (struct tm) { 0 };
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 5d7452a..30d52c4 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -47,9 +47,6 @@ string_param("clocksource", opt_clocksource);
 unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 DEFINE_SPINLOCK(rtc_lock);
 unsigned long pit0_ticks;
-static unsigned long wc_sec; /* UTC time at last 'time update'. */
-static unsigned int wc_nsec;
-static DEFINE_SPINLOCK(wc_lock);
 
 struct cpu_time {
     u64 local_tsc_stamp;
@@ -783,10 +780,6 @@ uint64_t tsc_ticks2ns(uint64_t ticks)
     return scale_delta(ticks, &t->tsc_scale);
 }
 
-/* Explicitly OR with 1 just in case version number gets out of sync. */
-#define version_update_begin(v) (((v)+1)|1)
-#define version_update_end(v)   ((v)+1)
-
 static void __update_vcpu_system_time(struct vcpu *v, int force)
 {
     struct cpu_time       *t;
@@ -893,37 +886,6 @@ void force_update_vcpu_system_time(struct vcpu *v)
     __update_vcpu_system_time(v, 1);
 }
 
-void update_domain_wallclock_time(struct domain *d)
-{
-    uint32_t *wc_version;
-    unsigned long sec;
-
-    spin_lock(&wc_lock);
-
-    wc_version = &shared_info(d, wc_version);
-    *wc_version = version_update_begin(*wc_version);
-    wmb();
-
-    sec = wc_sec + d->time_offset_seconds;
-    if ( likely(!has_32bit_shinfo(d)) )
-    {
-        d->shared_info->native.wc_sec    = sec;
-        d->shared_info->native.wc_nsec   = wc_nsec;
-        d->shared_info->native.wc_sec_hi = sec >> 32;
-    }
-    else
-    {
-        d->shared_info->compat.wc_sec         = sec;
-        d->shared_info->compat.wc_nsec        = wc_nsec;
-        d->shared_info->compat.arch.wc_sec_hi = sec >> 32;
-    }
-
-    wmb();
-    *wc_version = version_update_end(*wc_version);
-
-    spin_unlock(&wc_lock);
-}
-
 static void update_domain_rtc(void)
 {
     struct domain *d;
@@ -981,27 +943,6 @@ int cpu_frequency_change(u64 freq)
     return 0;
 }
 
-/* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
-void do_settime(unsigned long secs, unsigned int nsecs, u64 system_time_base)
-{
-    u64 x;
-    u32 y;
-    struct domain *d;
-
-    x = SECONDS(secs) + nsecs - system_time_base;
-    y = do_div(x, 1000000000);
-
-    spin_lock(&wc_lock);
-    wc_sec  = x;
-    wc_nsec = y;
-    spin_unlock(&wc_lock);
-
-    rcu_read_lock(&domlist_read_lock);
-    for_each_domain ( d )
-        update_domain_wallclock_time(d);
-    rcu_read_unlock(&domlist_read_lock);
-}
-
 /* Per-CPU communication between rendezvous IRQ and softirq handler. */
 struct cpu_calibration {
     u64 local_tsc_stamp;
@@ -1601,25 +1542,6 @@ void send_timer_event(struct vcpu *v)
     send_guest_vcpu_virq(v, VIRQ_TIMER);
 }
 
-/* Return secs after 00:00:00 localtime, 1 January, 1970. */
-unsigned long get_localtime(struct domain *d)
-{
-    return wc_sec + (wc_nsec + NOW()) / 1000000000ULL 
-        + d->time_offset_seconds;
-}
-
-/* Return microsecs after 00:00:00 localtime, 1 January, 1970. */
-uint64_t get_localtime_us(struct domain *d)
-{
-    return (SECONDS(wc_sec + d->time_offset_seconds) + wc_nsec + NOW())
-           / 1000UL;
-}
-
-unsigned long get_sec(void)
-{
-    return wc_sec + (wc_nsec + NOW()) / 1000000000ULL;
-}
-
 /* "cmos_utc_offset" is the difference between UTC time and CMOS time. */
 static long cmos_utc_offset; /* in seconds */
 
@@ -1628,7 +1550,7 @@ int time_suspend(void)
     if ( smp_processor_id() == 0 )
     {
         cmos_utc_offset = -get_cmos_time();
-        cmos_utc_offset += (wc_sec + (wc_nsec + NOW()) / 1000000000ULL);
+        cmos_utc_offset += get_sec();
         kill_timer(&calibration_timer);
 
         /* Sync platform timer stamps. */
@@ -1708,22 +1630,6 @@ int hwdom_pit_access(struct ioreq *ioreq)
     return 0;
 }
 
-struct tm wallclock_time(uint64_t *ns)
-{
-    uint64_t seconds, nsec;
-
-    if ( !wc_sec )
-        return (struct tm) { 0 };
-
-    seconds = NOW() + SECONDS(wc_sec) + wc_nsec;
-    nsec = do_div(seconds, 1000000000);
-
-    if ( ns )
-        *ns = nsec;
-
-    return gmtime(seconds);
-}
-
 /*
  * PV SoftTSC Emulation.
  */
diff --git a/xen/common/time.c b/xen/common/time.c
index 29fdf52..721ada8 100644
--- a/xen/common/time.c
+++ b/xen/common/time.c
@@ -15,8 +15,12 @@
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <xen/config.h>
+#include <xen/sched.h>
+#include <xen/shared.h>
+#include <xen/spinlock.h>
 #include <xen/time.h>
+#include <asm/div64.h>
+#include <asm/domain.h>
 
 /* Nonzero if YEAR is a leap year (every 4 years,
    except every 100th isn't, and every 400th is).  */
@@ -34,6 +38,10 @@ const unsigned short int __mon_lengths[2][12] = {
 #define SECS_PER_HOUR (60 * 60)
 #define SECS_PER_DAY  (SECS_PER_HOUR * 24)
 
+static uint64_t wc_sec; /* UTC time at last 'time update'. */
+static unsigned int wc_nsec;
+static DEFINE_SPINLOCK(wc_lock);
+
 struct tm gmtime(unsigned long t)
 {
     struct tm tbuf;
@@ -85,3 +93,88 @@ struct tm gmtime(unsigned long t)
 
     return tbuf;
 }
+
+void update_domain_wallclock_time(struct domain *d)
+{
+    uint32_t *wc_version;
+    uint64_t sec;
+
+    spin_lock(&wc_lock);
+
+    wc_version = &shared_info(d, wc_version);
+    *wc_version = version_update_begin(*wc_version);
+    wmb();
+
+    sec = wc_sec + d->time_offset_seconds;
+    shared_info(d, wc_sec)    = sec;
+    shared_info(d, wc_nsec)   = wc_nsec;
+#ifdef CONFIG_X86
+    if ( likely(!has_32bit_shinfo(d)) )
+        d->shared_info->native.wc_sec_hi = sec >> 32;
+    else
+        d->shared_info->compat.arch.wc_sec_hi = sec >> 32;
+#else
+    shared_info(d, wc_sec_hi) = sec >> 32;
+#endif
+
+    wmb();
+    *wc_version = version_update_end(*wc_version);
+
+    spin_unlock(&wc_lock);
+}
+
+/* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
+void do_settime(u64 secs, unsigned int nsecs, u64 system_time_base)
+{
+    u64 x;
+    u32 y;
+    struct domain *d;
+
+    x = SECONDS(secs) + nsecs - system_time_base;
+    y = do_div(x, 1000000000);
+
+    spin_lock(&wc_lock);
+    wc_sec  = x;
+    wc_nsec = y;
+    spin_unlock(&wc_lock);
+
+    rcu_read_lock(&domlist_read_lock);
+    for_each_domain ( d )
+        update_domain_wallclock_time(d);
+    rcu_read_unlock(&domlist_read_lock);
+}
+
+/* Return secs after 00:00:00 localtime, 1 January, 1970. */
+unsigned long get_localtime(struct domain *d)
+{
+    return wc_sec + (wc_nsec + NOW()) / 1000000000ULL
+        + d->time_offset_seconds;
+}
+
+/* Return microsecs after 00:00:00 localtime, 1 January, 1970. */
+uint64_t get_localtime_us(struct domain *d)
+{
+    return (SECONDS(wc_sec + d->time_offset_seconds) + wc_nsec + NOW())
+           / 1000UL;
+}
+
+unsigned long get_sec(void)
+{
+    return wc_sec + (wc_nsec + NOW()) / 1000000000ULL;
+}
+
+struct tm wallclock_time(uint64_t *ns)
+{
+    uint64_t seconds, nsec;
+
+    if ( !wc_sec )
+        return (struct tm) { 0 };
+
+    seconds = NOW() + SECONDS(wc_sec) + wc_nsec;
+    nsec = do_div(seconds, 1000000000);
+
+    if ( ns )
+        *ns = nsec;
+
+    return gmtime(seconds);
+}
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index da4e8d7..b742746 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -60,11 +60,14 @@ struct tm wallclock_time(uint64_t *ns);
 /* Chosen so (NOW() + delta) wont overflow without an uptime of 200 years */
 #define STIME_DELTA_MAX ((s_time_t)((uint64_t)~0ull>>2))
 
+/* Explicitly OR with 1 just in case version number gets out of sync. */
+#define version_update_begin(v) (((v) + 1) | 1)
+#define version_update_end(v)   ((v) + 1)
 extern void update_vcpu_system_time(struct vcpu *v);
 extern void update_domain_wallclock_time(struct domain *d);
 
 extern void do_settime(
-    unsigned long secs, unsigned int nsecs, u64 system_time_base);
+    u64 secs, unsigned int nsecs, u64 system_time_base);
 
 extern void send_timer_event(struct vcpu *v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:51:23 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51: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 1a23Vj-00050m-Bj; Thu, 26 Nov 2015 20:51:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vh-00050W-PD
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:21 +0000
Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id
	AA/A6-21201-8C077565; Thu, 26 Nov 2015 20:51:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1448571079!6871366!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 46875 invoked from network); 26 Nov 2015 20:51:20 -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;
	26 Nov 2015 20:51:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vf-0003Dd-30
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ve-0000li-UP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:18 +0000
Date: Thu, 26 Nov 2015 20:51:18 +0000
Message-Id: <E1a23Ve-0000li-UP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: move wallclock functions from x86
	to common
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f1e5b11099c0d5cc51d26ba3f85d8fc3581d1cb3
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Nov 12 17:46:02 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 11:26:10 2015 +0000

    xen: move wallclock functions from x86 to common
    
    Remove dummy arm implementation of wallclock_time.
    Use shared_info() in common code rather than x86-ism to access it, when
    possible.
    
    Define the static variable wc_sec, and the local variable sec in
    update_domain_wallclock_time, as uint64_t instead of unsigned long, to
    avoid size issue on arm.
    Take a uint64_t sec parameter in do_settime for the same reason.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    CC: JBeulich@suse.com
    CC: andrew.cooper3@citrix.com
    [ ijc -- typoes in commit message ]
---
 xen/arch/arm/time.c    |    5 --
 xen/arch/x86/time.c    |   96 +-----------------------------------------------
 xen/common/time.c      |   95 +++++++++++++++++++++++++++++++++++++++++++++++-
 xen/include/xen/time.h |    5 ++-
 4 files changed, 99 insertions(+), 102 deletions(-)

diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 5ded30c..6207615 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -280,11 +280,6 @@ void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds)
     /* XXX update guest visible wallclock time */
 }
 
-struct tm wallclock_time(uint64_t *ns)
-{
-    return (struct tm) { 0 };
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 5d7452a..30d52c4 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -47,9 +47,6 @@ string_param("clocksource", opt_clocksource);
 unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 DEFINE_SPINLOCK(rtc_lock);
 unsigned long pit0_ticks;
-static unsigned long wc_sec; /* UTC time at last 'time update'. */
-static unsigned int wc_nsec;
-static DEFINE_SPINLOCK(wc_lock);
 
 struct cpu_time {
     u64 local_tsc_stamp;
@@ -783,10 +780,6 @@ uint64_t tsc_ticks2ns(uint64_t ticks)
     return scale_delta(ticks, &t->tsc_scale);
 }
 
-/* Explicitly OR with 1 just in case version number gets out of sync. */
-#define version_update_begin(v) (((v)+1)|1)
-#define version_update_end(v)   ((v)+1)
-
 static void __update_vcpu_system_time(struct vcpu *v, int force)
 {
     struct cpu_time       *t;
@@ -893,37 +886,6 @@ void force_update_vcpu_system_time(struct vcpu *v)
     __update_vcpu_system_time(v, 1);
 }
 
-void update_domain_wallclock_time(struct domain *d)
-{
-    uint32_t *wc_version;
-    unsigned long sec;
-
-    spin_lock(&wc_lock);
-
-    wc_version = &shared_info(d, wc_version);
-    *wc_version = version_update_begin(*wc_version);
-    wmb();
-
-    sec = wc_sec + d->time_offset_seconds;
-    if ( likely(!has_32bit_shinfo(d)) )
-    {
-        d->shared_info->native.wc_sec    = sec;
-        d->shared_info->native.wc_nsec   = wc_nsec;
-        d->shared_info->native.wc_sec_hi = sec >> 32;
-    }
-    else
-    {
-        d->shared_info->compat.wc_sec         = sec;
-        d->shared_info->compat.wc_nsec        = wc_nsec;
-        d->shared_info->compat.arch.wc_sec_hi = sec >> 32;
-    }
-
-    wmb();
-    *wc_version = version_update_end(*wc_version);
-
-    spin_unlock(&wc_lock);
-}
-
 static void update_domain_rtc(void)
 {
     struct domain *d;
@@ -981,27 +943,6 @@ int cpu_frequency_change(u64 freq)
     return 0;
 }
 
-/* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
-void do_settime(unsigned long secs, unsigned int nsecs, u64 system_time_base)
-{
-    u64 x;
-    u32 y;
-    struct domain *d;
-
-    x = SECONDS(secs) + nsecs - system_time_base;
-    y = do_div(x, 1000000000);
-
-    spin_lock(&wc_lock);
-    wc_sec  = x;
-    wc_nsec = y;
-    spin_unlock(&wc_lock);
-
-    rcu_read_lock(&domlist_read_lock);
-    for_each_domain ( d )
-        update_domain_wallclock_time(d);
-    rcu_read_unlock(&domlist_read_lock);
-}
-
 /* Per-CPU communication between rendezvous IRQ and softirq handler. */
 struct cpu_calibration {
     u64 local_tsc_stamp;
@@ -1601,25 +1542,6 @@ void send_timer_event(struct vcpu *v)
     send_guest_vcpu_virq(v, VIRQ_TIMER);
 }
 
-/* Return secs after 00:00:00 localtime, 1 January, 1970. */
-unsigned long get_localtime(struct domain *d)
-{
-    return wc_sec + (wc_nsec + NOW()) / 1000000000ULL 
-        + d->time_offset_seconds;
-}
-
-/* Return microsecs after 00:00:00 localtime, 1 January, 1970. */
-uint64_t get_localtime_us(struct domain *d)
-{
-    return (SECONDS(wc_sec + d->time_offset_seconds) + wc_nsec + NOW())
-           / 1000UL;
-}
-
-unsigned long get_sec(void)
-{
-    return wc_sec + (wc_nsec + NOW()) / 1000000000ULL;
-}
-
 /* "cmos_utc_offset" is the difference between UTC time and CMOS time. */
 static long cmos_utc_offset; /* in seconds */
 
@@ -1628,7 +1550,7 @@ int time_suspend(void)
     if ( smp_processor_id() == 0 )
     {
         cmos_utc_offset = -get_cmos_time();
-        cmos_utc_offset += (wc_sec + (wc_nsec + NOW()) / 1000000000ULL);
+        cmos_utc_offset += get_sec();
         kill_timer(&calibration_timer);
 
         /* Sync platform timer stamps. */
@@ -1708,22 +1630,6 @@ int hwdom_pit_access(struct ioreq *ioreq)
     return 0;
 }
 
-struct tm wallclock_time(uint64_t *ns)
-{
-    uint64_t seconds, nsec;
-
-    if ( !wc_sec )
-        return (struct tm) { 0 };
-
-    seconds = NOW() + SECONDS(wc_sec) + wc_nsec;
-    nsec = do_div(seconds, 1000000000);
-
-    if ( ns )
-        *ns = nsec;
-
-    return gmtime(seconds);
-}
-
 /*
  * PV SoftTSC Emulation.
  */
diff --git a/xen/common/time.c b/xen/common/time.c
index 29fdf52..721ada8 100644
--- a/xen/common/time.c
+++ b/xen/common/time.c
@@ -15,8 +15,12 @@
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <xen/config.h>
+#include <xen/sched.h>
+#include <xen/shared.h>
+#include <xen/spinlock.h>
 #include <xen/time.h>
+#include <asm/div64.h>
+#include <asm/domain.h>
 
 /* Nonzero if YEAR is a leap year (every 4 years,
    except every 100th isn't, and every 400th is).  */
@@ -34,6 +38,10 @@ const unsigned short int __mon_lengths[2][12] = {
 #define SECS_PER_HOUR (60 * 60)
 #define SECS_PER_DAY  (SECS_PER_HOUR * 24)
 
+static uint64_t wc_sec; /* UTC time at last 'time update'. */
+static unsigned int wc_nsec;
+static DEFINE_SPINLOCK(wc_lock);
+
 struct tm gmtime(unsigned long t)
 {
     struct tm tbuf;
@@ -85,3 +93,88 @@ struct tm gmtime(unsigned long t)
 
     return tbuf;
 }
+
+void update_domain_wallclock_time(struct domain *d)
+{
+    uint32_t *wc_version;
+    uint64_t sec;
+
+    spin_lock(&wc_lock);
+
+    wc_version = &shared_info(d, wc_version);
+    *wc_version = version_update_begin(*wc_version);
+    wmb();
+
+    sec = wc_sec + d->time_offset_seconds;
+    shared_info(d, wc_sec)    = sec;
+    shared_info(d, wc_nsec)   = wc_nsec;
+#ifdef CONFIG_X86
+    if ( likely(!has_32bit_shinfo(d)) )
+        d->shared_info->native.wc_sec_hi = sec >> 32;
+    else
+        d->shared_info->compat.arch.wc_sec_hi = sec >> 32;
+#else
+    shared_info(d, wc_sec_hi) = sec >> 32;
+#endif
+
+    wmb();
+    *wc_version = version_update_end(*wc_version);
+
+    spin_unlock(&wc_lock);
+}
+
+/* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
+void do_settime(u64 secs, unsigned int nsecs, u64 system_time_base)
+{
+    u64 x;
+    u32 y;
+    struct domain *d;
+
+    x = SECONDS(secs) + nsecs - system_time_base;
+    y = do_div(x, 1000000000);
+
+    spin_lock(&wc_lock);
+    wc_sec  = x;
+    wc_nsec = y;
+    spin_unlock(&wc_lock);
+
+    rcu_read_lock(&domlist_read_lock);
+    for_each_domain ( d )
+        update_domain_wallclock_time(d);
+    rcu_read_unlock(&domlist_read_lock);
+}
+
+/* Return secs after 00:00:00 localtime, 1 January, 1970. */
+unsigned long get_localtime(struct domain *d)
+{
+    return wc_sec + (wc_nsec + NOW()) / 1000000000ULL
+        + d->time_offset_seconds;
+}
+
+/* Return microsecs after 00:00:00 localtime, 1 January, 1970. */
+uint64_t get_localtime_us(struct domain *d)
+{
+    return (SECONDS(wc_sec + d->time_offset_seconds) + wc_nsec + NOW())
+           / 1000UL;
+}
+
+unsigned long get_sec(void)
+{
+    return wc_sec + (wc_nsec + NOW()) / 1000000000ULL;
+}
+
+struct tm wallclock_time(uint64_t *ns)
+{
+    uint64_t seconds, nsec;
+
+    if ( !wc_sec )
+        return (struct tm) { 0 };
+
+    seconds = NOW() + SECONDS(wc_sec) + wc_nsec;
+    nsec = do_div(seconds, 1000000000);
+
+    if ( ns )
+        *ns = nsec;
+
+    return gmtime(seconds);
+}
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index da4e8d7..b742746 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -60,11 +60,14 @@ struct tm wallclock_time(uint64_t *ns);
 /* Chosen so (NOW() + delta) wont overflow without an uptime of 200 years */
 #define STIME_DELTA_MAX ((s_time_t)((uint64_t)~0ull>>2))
 
+/* Explicitly OR with 1 just in case version number gets out of sync. */
+#define version_update_begin(v) (((v) + 1) | 1)
+#define version_update_end(v)   ((v) + 1)
 extern void update_vcpu_system_time(struct vcpu *v);
 extern void update_domain_wallclock_time(struct domain *d);
 
 extern void do_settime(
-    unsigned long secs, unsigned int nsecs, u64 system_time_base);
+    u64 secs, unsigned int nsecs, u64 system_time_base);
 
 extern void send_timer_event(struct vcpu *v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:51:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51: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 1a23Vt-00053H-KR; Thu, 26 Nov 2015 20:51: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 1a23Vs-00052z-2G
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:32 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	93/9A-12831-3D077565; Thu, 26 Nov 2015 20:51:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448571089!6809956!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64449 invoked from network); 26 Nov 2015 20:51:30 -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;
	26 Nov 2015 20:51:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vp-0003Dl-DN
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vp-0000mn-AQ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:29 +0000
Date: Thu, 26 Nov 2015 20:51:29 +0000
Message-Id: <E1a23Vp-0000mn-AQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: export platform_op XENPF_settime64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c311769a686d5442d27571d98d05a41ea76233f
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Nov 12 17:46:03 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 11:26:25 2015 +0000

    arm: export platform_op XENPF_settime64
    
    Call update_domain_wallclock_time at domain initialization.
    Set time_offset_seconds to the number of seconds between physical boot
    and domain initialization: it is going to be used to get/set the
    wallclock time.
    Add time_offset_seconds to system_time when before calling do_settime,
    so that system_time actually accounts for all the time in nsec between
    machine boot and when the wallclock was set.
    
    Expose xsm_platform_op to ARM.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    CC: dgdegra@tycho.nsa.gov
---
 xen/arch/arm/Makefile             |    1 +
 xen/arch/arm/domain.c             |    2 +
 xen/arch/arm/platform_hypercall.c |   70 ++++++++++++++++++
 xen/arch/arm/traps.c              |    1 +
 xen/arch/arm/vtimer.c             |    3 +
 xen/include/xsm/dummy.h           |   12 ++--
 xen/include/xsm/xsm.h             |   13 ++--
 xen/xsm/dummy.c                   |    2 +-
 xen/xsm/flask/hooks.c             |  140 ++++++++++++++++++------------------
 9 files changed, 161 insertions(+), 83 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index e47dd4c..4ac5edd 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -23,6 +23,7 @@ obj-y += percpu.o
 obj-y += guestcopy.o
 obj-y += physdev.o
 obj-y += platform.o
+obj-y += platform_hypercall.o
 obj-y += setup.o
 obj-y += bootfdt.o
 obj-y += time.o
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 1b0f9eb..860ac7d 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -595,6 +595,8 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
     if ( (rc = domain_vtimer_init(d, config)) != 0 )
         goto fail;
 
+    update_domain_wallclock_time(d);
+
     /*
      * The hardware domain will get a PPI later in
      * arch/arm/domain_build.c  depending on the
diff --git a/xen/arch/arm/platform_hypercall.c b/xen/arch/arm/platform_hypercall.c
new file mode 100644
index 0000000..b708711
--- /dev/null
+++ b/xen/arch/arm/platform_hypercall.c
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * platform_hypercall.c
+ *
+ * Hardware platform operations. Intended for use by domain-0 kernel.
+ *
+ * Copyright (c) 2015, Citrix
+ */
+
+#include <xen/config.h>
+#include <xen/types.h>
+#include <xen/sched.h>
+#include <xen/guest_access.h>
+#include <xen/spinlock.h>
+#include <public/platform.h>
+#include <xsm/xsm.h>
+#include <asm/current.h>
+#include <asm/event.h>
+
+DEFINE_SPINLOCK(xenpf_lock);
+
+long do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
+{
+    long ret;
+    struct xen_platform_op curop, *op = &curop;
+    struct domain *d;
+
+    if ( copy_from_guest(op, u_xenpf_op, 1) )
+        return -EFAULT;
+
+    if ( op->interface_version != XENPF_INTERFACE_VERSION )
+        return -EACCES;
+
+    d = rcu_lock_current_domain();
+    if ( d == NULL )
+        return -ESRCH;
+
+    ret = xsm_platform_op(XSM_PRIV, op->cmd);
+    if ( ret )
+        return ret;
+
+    /*
+     * Trylock here avoids deadlock with an existing platform critical section
+     * which might (for some current or future reason) want to synchronise
+     * with this vcpu.
+     */
+    while ( !spin_trylock(&xenpf_lock) )
+        if ( hypercall_preempt_check() )
+            return hypercall_create_continuation(
+                __HYPERVISOR_platform_op, "h", u_xenpf_op);
+
+    switch ( op->cmd )
+    {
+    case XENPF_settime64:
+        if ( likely(!op->u.settime64.mbz) )
+            do_settime(op->u.settime64.secs,
+                       op->u.settime64.nsecs,
+                       op->u.settime64.system_time + SECONDS(d->time_offset_seconds));
+        else
+            ret = -EINVAL;
+        break;
+
+    default:
+        ret = -ENOSYS;
+        break;
+    }
+
+    spin_unlock(&xenpf_lock);
+    rcu_unlock_domain(d);
+    return ret;
+}
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 9d2bd6a..c49bd3f 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1233,6 +1233,7 @@ static arm_hypercall_t arm_hypercall_table[] = {
     HYPERCALL(hvm_op, 2),
     HYPERCALL(grant_table_op, 3),
     HYPERCALL(multicall, 2),
+    HYPERCALL(platform_op, 1),
     HYPERCALL_ARM(vcpu_op, 3),
 };
 
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 1418092..c8e2a12 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -22,6 +22,7 @@
 #include <xen/timer.h>
 #include <xen/sched.h>
 #include <xen/perfc.h>
+#include <asm/div64.h>
 #include <asm/irq.h>
 #include <asm/time.h>
 #include <asm/gic.h>
@@ -64,6 +65,8 @@ int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *config)
 {
     d->arch.phys_timer_base.offset = NOW();
     d->arch.virt_timer_base.offset = READ_SYSREG64(CNTPCT_EL0);
+    d->time_offset_seconds = ticks_to_ns(d->arch.virt_timer_base.offset - boot_count);
+    do_div(d->time_offset_seconds, 1000000000);
 
     config->clock_frequency = timer_dt_clock_frequency;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9fe372c..e43f2a1 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -584,6 +584,12 @@ static XSM_INLINE int xsm_mem_sharing(XSM_DEFAULT_ARG struct domain *d)
 }
 #endif
 
+static XSM_INLINE int xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
+}
+
 #ifdef CONFIG_X86
 static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID)
 {
@@ -639,12 +645,6 @@ static XSM_INLINE int xsm_apic(XSM_DEFAULT_ARG struct domain *d, int cmd)
     return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
-{
-    XSM_ASSERT_ACTION(XSM_PRIV);
-    return xsm_default_action(action, current->domain, NULL);
-}
-
 static XSM_INLINE int xsm_machine_memory_map(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index ba3caed..f48cf60 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -164,6 +164,8 @@ struct xsm_operations {
     int (*mem_sharing) (struct domain *d);
 #endif
 
+    int (*platform_op) (uint32_t cmd);
+
 #ifdef CONFIG_X86
     int (*do_mca) (void);
     int (*shadow_control) (struct domain *d, uint32_t op);
@@ -175,7 +177,6 @@ struct xsm_operations {
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*memtype) (uint32_t access);
-    int (*platform_op) (uint32_t cmd);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
@@ -624,6 +625,11 @@ static inline int xsm_mem_sharing (xsm_default_t def, struct domain *d)
 }
 #endif
 
+static inline int xsm_platform_op (xsm_default_t def, uint32_t op)
+{
+    return xsm_ops->platform_op(op);
+}
+
 #ifdef CONFIG_X86
 static inline int xsm_do_mca(xsm_default_t def)
 {
@@ -675,11 +681,6 @@ static inline int xsm_memtype (xsm_default_t def, uint32_t access)
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_platform_op (xsm_default_t def, uint32_t op)
-{
-    return xsm_ops->platform_op(op);
-}
-
 static inline int xsm_machine_memory_map(xsm_default_t def)
 {
     return xsm_ops->machine_memory_map();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 72eba40..618a96e 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -141,6 +141,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, mem_sharing);
 #endif
 
+    set_to_dummy_if_null(ops, platform_op);
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, do_mca);
     set_to_dummy_if_null(ops, shadow_control);
@@ -151,7 +152,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hvm_ioreq_server);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
     set_to_dummy_if_null(ops, mmu_update);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 4180f3b..da8d287 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1335,6 +1335,75 @@ static int flask_deassign_dtdevice(struct domain *d, const char *dtpath)
 }
 #endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE */
 
+static int flask_platform_op(uint32_t op)
+{
+    switch ( op )
+    {
+#ifdef CONFIG_X86
+    /* These operations have their own XSM hooks */
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        return 0;
+#endif
+
+    case XENPF_settime32:
+    case XENPF_settime64:
+        return domain_has_xen(current->domain, XEN__SETTIME);
+
+    case XENPF_add_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_ADD);
+
+    case XENPF_del_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_DEL);
+
+    case XENPF_read_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_READ);
+
+    case XENPF_microcode_update:
+        return domain_has_xen(current->domain, XEN__MICROCODE);
+
+    case XENPF_platform_quirk:
+        return domain_has_xen(current->domain, XEN__QUIRK);
+
+    case XENPF_firmware_info:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
+    case XENPF_efi_runtime_call:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
+    case XENPF_enter_acpi_sleep:
+        return domain_has_xen(current->domain, XEN__SLEEP);
+
+    case XENPF_change_freq:
+        return domain_has_xen(current->domain, XEN__FREQUENCY);
+
+    case XENPF_getidletime:
+        return domain_has_xen(current->domain, XEN__GETIDLE);
+
+    case XENPF_set_processor_pminfo:
+    case XENPF_core_parking:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
+    case XENPF_get_cpu_version:
+    case XENPF_get_cpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
+    case XENPF_resource_op:
+        return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
+                                    XEN2__RESOURCE_OP, NULL);
+
+    case XENPF_get_symbol:
+        return avc_has_perm(domain_sid(current->domain), SECINITSID_XEN,
+                            SECCLASS_XEN2, XEN2__GET_SYMBOL, NULL);
+
+    default:
+        printk("flask_platform_op: Unknown op %d\n", op);
+        return -EPERM;
+    }
+}
+
 #ifdef CONFIG_X86
 static int flask_do_mca(void)
 {
@@ -1473,75 +1542,6 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_platform_op(uint32_t op)
-{
-    switch ( op )
-    {
-#ifdef CONFIG_X86
-    /* These operations have their own XSM hooks */
-    case XENPF_cpu_online:
-    case XENPF_cpu_offline:
-    case XENPF_cpu_hotadd:
-    case XENPF_mem_hotadd:
-        return 0;
-#endif
-
-    case XENPF_settime32:
-    case XENPF_settime64:
-        return domain_has_xen(current->domain, XEN__SETTIME);
-
-    case XENPF_add_memtype:
-        return domain_has_xen(current->domain, XEN__MTRR_ADD);
-
-    case XENPF_del_memtype:
-        return domain_has_xen(current->domain, XEN__MTRR_DEL);
-
-    case XENPF_read_memtype:
-        return domain_has_xen(current->domain, XEN__MTRR_READ);
-
-    case XENPF_microcode_update:
-        return domain_has_xen(current->domain, XEN__MICROCODE);
-
-    case XENPF_platform_quirk:
-        return domain_has_xen(current->domain, XEN__QUIRK);
-
-    case XENPF_firmware_info:
-        return domain_has_xen(current->domain, XEN__FIRMWARE);
-
-    case XENPF_efi_runtime_call:
-        return domain_has_xen(current->domain, XEN__FIRMWARE);
-
-    case XENPF_enter_acpi_sleep:
-        return domain_has_xen(current->domain, XEN__SLEEP);
-
-    case XENPF_change_freq:
-        return domain_has_xen(current->domain, XEN__FREQUENCY);
-
-    case XENPF_getidletime:
-        return domain_has_xen(current->domain, XEN__GETIDLE);
-
-    case XENPF_set_processor_pminfo:
-    case XENPF_core_parking:
-        return domain_has_xen(current->domain, XEN__PM_OP);
-
-    case XENPF_get_cpu_version:
-    case XENPF_get_cpuinfo:
-        return domain_has_xen(current->domain, XEN__GETCPUINFO);
-
-    case XENPF_resource_op:
-        return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
-                                    XEN2__RESOURCE_OP, NULL);
-
-    case XENPF_get_symbol:
-        return avc_has_perm(domain_sid(current->domain), SECINITSID_XEN,
-                            SECCLASS_XEN2, XEN2__GET_SYMBOL, NULL);
-
-    default:
-        printk("flask_platform_op: Unknown op %d\n", op);
-        return -EPERM;
-    }
-}
-
 static int flask_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
@@ -1738,6 +1738,7 @@ static struct xsm_operations flask_ops = {
     .deassign_dtdevice = flask_deassign_dtdevice,
 #endif
 
+    .platform_op = flask_platform_op,
 #ifdef CONFIG_X86
     .do_mca = flask_do_mca,
     .shadow_control = flask_shadow_control,
@@ -1748,7 +1749,6 @@ static struct xsm_operations flask_ops = {
     .hvm_ioreq_server = flask_hvm_ioreq_server,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
-    .platform_op = flask_platform_op,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
     .mmu_update = flask_mmu_update,
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:51:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51: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 1a23Vt-00053H-KR; Thu, 26 Nov 2015 20:51: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 1a23Vs-00052z-2G
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:32 +0000
Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id
	93/9A-12831-3D077565; Thu, 26 Nov 2015 20:51:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448571089!6809956!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64449 invoked from network); 26 Nov 2015 20:51:30 -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;
	26 Nov 2015 20:51:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vp-0003Dl-DN
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vp-0000mn-AQ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:29 +0000
Date: Thu, 26 Nov 2015 20:51:29 +0000
Message-Id: <E1a23Vp-0000mn-AQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: export platform_op XENPF_settime64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c311769a686d5442d27571d98d05a41ea76233f
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Nov 12 17:46:03 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 11:26:25 2015 +0000

    arm: export platform_op XENPF_settime64
    
    Call update_domain_wallclock_time at domain initialization.
    Set time_offset_seconds to the number of seconds between physical boot
    and domain initialization: it is going to be used to get/set the
    wallclock time.
    Add time_offset_seconds to system_time when before calling do_settime,
    so that system_time actually accounts for all the time in nsec between
    machine boot and when the wallclock was set.
    
    Expose xsm_platform_op to ARM.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    CC: dgdegra@tycho.nsa.gov
---
 xen/arch/arm/Makefile             |    1 +
 xen/arch/arm/domain.c             |    2 +
 xen/arch/arm/platform_hypercall.c |   70 ++++++++++++++++++
 xen/arch/arm/traps.c              |    1 +
 xen/arch/arm/vtimer.c             |    3 +
 xen/include/xsm/dummy.h           |   12 ++--
 xen/include/xsm/xsm.h             |   13 ++--
 xen/xsm/dummy.c                   |    2 +-
 xen/xsm/flask/hooks.c             |  140 ++++++++++++++++++------------------
 9 files changed, 161 insertions(+), 83 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index e47dd4c..4ac5edd 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -23,6 +23,7 @@ obj-y += percpu.o
 obj-y += guestcopy.o
 obj-y += physdev.o
 obj-y += platform.o
+obj-y += platform_hypercall.o
 obj-y += setup.o
 obj-y += bootfdt.o
 obj-y += time.o
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 1b0f9eb..860ac7d 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -595,6 +595,8 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
     if ( (rc = domain_vtimer_init(d, config)) != 0 )
         goto fail;
 
+    update_domain_wallclock_time(d);
+
     /*
      * The hardware domain will get a PPI later in
      * arch/arm/domain_build.c  depending on the
diff --git a/xen/arch/arm/platform_hypercall.c b/xen/arch/arm/platform_hypercall.c
new file mode 100644
index 0000000..b708711
--- /dev/null
+++ b/xen/arch/arm/platform_hypercall.c
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * platform_hypercall.c
+ *
+ * Hardware platform operations. Intended for use by domain-0 kernel.
+ *
+ * Copyright (c) 2015, Citrix
+ */
+
+#include <xen/config.h>
+#include <xen/types.h>
+#include <xen/sched.h>
+#include <xen/guest_access.h>
+#include <xen/spinlock.h>
+#include <public/platform.h>
+#include <xsm/xsm.h>
+#include <asm/current.h>
+#include <asm/event.h>
+
+DEFINE_SPINLOCK(xenpf_lock);
+
+long do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
+{
+    long ret;
+    struct xen_platform_op curop, *op = &curop;
+    struct domain *d;
+
+    if ( copy_from_guest(op, u_xenpf_op, 1) )
+        return -EFAULT;
+
+    if ( op->interface_version != XENPF_INTERFACE_VERSION )
+        return -EACCES;
+
+    d = rcu_lock_current_domain();
+    if ( d == NULL )
+        return -ESRCH;
+
+    ret = xsm_platform_op(XSM_PRIV, op->cmd);
+    if ( ret )
+        return ret;
+
+    /*
+     * Trylock here avoids deadlock with an existing platform critical section
+     * which might (for some current or future reason) want to synchronise
+     * with this vcpu.
+     */
+    while ( !spin_trylock(&xenpf_lock) )
+        if ( hypercall_preempt_check() )
+            return hypercall_create_continuation(
+                __HYPERVISOR_platform_op, "h", u_xenpf_op);
+
+    switch ( op->cmd )
+    {
+    case XENPF_settime64:
+        if ( likely(!op->u.settime64.mbz) )
+            do_settime(op->u.settime64.secs,
+                       op->u.settime64.nsecs,
+                       op->u.settime64.system_time + SECONDS(d->time_offset_seconds));
+        else
+            ret = -EINVAL;
+        break;
+
+    default:
+        ret = -ENOSYS;
+        break;
+    }
+
+    spin_unlock(&xenpf_lock);
+    rcu_unlock_domain(d);
+    return ret;
+}
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 9d2bd6a..c49bd3f 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1233,6 +1233,7 @@ static arm_hypercall_t arm_hypercall_table[] = {
     HYPERCALL(hvm_op, 2),
     HYPERCALL(grant_table_op, 3),
     HYPERCALL(multicall, 2),
+    HYPERCALL(platform_op, 1),
     HYPERCALL_ARM(vcpu_op, 3),
 };
 
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 1418092..c8e2a12 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -22,6 +22,7 @@
 #include <xen/timer.h>
 #include <xen/sched.h>
 #include <xen/perfc.h>
+#include <asm/div64.h>
 #include <asm/irq.h>
 #include <asm/time.h>
 #include <asm/gic.h>
@@ -64,6 +65,8 @@ int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *config)
 {
     d->arch.phys_timer_base.offset = NOW();
     d->arch.virt_timer_base.offset = READ_SYSREG64(CNTPCT_EL0);
+    d->time_offset_seconds = ticks_to_ns(d->arch.virt_timer_base.offset - boot_count);
+    do_div(d->time_offset_seconds, 1000000000);
 
     config->clock_frequency = timer_dt_clock_frequency;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 9fe372c..e43f2a1 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -584,6 +584,12 @@ static XSM_INLINE int xsm_mem_sharing(XSM_DEFAULT_ARG struct domain *d)
 }
 #endif
 
+static XSM_INLINE int xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
+}
+
 #ifdef CONFIG_X86
 static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID)
 {
@@ -639,12 +645,6 @@ static XSM_INLINE int xsm_apic(XSM_DEFAULT_ARG struct domain *d, int cmd)
     return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
-{
-    XSM_ASSERT_ACTION(XSM_PRIV);
-    return xsm_default_action(action, current->domain, NULL);
-}
-
 static XSM_INLINE int xsm_machine_memory_map(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index ba3caed..f48cf60 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -164,6 +164,8 @@ struct xsm_operations {
     int (*mem_sharing) (struct domain *d);
 #endif
 
+    int (*platform_op) (uint32_t cmd);
+
 #ifdef CONFIG_X86
     int (*do_mca) (void);
     int (*shadow_control) (struct domain *d, uint32_t op);
@@ -175,7 +177,6 @@ struct xsm_operations {
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
     int (*apic) (struct domain *d, int cmd);
     int (*memtype) (uint32_t access);
-    int (*platform_op) (uint32_t cmd);
     int (*machine_memory_map) (void);
     int (*domain_memory_map) (struct domain *d);
 #define XSM_MMU_UPDATE_READ      1
@@ -624,6 +625,11 @@ static inline int xsm_mem_sharing (xsm_default_t def, struct domain *d)
 }
 #endif
 
+static inline int xsm_platform_op (xsm_default_t def, uint32_t op)
+{
+    return xsm_ops->platform_op(op);
+}
+
 #ifdef CONFIG_X86
 static inline int xsm_do_mca(xsm_default_t def)
 {
@@ -675,11 +681,6 @@ static inline int xsm_memtype (xsm_default_t def, uint32_t access)
     return xsm_ops->memtype(access);
 }
 
-static inline int xsm_platform_op (xsm_default_t def, uint32_t op)
-{
-    return xsm_ops->platform_op(op);
-}
-
 static inline int xsm_machine_memory_map(xsm_default_t def)
 {
     return xsm_ops->machine_memory_map();
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 72eba40..618a96e 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -141,6 +141,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, mem_sharing);
 #endif
 
+    set_to_dummy_if_null(ops, platform_op);
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, do_mca);
     set_to_dummy_if_null(ops, shadow_control);
@@ -151,7 +152,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hvm_ioreq_server);
     set_to_dummy_if_null(ops, mem_sharing_op);
     set_to_dummy_if_null(ops, apic);
-    set_to_dummy_if_null(ops, platform_op);
     set_to_dummy_if_null(ops, machine_memory_map);
     set_to_dummy_if_null(ops, domain_memory_map);
     set_to_dummy_if_null(ops, mmu_update);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 4180f3b..da8d287 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1335,6 +1335,75 @@ static int flask_deassign_dtdevice(struct domain *d, const char *dtpath)
 }
 #endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE */
 
+static int flask_platform_op(uint32_t op)
+{
+    switch ( op )
+    {
+#ifdef CONFIG_X86
+    /* These operations have their own XSM hooks */
+    case XENPF_cpu_online:
+    case XENPF_cpu_offline:
+    case XENPF_cpu_hotadd:
+    case XENPF_mem_hotadd:
+        return 0;
+#endif
+
+    case XENPF_settime32:
+    case XENPF_settime64:
+        return domain_has_xen(current->domain, XEN__SETTIME);
+
+    case XENPF_add_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_ADD);
+
+    case XENPF_del_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_DEL);
+
+    case XENPF_read_memtype:
+        return domain_has_xen(current->domain, XEN__MTRR_READ);
+
+    case XENPF_microcode_update:
+        return domain_has_xen(current->domain, XEN__MICROCODE);
+
+    case XENPF_platform_quirk:
+        return domain_has_xen(current->domain, XEN__QUIRK);
+
+    case XENPF_firmware_info:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
+    case XENPF_efi_runtime_call:
+        return domain_has_xen(current->domain, XEN__FIRMWARE);
+
+    case XENPF_enter_acpi_sleep:
+        return domain_has_xen(current->domain, XEN__SLEEP);
+
+    case XENPF_change_freq:
+        return domain_has_xen(current->domain, XEN__FREQUENCY);
+
+    case XENPF_getidletime:
+        return domain_has_xen(current->domain, XEN__GETIDLE);
+
+    case XENPF_set_processor_pminfo:
+    case XENPF_core_parking:
+        return domain_has_xen(current->domain, XEN__PM_OP);
+
+    case XENPF_get_cpu_version:
+    case XENPF_get_cpuinfo:
+        return domain_has_xen(current->domain, XEN__GETCPUINFO);
+
+    case XENPF_resource_op:
+        return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
+                                    XEN2__RESOURCE_OP, NULL);
+
+    case XENPF_get_symbol:
+        return avc_has_perm(domain_sid(current->domain), SECINITSID_XEN,
+                            SECCLASS_XEN2, XEN2__GET_SYMBOL, NULL);
+
+    default:
+        printk("flask_platform_op: Unknown op %d\n", op);
+        return -EPERM;
+    }
+}
+
 #ifdef CONFIG_X86
 static int flask_do_mca(void)
 {
@@ -1473,75 +1542,6 @@ static int flask_apic(struct domain *d, int cmd)
     return domain_has_xen(d, perm);
 }
 
-static int flask_platform_op(uint32_t op)
-{
-    switch ( op )
-    {
-#ifdef CONFIG_X86
-    /* These operations have their own XSM hooks */
-    case XENPF_cpu_online:
-    case XENPF_cpu_offline:
-    case XENPF_cpu_hotadd:
-    case XENPF_mem_hotadd:
-        return 0;
-#endif
-
-    case XENPF_settime32:
-    case XENPF_settime64:
-        return domain_has_xen(current->domain, XEN__SETTIME);
-
-    case XENPF_add_memtype:
-        return domain_has_xen(current->domain, XEN__MTRR_ADD);
-
-    case XENPF_del_memtype:
-        return domain_has_xen(current->domain, XEN__MTRR_DEL);
-
-    case XENPF_read_memtype:
-        return domain_has_xen(current->domain, XEN__MTRR_READ);
-
-    case XENPF_microcode_update:
-        return domain_has_xen(current->domain, XEN__MICROCODE);
-
-    case XENPF_platform_quirk:
-        return domain_has_xen(current->domain, XEN__QUIRK);
-
-    case XENPF_firmware_info:
-        return domain_has_xen(current->domain, XEN__FIRMWARE);
-
-    case XENPF_efi_runtime_call:
-        return domain_has_xen(current->domain, XEN__FIRMWARE);
-
-    case XENPF_enter_acpi_sleep:
-        return domain_has_xen(current->domain, XEN__SLEEP);
-
-    case XENPF_change_freq:
-        return domain_has_xen(current->domain, XEN__FREQUENCY);
-
-    case XENPF_getidletime:
-        return domain_has_xen(current->domain, XEN__GETIDLE);
-
-    case XENPF_set_processor_pminfo:
-    case XENPF_core_parking:
-        return domain_has_xen(current->domain, XEN__PM_OP);
-
-    case XENPF_get_cpu_version:
-    case XENPF_get_cpuinfo:
-        return domain_has_xen(current->domain, XEN__GETCPUINFO);
-
-    case XENPF_resource_op:
-        return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
-                                    XEN2__RESOURCE_OP, NULL);
-
-    case XENPF_get_symbol:
-        return avc_has_perm(domain_sid(current->domain), SECINITSID_XEN,
-                            SECCLASS_XEN2, XEN2__GET_SYMBOL, NULL);
-
-    default:
-        printk("flask_platform_op: Unknown op %d\n", op);
-        return -EPERM;
-    }
-}
-
 static int flask_machine_memory_map(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
@@ -1738,6 +1738,7 @@ static struct xsm_operations flask_ops = {
     .deassign_dtdevice = flask_deassign_dtdevice,
 #endif
 
+    .platform_op = flask_platform_op,
 #ifdef CONFIG_X86
     .do_mca = flask_do_mca,
     .shadow_control = flask_shadow_control,
@@ -1748,7 +1749,6 @@ static struct xsm_operations flask_ops = {
     .hvm_ioreq_server = flask_hvm_ioreq_server,
     .mem_sharing_op = flask_mem_sharing_op,
     .apic = flask_apic,
-    .platform_op = flask_platform_op,
     .machine_memory_map = flask_machine_memory_map,
     .domain_memory_map = flask_domain_memory_map,
     .mmu_update = flask_mmu_update,
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:51:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51: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 1a23W5-00054l-Og; Thu, 26 Nov 2015 20:51:45 +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 1a23W3-00054U-PR
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:43 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	74/C4-28221-FD077565; Thu, 26 Nov 2015 20:51:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1448571099!6616179!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19007 invoked from network); 26 Nov 2015 20:51:40 -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;
	26 Nov 2015 20:51:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vz-0003Dt-Nn
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vz-0000nG-LV
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:39 +0000
Date: Thu, 26 Nov 2015 20:51:39 +0000
Message-Id: <E1a23Vz-0000nG-LV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: move ticks conversions
	function declarations to the 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 ca550063e38da59a3b529f31a64f0d8787b61876
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Nov 12 17:46:04 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 11:26:51 2015 +0000

    xen/arm: move ticks conversions function declarations to the header file
    
    This is just a cleanup, not required at the moment.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c      |    3 ---
 xen/include/asm-arm/time.h |    3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index c8e2a12..629feb4 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -29,9 +29,6 @@
 #include <asm/vgic.h>
 #include <asm/regs.h>
 
-extern s_time_t ticks_to_ns(uint64_t ticks);
-extern uint64_t ns_to_ticks(s_time_t ns);
-
 /*
  * Check if regs is allowed access, user_gate is tail end of a
  * CNTKCTL_EL1_ bit name which gates user access
diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h
index d755f36..f99d6e8 100644
--- a/xen/include/asm-arm/time.h
+++ b/xen/include/asm-arm/time.h
@@ -37,6 +37,9 @@ extern void __cpuinit init_timer_interrupt(void);
 /* Counter value at boot time */
 extern uint64_t boot_count;
 
+extern s_time_t ticks_to_ns(uint64_t ticks);
+extern uint64_t ns_to_ticks(s_time_t ns);
+
 void preinit_xen_time(void);
 
 #endif /* __ARM_TIME_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 Thu Nov 26 20:51:45 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51: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 1a23W5-00054l-Og; Thu, 26 Nov 2015 20:51:45 +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 1a23W3-00054U-PR
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:43 +0000
Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id
	74/C4-28221-FD077565; Thu, 26 Nov 2015 20:51:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1448571099!6616179!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19007 invoked from network); 26 Nov 2015 20:51:40 -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;
	26 Nov 2015 20:51:40 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vz-0003Dt-Nn
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Vz-0000nG-LV
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:39 +0000
Date: Thu, 26 Nov 2015 20:51:39 +0000
Message-Id: <E1a23Vz-0000nG-LV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: move ticks conversions
	function declarations to the 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 ca550063e38da59a3b529f31a64f0d8787b61876
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Thu Nov 12 17:46:04 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 11:26:51 2015 +0000

    xen/arm: move ticks conversions function declarations to the header file
    
    This is just a cleanup, not required at the moment.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Reviewed-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c      |    3 ---
 xen/include/asm-arm/time.h |    3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index c8e2a12..629feb4 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -29,9 +29,6 @@
 #include <asm/vgic.h>
 #include <asm/regs.h>
 
-extern s_time_t ticks_to_ns(uint64_t ticks);
-extern uint64_t ns_to_ticks(s_time_t ns);
-
 /*
  * Check if regs is allowed access, user_gate is tail end of a
  * CNTKCTL_EL1_ bit name which gates user access
diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h
index d755f36..f99d6e8 100644
--- a/xen/include/asm-arm/time.h
+++ b/xen/include/asm-arm/time.h
@@ -37,6 +37,9 @@ extern void __cpuinit init_timer_interrupt(void);
 /* Counter value at boot time */
 extern uint64_t boot_count;
 
+extern s_time_t ticks_to_ns(uint64_t ticks);
+extern uint64_t ns_to_ticks(s_time_t ns);
+
 void preinit_xen_time(void);
 
 #endif /* __ARM_TIME_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 Thu Nov 26 20:51:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23WD-00055q-Tj; Thu, 26 Nov 2015 20:51: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 1a23WC-00055a-Ah
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:52 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	83/2C-08347-7E077565; Thu, 26 Nov 2015 20:51:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1448571110!6585947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 43891 invoked from network); 26 Nov 2015 20:51:51 -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;
	26 Nov 2015 20:51:51 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WA-0003E1-3v
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WA-0000ng-1r
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:50 +0000
Date: Thu, 26 Nov 2015 20:51:50 +0000
Message-Id: <E1a23WA-0000ng-1r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Implement correctly
	ITARGETSR0 - ITARGETSR7 read-only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc50de883847c1ebc7c8b4d73283d9be6c4df38e
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:38 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 11:56:35 2015 +0000

    xen/arm: vgic-v2: Implement correctly ITARGETSR0 - ITARGETSR7 read-only
    
    Each ITARGETSR register are 4-byte wide and the offset is in byte.
    
    The current implementation is computing the end of the range wrongly
    resulting to emulate only ITARGETSR{0,1} read-only. The rest will be
    treated as read-write.
    
    As 8 registers should be read-only, the end of the range should be
    ITARGETSR + (4 * 8) - 1.
    
    For convenience introduce ITARGETSR7 and ITARGETSR8.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vgic-v2.c    |    4 ++--
 xen/include/asm-arm/gic.h |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index f7d784b..041291c 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -338,11 +338,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
                v, r, gicd_reg - GICD_ICACTIVER);
         return 0;
 
-    case GICD_ITARGETSR ... GICD_ITARGETSR + 7:
+    case GICD_ITARGETSR ... GICD_ITARGETSR7:
         /* SGI/PPI target is read only */
         goto write_ignore_32;
 
-    case GICD_ITARGETSR + 8 ... GICD_ITARGETSRN:
+    case GICD_ITARGETSR8 ... GICD_ITARGETSRN:
     {
         /* unsigned long needed for find_next_bit */
         unsigned long target;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 0116481..3064d1c 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -42,6 +42,8 @@
 #define GICD_IPRIORITYR (0x400)
 #define GICD_IPRIORITYRN (0x7F8)
 #define GICD_ITARGETSR  (0x800)
+#define GICD_ITARGETSR7 (0x81C)
+#define GICD_ITARGETSR8 (0x820)
 #define GICD_ITARGETSRN (0xBF8)
 #define GICD_ICFGR      (0xC00)
 #define GICD_ICFGRN     (0xCFC)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:51:53 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:51:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23WD-00055q-Tj; Thu, 26 Nov 2015 20:51: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 1a23WC-00055a-Ah
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:52 +0000
Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id
	83/2C-08347-7E077565; Thu, 26 Nov 2015 20:51:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1448571110!6585947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 43891 invoked from network); 26 Nov 2015 20:51:51 -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;
	26 Nov 2015 20:51:51 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WA-0003E1-3v
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WA-0000ng-1r
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:51:50 +0000
Date: Thu, 26 Nov 2015 20:51:50 +0000
Message-Id: <E1a23WA-0000ng-1r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Implement correctly
	ITARGETSR0 - ITARGETSR7 read-only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc50de883847c1ebc7c8b4d73283d9be6c4df38e
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:38 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 11:56:35 2015 +0000

    xen/arm: vgic-v2: Implement correctly ITARGETSR0 - ITARGETSR7 read-only
    
    Each ITARGETSR register are 4-byte wide and the offset is in byte.
    
    The current implementation is computing the end of the range wrongly
    resulting to emulate only ITARGETSR{0,1} read-only. The rest will be
    treated as read-write.
    
    As 8 registers should be read-only, the end of the range should be
    ITARGETSR + (4 * 8) - 1.
    
    For convenience introduce ITARGETSR7 and ITARGETSR8.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vgic-v2.c    |    4 ++--
 xen/include/asm-arm/gic.h |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index f7d784b..041291c 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -338,11 +338,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
                v, r, gicd_reg - GICD_ICACTIVER);
         return 0;
 
-    case GICD_ITARGETSR ... GICD_ITARGETSR + 7:
+    case GICD_ITARGETSR ... GICD_ITARGETSR7:
         /* SGI/PPI target is read only */
         goto write_ignore_32;
 
-    case GICD_ITARGETSR + 8 ... GICD_ITARGETSRN:
+    case GICD_ITARGETSR8 ... GICD_ITARGETSRN:
     {
         /* unsigned long needed for find_next_bit */
         unsigned long target;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 0116481..3064d1c 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -42,6 +42,8 @@
 #define GICD_IPRIORITYR (0x400)
 #define GICD_IPRIORITYRN (0x7F8)
 #define GICD_ITARGETSR  (0x800)
+#define GICD_ITARGETSR7 (0x81C)
+#define GICD_ITARGETSR8 (0x820)
 #define GICD_ITARGETSRN (0xBF8)
 #define GICD_ICFGR      (0xC00)
 #define GICD_ICFGRN     (0xCFC)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:52:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:52: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 1a23WO-00057T-23; Thu, 26 Nov 2015 20:52:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WM-00057D-NB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:02 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	3C/8E-29649-1F077565; Thu, 26 Nov 2015 20:52:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448571120!6937998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60884 invoked from network); 26 Nov 2015 20:52:01 -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;
	26 Nov 2015 20:52:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WK-0003E9-CP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WK-0000o6-B3
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:00 +0000
Date: Thu, 26 Nov 2015 20:52:00 +0000
Message-Id: <E1a23WK-0000o6-B3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Handle correctly
	byte write in ITARGETSR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9f5e16e7659fc9abb64c1d50dfea0dcfdb49b01b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:39 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:18 2015 +0000

    xen/arm: vgic-v2: Handle correctly byte write in ITARGETSR
    
    During a store, the byte is always in the low part of the register (i.e
    [0:7]).
    
    We are incorrectly masking the register by using a shift of the byte
    offset in the ITARGETSR while the byte is alwasy in r[0:7]. This will
    result in a target list equal to 0 which is ignored by the emulation.
    
    Because of that the guest will only be able to modify the first byte in
    each ITARGETSR.
    
    Furthermore, the body of the loop is retrieving the old target list
    using the index of the byte.
    
    To avoid modifying too much the loop, shift the byte stored to the correct
    offset.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vgic-v2.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 041291c..486e497 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -353,11 +353,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* 8-bit vcpu mask for this domain */
         BUG_ON(v->domain->max_vcpus > 8);
         target = (1 << v->domain->max_vcpus) - 1;
-        if ( dabt.size == 2 )
-            target = target | (target << 8) | (target << 16) | (target << 24);
+        target = target | (target << 8) | (target << 16) | (target << 24);
+        if ( dabt.size == DABT_WORD )
+            target &= r;
         else
-            target = (target << (8 * (gicd_reg & 0x3)));
-        target &= r;
+            target &= (r << (8 * (gicd_reg & 0x3)));
         /* ignore zero writes */
         if ( !target )
             goto write_ignore;
@@ -381,7 +381,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
             if ( new_target != old_target )
             {
-                irq = gicd_reg - GICD_ITARGETSR + (i / 8);
+                irq = (gicd_reg & ~0x3) - GICD_ITARGETSR + (i / 8);
                 v_target = v->domain->vcpu[new_target];
                 v_old = v->domain->vcpu[old_target];
                 vgic_migrate_irq(v_old, v_target, irq);
@@ -393,7 +393,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
                                              DABT_WORD)] = target;
         else
             vgic_byte_write(&rank->v2.itargets[REG_RANK_INDEX(8,
-                      gicd_reg - GICD_ITARGETSR, DABT_WORD)], target, gicd_reg);
+                      gicd_reg - GICD_ITARGETSR, DABT_WORD)], r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
         return 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 Thu Nov 26 20:52:04 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:52: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 1a23WO-00057T-23; Thu, 26 Nov 2015 20:52:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WM-00057D-NB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:02 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	3C/8E-29649-1F077565; Thu, 26 Nov 2015 20:52:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448571120!6937998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 60884 invoked from network); 26 Nov 2015 20:52:01 -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;
	26 Nov 2015 20:52:01 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WK-0003E9-CP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WK-0000o6-B3
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:00 +0000
Date: Thu, 26 Nov 2015 20:52:00 +0000
Message-Id: <E1a23WK-0000o6-B3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Handle correctly
	byte write in ITARGETSR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9f5e16e7659fc9abb64c1d50dfea0dcfdb49b01b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:39 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:18 2015 +0000

    xen/arm: vgic-v2: Handle correctly byte write in ITARGETSR
    
    During a store, the byte is always in the low part of the register (i.e
    [0:7]).
    
    We are incorrectly masking the register by using a shift of the byte
    offset in the ITARGETSR while the byte is alwasy in r[0:7]. This will
    result in a target list equal to 0 which is ignored by the emulation.
    
    Because of that the guest will only be able to modify the first byte in
    each ITARGETSR.
    
    Furthermore, the body of the loop is retrieving the old target list
    using the index of the byte.
    
    To avoid modifying too much the loop, shift the byte stored to the correct
    offset.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vgic-v2.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 041291c..486e497 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -353,11 +353,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* 8-bit vcpu mask for this domain */
         BUG_ON(v->domain->max_vcpus > 8);
         target = (1 << v->domain->max_vcpus) - 1;
-        if ( dabt.size == 2 )
-            target = target | (target << 8) | (target << 16) | (target << 24);
+        target = target | (target << 8) | (target << 16) | (target << 24);
+        if ( dabt.size == DABT_WORD )
+            target &= r;
         else
-            target = (target << (8 * (gicd_reg & 0x3)));
-        target &= r;
+            target &= (r << (8 * (gicd_reg & 0x3)));
         /* ignore zero writes */
         if ( !target )
             goto write_ignore;
@@ -381,7 +381,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
             if ( new_target != old_target )
             {
-                irq = gicd_reg - GICD_ITARGETSR + (i / 8);
+                irq = (gicd_reg & ~0x3) - GICD_ITARGETSR + (i / 8);
                 v_target = v->domain->vcpu[new_target];
                 v_old = v->domain->vcpu[old_target];
                 vgic_migrate_irq(v_old, v_target, irq);
@@ -393,7 +393,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
                                              DABT_WORD)] = target;
         else
             vgic_byte_write(&rank->v2.itargets[REG_RANK_INDEX(8,
-                      gicd_reg - GICD_ITARGETSR, DABT_WORD)], target, gicd_reg);
+                      gicd_reg - GICD_ITARGETSR, DABT_WORD)], r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
         return 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 Thu Nov 26 20:52:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:52: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 1a23WY-000590-7D; Thu, 26 Nov 2015 20:52: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 1a23WX-00058o-9r
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:13 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	E3/DE-03235-CF077565; Thu, 26 Nov 2015 20:52:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448571130!6810023!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2877 invoked from network); 26 Nov 2015 20:52:11 -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;
	26 Nov 2015 20:52:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WU-0003Ek-Mj
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WU-0000oi-Ks
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:10 +0000
Date: Thu, 26 Nov 2015 20:52:10 +0000
Message-Id: <E1a23WU-0000oi-Ks@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Don't ignore a write
	in ITARGETSR if one field is 0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e99e162b8f9e6f4e75c16585d958a58b7aba333e
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:40 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:25 2015 +0000

    xen/arm: vgic-v2: Don't ignore a write in ITARGETSR if one field is 0
    
    The current implementation ignores the whole write if one of the field is
    0. Although, based on the spec (4.3.12 IHI 0048B.b), 0 is a valid value
    when:
        - The interrupt is not wired in the distributor. From the Xen
        point of view, it means that the corresponding bit is not set in
        d->arch.vgic.allocated_irqs.
        - The user wants to disable the IRQ forwarding in the distributor.
        I.e the IRQ stays pending in the distributor and never received by
        the guest.
    
    Implementing the later will require more work in Xen because we always
    assume the interrupt is forwarded to a valid vCPU. So for now, ignore
    any field where the value is 0.
    
    The emulation of the write access of ITARGETSR has been reworked and
    moved to a new function because it would have been difficult to
    implement properly the behavior with the current code.
    
    The new implementation is breaking the register in 4 distinct bytes. For
    each byte, it will check the validity of the target list, find the new
    target, migrate the interrupt and store the value if necessary.
    
    In the new implementation there is nearly no distinction of the access
    size to avoid having too many different path which is harder to test.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c |  145 +++++++++++++++++++++++++++++++++--------------
 1 files changed, 102 insertions(+), 43 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 486e497..ad2ea0a 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -57,6 +57,98 @@ void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
     vgic_v2_hw.aliased_offset = aliased_offset;
 }
 
+#define NR_TARGETS_PER_ITARGETSR    4U
+#define NR_BITS_PER_TARGET  (32U / NR_TARGETS_PER_ITARGETSR)
+
+/*
+ * Store an ITARGETSR register. This function only deals with ITARGETSR8
+ * and onwards.
+ *
+ * Note the offset will be aligned to the appropriate boundary.
+ */
+static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
+                                 unsigned int offset, uint32_t itargetsr)
+{
+    unsigned int i;
+    unsigned int regidx = REG_RANK_INDEX(8, offset, DABT_WORD);
+    unsigned int virq;
+
+    ASSERT(spin_is_locked(&rank->lock));
+
+    /*
+     * The ITARGETSR0-7, used for SGIs/PPIs, are implemented RO in the
+     * emulation and should never call this function.
+     *
+     * They all live in the first rank.
+     */
+    BUILD_BUG_ON(NR_INTERRUPT_PER_RANK != 32);
+    ASSERT(rank->index >= 1);
+
+    offset &= INTERRUPT_RANK_MASK;
+    offset &= ~(NR_TARGETS_PER_ITARGETSR - 1);
+
+    virq = rank->index * NR_INTERRUPT_PER_RANK + offset;
+
+    for ( i = 0; i < NR_TARGETS_PER_ITARGETSR; i++, offset++, virq++ )
+    {
+        unsigned int new_target, old_target;
+        uint8_t new_mask, old_mask;
+
+        /*
+         * Don't need to mask as we rely on new_mask to fit for only one
+         * target.
+         */
+        BUILD_BUG_ON((sizeof (new_mask) * 8) != NR_BITS_PER_TARGET);
+
+        new_mask = itargetsr >> (i * NR_BITS_PER_TARGET);
+        old_mask = vgic_byte_read(rank->v2.itargets[regidx], i);
+
+        /*
+         * SPIs are using the 1-N model (see 1.4.3 in ARM IHI 0048B).
+         * While the interrupt could be set pending to all the vCPUs in
+         * target list, it's not guaranteed by the spec.
+         * For simplicity, always route the vIRQ to the first interrupt
+         * in the target list
+         */
+        new_target = ffs(new_mask);
+        old_target = ffs(old_mask);
+
+        /* The current target should always be valid */
+        ASSERT(old_target && (old_target <= d->max_vcpus));
+
+        /*
+         * Ignore the write request for this interrupt if the new target
+         * is invalid.
+         * XXX: From the spec, if the target list is not valid, the
+         * interrupt should be ignored (i.e not forwarded to the
+         * guest).
+         */
+        if ( !new_target || (new_target > d->max_vcpus) )
+        {
+            gprintk(XENLOG_WARNING,
+                   "No valid vCPU found for vIRQ%u in the target list (%#x). Skip it\n",
+                   virq, new_mask);
+            continue;
+        }
+
+        /* The vCPU ID always starts from 0 */
+        new_target--;
+        old_target--;
+
+        /* Only migrate the vIRQ if the target vCPU has changed */
+        if ( new_target != old_target )
+        {
+            vgic_migrate_irq(d->vcpu[old_target],
+                             d->vcpu[new_target],
+                             virq);
+        }
+
+        /* Bit corresponding to unimplemented CPU is write-ignore. */
+        new_mask &= (1 << d->max_vcpus) - 1;
+        vgic_byte_write(&rank->v2.itargets[regidx], new_mask, i);
+    }
+}
+
 static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
                                    register_t *r, void *priv)
 {
@@ -344,56 +436,23 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case GICD_ITARGETSR8 ... GICD_ITARGETSRN:
     {
-        /* unsigned long needed for find_next_bit */
-        unsigned long target;
-        int i;
+        uint32_t itargetsr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
-        /* 8-bit vcpu mask for this domain */
-        BUG_ON(v->domain->max_vcpus > 8);
-        target = (1 << v->domain->max_vcpus) - 1;
-        target = target | (target << 8) | (target << 16) | (target << 24);
+        vgic_lock_rank(v, rank, flags);
         if ( dabt.size == DABT_WORD )
-            target &= r;
+            itargetsr = r;
         else
-            target &= (r << (8 * (gicd_reg & 0x3)));
-        /* ignore zero writes */
-        if ( !target )
-            goto write_ignore;
-        /* For word reads ignore writes where any single byte is zero */
-        if ( dabt.size == 2 &&
-            !((target & 0xff) && (target & (0xff << 8)) &&
-             (target & (0xff << 16)) && (target & (0xff << 24))))
-            goto write_ignore;
-        vgic_lock_rank(v, rank, flags);
-        i = 0;
-        while ( (i = find_next_bit(&target, 32, i)) < 32 )
         {
-            unsigned int irq, new_target, old_target;
-            unsigned long old_target_mask;
-            struct vcpu *v_target, *v_old;
-
-            new_target = i % 8;
-            old_target_mask = vgic_byte_read(rank->v2.itargets[REG_RANK_INDEX(8,
-                                             gicd_reg - GICD_ITARGETSR, DABT_WORD)], i/8);
-            old_target = find_first_bit(&old_target_mask, 8);
-
-            if ( new_target != old_target )
-            {
-                irq = (gicd_reg & ~0x3) - GICD_ITARGETSR + (i / 8);
-                v_target = v->domain->vcpu[new_target];
-                v_old = v->domain->vcpu[old_target];
-                vgic_migrate_irq(v_old, v_target, irq);
-            }
-            i += 8 - new_target;
+            itargetsr = rank->v2.itargets[REG_RANK_INDEX(8,
+                                    gicd_reg - GICD_ITARGETSR,
+                                    DABT_WORD)];
+            vgic_byte_write(&itargetsr, r, gicd_reg);
         }
-        if ( dabt.size == DABT_WORD )
-            rank->v2.itargets[REG_RANK_INDEX(8, gicd_reg - GICD_ITARGETSR,
-                                             DABT_WORD)] = target;
-        else
-            vgic_byte_write(&rank->v2.itargets[REG_RANK_INDEX(8,
-                      gicd_reg - GICD_ITARGETSR, DABT_WORD)], r, gicd_reg);
+        vgic_store_itargetsr(v->domain, rank, gicd_reg - GICD_ITARGETSR,
+                             itargetsr);
         vgic_unlock_rank(v, rank, flags);
         return 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 Thu Nov 26 20:52:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:52: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 1a23WY-000590-7D; Thu, 26 Nov 2015 20:52: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 1a23WX-00058o-9r
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:13 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	E3/DE-03235-CF077565; Thu, 26 Nov 2015 20:52:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1448571130!6810023!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2877 invoked from network); 26 Nov 2015 20:52:11 -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;
	26 Nov 2015 20:52:11 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WU-0003Ek-Mj
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23WU-0000oi-Ks
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:10 +0000
Date: Thu, 26 Nov 2015 20:52:10 +0000
Message-Id: <E1a23WU-0000oi-Ks@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Don't ignore a write
	in ITARGETSR if one field is 0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e99e162b8f9e6f4e75c16585d958a58b7aba333e
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:40 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:25 2015 +0000

    xen/arm: vgic-v2: Don't ignore a write in ITARGETSR if one field is 0
    
    The current implementation ignores the whole write if one of the field is
    0. Although, based on the spec (4.3.12 IHI 0048B.b), 0 is a valid value
    when:
        - The interrupt is not wired in the distributor. From the Xen
        point of view, it means that the corresponding bit is not set in
        d->arch.vgic.allocated_irqs.
        - The user wants to disable the IRQ forwarding in the distributor.
        I.e the IRQ stays pending in the distributor and never received by
        the guest.
    
    Implementing the later will require more work in Xen because we always
    assume the interrupt is forwarded to a valid vCPU. So for now, ignore
    any field where the value is 0.
    
    The emulation of the write access of ITARGETSR has been reworked and
    moved to a new function because it would have been difficult to
    implement properly the behavior with the current code.
    
    The new implementation is breaking the register in 4 distinct bytes. For
    each byte, it will check the validity of the target list, find the new
    target, migrate the interrupt and store the value if necessary.
    
    In the new implementation there is nearly no distinction of the access
    size to avoid having too many different path which is harder to test.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c |  145 +++++++++++++++++++++++++++++++++--------------
 1 files changed, 102 insertions(+), 43 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 486e497..ad2ea0a 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -57,6 +57,98 @@ void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
     vgic_v2_hw.aliased_offset = aliased_offset;
 }
 
+#define NR_TARGETS_PER_ITARGETSR    4U
+#define NR_BITS_PER_TARGET  (32U / NR_TARGETS_PER_ITARGETSR)
+
+/*
+ * Store an ITARGETSR register. This function only deals with ITARGETSR8
+ * and onwards.
+ *
+ * Note the offset will be aligned to the appropriate boundary.
+ */
+static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
+                                 unsigned int offset, uint32_t itargetsr)
+{
+    unsigned int i;
+    unsigned int regidx = REG_RANK_INDEX(8, offset, DABT_WORD);
+    unsigned int virq;
+
+    ASSERT(spin_is_locked(&rank->lock));
+
+    /*
+     * The ITARGETSR0-7, used for SGIs/PPIs, are implemented RO in the
+     * emulation and should never call this function.
+     *
+     * They all live in the first rank.
+     */
+    BUILD_BUG_ON(NR_INTERRUPT_PER_RANK != 32);
+    ASSERT(rank->index >= 1);
+
+    offset &= INTERRUPT_RANK_MASK;
+    offset &= ~(NR_TARGETS_PER_ITARGETSR - 1);
+
+    virq = rank->index * NR_INTERRUPT_PER_RANK + offset;
+
+    for ( i = 0; i < NR_TARGETS_PER_ITARGETSR; i++, offset++, virq++ )
+    {
+        unsigned int new_target, old_target;
+        uint8_t new_mask, old_mask;
+
+        /*
+         * Don't need to mask as we rely on new_mask to fit for only one
+         * target.
+         */
+        BUILD_BUG_ON((sizeof (new_mask) * 8) != NR_BITS_PER_TARGET);
+
+        new_mask = itargetsr >> (i * NR_BITS_PER_TARGET);
+        old_mask = vgic_byte_read(rank->v2.itargets[regidx], i);
+
+        /*
+         * SPIs are using the 1-N model (see 1.4.3 in ARM IHI 0048B).
+         * While the interrupt could be set pending to all the vCPUs in
+         * target list, it's not guaranteed by the spec.
+         * For simplicity, always route the vIRQ to the first interrupt
+         * in the target list
+         */
+        new_target = ffs(new_mask);
+        old_target = ffs(old_mask);
+
+        /* The current target should always be valid */
+        ASSERT(old_target && (old_target <= d->max_vcpus));
+
+        /*
+         * Ignore the write request for this interrupt if the new target
+         * is invalid.
+         * XXX: From the spec, if the target list is not valid, the
+         * interrupt should be ignored (i.e not forwarded to the
+         * guest).
+         */
+        if ( !new_target || (new_target > d->max_vcpus) )
+        {
+            gprintk(XENLOG_WARNING,
+                   "No valid vCPU found for vIRQ%u in the target list (%#x). Skip it\n",
+                   virq, new_mask);
+            continue;
+        }
+
+        /* The vCPU ID always starts from 0 */
+        new_target--;
+        old_target--;
+
+        /* Only migrate the vIRQ if the target vCPU has changed */
+        if ( new_target != old_target )
+        {
+            vgic_migrate_irq(d->vcpu[old_target],
+                             d->vcpu[new_target],
+                             virq);
+        }
+
+        /* Bit corresponding to unimplemented CPU is write-ignore. */
+        new_mask &= (1 << d->max_vcpus) - 1;
+        vgic_byte_write(&rank->v2.itargets[regidx], new_mask, i);
+    }
+}
+
 static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
                                    register_t *r, void *priv)
 {
@@ -344,56 +436,23 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case GICD_ITARGETSR8 ... GICD_ITARGETSRN:
     {
-        /* unsigned long needed for find_next_bit */
-        unsigned long target;
-        int i;
+        uint32_t itargetsr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
-        /* 8-bit vcpu mask for this domain */
-        BUG_ON(v->domain->max_vcpus > 8);
-        target = (1 << v->domain->max_vcpus) - 1;
-        target = target | (target << 8) | (target << 16) | (target << 24);
+        vgic_lock_rank(v, rank, flags);
         if ( dabt.size == DABT_WORD )
-            target &= r;
+            itargetsr = r;
         else
-            target &= (r << (8 * (gicd_reg & 0x3)));
-        /* ignore zero writes */
-        if ( !target )
-            goto write_ignore;
-        /* For word reads ignore writes where any single byte is zero */
-        if ( dabt.size == 2 &&
-            !((target & 0xff) && (target & (0xff << 8)) &&
-             (target & (0xff << 16)) && (target & (0xff << 24))))
-            goto write_ignore;
-        vgic_lock_rank(v, rank, flags);
-        i = 0;
-        while ( (i = find_next_bit(&target, 32, i)) < 32 )
         {
-            unsigned int irq, new_target, old_target;
-            unsigned long old_target_mask;
-            struct vcpu *v_target, *v_old;
-
-            new_target = i % 8;
-            old_target_mask = vgic_byte_read(rank->v2.itargets[REG_RANK_INDEX(8,
-                                             gicd_reg - GICD_ITARGETSR, DABT_WORD)], i/8);
-            old_target = find_first_bit(&old_target_mask, 8);
-
-            if ( new_target != old_target )
-            {
-                irq = (gicd_reg & ~0x3) - GICD_ITARGETSR + (i / 8);
-                v_target = v->domain->vcpu[new_target];
-                v_old = v->domain->vcpu[old_target];
-                vgic_migrate_irq(v_old, v_target, irq);
-            }
-            i += 8 - new_target;
+            itargetsr = rank->v2.itargets[REG_RANK_INDEX(8,
+                                    gicd_reg - GICD_ITARGETSR,
+                                    DABT_WORD)];
+            vgic_byte_write(&itargetsr, r, gicd_reg);
         }
-        if ( dabt.size == DABT_WORD )
-            rank->v2.itargets[REG_RANK_INDEX(8, gicd_reg - GICD_ITARGETSR,
-                                             DABT_WORD)] = target;
-        else
-            vgic_byte_write(&rank->v2.itargets[REG_RANK_INDEX(8,
-                      gicd_reg - GICD_ITARGETSR, DABT_WORD)], r, gicd_reg);
+        vgic_store_itargetsr(v->domain, rank, gicd_reg - GICD_ITARGETSR,
+                             itargetsr);
         vgic_unlock_rank(v, rank, flags);
         return 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 Thu Nov 26 20:52:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:52: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 1a23Wo-0005BR-G8; Thu, 26 Nov 2015 20:52:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Wn-0005BJ-Cj
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:29 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	BA/E9-10678-C0177565; Thu, 26 Nov 2015 20:52:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1448571146!6322525!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23791 invoked from network); 26 Nov 2015 20:52:27 -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;
	26 Nov 2015 20:52:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Wk-0003Ex-7R
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Wj-0000p7-V8
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:26 +0000
Date: Thu, 26 Nov 2015 20:52:25 +0000
Message-Id: <E1a23Wj-0000p7-V8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Optimize the way to
	store the target vCPU in the rank
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5d495f4349b56b5fc5a95a1918dd8b1c960b210b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:41 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:26 2015 +0000

    xen/arm: vgic: Optimize the way to store the target vCPU in the rank
    
    Xen is currently directly storing the value of GICD_ITARGETSR register
    (for GICv2) and GICD_IROUTER (for GICv3) in the rank. This makes the
    emulation of the registers access very simple but makes the code to get
    the target vCPU for a given vIRQ more complex.
    
    While the target vCPU of an vIRQ is retrieved every time an vIRQ is
    injected to the guest, the access to the register occurs less often.
    
    So the data structure should be optimized for the most common case
    rather than the inverse.
    
    This patch introduces the usage of an array to store the target vCPU for
    every interrupt in the rank. This will make the code to get the target
    very quick. The emulation code will now have to generate the GICD_ITARGETSR
    and GICD_IROUTER register for read access and split it to store in a
    convenient way.
    
    With the new way to store the target vCPU, the structure vgic_irq_rank
    is shrunk down from 320 bytes to 92 bytes. This is saving about 228
    bytes of memory allocated separately per vCPU.
    
    Note that with these changes, any read to those register will list only
    the target vCPU used by Xen. As the spec is not clear whether this is a
    valid choice or not, OSes which have a different interpretation of the
    spec (i.e OSes which perform read-modify-write operations on these
    registers) may not boot anymore on Xen. Although, I think this is fair
    trade between memory usage in Xen (1KB less on a domain using 4 vCPUs
    with no SPIs) and a strict interpretation of the spec (though all the
    cases are not clearly defined).
    
    Furthermore, the implementation of the callback get_target_vcpu is now
    exactly the same. Consolidate the implementation in the common vGIC code
    and drop the callback.
    
    Finally take the opportunity to fix coding style and replace "irq" by
    "virq" to make clear that we are dealing with virtual IRQ in section we
    are modifying.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c     |   86 ++++++++++++-------------------
 xen/arch/arm/vgic-v3.c     |  119 +++++++++++++++++++++++--------------------
 xen/arch/arm/vgic.c        |   45 +++++++++++++----
 xen/include/asm-arm/vgic.h |   18 ++-----
 4 files changed, 137 insertions(+), 131 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index ad2ea0a..62159bf 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -61,8 +61,31 @@ void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
 #define NR_BITS_PER_TARGET  (32U / NR_TARGETS_PER_ITARGETSR)
 
 /*
- * Store an ITARGETSR register. This function only deals with ITARGETSR8
- * and onwards.
+ * Fetch an ITARGETSR register based on the offset from ITARGETSR0. Only
+ * one vCPU will be listed for a given vIRQ.
+ *
+ * Note the offset will be aligned to the appropriate boundary.
+ */
+static uint32_t vgic_fetch_itargetsr(struct vgic_irq_rank *rank,
+                                     unsigned int offset)
+{
+    uint32_t reg = 0;
+    unsigned int i;
+
+    ASSERT(spin_is_locked(&rank->lock));
+
+    offset &= INTERRUPT_RANK_MASK;
+    offset &= ~(NR_TARGETS_PER_ITARGETSR - 1);
+
+    for ( i = 0; i < NR_TARGETS_PER_ITARGETSR; i++, offset++ )
+        reg |= (1 << rank->vcpu[offset]) << (i * NR_BITS_PER_TARGET);
+
+    return reg;
+}
+
+/*
+ * Store an ITARGETSR register in a convenient way and migrate the vIRQ
+ * if necessary. This function only deals with ITARGETSR8 and onwards.
  *
  * Note the offset will be aligned to the appropriate boundary.
  */
@@ -70,7 +93,6 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
                                  unsigned int offset, uint32_t itargetsr)
 {
     unsigned int i;
-    unsigned int regidx = REG_RANK_INDEX(8, offset, DABT_WORD);
     unsigned int virq;
 
     ASSERT(spin_is_locked(&rank->lock));
@@ -92,7 +114,7 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
     for ( i = 0; i < NR_TARGETS_PER_ITARGETSR; i++, offset++, virq++ )
     {
         unsigned int new_target, old_target;
-        uint8_t new_mask, old_mask;
+        uint8_t new_mask;
 
         /*
          * Don't need to mask as we rely on new_mask to fit for only one
@@ -101,7 +123,6 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
         BUILD_BUG_ON((sizeof (new_mask) * 8) != NR_BITS_PER_TARGET);
 
         new_mask = itargetsr >> (i * NR_BITS_PER_TARGET);
-        old_mask = vgic_byte_read(rank->v2.itargets[regidx], i);
 
         /*
          * SPIs are using the 1-N model (see 1.4.3 in ARM IHI 0048B).
@@ -111,10 +132,6 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
          * in the target list
          */
         new_target = ffs(new_mask);
-        old_target = ffs(old_mask);
-
-        /* The current target should always be valid */
-        ASSERT(old_target && (old_target <= d->max_vcpus));
 
         /*
          * Ignore the write request for this interrupt if the new target
@@ -133,7 +150,8 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
 
         /* The vCPU ID always starts from 0 */
         new_target--;
-        old_target--;
+
+        old_target = rank->vcpu[offset];
 
         /* Only migrate the vIRQ if the target vCPU has changed */
         if ( new_target != old_target )
@@ -143,9 +161,7 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
                              virq);
         }
 
-        /* Bit corresponding to unimplemented CPU is write-ignore. */
-        new_mask &= (1 << d->max_vcpus) - 1;
-        vgic_byte_write(&rank->v2.itargets[regidx], new_mask, i);
+        rank->vcpu[offset] = new_target;
     }
 }
 
@@ -225,8 +241,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->v2.itargets[REG_RANK_INDEX(8, gicd_reg - GICD_ITARGETSR,
-                                              DABT_WORD)];
+        *r = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
         if ( dabt.size == DABT_BYTE )
             *r = vgic_byte_read(*r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
@@ -446,9 +461,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
             itargetsr = r;
         else
         {
-            itargetsr = rank->v2.itargets[REG_RANK_INDEX(8,
-                                    gicd_reg - GICD_ITARGETSR,
-                                    DABT_WORD)];
+            itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
             vgic_byte_write(&itargetsr, r, gicd_reg);
         }
         vgic_store_itargetsr(v->domain, rank, gicd_reg - GICD_ITARGETSR,
@@ -553,43 +566,16 @@ static const struct mmio_handler_ops vgic_v2_distr_mmio_handler = {
     .write = vgic_v2_distr_mmio_write,
 };
 
-static struct vcpu *vgic_v2_get_target_vcpu(struct vcpu *v, unsigned int irq)
-{
-    unsigned long target;
-    struct vcpu *v_target;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
-    ASSERT(spin_is_locked(&rank->lock));
-
-    target = vgic_byte_read(rank->v2.itargets[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], irq & 0x3);
-
-    /* 1-N SPI should be delivered as pending to all the vcpus in the
-     * mask, but here we just return the first vcpu for simplicity and
-     * because it would be too slow to do otherwise. */
-    target = find_first_bit(&target, 8);
-    ASSERT(target >= 0 && target < v->domain->max_vcpus);
-    v_target = v->domain->vcpu[target];
-    return v_target;
-}
-
 static int vgic_v2_vcpu_init(struct vcpu *v)
 {
-    int i;
-
-    /* For SGI and PPI the target is always this CPU */
-    for ( i = 0 ; i < 8 ; i++ )
-        v->arch.vgic.private_irqs->v2.itargets[i] =
-              (1<<(v->vcpu_id+0))
-            | (1<<(v->vcpu_id+8))
-            | (1<<(v->vcpu_id+16))
-            | (1<<(v->vcpu_id+24));
+    /* Nothing specific to initialize for this driver */
 
     return 0;
 }
 
 static int vgic_v2_domain_init(struct domain *d)
 {
-    int i, ret;
+    int ret;
     paddr_t cbase, csize;
     paddr_t vbase;
 
@@ -635,11 +621,6 @@ static int vgic_v2_domain_init(struct domain *d)
     if ( ret )
         return ret;
 
-    /* By default deliver to CPU0 */
-    for ( i = 0; i < DOMAIN_NR_RANKS(d); i++ )
-        memset(d->arch.vgic.shared_irqs[i].v2.itargets, 0x1,
-               sizeof(d->arch.vgic.shared_irqs[i].v2.itargets));
-
     register_mmio_handler(d, &vgic_v2_distr_mmio_handler, d->arch.vgic.dbase,
                           PAGE_SIZE, NULL);
 
@@ -649,7 +630,6 @@ static int vgic_v2_domain_init(struct domain *d)
 static const struct vgic_ops vgic_v2_ops = {
     .vcpu_init   = vgic_v2_vcpu_init,
     .domain_init = vgic_v2_domain_init,
-    .get_target_vcpu = vgic_v2_get_target_vcpu,
     .max_vcpus = 8,
 };
 
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index b5249ff..4f976d4 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -89,18 +89,72 @@ static struct vcpu *vgic_v3_irouter_to_vcpu(struct domain *d, uint64_t irouter)
     return d->vcpu[vcpu_id];
 }
 
-static struct vcpu *vgic_v3_get_target_vcpu(struct vcpu *v, unsigned int irq)
-{
-    struct vcpu *v_target;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
+#define NR_BYTES_PER_IROUTER 8U
 
+/*
+ * Fetch an IROUTER register based on the offset from IROUTER0. Only one
+ * vCPU will be listed for a given vIRQ.
+ *
+ * Note the offset will be aligned to the appropriate  boundary.
+ */
+static uint64_t vgic_fetch_irouter(struct vgic_irq_rank *rank,
+                                   unsigned int offset)
+{
     ASSERT(spin_is_locked(&rank->lock));
 
-    v_target = vgic_v3_irouter_to_vcpu(v->domain, rank->v3.irouter[irq % 32]);
+    /* There is exactly 1 vIRQ per IROUTER */
+    offset /= NR_BYTES_PER_IROUTER;
 
-    ASSERT(v_target != NULL);
+    /* Get the index in the rank */
+    offset &= INTERRUPT_RANK_MASK;
 
-    return v_target;
+    return vcpuid_to_vaffinity(rank->vcpu[offset]);
+}
+
+/*
+ * Store an IROUTER register in a convenient way and migrate the vIRQ
+ * if necessary. This function only deals with IROUTER32 and onwards.
+ *
+ * Note the offset will be aligned to the appropriate boundary.
+ */
+static void vgic_store_irouter(struct domain *d, struct vgic_irq_rank *rank,
+                               unsigned int offset, uint64_t irouter)
+{
+    struct vcpu *new_vcpu, *old_vcpu;
+    unsigned int virq;
+
+    /* There is 1 vIRQ per IROUTER */
+    virq = offset / NR_BYTES_PER_IROUTER;
+
+    /*
+     * The IROUTER0-31, used for SGIs/PPIs, are reserved and should
+     * never call this function.
+     */
+    ASSERT(virq >= 32);
+
+    /* Get the index in the rank */
+    offset &= virq & INTERRUPT_RANK_MASK;
+
+    new_vcpu = vgic_v3_irouter_to_vcpu(d, irouter);
+    old_vcpu = d->vcpu[rank->vcpu[offset]];
+
+    /*
+     * From the spec (see 8.9.13 in IHI 0069A), any write with an
+     * invalid vCPU will lead to the interrupt being ignored.
+     *
+     * But the current code to inject an IRQ is not able to cope with
+     * invalid vCPU. So for now, just ignore the write.
+     *
+     * TODO: Respect the spec
+     */
+    if ( !new_vcpu )
+        return;
+
+    /* Only migrate the IRQ if the target vCPU has changed */
+    if ( new_vcpu != old_vcpu )
+        vgic_migrate_irq(old_vcpu, new_vcpu, virq);
+
+    rank->vcpu[offset] = new_vcpu->vcpu_id;
 }
 
 static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
@@ -726,8 +780,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->v3.irouter[REG_RANK_INDEX(64,
-                              (gicd_reg - GICD_IROUTER), DABT_DOUBLE_WORD)];
+        *r = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_NSACR ... GICD_NSACRN:
@@ -812,8 +865,6 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     struct hsr_dabt dabt = info->dabt;
     struct vgic_irq_rank *rank;
     unsigned long flags;
-    uint64_t new_irouter, old_irouter;
-    struct vcpu *old_vcpu, *new_vcpu;
     int gicd_reg = (int)(info->gpa - v->domain->arch.vgic.dbase);
 
     perfc_incr(vgicd_writes);
@@ -881,32 +932,8 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto write_ignore;
-        new_irouter = r;
         vgic_lock_rank(v, rank, flags);
-
-        old_irouter = rank->v3.irouter[REG_RANK_INDEX(64,
-                                       (gicd_reg - GICD_IROUTER),
-                                       DABT_DOUBLE_WORD)];
-        old_vcpu = vgic_v3_irouter_to_vcpu(v->domain, old_irouter);
-        new_vcpu = vgic_v3_irouter_to_vcpu(v->domain, new_irouter);
-
-        if ( !new_vcpu )
-        {
-            printk(XENLOG_G_DEBUG
-                   "%pv: vGICD: wrong irouter at offset %#08x val %#"PRIregister,
-                   v, gicd_reg, r);
-            vgic_unlock_rank(v, rank, flags);
-            /*
-             * TODO: Don't inject a fault to the guest when the MPIDR is
-             * not valid. From the spec, the interrupt should be
-             * ignored.
-             */
-            return 0;
-        }
-        rank->v3.irouter[REG_RANK_INDEX(64, (gicd_reg - GICD_IROUTER),
-                         DABT_DOUBLE_WORD)] = new_irouter;
-        if ( old_vcpu != new_vcpu )
-            vgic_migrate_irq(old_vcpu, new_vcpu, (gicd_reg - GICD_IROUTER)/8);
+        vgic_store_irouter(v->domain, rank, gicd_reg - GICD_IROUTER, r);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_NSACR ... GICD_NSACRN:
@@ -1036,7 +1063,6 @@ static const struct mmio_handler_ops vgic_distr_mmio_handler = {
 static int vgic_v3_vcpu_init(struct vcpu *v)
 {
     int i;
-    uint64_t affinity;
     paddr_t rdist_base;
     struct vgic_rdist_region *region;
     unsigned int last_cpu;
@@ -1045,15 +1071,6 @@ static int vgic_v3_vcpu_init(struct vcpu *v)
     struct domain *d = v->domain;
     uint32_t rdist_stride = d->arch.vgic.rdist_stride;
 
-    /* For SGI and PPI the target is always this CPU */
-    affinity = (MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 3) << 32 |
-                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 2) << 16 |
-                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 1) << 8  |
-                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 0));
-
-    for ( i = 0 ; i < 32 ; i++ )
-        v->arch.vgic.private_irqs->v3.irouter[i] = affinity;
-
     /*
      * Find the region where the re-distributor lives. For this purpose,
      * we look one region ahead as we have only the first CPU in hand.
@@ -1098,7 +1115,7 @@ static int vgic_v3_vcpu_init(struct vcpu *v)
 
 static int vgic_v3_domain_init(struct domain *d)
 {
-    int i, idx;
+    int i;
 
     /*
      * Domain 0 gets the hardware address.
@@ -1150,13 +1167,6 @@ static int vgic_v3_domain_init(struct domain *d)
         d->arch.vgic.rdist_regions[0].first_cpu = 0;
     }
 
-    /* By default deliver to CPU0 */
-    for ( i = 0; i < DOMAIN_NR_RANKS(d); i++ )
-    {
-        for ( idx = 0; idx < 32; idx++ )
-            d->arch.vgic.shared_irqs[i].v3.irouter[idx] = 0;
-    }
-
     /* Register mmio handle for the Distributor */
     register_mmio_handler(d, &vgic_distr_mmio_handler, d->arch.vgic.dbase,
                           SZ_64K, NULL);
@@ -1182,7 +1192,6 @@ static int vgic_v3_domain_init(struct domain *d)
 static const struct vgic_ops v3_ops = {
     .vcpu_init   = vgic_v3_vcpu_init,
     .domain_init = vgic_v3_domain_init,
-    .get_target_vcpu  = vgic_v3_get_target_vcpu,
     .emulate_sysreg  = vgic_v3_emulate_sysreg,
     /*
      * We use both AFF1 and AFF0 in (v)MPIDR. Thus, the max number of CPU
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 7bb4570..531ce5d 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -68,11 +68,24 @@ static void vgic_init_pending_irq(struct pending_irq *p, unsigned int virq)
     p->irq = virq;
 }
 
-static void vgic_rank_init(struct vgic_irq_rank *rank, uint8_t index)
+static void vgic_rank_init(struct vgic_irq_rank *rank, uint8_t index,
+                           unsigned int vcpu)
 {
+    unsigned int i;
+
+    /*
+     * Make sure that the type chosen to store the target is able to
+     * store an VCPU ID between 0 and the maximum of virtual CPUs
+     * supported.
+     */
+    BUILD_BUG_ON((1 << (sizeof(rank->vcpu[0]) * 8)) < MAX_VIRT_CPUS);
+
     spin_lock_init(&rank->lock);
 
     rank->index = index;
+
+    for ( i = 0; i < NR_INTERRUPT_PER_RANK; i++ )
+        rank->vcpu[i] = vcpu;
 }
 
 int domain_vgic_init(struct domain *d, unsigned int nr_spis)
@@ -121,8 +134,9 @@ int domain_vgic_init(struct domain *d, unsigned int nr_spis)
     for (i=0; i<d->arch.vgic.nr_spis; i++)
         vgic_init_pending_irq(&d->arch.vgic.pending_irqs[i], i + 32);
 
+    /* SPIs are routed to VCPU0 by default */
     for ( i = 0; i < DOMAIN_NR_RANKS(d); i++ )
-        vgic_rank_init(&d->arch.vgic.shared_irqs[i], i + 1);
+        vgic_rank_init(&d->arch.vgic.shared_irqs[i], i + 1, 0);
 
     ret = d->arch.vgic.handler->domain_init(d);
     if ( ret )
@@ -176,7 +190,8 @@ int vcpu_vgic_init(struct vcpu *v)
     if ( v->arch.vgic.private_irqs == NULL )
       return -ENOMEM;
 
-    vgic_rank_init(v->arch.vgic.private_irqs, 0);
+    /* SGIs/PPIs are always routed to this VCPU */
+    vgic_rank_init(v->arch.vgic.private_irqs, 0, v->vcpu_id);
 
     v->domain->arch.vgic.handler->vcpu_init(v);
 
@@ -197,17 +212,27 @@ int vcpu_vgic_free(struct vcpu *v)
     return 0;
 }
 
+/* The function should be called by rank lock taken. */
+static struct vcpu *__vgic_get_target_vcpu(struct vcpu *v, unsigned int virq)
+{
+    struct vgic_irq_rank *rank = vgic_rank_irq(v, virq);
+
+    ASSERT(spin_is_locked(&rank->lock));
+
+    return v->domain->vcpu[rank->vcpu[virq & INTERRUPT_RANK_MASK]];
+}
+
 /* takes the rank lock */
-struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int irq)
+struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int virq)
 {
-    struct domain *d = v->domain;
     struct vcpu *v_target;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
+    struct vgic_irq_rank *rank = vgic_rank_irq(v, virq);
     unsigned long flags;
 
     vgic_lock_rank(v, rank, flags);
-    v_target = d->arch.vgic.handler->get_target_vcpu(v, irq);
+    v_target = __vgic_get_target_vcpu(v, virq);
     vgic_unlock_rank(v, rank, flags);
+
     return v_target;
 }
 
@@ -286,7 +311,6 @@ void arch_move_irqs(struct vcpu *v)
 
 void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n)
 {
-    struct domain *d = v->domain;
     const unsigned long mask = r;
     struct pending_irq *p;
     unsigned int irq;
@@ -296,7 +320,7 @@ void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n)
 
     while ( (i = find_next_bit(&mask, 32, i)) < 32 ) {
         irq = i + (32 * n);
-        v_target = d->arch.vgic.handler->get_target_vcpu(v, irq);
+        v_target = __vgic_get_target_vcpu(v, irq);
         p = irq_to_pending(v_target, irq);
         clear_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
         gic_remove_from_queues(v_target, irq);
@@ -312,7 +336,6 @@ void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n)
 
 void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
 {
-    struct domain *d = v->domain;
     const unsigned long mask = r;
     struct pending_irq *p;
     unsigned int irq;
@@ -322,7 +345,7 @@ void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
 
     while ( (i = find_next_bit(&mask, 32, i)) < 32 ) {
         irq = i + (32 * n);
-        v_target = d->arch.vgic.handler->get_target_vcpu(v, irq);
+        v_target = __vgic_get_target_vcpu(v, irq);
         p = irq_to_pending(v_target, irq);
         set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
         spin_lock_irqsave(&v_target->arch.vgic.lock, flags);
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index cb51a9e..a1ef429 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -104,14 +104,11 @@ struct vgic_irq_rank {
         uint32_t ipriorityr[8];
     };
 
-    union {
-        struct {
-            uint32_t itargets[8];
-        }v2;
-        struct {
-            uint64_t irouter[32];
-        }v3;
-    };
+    /*
+     * It's more convenient to store a target VCPU per vIRQ
+     * than the register ITARGETSR/IROUTER itself
+     */
+    uint8_t vcpu[32];
 };
 
 struct sgi_target {
@@ -130,9 +127,6 @@ struct vgic_ops {
     int (*vcpu_init)(struct vcpu *v);
     /* Domain specific initialization of vGIC */
     int (*domain_init)(struct domain *d);
-    /* Get the target vcpu for a given virq. The rank lock is already taken
-     * when calling this. */
-    struct vcpu *(*get_target_vcpu)(struct vcpu *v, unsigned int irq);
     /* vGIC sysreg emulation */
     int (*emulate_sysreg)(struct cpu_user_regs *regs, union hsr hsr);
     /* Maximum number of vCPU supported */
@@ -205,7 +199,7 @@ enum gic_sgi_mode;
 extern int domain_vgic_init(struct domain *d, unsigned int nr_spis);
 extern void domain_vgic_free(struct domain *d);
 extern int vcpu_vgic_init(struct vcpu *v);
-extern struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int irq);
+extern struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int virq);
 extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int virq);
 extern void vgic_vcpu_inject_spi(struct domain *d, unsigned int virq);
 extern void vgic_clear_pending_irqs(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:52:30 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:52: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 1a23Wo-0005BR-G8; Thu, 26 Nov 2015 20:52:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Wn-0005BJ-Cj
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:29 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	BA/E9-10678-C0177565; Thu, 26 Nov 2015 20:52:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1448571146!6322525!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23791 invoked from network); 26 Nov 2015 20:52:27 -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;
	26 Nov 2015 20:52:27 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Wk-0003Ex-7R
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Wj-0000p7-V8
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:26 +0000
Date: Thu, 26 Nov 2015 20:52:25 +0000
Message-Id: <E1a23Wj-0000p7-V8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Optimize the way to
	store the target vCPU in the rank
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5d495f4349b56b5fc5a95a1918dd8b1c960b210b
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:41 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:26 2015 +0000

    xen/arm: vgic: Optimize the way to store the target vCPU in the rank
    
    Xen is currently directly storing the value of GICD_ITARGETSR register
    (for GICv2) and GICD_IROUTER (for GICv3) in the rank. This makes the
    emulation of the registers access very simple but makes the code to get
    the target vCPU for a given vIRQ more complex.
    
    While the target vCPU of an vIRQ is retrieved every time an vIRQ is
    injected to the guest, the access to the register occurs less often.
    
    So the data structure should be optimized for the most common case
    rather than the inverse.
    
    This patch introduces the usage of an array to store the target vCPU for
    every interrupt in the rank. This will make the code to get the target
    very quick. The emulation code will now have to generate the GICD_ITARGETSR
    and GICD_IROUTER register for read access and split it to store in a
    convenient way.
    
    With the new way to store the target vCPU, the structure vgic_irq_rank
    is shrunk down from 320 bytes to 92 bytes. This is saving about 228
    bytes of memory allocated separately per vCPU.
    
    Note that with these changes, any read to those register will list only
    the target vCPU used by Xen. As the spec is not clear whether this is a
    valid choice or not, OSes which have a different interpretation of the
    spec (i.e OSes which perform read-modify-write operations on these
    registers) may not boot anymore on Xen. Although, I think this is fair
    trade between memory usage in Xen (1KB less on a domain using 4 vCPUs
    with no SPIs) and a strict interpretation of the spec (though all the
    cases are not clearly defined).
    
    Furthermore, the implementation of the callback get_target_vcpu is now
    exactly the same. Consolidate the implementation in the common vGIC code
    and drop the callback.
    
    Finally take the opportunity to fix coding style and replace "irq" by
    "virq" to make clear that we are dealing with virtual IRQ in section we
    are modifying.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c     |   86 ++++++++++++-------------------
 xen/arch/arm/vgic-v3.c     |  119 +++++++++++++++++++++++--------------------
 xen/arch/arm/vgic.c        |   45 +++++++++++++----
 xen/include/asm-arm/vgic.h |   18 ++-----
 4 files changed, 137 insertions(+), 131 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index ad2ea0a..62159bf 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -61,8 +61,31 @@ void vgic_v2_setup_hw(paddr_t dbase, paddr_t cbase, paddr_t csize,
 #define NR_BITS_PER_TARGET  (32U / NR_TARGETS_PER_ITARGETSR)
 
 /*
- * Store an ITARGETSR register. This function only deals with ITARGETSR8
- * and onwards.
+ * Fetch an ITARGETSR register based on the offset from ITARGETSR0. Only
+ * one vCPU will be listed for a given vIRQ.
+ *
+ * Note the offset will be aligned to the appropriate boundary.
+ */
+static uint32_t vgic_fetch_itargetsr(struct vgic_irq_rank *rank,
+                                     unsigned int offset)
+{
+    uint32_t reg = 0;
+    unsigned int i;
+
+    ASSERT(spin_is_locked(&rank->lock));
+
+    offset &= INTERRUPT_RANK_MASK;
+    offset &= ~(NR_TARGETS_PER_ITARGETSR - 1);
+
+    for ( i = 0; i < NR_TARGETS_PER_ITARGETSR; i++, offset++ )
+        reg |= (1 << rank->vcpu[offset]) << (i * NR_BITS_PER_TARGET);
+
+    return reg;
+}
+
+/*
+ * Store an ITARGETSR register in a convenient way and migrate the vIRQ
+ * if necessary. This function only deals with ITARGETSR8 and onwards.
  *
  * Note the offset will be aligned to the appropriate boundary.
  */
@@ -70,7 +93,6 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
                                  unsigned int offset, uint32_t itargetsr)
 {
     unsigned int i;
-    unsigned int regidx = REG_RANK_INDEX(8, offset, DABT_WORD);
     unsigned int virq;
 
     ASSERT(spin_is_locked(&rank->lock));
@@ -92,7 +114,7 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
     for ( i = 0; i < NR_TARGETS_PER_ITARGETSR; i++, offset++, virq++ )
     {
         unsigned int new_target, old_target;
-        uint8_t new_mask, old_mask;
+        uint8_t new_mask;
 
         /*
          * Don't need to mask as we rely on new_mask to fit for only one
@@ -101,7 +123,6 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
         BUILD_BUG_ON((sizeof (new_mask) * 8) != NR_BITS_PER_TARGET);
 
         new_mask = itargetsr >> (i * NR_BITS_PER_TARGET);
-        old_mask = vgic_byte_read(rank->v2.itargets[regidx], i);
 
         /*
          * SPIs are using the 1-N model (see 1.4.3 in ARM IHI 0048B).
@@ -111,10 +132,6 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
          * in the target list
          */
         new_target = ffs(new_mask);
-        old_target = ffs(old_mask);
-
-        /* The current target should always be valid */
-        ASSERT(old_target && (old_target <= d->max_vcpus));
 
         /*
          * Ignore the write request for this interrupt if the new target
@@ -133,7 +150,8 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
 
         /* The vCPU ID always starts from 0 */
         new_target--;
-        old_target--;
+
+        old_target = rank->vcpu[offset];
 
         /* Only migrate the vIRQ if the target vCPU has changed */
         if ( new_target != old_target )
@@ -143,9 +161,7 @@ static void vgic_store_itargetsr(struct domain *d, struct vgic_irq_rank *rank,
                              virq);
         }
 
-        /* Bit corresponding to unimplemented CPU is write-ignore. */
-        new_mask &= (1 << d->max_vcpus) - 1;
-        vgic_byte_write(&rank->v2.itargets[regidx], new_mask, i);
+        rank->vcpu[offset] = new_target;
     }
 }
 
@@ -225,8 +241,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->v2.itargets[REG_RANK_INDEX(8, gicd_reg - GICD_ITARGETSR,
-                                              DABT_WORD)];
+        *r = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
         if ( dabt.size == DABT_BYTE )
             *r = vgic_byte_read(*r, gicd_reg);
         vgic_unlock_rank(v, rank, flags);
@@ -446,9 +461,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
             itargetsr = r;
         else
         {
-            itargetsr = rank->v2.itargets[REG_RANK_INDEX(8,
-                                    gicd_reg - GICD_ITARGETSR,
-                                    DABT_WORD)];
+            itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
             vgic_byte_write(&itargetsr, r, gicd_reg);
         }
         vgic_store_itargetsr(v->domain, rank, gicd_reg - GICD_ITARGETSR,
@@ -553,43 +566,16 @@ static const struct mmio_handler_ops vgic_v2_distr_mmio_handler = {
     .write = vgic_v2_distr_mmio_write,
 };
 
-static struct vcpu *vgic_v2_get_target_vcpu(struct vcpu *v, unsigned int irq)
-{
-    unsigned long target;
-    struct vcpu *v_target;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
-    ASSERT(spin_is_locked(&rank->lock));
-
-    target = vgic_byte_read(rank->v2.itargets[REG_RANK_INDEX(8,
-                                              irq, DABT_WORD)], irq & 0x3);
-
-    /* 1-N SPI should be delivered as pending to all the vcpus in the
-     * mask, but here we just return the first vcpu for simplicity and
-     * because it would be too slow to do otherwise. */
-    target = find_first_bit(&target, 8);
-    ASSERT(target >= 0 && target < v->domain->max_vcpus);
-    v_target = v->domain->vcpu[target];
-    return v_target;
-}
-
 static int vgic_v2_vcpu_init(struct vcpu *v)
 {
-    int i;
-
-    /* For SGI and PPI the target is always this CPU */
-    for ( i = 0 ; i < 8 ; i++ )
-        v->arch.vgic.private_irqs->v2.itargets[i] =
-              (1<<(v->vcpu_id+0))
-            | (1<<(v->vcpu_id+8))
-            | (1<<(v->vcpu_id+16))
-            | (1<<(v->vcpu_id+24));
+    /* Nothing specific to initialize for this driver */
 
     return 0;
 }
 
 static int vgic_v2_domain_init(struct domain *d)
 {
-    int i, ret;
+    int ret;
     paddr_t cbase, csize;
     paddr_t vbase;
 
@@ -635,11 +621,6 @@ static int vgic_v2_domain_init(struct domain *d)
     if ( ret )
         return ret;
 
-    /* By default deliver to CPU0 */
-    for ( i = 0; i < DOMAIN_NR_RANKS(d); i++ )
-        memset(d->arch.vgic.shared_irqs[i].v2.itargets, 0x1,
-               sizeof(d->arch.vgic.shared_irqs[i].v2.itargets));
-
     register_mmio_handler(d, &vgic_v2_distr_mmio_handler, d->arch.vgic.dbase,
                           PAGE_SIZE, NULL);
 
@@ -649,7 +630,6 @@ static int vgic_v2_domain_init(struct domain *d)
 static const struct vgic_ops vgic_v2_ops = {
     .vcpu_init   = vgic_v2_vcpu_init,
     .domain_init = vgic_v2_domain_init,
-    .get_target_vcpu = vgic_v2_get_target_vcpu,
     .max_vcpus = 8,
 };
 
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index b5249ff..4f976d4 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -89,18 +89,72 @@ static struct vcpu *vgic_v3_irouter_to_vcpu(struct domain *d, uint64_t irouter)
     return d->vcpu[vcpu_id];
 }
 
-static struct vcpu *vgic_v3_get_target_vcpu(struct vcpu *v, unsigned int irq)
-{
-    struct vcpu *v_target;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
+#define NR_BYTES_PER_IROUTER 8U
 
+/*
+ * Fetch an IROUTER register based on the offset from IROUTER0. Only one
+ * vCPU will be listed for a given vIRQ.
+ *
+ * Note the offset will be aligned to the appropriate  boundary.
+ */
+static uint64_t vgic_fetch_irouter(struct vgic_irq_rank *rank,
+                                   unsigned int offset)
+{
     ASSERT(spin_is_locked(&rank->lock));
 
-    v_target = vgic_v3_irouter_to_vcpu(v->domain, rank->v3.irouter[irq % 32]);
+    /* There is exactly 1 vIRQ per IROUTER */
+    offset /= NR_BYTES_PER_IROUTER;
 
-    ASSERT(v_target != NULL);
+    /* Get the index in the rank */
+    offset &= INTERRUPT_RANK_MASK;
 
-    return v_target;
+    return vcpuid_to_vaffinity(rank->vcpu[offset]);
+}
+
+/*
+ * Store an IROUTER register in a convenient way and migrate the vIRQ
+ * if necessary. This function only deals with IROUTER32 and onwards.
+ *
+ * Note the offset will be aligned to the appropriate boundary.
+ */
+static void vgic_store_irouter(struct domain *d, struct vgic_irq_rank *rank,
+                               unsigned int offset, uint64_t irouter)
+{
+    struct vcpu *new_vcpu, *old_vcpu;
+    unsigned int virq;
+
+    /* There is 1 vIRQ per IROUTER */
+    virq = offset / NR_BYTES_PER_IROUTER;
+
+    /*
+     * The IROUTER0-31, used for SGIs/PPIs, are reserved and should
+     * never call this function.
+     */
+    ASSERT(virq >= 32);
+
+    /* Get the index in the rank */
+    offset &= virq & INTERRUPT_RANK_MASK;
+
+    new_vcpu = vgic_v3_irouter_to_vcpu(d, irouter);
+    old_vcpu = d->vcpu[rank->vcpu[offset]];
+
+    /*
+     * From the spec (see 8.9.13 in IHI 0069A), any write with an
+     * invalid vCPU will lead to the interrupt being ignored.
+     *
+     * But the current code to inject an IRQ is not able to cope with
+     * invalid vCPU. So for now, just ignore the write.
+     *
+     * TODO: Respect the spec
+     */
+    if ( !new_vcpu )
+        return;
+
+    /* Only migrate the IRQ if the target vCPU has changed */
+    if ( new_vcpu != old_vcpu )
+        vgic_migrate_irq(old_vcpu, new_vcpu, virq);
+
+    rank->vcpu[offset] = new_vcpu->vcpu_id;
 }
 
 static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
@@ -726,8 +780,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->v3.irouter[REG_RANK_INDEX(64,
-                              (gicd_reg - GICD_IROUTER), DABT_DOUBLE_WORD)];
+        *r = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_NSACR ... GICD_NSACRN:
@@ -812,8 +865,6 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     struct hsr_dabt dabt = info->dabt;
     struct vgic_irq_rank *rank;
     unsigned long flags;
-    uint64_t new_irouter, old_irouter;
-    struct vcpu *old_vcpu, *new_vcpu;
     int gicd_reg = (int)(info->gpa - v->domain->arch.vgic.dbase);
 
     perfc_incr(vgicd_writes);
@@ -881,32 +932,8 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto write_ignore;
-        new_irouter = r;
         vgic_lock_rank(v, rank, flags);
-
-        old_irouter = rank->v3.irouter[REG_RANK_INDEX(64,
-                                       (gicd_reg - GICD_IROUTER),
-                                       DABT_DOUBLE_WORD)];
-        old_vcpu = vgic_v3_irouter_to_vcpu(v->domain, old_irouter);
-        new_vcpu = vgic_v3_irouter_to_vcpu(v->domain, new_irouter);
-
-        if ( !new_vcpu )
-        {
-            printk(XENLOG_G_DEBUG
-                   "%pv: vGICD: wrong irouter at offset %#08x val %#"PRIregister,
-                   v, gicd_reg, r);
-            vgic_unlock_rank(v, rank, flags);
-            /*
-             * TODO: Don't inject a fault to the guest when the MPIDR is
-             * not valid. From the spec, the interrupt should be
-             * ignored.
-             */
-            return 0;
-        }
-        rank->v3.irouter[REG_RANK_INDEX(64, (gicd_reg - GICD_IROUTER),
-                         DABT_DOUBLE_WORD)] = new_irouter;
-        if ( old_vcpu != new_vcpu )
-            vgic_migrate_irq(old_vcpu, new_vcpu, (gicd_reg - GICD_IROUTER)/8);
+        vgic_store_irouter(v->domain, rank, gicd_reg - GICD_IROUTER, r);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_NSACR ... GICD_NSACRN:
@@ -1036,7 +1063,6 @@ static const struct mmio_handler_ops vgic_distr_mmio_handler = {
 static int vgic_v3_vcpu_init(struct vcpu *v)
 {
     int i;
-    uint64_t affinity;
     paddr_t rdist_base;
     struct vgic_rdist_region *region;
     unsigned int last_cpu;
@@ -1045,15 +1071,6 @@ static int vgic_v3_vcpu_init(struct vcpu *v)
     struct domain *d = v->domain;
     uint32_t rdist_stride = d->arch.vgic.rdist_stride;
 
-    /* For SGI and PPI the target is always this CPU */
-    affinity = (MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 3) << 32 |
-                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 2) << 16 |
-                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 1) << 8  |
-                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 0));
-
-    for ( i = 0 ; i < 32 ; i++ )
-        v->arch.vgic.private_irqs->v3.irouter[i] = affinity;
-
     /*
      * Find the region where the re-distributor lives. For this purpose,
      * we look one region ahead as we have only the first CPU in hand.
@@ -1098,7 +1115,7 @@ static int vgic_v3_vcpu_init(struct vcpu *v)
 
 static int vgic_v3_domain_init(struct domain *d)
 {
-    int i, idx;
+    int i;
 
     /*
      * Domain 0 gets the hardware address.
@@ -1150,13 +1167,6 @@ static int vgic_v3_domain_init(struct domain *d)
         d->arch.vgic.rdist_regions[0].first_cpu = 0;
     }
 
-    /* By default deliver to CPU0 */
-    for ( i = 0; i < DOMAIN_NR_RANKS(d); i++ )
-    {
-        for ( idx = 0; idx < 32; idx++ )
-            d->arch.vgic.shared_irqs[i].v3.irouter[idx] = 0;
-    }
-
     /* Register mmio handle for the Distributor */
     register_mmio_handler(d, &vgic_distr_mmio_handler, d->arch.vgic.dbase,
                           SZ_64K, NULL);
@@ -1182,7 +1192,6 @@ static int vgic_v3_domain_init(struct domain *d)
 static const struct vgic_ops v3_ops = {
     .vcpu_init   = vgic_v3_vcpu_init,
     .domain_init = vgic_v3_domain_init,
-    .get_target_vcpu  = vgic_v3_get_target_vcpu,
     .emulate_sysreg  = vgic_v3_emulate_sysreg,
     /*
      * We use both AFF1 and AFF0 in (v)MPIDR. Thus, the max number of CPU
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 7bb4570..531ce5d 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -68,11 +68,24 @@ static void vgic_init_pending_irq(struct pending_irq *p, unsigned int virq)
     p->irq = virq;
 }
 
-static void vgic_rank_init(struct vgic_irq_rank *rank, uint8_t index)
+static void vgic_rank_init(struct vgic_irq_rank *rank, uint8_t index,
+                           unsigned int vcpu)
 {
+    unsigned int i;
+
+    /*
+     * Make sure that the type chosen to store the target is able to
+     * store an VCPU ID between 0 and the maximum of virtual CPUs
+     * supported.
+     */
+    BUILD_BUG_ON((1 << (sizeof(rank->vcpu[0]) * 8)) < MAX_VIRT_CPUS);
+
     spin_lock_init(&rank->lock);
 
     rank->index = index;
+
+    for ( i = 0; i < NR_INTERRUPT_PER_RANK; i++ )
+        rank->vcpu[i] = vcpu;
 }
 
 int domain_vgic_init(struct domain *d, unsigned int nr_spis)
@@ -121,8 +134,9 @@ int domain_vgic_init(struct domain *d, unsigned int nr_spis)
     for (i=0; i<d->arch.vgic.nr_spis; i++)
         vgic_init_pending_irq(&d->arch.vgic.pending_irqs[i], i + 32);
 
+    /* SPIs are routed to VCPU0 by default */
     for ( i = 0; i < DOMAIN_NR_RANKS(d); i++ )
-        vgic_rank_init(&d->arch.vgic.shared_irqs[i], i + 1);
+        vgic_rank_init(&d->arch.vgic.shared_irqs[i], i + 1, 0);
 
     ret = d->arch.vgic.handler->domain_init(d);
     if ( ret )
@@ -176,7 +190,8 @@ int vcpu_vgic_init(struct vcpu *v)
     if ( v->arch.vgic.private_irqs == NULL )
       return -ENOMEM;
 
-    vgic_rank_init(v->arch.vgic.private_irqs, 0);
+    /* SGIs/PPIs are always routed to this VCPU */
+    vgic_rank_init(v->arch.vgic.private_irqs, 0, v->vcpu_id);
 
     v->domain->arch.vgic.handler->vcpu_init(v);
 
@@ -197,17 +212,27 @@ int vcpu_vgic_free(struct vcpu *v)
     return 0;
 }
 
+/* The function should be called by rank lock taken. */
+static struct vcpu *__vgic_get_target_vcpu(struct vcpu *v, unsigned int virq)
+{
+    struct vgic_irq_rank *rank = vgic_rank_irq(v, virq);
+
+    ASSERT(spin_is_locked(&rank->lock));
+
+    return v->domain->vcpu[rank->vcpu[virq & INTERRUPT_RANK_MASK]];
+}
+
 /* takes the rank lock */
-struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int irq)
+struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int virq)
 {
-    struct domain *d = v->domain;
     struct vcpu *v_target;
-    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
+    struct vgic_irq_rank *rank = vgic_rank_irq(v, virq);
     unsigned long flags;
 
     vgic_lock_rank(v, rank, flags);
-    v_target = d->arch.vgic.handler->get_target_vcpu(v, irq);
+    v_target = __vgic_get_target_vcpu(v, virq);
     vgic_unlock_rank(v, rank, flags);
+
     return v_target;
 }
 
@@ -286,7 +311,6 @@ void arch_move_irqs(struct vcpu *v)
 
 void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n)
 {
-    struct domain *d = v->domain;
     const unsigned long mask = r;
     struct pending_irq *p;
     unsigned int irq;
@@ -296,7 +320,7 @@ void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n)
 
     while ( (i = find_next_bit(&mask, 32, i)) < 32 ) {
         irq = i + (32 * n);
-        v_target = d->arch.vgic.handler->get_target_vcpu(v, irq);
+        v_target = __vgic_get_target_vcpu(v, irq);
         p = irq_to_pending(v_target, irq);
         clear_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
         gic_remove_from_queues(v_target, irq);
@@ -312,7 +336,6 @@ void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n)
 
 void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
 {
-    struct domain *d = v->domain;
     const unsigned long mask = r;
     struct pending_irq *p;
     unsigned int irq;
@@ -322,7 +345,7 @@ void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
 
     while ( (i = find_next_bit(&mask, 32, i)) < 32 ) {
         irq = i + (32 * n);
-        v_target = d->arch.vgic.handler->get_target_vcpu(v, irq);
+        v_target = __vgic_get_target_vcpu(v, irq);
         p = irq_to_pending(v_target, irq);
         set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
         spin_lock_irqsave(&v_target->arch.vgic.lock, flags);
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index cb51a9e..a1ef429 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -104,14 +104,11 @@ struct vgic_irq_rank {
         uint32_t ipriorityr[8];
     };
 
-    union {
-        struct {
-            uint32_t itargets[8];
-        }v2;
-        struct {
-            uint64_t irouter[32];
-        }v3;
-    };
+    /*
+     * It's more convenient to store a target VCPU per vIRQ
+     * than the register ITARGETSR/IROUTER itself
+     */
+    uint8_t vcpu[32];
 };
 
 struct sgi_target {
@@ -130,9 +127,6 @@ struct vgic_ops {
     int (*vcpu_init)(struct vcpu *v);
     /* Domain specific initialization of vGIC */
     int (*domain_init)(struct domain *d);
-    /* Get the target vcpu for a given virq. The rank lock is already taken
-     * when calling this. */
-    struct vcpu *(*get_target_vcpu)(struct vcpu *v, unsigned int irq);
     /* vGIC sysreg emulation */
     int (*emulate_sysreg)(struct cpu_user_regs *regs, union hsr hsr);
     /* Maximum number of vCPU supported */
@@ -205,7 +199,7 @@ enum gic_sgi_mode;
 extern int domain_vgic_init(struct domain *d, unsigned int nr_spis);
 extern void domain_vgic_free(struct domain *d);
 extern int vcpu_vgic_init(struct vcpu *v);
-extern struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int irq);
+extern struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int virq);
 extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int virq);
 extern void vgic_vcpu_inject_spi(struct domain *d, unsigned int virq);
 extern void vgic_clear_pending_irqs(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:52:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:52: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 1a23Wy-0005Cc-Lc; Thu, 26 Nov 2015 20:52: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 1a23Wx-0005CR-NB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:40 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	75/EF-23747-61177565; Thu, 26 Nov 2015 20:52:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1448571156!6860290!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21834 invoked from network); 26 Nov 2015 20:52:37 -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;
	26 Nov 2015 20:52:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Wu-0003F5-IZ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Wu-0000qQ-GP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:36 +0000
Date: Thu, 26 Nov 2015 20:52:36 +0000
Message-Id: <E1a23Wu-0000qQ-GP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Introduce helpers to
	extract/update/clear/set vGIC register ...
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 423e9ecdc26c4b40c8db1fcc63b3655463c29976
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:42 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:26 2015 +0000

    xen/arm: vgic: Introduce helpers to extract/update/clear/set vGIC register ...
    
    and use them in the vGIC emulation.
    
    The GIC registers may support different access sizes. Rather than open
    coding the access for every registers, provide a set of helpers to access
    them.
    
    The caller will have to call vgic_regN_* where N is the size of the
    emulated registers.
    
    The new helpers supports any access size and expect the caller to
    validate the access size supported by the emulated registers.
    
    Finally, take the opportunity to fix the coding style in section we are
    modifying.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c     |   89 ++++++++++++++++++++------------
 xen/arch/arm/vgic-v3.c     |  125 ++++++++++++++++++++++++++++++--------------
 xen/include/asm-arm/vgic.h |  111 +++++++++++++++++++++++++++++++++++----
 3 files changed, 243 insertions(+), 82 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 62159bf..c94f0f3 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -180,24 +180,31 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICD_CTLR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         vgic_lock(v);
-        *r = v->domain->arch.vgic.ctlr;
+        *r = vgic_reg32_extract(v->domain->arch.vgic.ctlr, info);
         vgic_unlock(v);
         return 1;
     case GICD_TYPER:
+    {
+        uint32_t typer;
+
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* No secure world support for guests. */
         vgic_lock(v);
-        *r = ( ((v->domain->max_vcpus - 1) << GICD_TYPE_CPUS_SHIFT) )
+        typer = ((v->domain->max_vcpus - 1) << GICD_TYPE_CPUS_SHIFT)
             | DIV_ROUND_UP(v->domain->arch.vgic.nr_spis, 32);
         vgic_unlock(v);
+
+        *r = vgic_reg32_extract(typer, info);
+
         return 1;
+    }
     case GICD_IIDR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /*
          * XXX Do we need a JEP106 manufacturer ID?
          * Just use the physical h/w value for now
          */
-        *r = 0x0000043b;
+        *r = vgic_reg32_extract(0x0000043b, info);
         return 1;
 
     /* Implementation defined -- read as zero */
@@ -213,7 +220,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ienable;
+        *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -222,7 +229,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ienable;
+        *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -237,37 +244,53 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_as_zero;
 
     case GICD_ITARGETSR ... GICD_ITARGETSRN:
+    {
+        uint32_t itargetsr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
-        if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, gicd_reg);
+        itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
         vgic_unlock_rank(v, rank, flags);
+        *r = vgic_reg32_extract(itargetsr, info);
+
         return 1;
+    }
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    {
+        uint32_t ipriorityr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR, DABT_WORD);
-        if ( rank == NULL) goto read_as_zero;
+        if ( rank == NULL ) goto read_as_zero;
 
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ipriorityr[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
-                                             DABT_WORD)];
-        if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, gicd_reg);
+        ipriorityr = rank->ipriorityr[REG_RANK_INDEX(8,
+                                                     gicd_reg - GICD_IPRIORITYR,
+                                                     DABT_WORD)];
         vgic_unlock_rank(v, rank, flags);
+        *r = vgic_reg32_extract(ipriorityr, info);
+
         return 1;
+    }
 
     case GICD_ICFGR ... GICD_ICFGRN:
+    {
+        uint32_t icfgr;
+
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR, DABT_WORD)];
+        icfgr = rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR, DABT_WORD)];
         vgic_unlock_rank(v, rank, flags);
+
+        *r = vgic_reg32_extract(icfgr, info);
+
         return 1;
+    }
 
     case GICD_NSACR ... GICD_NSACRN:
         /* We do not implement security extensions for guests, read zero */
@@ -377,7 +400,8 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* Ignore all but the enable bit */
         vgic_lock(v);
-        v->domain->arch.vgic.ctlr = r & GICD_CTL_ENABLE;
+        vgic_reg32_update(&v->domain->arch.vgic.ctlr, r, info);
+        v->domain->arch.vgic.ctlr &= GICD_CTL_ENABLE;
         vgic_unlock(v);
 
         return 1;
@@ -401,8 +425,8 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable |= r;
-        vgic_enable_irqs(v, r & (~tr), rank->index);
+        vgic_reg32_setbits(&rank->ienable, r, info);
+        vgic_enable_irqs(v, (rank->ienable) & (~tr), rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -412,8 +436,8 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable &= ~r;
-        vgic_disable_irqs(v, r & tr, rank->index);
+        vgic_reg32_clearbits(&rank->ienable, r, info);
+        vgic_disable_irqs(v, (~rank->ienable) & tr, rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -457,13 +481,8 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        if ( dabt.size == DABT_WORD )
-            itargetsr = r;
-        else
-        {
-            itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
-            vgic_byte_write(&itargetsr, r, gicd_reg);
-        }
+        itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
+        vgic_reg32_update(&itargetsr, r, info);
         vgic_store_itargetsr(v->domain, rank, gicd_reg - GICD_ITARGETSR,
                              itargetsr);
         vgic_unlock_rank(v, rank, flags);
@@ -471,18 +490,20 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     }
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    {
+        uint32_t *ipriorityr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        if ( dabt.size == DABT_WORD )
-            rank->ipriorityr[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
-                                            DABT_WORD)] = r;
-        else
-            vgic_byte_write(&rank->ipriorityr[REG_RANK_INDEX(8,
-                        gicd_reg - GICD_IPRIORITYR, DABT_WORD)], r, gicd_reg);
+        ipriorityr = &rank->ipriorityr[REG_RANK_INDEX(8,
+                                                      gicd_reg - GICD_IPRIORITYR,
+                                                      DABT_WORD)];
+        vgic_reg32_update(ipriorityr, r, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
+    }
 
     case GICD_ICFGR: /* SGIs */
         goto write_ignore_32;
@@ -494,7 +515,9 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR, DABT_WORD)] = r;
+        vgic_reg32_update(&rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR,
+                                                     DABT_WORD)],
+                          r, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 4f976d4..634211b 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -162,7 +162,6 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
                                          register_t *r)
 {
     struct hsr_dabt dabt = info->dabt;
-    uint64_t aff;
 
     switch ( gicr_reg )
     {
@@ -171,21 +170,27 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_as_zero_32;
     case GICR_IIDR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICR_IIDR_VAL;
+        *r = vgic_reg32_extract(GICV3_GICR_IIDR_VAL, info);
         return 1;
     case GICR_TYPER:
+    {
+        uint64_t typer, aff;
+
         if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
         /* TBD: Update processor id in [23:8] when ITS support is added */
         aff = (MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 3) << 56 |
                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 2) << 48 |
                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 1) << 40 |
                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 0) << 32);
-        *r = aff;
+        typer = aff;
 
         if ( v->arch.vgic.flags & VGIC_V3_RDIST_LAST )
-            *r |= GICR_TYPER_LAST;
+            typer |= GICR_TYPER_LAST;
+
+        *r = vgic_reg64_extract(typer, info);
 
         return 1;
+    }
     case GICR_STATUSR:
         /* Not implemented */
         goto read_as_zero_32;
@@ -214,7 +219,7 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICR_SYNCR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* RO . But when read it always returns busy bito bit[0] */
-        *r = GICR_SYNCR_NOT_BUSY;
+        *r = vgic_reg32_extract(GICR_SYNCR_NOT_BUSY, info);
         return 1;
     case GICR_MOVLPIR:
         /* WO Read as zero */
@@ -224,22 +229,22 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_as_zero_64;
     case GICR_PIDR0:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICR_PIDR0;
+        *r = vgic_reg32_extract(GICV3_GICR_PIDR0, info);
          return 1;
     case GICR_PIDR1:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICR_PIDR1;
+        *r = vgic_reg32_extract(GICV3_GICR_PIDR1, info);
          return 1;
     case GICR_PIDR2:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICR_PIDR2;
+        *r = vgic_reg32_extract(GICV3_GICR_PIDR2, info);
          return 1;
     case GICR_PIDR3:
         /* Manufacture/customer defined */
         goto read_as_zero_32;
     case GICR_PIDR4:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICR_PIDR4;
+        *r = vgic_reg32_extract(GICV3_GICR_PIDR4, info);
          return 1;
     case GICR_PIDR5 ... GICR_PIDR7:
         /* Reserved0 */
@@ -360,7 +365,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         rank = vgic_rank_offset(v, 1, reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ienable;
+        *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICENABLER ... GICD_ICENABLERN:
@@ -368,7 +373,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         rank = vgic_rank_offset(v, 1, reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ienable;
+        *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     /* Read the pending status of an IRQ via GICD/GICR is not supported */
@@ -382,25 +387,38 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         goto read_as_zero;
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    {
+        uint32_t ipriorityr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, reg - GICD_IPRIORITYR, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
 
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
-                                             DABT_WORD)];
-        if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, reg);
+        ipriorityr = rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
+                                                     DABT_WORD)];
         vgic_unlock_rank(v, rank, flags);
+
+        *r = vgic_reg32_extract(ipriorityr, info);
+
         return 1;
+    }
+
     case GICD_ICFGR ... GICD_ICFGRN:
+    {
+        uint32_t icfgr;
+
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 2, reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR, DABT_WORD)];
+        icfgr = rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR, DABT_WORD)];
         vgic_unlock_rank(v, rank, flags);
+
+        *r = vgic_reg32_extract(icfgr, info);
+
         return 1;
+    }
     default:
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled read r%d offset %#08x\n",
@@ -439,8 +457,8 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable |= r;
-        vgic_enable_irqs(v, r & (~tr), rank->index);
+        vgic_reg32_setbits(&rank->ienable, r, info);
+        vgic_enable_irqs(v, (rank->ienable) & (~tr), rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICENABLER ... GICD_ICENABLERN:
@@ -449,8 +467,8 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable &= ~r;
-        vgic_disable_irqs(v, r & tr, rank->index);
+        vgic_reg32_clearbits(&rank->ienable, r, info);
+        vgic_disable_irqs(v, (~rank->ienable) & tr, rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ISPENDR ... GICD_ISPENDRN:
@@ -482,18 +500,19 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         return 0;
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    {
+        uint32_t *ipriorityr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, reg - GICD_IPRIORITYR, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        if ( dabt.size == DABT_WORD )
-            rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
-                                            DABT_WORD)] = r;
-        else
-            vgic_byte_write(&rank->ipriorityr[REG_RANK_INDEX(8,
-                       reg - GICD_IPRIORITYR, DABT_WORD)], r, reg);
+        ipriorityr = &rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
+                                                      DABT_WORD)];
+        vgic_reg32_update(ipriorityr, r, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
+    }
     case GICD_ICFGR: /* Restricted to configure SGIs */
         goto write_ignore_32;
     case GICD_ICFGR + 4 ... GICD_ICFGRN: /* PPI + SPIs */
@@ -503,9 +522,12 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         rank = vgic_rank_offset(v, 2, reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR, DABT_WORD)] = r;
+        vgic_reg32_update(&rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR,
+                                                     DABT_WORD)],
+                          r, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
+
     default:
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled write r%d=%"PRIregister" offset %#08x\n",
@@ -719,7 +741,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICD_CTLR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         vgic_lock(v);
-        *r = v->domain->arch.vgic.ctlr;
+        *r = vgic_reg32_extract(v->domain->arch.vgic.ctlr, info);
         vgic_unlock(v);
         return 1;
     case GICD_TYPER:
@@ -734,13 +756,16 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          * bit is zero. The maximum is 8.
          */
         unsigned int ncpus = min_t(unsigned int, v->domain->max_vcpus, 8);
+        uint32_t typer;
 
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* No secure world support for guests. */
-        *r = ((ncpus - 1) << GICD_TYPE_CPUS_SHIFT |
-              DIV_ROUND_UP(v->domain->arch.vgic.nr_spis, 32));
+        typer = ((ncpus - 1) << GICD_TYPE_CPUS_SHIFT |
+                 DIV_ROUND_UP(v->domain->arch.vgic.nr_spis, 32));
+
+        typer |= (irq_bits - 1) << GICD_TYPE_ID_BITS_SHIFT;
 
-        *r |= (irq_bits - 1) << GICD_TYPE_ID_BITS_SHIFT;
+        *r = vgic_reg32_extract(typer, info);
 
         return 1;
     }
@@ -752,7 +777,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_as_zero_32;
     case GICD_IIDR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICD_IIDR_VAL;
+        *r = vgic_reg32_extract(GICV3_GICD_IIDR_VAL, info);
         return 1;
     case 0x020 ... 0x03c:
     case 0xc000 ... 0xffcc:
@@ -775,14 +800,22 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* SGI/PPI is RES0 */
         goto read_as_zero_64;
     case GICD_IROUTER32 ... GICD_IROUTERN:
+    {
+        uint64_t irouter;
+
         if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
+        irouter = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
         vgic_unlock_rank(v, rank, flags);
+
+        *r = vgic_reg64_extract(irouter, info);
+
         return 1;
+    }
+
     case GICD_NSACR ... GICD_NSACRN:
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
@@ -798,17 +831,17 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICD_PIDR0:
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICD_PIDR0;
+        *r = vgic_reg32_extract(GICV3_GICD_PIDR0, info);
         return 1;
     case GICD_PIDR1:
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICD_PIDR1;
+        *r = vgic_reg32_extract(GICV3_GICD_PIDR1, info);
         return 1;
     case GICD_PIDR2:
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICD_PIDR2;
+        *r = vgic_reg32_extract(GICV3_GICD_PIDR2, info);
         return 1;
     case GICD_PIDR3:
         /* GICv3 identification value. Manufacturer/Customer defined */
@@ -816,7 +849,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICD_PIDR4:
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICD_PIDR4;
+        *r = vgic_reg32_extract(GICV3_GICD_PIDR4, info);
         return 1;
     case GICD_PIDR5 ... GICD_PIDR7:
         /* Reserved0 */
@@ -872,17 +905,24 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     switch ( gicd_reg )
     {
     case GICD_CTLR:
+    {
+        uint32_t ctlr = 0;
+
         if ( dabt.size != DABT_WORD ) goto bad_width;
 
         vgic_lock(v);
+
+        vgic_reg32_update(&ctlr, r, info);
+
         /* Only EnableGrp1A can be changed */
-        if ( r & GICD_CTLR_ENABLE_G1A )
+        if ( ctlr & GICD_CTLR_ENABLE_G1A )
             v->domain->arch.vgic.ctlr |= GICD_CTLR_ENABLE_G1A;
         else
             v->domain->arch.vgic.ctlr &= ~GICD_CTLR_ENABLE_G1A;
         vgic_unlock(v);
 
         return 1;
+    }
     case GICD_TYPER:
         /* RO -- write ignored */
         goto write_ignore_32;
@@ -928,14 +968,21 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* SGI/PPI is RES0 */
         goto write_ignore_64;
     case GICD_IROUTER32 ... GICD_IROUTERN:
+    {
+        uint64_t irouter;
+
         if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        vgic_store_irouter(v->domain, rank, gicd_reg - GICD_IROUTER, r);
+        irouter = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
+        vgic_reg64_update(&irouter, r, info);
+        vgic_store_irouter(v->domain, rank, gicd_reg - GICD_IROUTER, irouter);
         vgic_unlock_rank(v, rank, flags);
         return 1;
+    }
+
     case GICD_NSACR ... GICD_NSACRN:
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index a1ef429..005f822 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -19,6 +19,7 @@
 #define __ASM_ARM_VGIC_H__
 
 #include <xen/bitops.h>
+#include <asm/mmio.h>
 
 struct pending_irq
 {
@@ -166,26 +167,116 @@ static inline int REG_RANK_NR(int b, uint32_t n)
     }
 }
 
-static inline uint32_t vgic_byte_read(uint32_t val, int offset)
+#define VGIC_REG_MASK(size) ((~0UL) >> (BITS_PER_LONG - ((1 << (size)) * 8)))
+
+/*
+ * The check on the size supported by the register has to be done by
+ * the caller of vgic_regN_*.
+ *
+ * vgic_reg_* should never be called directly. Instead use the vgic_regN_*
+ * according to size of the emulated register
+ *
+ * Note that the alignment fault will always be taken in the guest
+ * (see B3.12.7 DDI0406.b).
+ */
+static inline register_t vgic_reg_extract(unsigned long reg,
+                                          unsigned int offset,
+                                          enum dabt_size size)
+{
+    reg >>= 8 * offset;
+    reg &= VGIC_REG_MASK(size);
+
+    return reg;
+}
+
+static inline void vgic_reg_update(unsigned long *reg, register_t val,
+                                   unsigned int offset,
+                                   enum dabt_size size)
 {
-    int byte = offset & 0x3;
+    unsigned long mask = VGIC_REG_MASK(size);
+    int shift = offset * 8;
 
-    val = val >> (8*byte);
-    val &= 0x000000ff;
+    *reg &= ~(mask << shift);
+    *reg |= ((unsigned long)val & mask) << shift;
+}
+
+static inline void vgic_reg_setbits(unsigned long *reg, register_t bits,
+                                    unsigned int offset,
+                                    enum dabt_size size)
+{
+    unsigned long mask = VGIC_REG_MASK(size);
+    int shift = offset * 8;
 
-    return val;
+    *reg |= ((unsigned long)bits & mask) << shift;
 }
 
-static inline void vgic_byte_write(uint32_t *reg, uint32_t var, int offset)
+static inline void vgic_reg_clearbits(unsigned long *reg, register_t bits,
+                                      unsigned int offset,
+                                      enum dabt_size size)
 {
-    int byte = offset & 0x3;
+    unsigned long mask = VGIC_REG_MASK(size);
+    int shift = offset * 8;
 
-    var &= 0xff;
+    *reg &= ~(((unsigned long)bits & mask) << shift);
+}
 
-    *reg &= ~(0xff << (8*byte));
-    *reg |= (var << (8*byte));
+/* N-bit register helpers */
+#define VGIC_REG_HELPERS(sz, offmask)                                   \
+static inline register_t vgic_reg##sz##_extract(uint##sz##_t reg,       \
+                                                const mmio_info_t *info)\
+{                                                                       \
+    return vgic_reg_extract(reg, info->gpa & offmask,                   \
+                            info->dabt.size);                           \
+}                                                                       \
+                                                                        \
+static inline void vgic_reg##sz##_update(uint##sz##_t *reg,             \
+                                         register_t val,                \
+                                         const mmio_info_t *info)       \
+{                                                                       \
+    unsigned long tmp = *reg;                                           \
+                                                                        \
+    vgic_reg_update(&tmp, val, info->gpa & offmask,                     \
+                    info->dabt.size);                                   \
+                                                                        \
+    *reg = tmp;                                                         \
+}                                                                       \
+                                                                        \
+static inline void vgic_reg##sz##_setbits(uint##sz##_t *reg,            \
+                                          register_t bits,              \
+                                          const mmio_info_t *info)      \
+{                                                                       \
+    unsigned long tmp = *reg;                                           \
+                                                                        \
+    vgic_reg_setbits(&tmp, bits, info->gpa & offmask,                   \
+                     info->dabt.size);                                  \
+                                                                        \
+    *reg = tmp;                                                         \
+}                                                                       \
+                                                                        \
+static inline void vgic_reg##sz##_clearbits(uint##sz##_t *reg,          \
+                                            register_t bits,            \
+                                            const mmio_info_t *info)    \
+{                                                                       \
+    unsigned long tmp = *reg;                                           \
+                                                                        \
+    vgic_reg_clearbits(&tmp, bits, info->gpa & offmask,                 \
+                       info->dabt.size);                                \
+                                                                        \
+    *reg = tmp;                                                         \
 }
 
+/*
+ * 64 bits registers are only supported on platform with 64-bit long.
+ * This is also allow us to optimize the 32 bit case by using
+ * unsigned long rather than uint64_t
+ */
+#if BITS_PER_LONG == 64
+VGIC_REG_HELPERS(64, 0x7);
+#endif
+VGIC_REG_HELPERS(32, 0x3);
+
+#undef VGIC_REG_HELPERS
+
 enum gic_sgi_mode;
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:52:40 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:52: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 1a23Wy-0005Cc-Lc; Thu, 26 Nov 2015 20:52: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 1a23Wx-0005CR-NB
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:40 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	75/EF-23747-61177565; Thu, 26 Nov 2015 20:52:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1448571156!6860290!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21834 invoked from network); 26 Nov 2015 20:52:37 -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;
	26 Nov 2015 20:52:37 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Wu-0003F5-IZ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Wu-0000qQ-GP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:36 +0000
Date: Thu, 26 Nov 2015 20:52:36 +0000
Message-Id: <E1a23Wu-0000qQ-GP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Introduce helpers to
	extract/update/clear/set vGIC register ...
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 423e9ecdc26c4b40c8db1fcc63b3655463c29976
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:42 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:26 2015 +0000

    xen/arm: vgic: Introduce helpers to extract/update/clear/set vGIC register ...
    
    and use them in the vGIC emulation.
    
    The GIC registers may support different access sizes. Rather than open
    coding the access for every registers, provide a set of helpers to access
    them.
    
    The caller will have to call vgic_regN_* where N is the size of the
    emulated registers.
    
    The new helpers supports any access size and expect the caller to
    validate the access size supported by the emulated registers.
    
    Finally, take the opportunity to fix the coding style in section we are
    modifying.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c     |   89 ++++++++++++++++++++------------
 xen/arch/arm/vgic-v3.c     |  125 ++++++++++++++++++++++++++++++--------------
 xen/include/asm-arm/vgic.h |  111 +++++++++++++++++++++++++++++++++++----
 3 files changed, 243 insertions(+), 82 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 62159bf..c94f0f3 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -180,24 +180,31 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICD_CTLR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         vgic_lock(v);
-        *r = v->domain->arch.vgic.ctlr;
+        *r = vgic_reg32_extract(v->domain->arch.vgic.ctlr, info);
         vgic_unlock(v);
         return 1;
     case GICD_TYPER:
+    {
+        uint32_t typer;
+
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* No secure world support for guests. */
         vgic_lock(v);
-        *r = ( ((v->domain->max_vcpus - 1) << GICD_TYPE_CPUS_SHIFT) )
+        typer = ((v->domain->max_vcpus - 1) << GICD_TYPE_CPUS_SHIFT)
             | DIV_ROUND_UP(v->domain->arch.vgic.nr_spis, 32);
         vgic_unlock(v);
+
+        *r = vgic_reg32_extract(typer, info);
+
         return 1;
+    }
     case GICD_IIDR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /*
          * XXX Do we need a JEP106 manufacturer ID?
          * Just use the physical h/w value for now
          */
-        *r = 0x0000043b;
+        *r = vgic_reg32_extract(0x0000043b, info);
         return 1;
 
     /* Implementation defined -- read as zero */
@@ -213,7 +220,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ienable;
+        *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -222,7 +229,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ienable;
+        *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -237,37 +244,53 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_as_zero;
 
     case GICD_ITARGETSR ... GICD_ITARGETSRN:
+    {
+        uint32_t itargetsr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
-        if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, gicd_reg);
+        itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
         vgic_unlock_rank(v, rank, flags);
+        *r = vgic_reg32_extract(itargetsr, info);
+
         return 1;
+    }
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    {
+        uint32_t ipriorityr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR, DABT_WORD);
-        if ( rank == NULL) goto read_as_zero;
+        if ( rank == NULL ) goto read_as_zero;
 
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ipriorityr[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
-                                             DABT_WORD)];
-        if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, gicd_reg);
+        ipriorityr = rank->ipriorityr[REG_RANK_INDEX(8,
+                                                     gicd_reg - GICD_IPRIORITYR,
+                                                     DABT_WORD)];
         vgic_unlock_rank(v, rank, flags);
+        *r = vgic_reg32_extract(ipriorityr, info);
+
         return 1;
+    }
 
     case GICD_ICFGR ... GICD_ICFGRN:
+    {
+        uint32_t icfgr;
+
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR, DABT_WORD)];
+        icfgr = rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR, DABT_WORD)];
         vgic_unlock_rank(v, rank, flags);
+
+        *r = vgic_reg32_extract(icfgr, info);
+
         return 1;
+    }
 
     case GICD_NSACR ... GICD_NSACRN:
         /* We do not implement security extensions for guests, read zero */
@@ -377,7 +400,8 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* Ignore all but the enable bit */
         vgic_lock(v);
-        v->domain->arch.vgic.ctlr = r & GICD_CTL_ENABLE;
+        vgic_reg32_update(&v->domain->arch.vgic.ctlr, r, info);
+        v->domain->arch.vgic.ctlr &= GICD_CTL_ENABLE;
         vgic_unlock(v);
 
         return 1;
@@ -401,8 +425,8 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable |= r;
-        vgic_enable_irqs(v, r & (~tr), rank->index);
+        vgic_reg32_setbits(&rank->ienable, r, info);
+        vgic_enable_irqs(v, (rank->ienable) & (~tr), rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -412,8 +436,8 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable &= ~r;
-        vgic_disable_irqs(v, r & tr, rank->index);
+        vgic_reg32_clearbits(&rank->ienable, r, info);
+        vgic_disable_irqs(v, (~rank->ienable) & tr, rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
@@ -457,13 +481,8 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        if ( dabt.size == DABT_WORD )
-            itargetsr = r;
-        else
-        {
-            itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
-            vgic_byte_write(&itargetsr, r, gicd_reg);
-        }
+        itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
+        vgic_reg32_update(&itargetsr, r, info);
         vgic_store_itargetsr(v->domain, rank, gicd_reg - GICD_ITARGETSR,
                              itargetsr);
         vgic_unlock_rank(v, rank, flags);
@@ -471,18 +490,20 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     }
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    {
+        uint32_t *ipriorityr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        if ( dabt.size == DABT_WORD )
-            rank->ipriorityr[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
-                                            DABT_WORD)] = r;
-        else
-            vgic_byte_write(&rank->ipriorityr[REG_RANK_INDEX(8,
-                        gicd_reg - GICD_IPRIORITYR, DABT_WORD)], r, gicd_reg);
+        ipriorityr = &rank->ipriorityr[REG_RANK_INDEX(8,
+                                                      gicd_reg - GICD_IPRIORITYR,
+                                                      DABT_WORD)];
+        vgic_reg32_update(ipriorityr, r, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
+    }
 
     case GICD_ICFGR: /* SGIs */
         goto write_ignore_32;
@@ -494,7 +515,9 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR, DABT_WORD)] = r;
+        vgic_reg32_update(&rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR,
+                                                     DABT_WORD)],
+                          r, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 4f976d4..634211b 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -162,7 +162,6 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
                                          register_t *r)
 {
     struct hsr_dabt dabt = info->dabt;
-    uint64_t aff;
 
     switch ( gicr_reg )
     {
@@ -171,21 +170,27 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_as_zero_32;
     case GICR_IIDR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICR_IIDR_VAL;
+        *r = vgic_reg32_extract(GICV3_GICR_IIDR_VAL, info);
         return 1;
     case GICR_TYPER:
+    {
+        uint64_t typer, aff;
+
         if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
         /* TBD: Update processor id in [23:8] when ITS support is added */
         aff = (MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 3) << 56 |
                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 2) << 48 |
                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 1) << 40 |
                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 0) << 32);
-        *r = aff;
+        typer = aff;
 
         if ( v->arch.vgic.flags & VGIC_V3_RDIST_LAST )
-            *r |= GICR_TYPER_LAST;
+            typer |= GICR_TYPER_LAST;
+
+        *r = vgic_reg64_extract(typer, info);
 
         return 1;
+    }
     case GICR_STATUSR:
         /* Not implemented */
         goto read_as_zero_32;
@@ -214,7 +219,7 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICR_SYNCR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* RO . But when read it always returns busy bito bit[0] */
-        *r = GICR_SYNCR_NOT_BUSY;
+        *r = vgic_reg32_extract(GICR_SYNCR_NOT_BUSY, info);
         return 1;
     case GICR_MOVLPIR:
         /* WO Read as zero */
@@ -224,22 +229,22 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_as_zero_64;
     case GICR_PIDR0:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICR_PIDR0;
+        *r = vgic_reg32_extract(GICV3_GICR_PIDR0, info);
          return 1;
     case GICR_PIDR1:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICR_PIDR1;
+        *r = vgic_reg32_extract(GICV3_GICR_PIDR1, info);
          return 1;
     case GICR_PIDR2:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICR_PIDR2;
+        *r = vgic_reg32_extract(GICV3_GICR_PIDR2, info);
          return 1;
     case GICR_PIDR3:
         /* Manufacture/customer defined */
         goto read_as_zero_32;
     case GICR_PIDR4:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICR_PIDR4;
+        *r = vgic_reg32_extract(GICV3_GICR_PIDR4, info);
          return 1;
     case GICR_PIDR5 ... GICR_PIDR7:
         /* Reserved0 */
@@ -360,7 +365,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         rank = vgic_rank_offset(v, 1, reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ienable;
+        *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICENABLER ... GICD_ICENABLERN:
@@ -368,7 +373,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         rank = vgic_rank_offset(v, 1, reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ienable;
+        *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     /* Read the pending status of an IRQ via GICD/GICR is not supported */
@@ -382,25 +387,38 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         goto read_as_zero;
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    {
+        uint32_t ipriorityr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, reg - GICD_IPRIORITYR, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
 
         vgic_lock_rank(v, rank, flags);
-        *r = rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
-                                             DABT_WORD)];
-        if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, reg);
+        ipriorityr = rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
+                                                     DABT_WORD)];
         vgic_unlock_rank(v, rank, flags);
+
+        *r = vgic_reg32_extract(ipriorityr, info);
+
         return 1;
+    }
+
     case GICD_ICFGR ... GICD_ICFGRN:
+    {
+        uint32_t icfgr;
+
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 2, reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR, DABT_WORD)];
+        icfgr = rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR, DABT_WORD)];
         vgic_unlock_rank(v, rank, flags);
+
+        *r = vgic_reg32_extract(icfgr, info);
+
         return 1;
+    }
     default:
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled read r%d offset %#08x\n",
@@ -439,8 +457,8 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable |= r;
-        vgic_enable_irqs(v, r & (~tr), rank->index);
+        vgic_reg32_setbits(&rank->ienable, r, info);
+        vgic_enable_irqs(v, (rank->ienable) & (~tr), rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ICENABLER ... GICD_ICENABLERN:
@@ -449,8 +467,8 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
         tr = rank->ienable;
-        rank->ienable &= ~r;
-        vgic_disable_irqs(v, r & tr, rank->index);
+        vgic_reg32_clearbits(&rank->ienable, r, info);
+        vgic_disable_irqs(v, (~rank->ienable) & tr, rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
     case GICD_ISPENDR ... GICD_ISPENDRN:
@@ -482,18 +500,19 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         return 0;
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    {
+        uint32_t *ipriorityr;
+
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 8, reg - GICD_IPRIORITYR, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        if ( dabt.size == DABT_WORD )
-            rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
-                                            DABT_WORD)] = r;
-        else
-            vgic_byte_write(&rank->ipriorityr[REG_RANK_INDEX(8,
-                       reg - GICD_IPRIORITYR, DABT_WORD)], r, reg);
+        ipriorityr = &rank->ipriorityr[REG_RANK_INDEX(8, reg - GICD_IPRIORITYR,
+                                                      DABT_WORD)];
+        vgic_reg32_update(ipriorityr, r, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
+    }
     case GICD_ICFGR: /* Restricted to configure SGIs */
         goto write_ignore_32;
     case GICD_ICFGR + 4 ... GICD_ICFGRN: /* PPI + SPIs */
@@ -503,9 +522,12 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         rank = vgic_rank_offset(v, 2, reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR, DABT_WORD)] = r;
+        vgic_reg32_update(&rank->icfg[REG_RANK_INDEX(2, reg - GICD_ICFGR,
+                                                     DABT_WORD)],
+                          r, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
+
     default:
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled write r%d=%"PRIregister" offset %#08x\n",
@@ -719,7 +741,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICD_CTLR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         vgic_lock(v);
-        *r = v->domain->arch.vgic.ctlr;
+        *r = vgic_reg32_extract(v->domain->arch.vgic.ctlr, info);
         vgic_unlock(v);
         return 1;
     case GICD_TYPER:
@@ -734,13 +756,16 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          * bit is zero. The maximum is 8.
          */
         unsigned int ncpus = min_t(unsigned int, v->domain->max_vcpus, 8);
+        uint32_t typer;
 
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* No secure world support for guests. */
-        *r = ((ncpus - 1) << GICD_TYPE_CPUS_SHIFT |
-              DIV_ROUND_UP(v->domain->arch.vgic.nr_spis, 32));
+        typer = ((ncpus - 1) << GICD_TYPE_CPUS_SHIFT |
+                 DIV_ROUND_UP(v->domain->arch.vgic.nr_spis, 32));
+
+        typer |= (irq_bits - 1) << GICD_TYPE_ID_BITS_SHIFT;
 
-        *r |= (irq_bits - 1) << GICD_TYPE_ID_BITS_SHIFT;
+        *r = vgic_reg32_extract(typer, info);
 
         return 1;
     }
@@ -752,7 +777,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_as_zero_32;
     case GICD_IIDR:
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICD_IIDR_VAL;
+        *r = vgic_reg32_extract(GICV3_GICD_IIDR_VAL, info);
         return 1;
     case 0x020 ... 0x03c:
     case 0xc000 ... 0xffcc:
@@ -775,14 +800,22 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* SGI/PPI is RES0 */
         goto read_as_zero_64;
     case GICD_IROUTER32 ... GICD_IROUTERN:
+    {
+        uint64_t irouter;
+
         if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto read_as_zero;
         vgic_lock_rank(v, rank, flags);
-        *r = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
+        irouter = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
         vgic_unlock_rank(v, rank, flags);
+
+        *r = vgic_reg64_extract(irouter, info);
+
         return 1;
+    }
+
     case GICD_NSACR ... GICD_NSACRN:
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
@@ -798,17 +831,17 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICD_PIDR0:
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICD_PIDR0;
+        *r = vgic_reg32_extract(GICV3_GICD_PIDR0, info);
         return 1;
     case GICD_PIDR1:
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICD_PIDR1;
+        *r = vgic_reg32_extract(GICV3_GICD_PIDR1, info);
         return 1;
     case GICD_PIDR2:
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICD_PIDR2;
+        *r = vgic_reg32_extract(GICV3_GICD_PIDR2, info);
         return 1;
     case GICD_PIDR3:
         /* GICv3 identification value. Manufacturer/Customer defined */
@@ -816,7 +849,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICD_PIDR4:
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = GICV3_GICD_PIDR4;
+        *r = vgic_reg32_extract(GICV3_GICD_PIDR4, info);
         return 1;
     case GICD_PIDR5 ... GICD_PIDR7:
         /* Reserved0 */
@@ -872,17 +905,24 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     switch ( gicd_reg )
     {
     case GICD_CTLR:
+    {
+        uint32_t ctlr = 0;
+
         if ( dabt.size != DABT_WORD ) goto bad_width;
 
         vgic_lock(v);
+
+        vgic_reg32_update(&ctlr, r, info);
+
         /* Only EnableGrp1A can be changed */
-        if ( r & GICD_CTLR_ENABLE_G1A )
+        if ( ctlr & GICD_CTLR_ENABLE_G1A )
             v->domain->arch.vgic.ctlr |= GICD_CTLR_ENABLE_G1A;
         else
             v->domain->arch.vgic.ctlr &= ~GICD_CTLR_ENABLE_G1A;
         vgic_unlock(v);
 
         return 1;
+    }
     case GICD_TYPER:
         /* RO -- write ignored */
         goto write_ignore_32;
@@ -928,14 +968,21 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* SGI/PPI is RES0 */
         goto write_ignore_64;
     case GICD_IROUTER32 ... GICD_IROUTERN:
+    {
+        uint64_t irouter;
+
         if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto write_ignore;
         vgic_lock_rank(v, rank, flags);
-        vgic_store_irouter(v->domain, rank, gicd_reg - GICD_IROUTER, r);
+        irouter = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
+        vgic_reg64_update(&irouter, r, info);
+        vgic_store_irouter(v->domain, rank, gicd_reg - GICD_IROUTER, irouter);
         vgic_unlock_rank(v, rank, flags);
         return 1;
+    }
+
     case GICD_NSACR ... GICD_NSACRN:
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index a1ef429..005f822 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -19,6 +19,7 @@
 #define __ASM_ARM_VGIC_H__
 
 #include <xen/bitops.h>
+#include <asm/mmio.h>
 
 struct pending_irq
 {
@@ -166,26 +167,116 @@ static inline int REG_RANK_NR(int b, uint32_t n)
     }
 }
 
-static inline uint32_t vgic_byte_read(uint32_t val, int offset)
+#define VGIC_REG_MASK(size) ((~0UL) >> (BITS_PER_LONG - ((1 << (size)) * 8)))
+
+/*
+ * The check on the size supported by the register has to be done by
+ * the caller of vgic_regN_*.
+ *
+ * vgic_reg_* should never be called directly. Instead use the vgic_regN_*
+ * according to size of the emulated register
+ *
+ * Note that the alignment fault will always be taken in the guest
+ * (see B3.12.7 DDI0406.b).
+ */
+static inline register_t vgic_reg_extract(unsigned long reg,
+                                          unsigned int offset,
+                                          enum dabt_size size)
+{
+    reg >>= 8 * offset;
+    reg &= VGIC_REG_MASK(size);
+
+    return reg;
+}
+
+static inline void vgic_reg_update(unsigned long *reg, register_t val,
+                                   unsigned int offset,
+                                   enum dabt_size size)
 {
-    int byte = offset & 0x3;
+    unsigned long mask = VGIC_REG_MASK(size);
+    int shift = offset * 8;
 
-    val = val >> (8*byte);
-    val &= 0x000000ff;
+    *reg &= ~(mask << shift);
+    *reg |= ((unsigned long)val & mask) << shift;
+}
+
+static inline void vgic_reg_setbits(unsigned long *reg, register_t bits,
+                                    unsigned int offset,
+                                    enum dabt_size size)
+{
+    unsigned long mask = VGIC_REG_MASK(size);
+    int shift = offset * 8;
 
-    return val;
+    *reg |= ((unsigned long)bits & mask) << shift;
 }
 
-static inline void vgic_byte_write(uint32_t *reg, uint32_t var, int offset)
+static inline void vgic_reg_clearbits(unsigned long *reg, register_t bits,
+                                      unsigned int offset,
+                                      enum dabt_size size)
 {
-    int byte = offset & 0x3;
+    unsigned long mask = VGIC_REG_MASK(size);
+    int shift = offset * 8;
 
-    var &= 0xff;
+    *reg &= ~(((unsigned long)bits & mask) << shift);
+}
 
-    *reg &= ~(0xff << (8*byte));
-    *reg |= (var << (8*byte));
+/* N-bit register helpers */
+#define VGIC_REG_HELPERS(sz, offmask)                                   \
+static inline register_t vgic_reg##sz##_extract(uint##sz##_t reg,       \
+                                                const mmio_info_t *info)\
+{                                                                       \
+    return vgic_reg_extract(reg, info->gpa & offmask,                   \
+                            info->dabt.size);                           \
+}                                                                       \
+                                                                        \
+static inline void vgic_reg##sz##_update(uint##sz##_t *reg,             \
+                                         register_t val,                \
+                                         const mmio_info_t *info)       \
+{                                                                       \
+    unsigned long tmp = *reg;                                           \
+                                                                        \
+    vgic_reg_update(&tmp, val, info->gpa & offmask,                     \
+                    info->dabt.size);                                   \
+                                                                        \
+    *reg = tmp;                                                         \
+}                                                                       \
+                                                                        \
+static inline void vgic_reg##sz##_setbits(uint##sz##_t *reg,            \
+                                          register_t bits,              \
+                                          const mmio_info_t *info)      \
+{                                                                       \
+    unsigned long tmp = *reg;                                           \
+                                                                        \
+    vgic_reg_setbits(&tmp, bits, info->gpa & offmask,                   \
+                     info->dabt.size);                                  \
+                                                                        \
+    *reg = tmp;                                                         \
+}                                                                       \
+                                                                        \
+static inline void vgic_reg##sz##_clearbits(uint##sz##_t *reg,          \
+                                            register_t bits,            \
+                                            const mmio_info_t *info)    \
+{                                                                       \
+    unsigned long tmp = *reg;                                           \
+                                                                        \
+    vgic_reg_clearbits(&tmp, bits, info->gpa & offmask,                 \
+                       info->dabt.size);                                \
+                                                                        \
+    *reg = tmp;                                                         \
 }
 
+/*
+ * 64 bits registers are only supported on platform with 64-bit long.
+ * This is also allow us to optimize the 32 bit case by using
+ * unsigned long rather than uint64_t
+ */
+#if BITS_PER_LONG == 64
+VGIC_REG_HELPERS(64, 0x7);
+#endif
+VGIC_REG_HELPERS(32, 0x3);
+
+#undef VGIC_REG_HELPERS
+
 enum gic_sgi_mode;
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:52:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:52: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 1a23X8-0005E9-V8; Thu, 26 Nov 2015 20:52: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 1a23X7-0005Dz-9C
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:49 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	82/BF-12889-02177565; Thu, 26 Nov 2015 20:52:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1448571167!3793004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25385 invoked from network); 26 Nov 2015 20:52:47 -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;
	26 Nov 2015 20:52:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23X4-0003FD-Sj
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23X4-0000qs-QX
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:46 +0000
Date: Thu, 26 Nov 2015 20:52:46 +0000
Message-Id: <E1a23X4-0000qs-QX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Support 32-bit
	access for 64-bit registers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4d6bbdc12e5660fb1842bdce06002bf65a09758
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:43 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:26 2015 +0000

    xen/arm: vgic-v3: Support 32-bit access for 64-bit registers
    
    Based on 8.1.3 (IHI 0069A), unless stated otherwise, the 64-bit registers
    supports both 32-bit and 64-bits access.
    
    All the registers we properly emulate (i.e not RAZ/WI) supports 32-bit access.
    
    For RAZ/WI, it's also seems to be the case but I'm not 100% sure. Anyway,
    emulating 32-bit access for them doesn't hurt. Note that we would need
    some extra care when they will be implemented (for instance GICR_PROPBASER).
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 634211b..3a7b86f 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -157,6 +157,15 @@ static void vgic_store_irouter(struct domain *d, struct vgic_irq_rank *rank,
     rank->vcpu[offset] = new_vcpu->vcpu_id;
 }
 
+static inline bool vgic_reg64_check_access(struct hsr_dabt dabt)
+{
+    /*
+     * 64 bits registers can be accessible using 32-bit and 64-bit unless
+     * stated otherwise (See 8.1.3 ARM IHI 0069A).
+     */
+    return ( dabt.size == DABT_DOUBLE_WORD || dabt.size == DABT_WORD );
+}
+
 static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
                                          uint32_t gicr_reg,
                                          register_t *r)
@@ -173,10 +182,11 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = vgic_reg32_extract(GICV3_GICR_IIDR_VAL, info);
         return 1;
     case GICR_TYPER:
+    case GICR_TYPER + 4:
     {
         uint64_t typer, aff;
 
-        if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+        if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
         /* TBD: Update processor id in [23:8] when ITS support is added */
         aff = (MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 3) << 56 |
                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 2) << 48 |
@@ -262,7 +272,7 @@ bad_width:
     return 0;
 
 read_as_zero_64:
-    if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+    if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
     *r = 0;
     return 1;
 
@@ -338,7 +348,7 @@ bad_width:
     return 0;
 
 write_ignore_64:
-    if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
     return 1;
 
 write_ignore_32:
@@ -803,7 +813,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     {
         uint64_t irouter;
 
-        if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+        if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto read_as_zero;
@@ -878,7 +888,7 @@ bad_width:
     return 0;
 
 read_as_zero_64:
-    if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
     *r = 0;
     return 1;
 
@@ -971,7 +981,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     {
         uint64_t irouter;
 
-        if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+        if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto write_ignore;
@@ -1030,7 +1040,7 @@ write_ignore_32:
     return 1;
 
 write_ignore_64:
-    if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
     return 1;
 
 write_ignore:
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:52:51 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:52: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 1a23X8-0005E9-V8; Thu, 26 Nov 2015 20:52: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 1a23X7-0005Dz-9C
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:49 +0000
Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id
	82/BF-12889-02177565; Thu, 26 Nov 2015 20:52:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1448571167!3793004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25385 invoked from network); 26 Nov 2015 20:52:47 -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;
	26 Nov 2015 20:52:47 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23X4-0003FD-Sj
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23X4-0000qs-QX
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:46 +0000
Date: Thu, 26 Nov 2015 20:52:46 +0000
Message-Id: <E1a23X4-0000qs-QX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Support 32-bit
	access for 64-bit registers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4d6bbdc12e5660fb1842bdce06002bf65a09758
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 16:42:43 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:26 2015 +0000

    xen/arm: vgic-v3: Support 32-bit access for 64-bit registers
    
    Based on 8.1.3 (IHI 0069A), unless stated otherwise, the 64-bit registers
    supports both 32-bit and 64-bits access.
    
    All the registers we properly emulate (i.e not RAZ/WI) supports 32-bit access.
    
    For RAZ/WI, it's also seems to be the case but I'm not 100% sure. Anyway,
    emulating 32-bit access for them doesn't hurt. Note that we would need
    some extra care when they will be implemented (for instance GICR_PROPBASER).
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 634211b..3a7b86f 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -157,6 +157,15 @@ static void vgic_store_irouter(struct domain *d, struct vgic_irq_rank *rank,
     rank->vcpu[offset] = new_vcpu->vcpu_id;
 }
 
+static inline bool vgic_reg64_check_access(struct hsr_dabt dabt)
+{
+    /*
+     * 64 bits registers can be accessible using 32-bit and 64-bit unless
+     * stated otherwise (See 8.1.3 ARM IHI 0069A).
+     */
+    return ( dabt.size == DABT_DOUBLE_WORD || dabt.size == DABT_WORD );
+}
+
 static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
                                          uint32_t gicr_reg,
                                          register_t *r)
@@ -173,10 +182,11 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = vgic_reg32_extract(GICV3_GICR_IIDR_VAL, info);
         return 1;
     case GICR_TYPER:
+    case GICR_TYPER + 4:
     {
         uint64_t typer, aff;
 
-        if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+        if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
         /* TBD: Update processor id in [23:8] when ITS support is added */
         aff = (MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 3) << 56 |
                MPIDR_AFFINITY_LEVEL(v->arch.vmpidr, 2) << 48 |
@@ -262,7 +272,7 @@ bad_width:
     return 0;
 
 read_as_zero_64:
-    if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+    if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
     *r = 0;
     return 1;
 
@@ -338,7 +348,7 @@ bad_width:
     return 0;
 
 write_ignore_64:
-    if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
     return 1;
 
 write_ignore_32:
@@ -803,7 +813,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     {
         uint64_t irouter;
 
-        if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+        if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto read_as_zero;
@@ -878,7 +888,7 @@ bad_width:
     return 0;
 
 read_as_zero_64:
-    if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
     *r = 0;
     return 1;
 
@@ -971,7 +981,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     {
         uint64_t irouter;
 
-        if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+        if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
         rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
                                 DABT_DOUBLE_WORD);
         if ( rank == NULL ) goto write_ignore;
@@ -1030,7 +1040,7 @@ write_ignore_32:
     return 1;
 
 write_ignore_64:
-    if ( dabt.size != DABT_DOUBLE_WORD ) goto bad_width;
+    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
     return 1;
 
 write_ignore:
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:53:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53: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 1a23XJ-0005IP-32; Thu, 26 Nov 2015 20:53:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XH-0005Fv-BA
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:59 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	E6/87-18107-A2177565; Thu, 26 Nov 2015 20:52:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1448571177!6810104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9111 invoked from network); 26 Nov 2015 20:52: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;
	26 Nov 2015 20:52:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XF-0003FM-4n
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XF-0000rO-2l
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:57 +0000
Date: Thu, 26 Nov 2015 20:52:57 +0000
Message-Id: <E1a23XF-0000rO-2l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Implement correctly
	ICFGR{0, 1} read-only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit afbbf2c8f638ba406b6f002fffe73f5761a5b658
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:27:56 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:27 2015 +0000

    xen/arm: vgic-v2: Implement correctly ICFGR{0, 1} read-only
    
    Each ITARGETSR register is 4-bytes wide and the offset is in bytes.
    
    The current implementation is computing the offset of ICFGR1 and ICFG2
    wrongly result to emulate only the first 2 byte of the ICFGR<n> range
    read-only. The rest will be treated as read-write.
    
    For convenience introduce ITARGETSR1 and ITARGETSR2.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- typoes in commit message ]
---
 xen/arch/arm/vgic-v2.c    |    6 ++++--
 xen/include/asm-arm/gic.h |    2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index c94f0f3..4fb954b 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -507,10 +507,12 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case GICD_ICFGR: /* SGIs */
         goto write_ignore_32;
-    case GICD_ICFGR + 1: /* PPIs */
+
+    case GICD_ICFGR1:
         /* It is implementation defined if these are writeable. We chose not */
         goto write_ignore_32;
-    case GICD_ICFGR + 2 ... GICD_ICFGRN: /* SPIs */
+
+    case GICD_ICFGR2 ... GICD_ICFGRN: /* SPIs */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 3064d1c..42a2eec 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -46,6 +46,8 @@
 #define GICD_ITARGETSR8 (0x820)
 #define GICD_ITARGETSRN (0xBF8)
 #define GICD_ICFGR      (0xC00)
+#define GICD_ICFGR1     (0xC04)
+#define GICD_ICFGR2     (0xC08)
 #define GICD_ICFGRN     (0xCFC)
 #define GICD_NSACR      (0xE00)
 #define GICD_NSACRN     (0xEFC)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:53:01 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53: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 1a23XJ-0005IP-32; Thu, 26 Nov 2015 20:53:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XH-0005Fv-BA
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:59 +0000
Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id
	E6/87-18107-A2177565; Thu, 26 Nov 2015 20:52:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1448571177!6810104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9111 invoked from network); 26 Nov 2015 20:52: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;
	26 Nov 2015 20:52:58 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XF-0003FM-4n
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XF-0000rO-2l
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:52:57 +0000
Date: Thu, 26 Nov 2015 20:52:57 +0000
Message-Id: <E1a23XF-0000rO-2l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v2: Implement correctly
	ICFGR{0, 1} read-only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit afbbf2c8f638ba406b6f002fffe73f5761a5b658
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:27:56 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:27 2015 +0000

    xen/arm: vgic-v2: Implement correctly ICFGR{0, 1} read-only
    
    Each ITARGETSR register is 4-bytes wide and the offset is in bytes.
    
    The current implementation is computing the offset of ICFGR1 and ICFG2
    wrongly result to emulate only the first 2 byte of the ICFGR<n> range
    read-only. The rest will be treated as read-write.
    
    For convenience introduce ITARGETSR1 and ITARGETSR2.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- typoes in commit message ]
---
 xen/arch/arm/vgic-v2.c    |    6 ++++--
 xen/include/asm-arm/gic.h |    2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index c94f0f3..4fb954b 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -507,10 +507,12 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case GICD_ICFGR: /* SGIs */
         goto write_ignore_32;
-    case GICD_ICFGR + 1: /* PPIs */
+
+    case GICD_ICFGR1:
         /* It is implementation defined if these are writeable. We chose not */
         goto write_ignore_32;
-    case GICD_ICFGR + 2 ... GICD_ICFGRN: /* SPIs */
+
+    case GICD_ICFGR2 ... GICD_ICFGRN: /* SPIs */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 3064d1c..42a2eec 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -46,6 +46,8 @@
 #define GICD_ITARGETSR8 (0x820)
 #define GICD_ITARGETSRN (0xBF8)
 #define GICD_ICFGR      (0xC00)
+#define GICD_ICFGR1     (0xC04)
+#define GICD_ICFGR2     (0xC08)
 #define GICD_ICFGRN     (0xCFC)
 #define GICD_NSACR      (0xE00)
 #define GICD_NSACRN     (0xEFC)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:53:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53: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 1a23XT-0005K6-6t; Thu, 26 Nov 2015 20:53: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 1a23XR-0005Jm-Gj
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:09 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	EF/2F-29649-43177565; Thu, 26 Nov 2015 20:53:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448571187!6942041!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2563 invoked from network); 26 Nov 2015 20:53:08 -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;
	26 Nov 2015 20:53:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XP-0003Fw-Bi
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XP-0000sA-AC
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:07 +0000
Date: Thu, 26 Nov 2015 20:53:07 +0000
Message-Id: <E1a23XP-0000sA-AC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Don't try to emulate
	IROUTER which do not exist in the spec
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 675b68f13de7449c033d345bcf469cc1b8cca6ac
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:27:57 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:27 2015 +0000

    xen/arm: vgic-v3: Don't try to emulate IROUTER which do not exist in the spec
    
    The range of valid IROUTER<n> are n = 32 - 1019 (see 8.9.13 in IHI 0069A)
    which correspond to the offset 0x6100-0x7FD8.
    
    Other offsets are invalid and therefore should not be emulated.
    
    Also remove the now unused label read_as_zero_64 and write_ignore_64.
    
    Note that GICD_IROUTER is kept to accommodate the GICv3 drivers which has
    been in part taken from Linux.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c            |   19 ++-----------------
 xen/include/asm-arm/gic_v3_defs.h |    3 +--
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 3a7b86f..902f64a 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -806,10 +806,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          * Manage in common
          */
         return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg, r);
-    case GICD_IROUTER ... GICD_IROUTER31:
-        /* SGI/PPI is RES0 */
-        goto read_as_zero_64;
-    case GICD_IROUTER32 ... GICD_IROUTERN:
+    case GICD_IROUTER32 ... GICD_IROUTER1019:
     {
         uint64_t irouter;
 
@@ -887,11 +884,6 @@ bad_width:
     domain_crash_synchronous();
     return 0;
 
-read_as_zero_64:
-    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
-    *r = 0;
-    return 1;
-
 read_as_zero_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     *r = 0;
@@ -974,10 +966,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
          * Manage in common */
         return __vgic_v3_distr_common_mmio_write("vGICD", v, info,
                                                  gicd_reg, r);
-    case GICD_IROUTER ... GICD_IROUTER31:
-        /* SGI/PPI is RES0 */
-        goto write_ignore_64;
-    case GICD_IROUTER32 ... GICD_IROUTERN:
+    case GICD_IROUTER32 ... GICD_IROUTER1019:
     {
         uint64_t irouter;
 
@@ -1039,10 +1028,6 @@ write_ignore_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     return 1;
 
-write_ignore_64:
-    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
-    return 1;
-
 write_ignore:
     return 1;
 }
diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index c6d73df..89a3548 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -29,9 +29,8 @@
 #define GICD_SETSPI_SR               (0x050)
 #define GICD_CLRSPI_SR               (0x058)
 #define GICD_IROUTER                 (0x6000)
-#define GICD_IROUTER31               (0x60F8)
 #define GICD_IROUTER32               (0x6100)
-#define GICD_IROUTERN                (0x7FF8)
+#define GICD_IROUTER1019             (0x7FD8)
 #define GICD_PIDR0                   (0xFFE0)
 #define GICD_PIDR1                   (0xFFE4)
 #define GICD_PIDR2                   (0xFFE8)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:53:11 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53: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 1a23XT-0005K6-6t; Thu, 26 Nov 2015 20:53: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 1a23XR-0005Jm-Gj
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:09 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	EF/2F-29649-43177565; Thu, 26 Nov 2015 20:53:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1448571187!6942041!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2563 invoked from network); 26 Nov 2015 20:53:08 -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;
	26 Nov 2015 20:53:08 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XP-0003Fw-Bi
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XP-0000sA-AC
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:07 +0000
Date: Thu, 26 Nov 2015 20:53:07 +0000
Message-Id: <E1a23XP-0000sA-AC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Don't try to emulate
	IROUTER which do not exist in the spec
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 675b68f13de7449c033d345bcf469cc1b8cca6ac
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:27:57 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:27 2015 +0000

    xen/arm: vgic-v3: Don't try to emulate IROUTER which do not exist in the spec
    
    The range of valid IROUTER<n> are n = 32 - 1019 (see 8.9.13 in IHI 0069A)
    which correspond to the offset 0x6100-0x7FD8.
    
    Other offsets are invalid and therefore should not be emulated.
    
    Also remove the now unused label read_as_zero_64 and write_ignore_64.
    
    Note that GICD_IROUTER is kept to accommodate the GICv3 drivers which has
    been in part taken from Linux.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c            |   19 ++-----------------
 xen/include/asm-arm/gic_v3_defs.h |    3 +--
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 3a7b86f..902f64a 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -806,10 +806,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          * Manage in common
          */
         return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg, r);
-    case GICD_IROUTER ... GICD_IROUTER31:
-        /* SGI/PPI is RES0 */
-        goto read_as_zero_64;
-    case GICD_IROUTER32 ... GICD_IROUTERN:
+    case GICD_IROUTER32 ... GICD_IROUTER1019:
     {
         uint64_t irouter;
 
@@ -887,11 +884,6 @@ bad_width:
     domain_crash_synchronous();
     return 0;
 
-read_as_zero_64:
-    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
-    *r = 0;
-    return 1;
-
 read_as_zero_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     *r = 0;
@@ -974,10 +966,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
          * Manage in common */
         return __vgic_v3_distr_common_mmio_write("vGICD", v, info,
                                                  gicd_reg, r);
-    case GICD_IROUTER ... GICD_IROUTER31:
-        /* SGI/PPI is RES0 */
-        goto write_ignore_64;
-    case GICD_IROUTER32 ... GICD_IROUTERN:
+    case GICD_IROUTER32 ... GICD_IROUTER1019:
     {
         uint64_t irouter;
 
@@ -1039,10 +1028,6 @@ write_ignore_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     return 1;
 
-write_ignore_64:
-    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
-    return 1;
-
 write_ignore:
     return 1;
 }
diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index c6d73df..89a3548 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -29,9 +29,8 @@
 #define GICD_SETSPI_SR               (0x050)
 #define GICD_CLRSPI_SR               (0x058)
 #define GICD_IROUTER                 (0x6000)
-#define GICD_IROUTER31               (0x60F8)
 #define GICD_IROUTER32               (0x6100)
-#define GICD_IROUTERN                (0x7FF8)
+#define GICD_IROUTER1019             (0x7FD8)
 #define GICD_PIDR0                   (0xFFE0)
 #define GICD_PIDR1                   (0xFFE4)
 #define GICD_PIDR2                   (0xFFE8)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:53:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23Xd-0005LW-BY; Thu, 26 Nov 2015 20:53:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xb-0005LC-NO
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:19 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	CE/7F-03235-F3177565; Thu, 26 Nov 2015 20:53:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1448571197!6808174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3004 invoked from network); 26 Nov 2015 20:53: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;
	26 Nov 2015 20:53:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XZ-0003G4-Kq
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XZ-0000se-Is
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:17 +0000
Date: Thu, 26 Nov 2015 20:53:17 +0000
Message-Id: <E1a23XZ-0000se-Is@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Use the correct
	offset GICR_IGRPMODR0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf1a142b3ef665bbd61b5b8375ca6e0544c42166
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:27:58 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:27 2015 +0000

    xen/arm: vgic-v3: Use the correct offset GICR_IGRPMODR0
    
    The offset is 0x0D00 and not 0x0F80.
    
    Also re-order the definition to keep all the definitions ordered.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/gic_v3_defs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index 89a3548..34e8b0a 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -96,7 +96,6 @@
 /* GICR for SGI's & PPI's */
 
 #define GICR_IGROUPR0                (0x0080)
-#define GICR_IGRPMODR0               (0x0F80)
 #define GICR_ISENABLER0              (0x0100)
 #define GICR_ICENABLER0              (0x0180)
 #define GICR_ISPENDR0                (0x0200)
@@ -107,6 +106,7 @@
 #define GICR_IPRIORITYR7             (0x041C)
 #define GICR_ICFGR0                  (0x0C00)
 #define GICR_ICFGR1                  (0x0C04)
+#define GICR_IGRPMODR0               (0x0D00)
 #define GICR_NSACR                   (0x0E00)
 
 #define GICR_TYPER_PLPIS             (1U << 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 Nov 26 20:53:21 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23Xd-0005LW-BY; Thu, 26 Nov 2015 20:53:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xb-0005LC-NO
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:19 +0000
Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id
	CE/7F-03235-F3177565; Thu, 26 Nov 2015 20:53:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1448571197!6808174!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3004 invoked from network); 26 Nov 2015 20:53: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;
	26 Nov 2015 20:53:18 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XZ-0003G4-Kq
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23XZ-0000se-Is
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:17 +0000
Date: Thu, 26 Nov 2015 20:53:17 +0000
Message-Id: <E1a23XZ-0000se-Is@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Use the correct
	offset GICR_IGRPMODR0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf1a142b3ef665bbd61b5b8375ca6e0544c42166
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:27:58 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:27 2015 +0000

    xen/arm: vgic-v3: Use the correct offset GICR_IGRPMODR0
    
    The offset is 0x0D00 and not 0x0F80.
    
    Also re-order the definition to keep all the definitions ordered.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/gic_v3_defs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index 89a3548..34e8b0a 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -96,7 +96,6 @@
 /* GICR for SGI's & PPI's */
 
 #define GICR_IGROUPR0                (0x0080)
-#define GICR_IGRPMODR0               (0x0F80)
 #define GICR_ISENABLER0              (0x0100)
 #define GICR_ICENABLER0              (0x0180)
 #define GICR_ISPENDR0                (0x0200)
@@ -107,6 +106,7 @@
 #define GICR_IPRIORITYR7             (0x041C)
 #define GICR_ICFGR0                  (0x0C00)
 #define GICR_ICFGR1                  (0x0C04)
+#define GICR_IGRPMODR0               (0x0D00)
 #define GICR_NSACR                   (0x0E00)
 
 #define GICR_TYPER_PLPIS             (1U << 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 Nov 26 20:53:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23Xo-0005Nq-Gn; Thu, 26 Nov 2015 20:53:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xm-0005NV-NP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:30 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	9A/3E-31069-94177565; Thu, 26 Nov 2015 20:53:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1448571208!6335162!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52590 invoked from network); 26 Nov 2015 20:53:29 -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;
	26 Nov 2015 20:53:29 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xk-0003GD-45
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xj-0000t8-SQ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:28 +0000
Date: Thu, 26 Nov 2015 20:53:27 +0000
Message-Id: <E1a23Xj-0000t8-SQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Only emulate
	identification registers required by the spec
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84ce5f4f3b17209346b5e80b6dc0cc2423fc084a
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:27:59 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:28 2015 +0000

    xen/arm: vgic-v3: Only emulate identification registers required by the spec
    
    Most of the identification registers space contains implementation
    defined registers (see 8.1.13 in ARM IHI 0069A) and only GIC{D,R}_PIDR2
    is required to be implemented.
    
    Currently the emulation of those registers mimic the ARM implementation,
    but it's untrue to say that we properly emulate a such implementation.
    
    Keep only GIC{D,R}_PIDR2 implemented with the "implementation defined
    bits" to zero and the ArchRev field (bits[7:4]) to 0x3 as we emulate a
    GICv3.
    
    Note that the emulation of the range wasn't valid anyway because the
    registers are split in 2 sets (PIDR4-PIDR7 and PIDR0-PIDR2).
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c            |  127 ++++++++++++++++++++++---------------
 xen/include/asm-arm/gic_v3_defs.h |   12 ----
 2 files changed, 76 insertions(+), 63 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 902f64a..0f6cb95 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -31,17 +31,15 @@
 #include <asm/gic_v3_defs.h>
 #include <asm/vgic.h>
 
-/* GICD_PIDRn register values for ARM implementations */
-#define GICV3_GICD_PIDR0  0x92
-#define GICV3_GICD_PIDR1  0xb4
-#define GICV3_GICD_PIDR2  0x3b
-#define GICV3_GICD_PIDR4  0x04
-
-/* GICR_PIDRn register values for ARM implementations */
-#define GICV3_GICR_PIDR0  0x93
-#define GICV3_GICR_PIDR1  GICV3_GICD_PIDR1
+/*
+ * PIDR2: Only bits[7:4] are not implementation defined. We are
+ * emulating a GICv3 ([7:4] = 0x3).
+ *
+ * We don't emulate a specific registers scheme so implement the others
+ * bits as RES0 as recommended by the spec (see 8.1.13 in ARM IHI 0069A).
+ */
+#define GICV3_GICD_PIDR2  0x30
 #define GICV3_GICR_PIDR2  GICV3_GICD_PIDR2
-#define GICV3_GICR_PIDR4  GICV3_GICD_PIDR4
 
 /*
  * GICD_CTLR default value:
@@ -237,28 +235,20 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICR_MOVALLR:
         /* WO Read as zero */
         goto read_as_zero_64;
-    case GICR_PIDR0:
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICR_PIDR0, info);
-         return 1;
-    case GICR_PIDR1:
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICR_PIDR1, info);
-         return 1;
+
+    case 0xFFD0 ... 0xFFE4:
+        /* Implementation defined identification registers */
+       goto read_impl_defined;
+
     case GICR_PIDR2:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICR_PIDR2, info);
          return 1;
-    case GICR_PIDR3:
-        /* Manufacture/customer defined */
-        goto read_as_zero_32;
-    case GICR_PIDR4:
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICR_PIDR4, info);
-         return 1;
-    case GICR_PIDR5 ... GICR_PIDR7:
-        /* Reserved0 */
-        goto read_as_zero_32;
+
+    case 0xFFEC ... 0xFFFC:
+         /* Implementation defined identification registers */
+         goto read_impl_defined;
+
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICR: unhandled read r%d offset %#08x\n",
@@ -280,6 +270,13 @@ read_as_zero_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     *r = 0;
     return 1;
+
+read_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: RAZ on implemention defined register offset %#08x\n",
+           v, gicr_reg);
+    *r = 0;
+    return 1;
 }
 
 static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
@@ -332,9 +329,19 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
     case GICR_MOVALLR:
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_PIDR7... GICR_PIDR0:
+
+    case 0xFFD0 ... 0xFFE4:
+        /* Implementation defined identification registers */
+       goto write_impl_defined;
+
+    case GICR_PIDR2:
         /* RO */
         goto write_ignore_32;
+
+    case 0xFFEC ... 0xFFFC:
+         /* Implementation defined identification registers */
+         goto write_impl_defined;
+
     default:
         printk(XENLOG_G_ERR "%pv: vGICR: unhandled write r%d offset %#08x\n",
                v, dabt.reg, gicr_reg);
@@ -354,6 +361,12 @@ write_ignore_64:
 write_ignore_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     return 1;
+
+write_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: WI on implementation defined register offset %#08x\n",
+           v, gicr_reg);
+    return 1;
 }
 
 static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
@@ -835,32 +848,21 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         /* Replaced with GICR_ISPENDR0. So ignore write */
         goto read_as_zero_32;
-    case GICD_PIDR0:
-        /* GICv3 identification value */
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICD_PIDR0, info);
-        return 1;
-    case GICD_PIDR1:
-        /* GICv3 identification value */
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICD_PIDR1, info);
-        return 1;
+
+    case 0xFFD0 ... 0xFFE4:
+        /* Implementation defined identification registers */
+       goto read_impl_defined;
+
     case GICD_PIDR2:
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICD_PIDR2, info);
         return 1;
-    case GICD_PIDR3:
-        /* GICv3 identification value. Manufacturer/Customer defined */
-        goto read_as_zero_32;
-    case GICD_PIDR4:
-        /* GICv3 identification value */
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICD_PIDR4, info);
-        return 1;
-    case GICD_PIDR5 ... GICD_PIDR7:
-        /* Reserved0 */
-        goto read_as_zero_32;
+
+    case 0xFFEC ... 0xFFFC:
+         /* Implementation defined identification registers */
+         goto read_impl_defined;
+
     case 0x00c:
     case 0x044:
     case 0x04c:
@@ -892,6 +894,13 @@ read_as_zero_32:
 read_as_zero:
     *r = 0;
     return 1;
+
+read_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: RAZ on implemention defined register offset %#08x\n",
+           v, gicd_reg);
+    *r = 0;
+    return 1;
 }
 
 static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
@@ -996,9 +1005,19 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* Replaced with GICR_ISPENDR0. So ignore write */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 0;
-    case GICD_PIDR7... GICD_PIDR0:
+
+    case 0xFFD0 ... 0xFFE4:
+        /* Implementation defined identification registers */
+       goto write_impl_defined;
+
+    case GICD_PIDR2:
         /* RO -- write ignore */
         goto write_ignore_32;
+
+    case 0xFFEC ... 0xFFFC:
+         /* Implementation defined identification registers */
+         goto write_impl_defined;
+
     case 0x00c:
     case 0x044:
     case 0x04c:
@@ -1030,6 +1049,12 @@ write_ignore_32:
 
 write_ignore:
     return 1;
+
+write_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: WI on implementation defined register offset %#08x\n",
+           v, gicd_reg);
+    return 1;
 }
 
 static int vgic_v3_to_sgi(struct vcpu *v, register_t sgir)
diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index 34e8b0a..5a6938c 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -31,13 +31,7 @@
 #define GICD_IROUTER                 (0x6000)
 #define GICD_IROUTER32               (0x6100)
 #define GICD_IROUTER1019             (0x7FD8)
-#define GICD_PIDR0                   (0xFFE0)
-#define GICD_PIDR1                   (0xFFE4)
 #define GICD_PIDR2                   (0xFFE8)
-#define GICD_PIDR3                   (0xFFEC)
-#define GICD_PIDR4                   (0xFFD0)
-#define GICD_PIDR5                   (0xFFD4)
-#define GICD_PIDR7                   (0xFFDC)
 
 /* Common between GICD_PIDR2 and GICR_PIDR2 */
 #define GIC_PIDR2_ARCH_MASK         (0xf0)
@@ -85,13 +79,7 @@
 #define GICR_SYNCR                   (0x00C0)
 #define GICR_MOVLPIR                 (0x100)
 #define GICR_MOVALLR                 (0x0110)
-#define GICR_PIDR0                   GICD_PIDR0
-#define GICR_PIDR1                   GICD_PIDR1
 #define GICR_PIDR2                   GICD_PIDR2
-#define GICR_PIDR3                   GICD_PIDR3
-#define GICR_PIDR4                   GICD_PIDR4
-#define GICR_PIDR5                   GICD_PIDR5
-#define GICR_PIDR7                   GICD_PIDR7
 
 /* GICR for SGI's & PPI's */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:53:32 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23Xo-0005Nq-Gn; Thu, 26 Nov 2015 20:53:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xm-0005NV-NP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:30 +0000
Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id
	9A/3E-31069-94177565; Thu, 26 Nov 2015 20:53:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1448571208!6335162!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 52590 invoked from network); 26 Nov 2015 20:53:29 -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;
	26 Nov 2015 20:53:29 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xk-0003GD-45
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xj-0000t8-SQ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:28 +0000
Date: Thu, 26 Nov 2015 20:53:27 +0000
Message-Id: <E1a23Xj-0000t8-SQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Only emulate
	identification registers required by the spec
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84ce5f4f3b17209346b5e80b6dc0cc2423fc084a
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:27:59 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:28 2015 +0000

    xen/arm: vgic-v3: Only emulate identification registers required by the spec
    
    Most of the identification registers space contains implementation
    defined registers (see 8.1.13 in ARM IHI 0069A) and only GIC{D,R}_PIDR2
    is required to be implemented.
    
    Currently the emulation of those registers mimic the ARM implementation,
    but it's untrue to say that we properly emulate a such implementation.
    
    Keep only GIC{D,R}_PIDR2 implemented with the "implementation defined
    bits" to zero and the ArchRev field (bits[7:4]) to 0x3 as we emulate a
    GICv3.
    
    Note that the emulation of the range wasn't valid anyway because the
    registers are split in 2 sets (PIDR4-PIDR7 and PIDR0-PIDR2).
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c            |  127 ++++++++++++++++++++++---------------
 xen/include/asm-arm/gic_v3_defs.h |   12 ----
 2 files changed, 76 insertions(+), 63 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 902f64a..0f6cb95 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -31,17 +31,15 @@
 #include <asm/gic_v3_defs.h>
 #include <asm/vgic.h>
 
-/* GICD_PIDRn register values for ARM implementations */
-#define GICV3_GICD_PIDR0  0x92
-#define GICV3_GICD_PIDR1  0xb4
-#define GICV3_GICD_PIDR2  0x3b
-#define GICV3_GICD_PIDR4  0x04
-
-/* GICR_PIDRn register values for ARM implementations */
-#define GICV3_GICR_PIDR0  0x93
-#define GICV3_GICR_PIDR1  GICV3_GICD_PIDR1
+/*
+ * PIDR2: Only bits[7:4] are not implementation defined. We are
+ * emulating a GICv3 ([7:4] = 0x3).
+ *
+ * We don't emulate a specific registers scheme so implement the others
+ * bits as RES0 as recommended by the spec (see 8.1.13 in ARM IHI 0069A).
+ */
+#define GICV3_GICD_PIDR2  0x30
 #define GICV3_GICR_PIDR2  GICV3_GICD_PIDR2
-#define GICV3_GICR_PIDR4  GICV3_GICD_PIDR4
 
 /*
  * GICD_CTLR default value:
@@ -237,28 +235,20 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICR_MOVALLR:
         /* WO Read as zero */
         goto read_as_zero_64;
-    case GICR_PIDR0:
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICR_PIDR0, info);
-         return 1;
-    case GICR_PIDR1:
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICR_PIDR1, info);
-         return 1;
+
+    case 0xFFD0 ... 0xFFE4:
+        /* Implementation defined identification registers */
+       goto read_impl_defined;
+
     case GICR_PIDR2:
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICR_PIDR2, info);
          return 1;
-    case GICR_PIDR3:
-        /* Manufacture/customer defined */
-        goto read_as_zero_32;
-    case GICR_PIDR4:
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICR_PIDR4, info);
-         return 1;
-    case GICR_PIDR5 ... GICR_PIDR7:
-        /* Reserved0 */
-        goto read_as_zero_32;
+
+    case 0xFFEC ... 0xFFFC:
+         /* Implementation defined identification registers */
+         goto read_impl_defined;
+
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICR: unhandled read r%d offset %#08x\n",
@@ -280,6 +270,13 @@ read_as_zero_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     *r = 0;
     return 1;
+
+read_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: RAZ on implemention defined register offset %#08x\n",
+           v, gicr_reg);
+    *r = 0;
+    return 1;
 }
 
 static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
@@ -332,9 +329,19 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
     case GICR_MOVALLR:
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_PIDR7... GICR_PIDR0:
+
+    case 0xFFD0 ... 0xFFE4:
+        /* Implementation defined identification registers */
+       goto write_impl_defined;
+
+    case GICR_PIDR2:
         /* RO */
         goto write_ignore_32;
+
+    case 0xFFEC ... 0xFFFC:
+         /* Implementation defined identification registers */
+         goto write_impl_defined;
+
     default:
         printk(XENLOG_G_ERR "%pv: vGICR: unhandled write r%d offset %#08x\n",
                v, dabt.reg, gicr_reg);
@@ -354,6 +361,12 @@ write_ignore_64:
 write_ignore_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     return 1;
+
+write_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: WI on implementation defined register offset %#08x\n",
+           v, gicr_reg);
+    return 1;
 }
 
 static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
@@ -835,32 +848,21 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         /* Replaced with GICR_ISPENDR0. So ignore write */
         goto read_as_zero_32;
-    case GICD_PIDR0:
-        /* GICv3 identification value */
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICD_PIDR0, info);
-        return 1;
-    case GICD_PIDR1:
-        /* GICv3 identification value */
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICD_PIDR1, info);
-        return 1;
+
+    case 0xFFD0 ... 0xFFE4:
+        /* Implementation defined identification registers */
+       goto read_impl_defined;
+
     case GICD_PIDR2:
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICD_PIDR2, info);
         return 1;
-    case GICD_PIDR3:
-        /* GICv3 identification value. Manufacturer/Customer defined */
-        goto read_as_zero_32;
-    case GICD_PIDR4:
-        /* GICv3 identification value */
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICD_PIDR4, info);
-        return 1;
-    case GICD_PIDR5 ... GICD_PIDR7:
-        /* Reserved0 */
-        goto read_as_zero_32;
+
+    case 0xFFEC ... 0xFFFC:
+         /* Implementation defined identification registers */
+         goto read_impl_defined;
+
     case 0x00c:
     case 0x044:
     case 0x04c:
@@ -892,6 +894,13 @@ read_as_zero_32:
 read_as_zero:
     *r = 0;
     return 1;
+
+read_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: RAZ on implemention defined register offset %#08x\n",
+           v, gicd_reg);
+    *r = 0;
+    return 1;
 }
 
 static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
@@ -996,9 +1005,19 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* Replaced with GICR_ISPENDR0. So ignore write */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 0;
-    case GICD_PIDR7... GICD_PIDR0:
+
+    case 0xFFD0 ... 0xFFE4:
+        /* Implementation defined identification registers */
+       goto write_impl_defined;
+
+    case GICD_PIDR2:
         /* RO -- write ignore */
         goto write_ignore_32;
+
+    case 0xFFEC ... 0xFFFC:
+         /* Implementation defined identification registers */
+         goto write_impl_defined;
+
     case 0x00c:
     case 0x044:
     case 0x04c:
@@ -1030,6 +1049,12 @@ write_ignore_32:
 
 write_ignore:
     return 1;
+
+write_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: WI on implementation defined register offset %#08x\n",
+           v, gicd_reg);
+    return 1;
 }
 
 static int vgic_v3_to_sgi(struct vcpu *v, register_t sgir)
diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index 34e8b0a..5a6938c 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -31,13 +31,7 @@
 #define GICD_IROUTER                 (0x6000)
 #define GICD_IROUTER32               (0x6100)
 #define GICD_IROUTER1019             (0x7FD8)
-#define GICD_PIDR0                   (0xFFE0)
-#define GICD_PIDR1                   (0xFFE4)
 #define GICD_PIDR2                   (0xFFE8)
-#define GICD_PIDR3                   (0xFFEC)
-#define GICD_PIDR4                   (0xFFD0)
-#define GICD_PIDR5                   (0xFFD4)
-#define GICD_PIDR7                   (0xFFDC)
 
 /* Common between GICD_PIDR2 and GICR_PIDR2 */
 #define GIC_PIDR2_ARCH_MASK         (0xf0)
@@ -85,13 +79,7 @@
 #define GICR_SYNCR                   (0x00C0)
 #define GICR_MOVLPIR                 (0x100)
 #define GICR_MOVALLR                 (0x0110)
-#define GICR_PIDR0                   GICD_PIDR0
-#define GICR_PIDR1                   GICD_PIDR1
 #define GICR_PIDR2                   GICD_PIDR2
-#define GICR_PIDR3                   GICD_PIDR3
-#define GICR_PIDR4                   GICD_PIDR4
-#define GICR_PIDR5                   GICD_PIDR5
-#define GICR_PIDR7                   GICD_PIDR7
 
 /* GICR for SGI's & PPI's */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:53:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53: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 1a23Y6-0005Pp-QB; Thu, 26 Nov 2015 20:53: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 1a23Y5-0005PL-Nd
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:50 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	99/8F-29649-45177565; Thu, 26 Nov 2015 20:53:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1448571218!7009069!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11586 invoked from network); 26 Nov 2015 20:53:39 -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;
	26 Nov 2015 20:53:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xu-0003GL-Dd
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xu-0000uD-Ax
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:38 +0000
Date: Thu, 26 Nov 2015 20:53:38 +0000
Message-Id: <E1a23Xu-0000uD-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Properly emulate the
	full register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a2b83f95bfad7c3533629cc7f3935cccc8e2d63d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:00 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:28 2015 +0000

    xen/arm: vgic: Properly emulate the full register
    
    The offset in the emulation is based on byte. As most of the registers
    are 64/32 bits, they will span over multiple bytes.
    
    However, the current emulation only cares about the first offset. This
    will result in not properly emulating any access on the register with
    any other offset.
    
    Introduce new macros to help implementing access on multiple byte and
    use them over the vGIC emulation.
    
    Note that I didn't convert the reserved/implementation defined
    registers. It will be done in a follow-up.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c          |   81 ++++++------
 xen/arch/arm/vgic-v3.c          |  287 +++++++++++++++++++++++---------------
 xen/include/asm-arm/vgic-emul.h |   24 ++++
 3 files changed, 240 insertions(+), 152 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 4fb954b..d1860a9 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -31,6 +31,7 @@
 #include <asm/mmio.h>
 #include <asm/platform.h>
 #include <asm/vgic.h>
+#include <asm/vgic-emul.h>
 
 static struct {
     bool_t enabled;
@@ -177,13 +178,14 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicd_reg )
     {
-    case GICD_CTLR:
+    case VREG32(GICD_CTLR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         vgic_lock(v);
         *r = vgic_reg32_extract(v->domain->arch.vgic.ctlr, info);
         vgic_unlock(v);
         return 1;
-    case GICD_TYPER:
+
+    case VREG32(GICD_TYPER):
     {
         uint32_t typer;
 
@@ -198,7 +200,8 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
 
         return 1;
     }
-    case GICD_IIDR:
+
+    case VREG32(GICD_IIDR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /*
          * XXX Do we need a JEP106 manufacturer ID?
@@ -211,11 +214,11 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case 0x020 ... 0x03c:
         goto read_as_zero;
 
-    case GICD_IGROUPR ... GICD_IGROUPRN:
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
 
-    case GICD_ISENABLER ... GICD_ISENABLERN:
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
@@ -224,7 +227,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
-    case GICD_ICENABLER ... GICD_ICENABLERN:
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
@@ -234,16 +237,16 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
 
     /* Read the pending status of an IRQ via GICD is not supported */
-    case GICD_ISPENDR ... GICD_ISPENDRN:
-    case GICD_ICPENDR ... GICD_ICPENDRN:
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         goto read_as_zero;
 
     /* Read the active status of an IRQ via GICD is not supported */
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
-    case GICD_ICACTIVER ... GICD_ICACTIVERN:
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         goto read_as_zero;
 
-    case GICD_ITARGETSR ... GICD_ITARGETSRN:
+    case VRANGE32(GICD_ITARGETSR, GICD_ITARGETSRN):
     {
         uint32_t itargetsr;
 
@@ -258,7 +261,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
         uint32_t ipriorityr;
 
@@ -276,7 +279,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_ICFGR ... GICD_ICFGRN:
+    case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
     {
         uint32_t icfgr;
 
@@ -292,26 +295,26 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_NSACR ... GICD_NSACRN:
+    case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
 
-    case GICD_SGIR:
+    case VREG32(GICD_SGIR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* Write only -- read unknown */
         *r = 0xdeadbeef;
         return 1;
 
     /* Setting/Clearing the SGI pending bit via GICD is not supported */
-    case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
-    case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
+    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
+    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
         goto read_as_zero;
 
     /* Implementation defined -- read as zero */
     case 0xfd0 ... 0xfe4:
         goto read_as_zero;
 
-    case GICD_ICPIDR2:
+    case VREG32(GICD_ICPIDR2):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR "%pv: vGICD: unhandled read from ICPIDR2\n", v);
         return 0;
@@ -396,7 +399,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicd_reg )
     {
-    case GICD_CTLR:
+    case VREG32(GICD_CTLR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* Ignore all but the enable bit */
         vgic_lock(v);
@@ -407,19 +410,19 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 1;
 
     /* R/O -- write ignored */
-    case GICD_TYPER:
-    case GICD_IIDR:
+    case VREG32(GICD_TYPER):
+    case VREG32(GICD_IIDR):
         goto write_ignore_32;
 
     /* Implementation defined -- write ignored */
     case 0x020 ... 0x03c:
         goto write_ignore;
 
-    case GICD_IGROUPR ... GICD_IGROUPRN:
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
 
-    case GICD_ISENABLER ... GICD_ISENABLERN:
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
@@ -430,7 +433,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
-    case GICD_ICENABLER ... GICD_ICENABLERN:
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
@@ -441,39 +444,39 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
-    case GICD_ISPENDR ... GICD_ISPENDRN:
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ISPENDR%d\n",
                v, r, gicd_reg - GICD_ISPENDR);
         return 0;
 
-    case GICD_ICPENDR ... GICD_ICPENDRN:
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ICPENDR%d\n",
                v, r, gicd_reg - GICD_ICPENDR);
         return 0;
 
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ISACTIVER%d\n",
                v, r, gicd_reg - GICD_ISACTIVER);
         return 0;
 
-    case GICD_ICACTIVER ... GICD_ICACTIVERN:
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
                v, r, gicd_reg - GICD_ICACTIVER);
         return 0;
 
-    case GICD_ITARGETSR ... GICD_ITARGETSR7:
+    case VRANGE32(GICD_ITARGETSR, GICD_ITARGETSR7):
         /* SGI/PPI target is read only */
         goto write_ignore_32;
 
-    case GICD_ITARGETSR8 ... GICD_ITARGETSRN:
+    case VRANGE32(GICD_ITARGETSR8, GICD_ITARGETSRN):
     {
         uint32_t itargetsr;
 
@@ -489,7 +492,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
         uint32_t *ipriorityr;
 
@@ -505,14 +508,14 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_ICFGR: /* SGIs */
+    case VREG32(GICD_ICFGR): /* SGIs */
         goto write_ignore_32;
 
-    case GICD_ICFGR1:
+    case VREG32(GICD_ICFGR1):
         /* It is implementation defined if these are writeable. We chose not */
         goto write_ignore_32;
 
-    case GICD_ICFGR2 ... GICD_ICFGRN: /* SPIs */
+    case VRANGE32(GICD_ICFGR2, GICD_ICFGRN): /* SPIs */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
@@ -523,22 +526,22 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
-    case GICD_NSACR ... GICD_NSACRN:
+    case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
 
-    case GICD_SGIR:
+    case VREG32(GICD_SGIR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return vgic_v2_to_sgi(v, r);
 
-    case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
+    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
                v, dabt.size ? "word" : "byte", r, gicd_reg - GICD_CPENDSGIR);
         return 0;
 
-    case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
+    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
@@ -550,7 +553,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         goto write_ignore;
 
     /* R/O -- write ignore */
-    case GICD_ICPIDR2:
+    case VREG32(GICD_ICPIDR2):
         goto write_ignore_32;
 
     /* Implementation defined -- write ignored */
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 0f6cb95..892104d 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -30,6 +30,7 @@
 #include <asm/mmio.h>
 #include <asm/gic_v3_defs.h>
 #include <asm/vgic.h>
+#include <asm/vgic-emul.h>
 
 /*
  * PIDR2: Only bits[7:4] are not implementation defined. We are
@@ -172,15 +173,16 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case GICR_CTLR:
+    case VREG32(GICR_CTLR):
         /* We have not implemented LPI's, read zero */
         goto read_as_zero_32;
-    case GICR_IIDR:
+
+    case VREG32(GICR_IIDR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICR_IIDR_VAL, info);
         return 1;
-    case GICR_TYPER:
-    case GICR_TYPER + 4:
+
+    case VREG64(GICR_TYPER):
     {
         uint64_t typer, aff;
 
@@ -199,40 +201,51 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
 
         return 1;
     }
-    case GICR_STATUSR:
+
+    case VREG32(GICR_STATUSR):
         /* Not implemented */
         goto read_as_zero_32;
-    case GICR_WAKER:
+
+    case VREG32(GICR_WAKER):
         /* Power management is not implemented */
         goto read_as_zero_32;
-    case GICR_SETLPIR:
+
+    case VREG64(GICR_SETLPIR):
         /* WO. Read as zero */
         goto read_as_zero_64;
-    case GICR_CLRLPIR:
+
+    case VREG64(GICR_CLRLPIR):
         /* WO. Read as zero */
         goto read_as_zero_64;
-    case GICR_PROPBASER:
+
+    case VREG64(GICR_PROPBASER):
         /* LPI's not implemented */
         goto read_as_zero_64;
-    case GICR_PENDBASER:
+
+    case VREG64(GICR_PENDBASER):
         /* LPI's not implemented */
         goto read_as_zero_64;
-    case GICR_INVLPIR:
+
+    case VREG64(GICR_INVLPIR):
         /* WO. Read as zero */
         goto read_as_zero_64;
-    case GICR_INVALLR:
+
+    case VREG64(GICR_INVALLR):
         /* WO. Read as zero */
         goto read_as_zero_64;
         return 0;
-    case GICR_SYNCR:
+
+    case VREG32(GICR_SYNCR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* RO . But when read it always returns busy bito bit[0] */
         *r = vgic_reg32_extract(GICR_SYNCR_NOT_BUSY, info);
         return 1;
-    case GICR_MOVLPIR:
+
+    case VREG64(GICR_MOVLPIR):
         /* WO Read as zero */
         goto read_as_zero_64;
-    case GICR_MOVALLR:
+
+    case VREG64(GICR_MOVALLR):
         /* WO Read as zero */
         goto read_as_zero_64;
 
@@ -240,7 +253,7 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* Implementation defined identification registers */
        goto read_impl_defined;
 
-    case GICR_PIDR2:
+    case VREG32(GICR_PIDR2):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICR_PIDR2, info);
          return 1;
@@ -287,46 +300,59 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case GICR_CTLR:
+    case VREG32(GICR_CTLR):
         /* LPI's not implemented */
         goto write_ignore_32;
-    case GICR_IIDR:
+
+    case VREG32(GICR_IIDR):
         /* RO */
         goto write_ignore_32;
-    case GICR_TYPER:
+
+    case VREG64(GICR_TYPER):
         /* RO */
         goto write_ignore_64;
-    case GICR_STATUSR:
+
+    case VREG32(GICR_STATUSR):
         /* Not implemented */
         goto write_ignore_32;
-    case GICR_WAKER:
+
+    case VREG32(GICR_WAKER):
         /* Power mgmt not implemented */
         goto write_ignore_32;
-    case GICR_SETLPIR:
+
+    case VREG64(GICR_SETLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_CLRLPIR:
+
+    case VREG64(GICR_CLRLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_PROPBASER:
+
+    case VREG64(GICR_PROPBASER):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_PENDBASER:
+
+    case VREG64(GICR_PENDBASER):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_INVLPIR:
+
+    case VREG64(GICR_INVLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_INVALLR:
+
+    case VREG64(GICR_INVALLR):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_SYNCR:
+
+    case VREG32(GICR_SYNCR):
         /* RO */
         goto write_ignore_32;
-    case GICR_MOVLPIR:
+
+    case VREG64(GICR_MOVLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_MOVALLR:
+
+    case VREG64(GICR_MOVALLR):
         /* LPI is not implemented */
         goto write_ignore_64;
 
@@ -334,7 +360,7 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* Implementation defined identification registers */
        goto write_impl_defined;
 
-    case GICR_PIDR2:
+    case VREG32(GICR_PIDR2):
         /* RO */
         goto write_ignore_32;
 
@@ -379,11 +405,12 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
 
     switch ( reg )
     {
-    case GICD_IGROUPR ... GICD_IGROUPRN:
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, read zero */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         goto read_as_zero;
-    case GICD_ISENABLER ... GICD_ISENABLERN:
+
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
@@ -391,7 +418,8 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
-    case GICD_ICENABLER ... GICD_ICENABLERN:
+
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
@@ -399,17 +427,18 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
+
     /* Read the pending status of an IRQ via GICD/GICR is not supported */
-    case GICD_ISPENDR ... GICD_ISPENDRN:
-    case GICD_ICPENDR ... GICD_ICPENDRN:
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDR):
         goto read_as_zero;
 
     /* Read the active status of an IRQ via GICD/GICR is not supported */
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
-    case GICD_ICACTIVER ... GICD_ICACTIVERN:
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVER):
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         goto read_as_zero;
 
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
         uint32_t ipriorityr;
 
@@ -427,7 +456,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         return 1;
     }
 
-    case GICD_ICFGR ... GICD_ICFGRN:
+    case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
     {
         uint32_t icfgr;
 
@@ -442,6 +471,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
 
         return 1;
     }
+
     default:
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled read r%d offset %#08x\n",
@@ -471,10 +501,11 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
 
     switch ( reg )
     {
-    case GICD_IGROUPR ... GICD_IGROUPRN:
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
-    case GICD_ISENABLER ... GICD_ISENABLERN:
+
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
@@ -484,7 +515,8 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_enable_irqs(v, (rank->ienable) & (~tr), rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
-    case GICD_ICENABLER ... GICD_ICENABLERN:
+
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
@@ -494,35 +526,36 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_disable_irqs(v, (~rank->ienable) & tr, rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
-    case GICD_ISPENDR ... GICD_ISPENDRN:
+
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ISPENDR%d\n",
                v, name, r, reg - GICD_ISPENDR);
         return 0;
 
-    case GICD_ICPENDR ... GICD_ICPENDRN:
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ICPENDR%d\n",
                v, name, r, reg - GICD_ICPENDR);
         return 0;
 
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ISACTIVER%d\n",
                v, name, r, reg - GICD_ISACTIVER);
         return 0;
 
-    case GICD_ICACTIVER ... GICD_ICACTIVERN:
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
                v, name, r, reg - GICD_ICACTIVER);
         return 0;
 
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
         uint32_t *ipriorityr;
 
@@ -536,9 +569,11 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_unlock_rank(v, rank, flags);
         return 1;
     }
-    case GICD_ICFGR: /* Restricted to configure SGIs */
+
+    case VREG32(GICD_ICFGR): /* Restricted to configure SGIs */
         goto write_ignore_32;
-    case GICD_ICFGR + 4 ... GICD_ICFGRN: /* PPI + SPIs */
+
+    case VRANGE32(GICD_ICFGR + 4, GICD_ICFGRN): /* PPI + SPIs */
         /* ICFGR1 for PPI's, which is implementation defined
            if ICFGR1 is programmable or not. We chose to program */
         if ( dabt.size != DABT_WORD ) goto bad_width;
@@ -578,16 +613,17 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case GICR_IGRPMODR0:
+    case VREG32(GICR_IGRPMODR0):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
-    case GICR_IGROUPR0:
-    case GICR_ISENABLER0:
-    case GICR_ICENABLER0:
-    case GICR_ISACTIVER0:
-    case GICR_ICACTIVER0:
-    case GICR_IPRIORITYR0...GICR_IPRIORITYR7:
-    case GICR_ICFGR0... GICR_ICFGR1:
+
+    case VREG32(GICR_IGROUPR0):
+    case VREG32(GICR_ISENABLER0):
+    case VREG32(GICR_ICENABLER0):
+    case VREG32(GICR_ISACTIVER0):
+    case VREG32(GICR_ICACTIVER0):
+    case VRANGE32(GICR_IPRIORITYR0, GICR_IPRIORITYR7):
+    case VRANGE32(GICR_ICFGR0, GICR_ICFGR1):
          /*
           * Above registers offset are common with GICD.
           * So handle in common with GICD handling
@@ -596,11 +632,11 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
                                                 gicr_reg, r);
 
     /* Read the pending status of an SGI is via GICR is not supported */
-    case GICR_ISPENDR0:
-    case GICR_ICPENDR0:
+    case VREG32(GICR_ISPENDR0):
+    case VREG32(GICR_ICPENDR0):
         goto read_as_zero;
 
-    case GICR_NSACR:
+    case VREG32(GICR_NSACR):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
 
@@ -630,39 +666,42 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case GICR_IGRPMODR0:
+    case VREG32(GICR_IGRPMODR0):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
-    case GICR_IGROUPR0:
-    case GICR_ISENABLER0:
-    case GICR_ICENABLER0:
-    case GICR_ISACTIVER0:
-    case GICR_ICACTIVER0:
-    case GICR_ICFGR1:
-    case GICR_IPRIORITYR0...GICR_IPRIORITYR7:
+
+    case VREG32(GICR_IGROUPR0):
+    case VREG32(GICR_ISENABLER0):
+    case VREG32(GICR_ICENABLER0):
+    case VREG32(GICR_ISACTIVER0):
+    case VREG32(GICR_ICACTIVER0):
+    case VREG32(GICR_ICFGR1):
+    case VRANGE32(GICR_IPRIORITYR0, GICR_IPRIORITYR7):
          /*
           * Above registers offset are common with GICD.
           * So handle common with GICD handling
           */
         return __vgic_v3_distr_common_mmio_write("vGICR: SGI", v,
                                                  info, gicr_reg, r);
-    case GICR_ISPENDR0:
+
+    case VREG32(GICR_ISPENDR0):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ISPENDR0\n",
                v, r);
         return 0;
 
-    case GICR_ICPENDR0:
+    case VREG32(GICR_ICPENDR0):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ICPENDR0\n",
                v, r);
         return 0;
 
-    case GICR_NSACR:
+    case VREG32(GICR_NSACR):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
+
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled write r%d offset %#08x\n",
@@ -761,13 +800,14 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicd_reg )
     {
-    case GICD_CTLR:
+    case VREG32(GICD_CTLR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         vgic_lock(v);
         *r = vgic_reg32_extract(v->domain->arch.vgic.ctlr, info);
         vgic_unlock(v);
         return 1;
-    case GICD_TYPER:
+
+    case VREG32(GICD_TYPER):
     {
         /*
          * Number of interrupt identifier bits supported by the GIC
@@ -792,34 +832,39 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
 
         return 1;
     }
-    case GICD_STATUSR:
+
+    case VREG32(GICD_STATUSR):
         /*
          *  Optional, Not implemented for now.
          *  Update to support guest debugging.
          */
         goto read_as_zero_32;
-    case GICD_IIDR:
+
+    case VREG32(GICD_IIDR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICD_IIDR_VAL, info);
         return 1;
+
     case 0x020 ... 0x03c:
     case 0xc000 ... 0xffcc:
         /* Implementation defined -- read as zero */
         goto read_as_zero_32;
-    case GICD_IGROUPR ... GICD_IGROUPRN:
-    case GICD_ISENABLER ... GICD_ISENABLERN:
-    case GICD_ICENABLER ... GICD_ICENABLERN:
-    case GICD_ISPENDR ... GICD_ISPENDRN:
-    case GICD_ICPENDR ... GICD_ICPENDRN:
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
-    case GICD_ICFGR ... GICD_ICFGRN:
+
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
+    case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
         /*
          * Above all register are common with GICR and GICD
          * Manage in common
          */
         return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg, r);
-    case GICD_IROUTER32 ... GICD_IROUTER1019:
+
+    case VRANGE64(GICD_IROUTER32, GICD_IROUTER1019):
     {
         uint64_t irouter;
 
@@ -836,16 +881,19 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_NSACR ... GICD_NSACRN:
+    case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
-    case GICD_SGIR:
+
+    case VREG32(GICD_SGIR):
         /* Read as ICH_SGIR system register with SRE set. So ignore */
         goto read_as_zero_32;
-    case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
+
+    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
         /* Replaced with GICR_ICPENDR0. So ignore write */
         goto read_as_zero_32;
-    case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
+
+    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
         /* Replaced with GICR_ISPENDR0. So ignore write */
         goto read_as_zero_32;
 
@@ -853,7 +901,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* Implementation defined identification registers */
        goto read_impl_defined;
 
-    case GICD_PIDR2:
+    case VREG32(GICD_PIDR2):
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICD_PIDR2, info);
@@ -915,7 +963,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicd_reg )
     {
-    case GICD_CTLR:
+    case VREG32(GICD_CTLR):
     {
         uint32_t ctlr = 0;
 
@@ -934,27 +982,35 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
         return 1;
     }
-    case GICD_TYPER:
+
+    case VREG32(GICD_TYPER):
         /* RO -- write ignored */
         goto write_ignore_32;
-    case GICD_IIDR:
+
+    case VREG32(GICD_IIDR):
         /* RO -- write ignored */
         goto write_ignore_32;
-    case GICD_STATUSR:
+
+    case VREG32(GICD_STATUSR):
         /* RO -- write ignored */
         goto write_ignore_32;
-    case GICD_SETSPI_NSR:
+
+    case VREG32(GICD_SETSPI_NSR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
-    case GICD_CLRSPI_NSR:
+
+    case VREG32(GICD_CLRSPI_NSR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
-    case GICD_SETSPI_SR:
+
+    case VREG32(GICD_SETSPI_SR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
-    case GICD_CLRSPI_SR:
+
+    case VREG32(GICD_CLRSPI_SR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
+
     case 0x020 ... 0x03c:
     case 0xc000 ... 0xffcc:
         /* Implementation defined -- write ignored */
@@ -962,20 +1018,22 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
                "%pv: vGICD: WI on implementation defined register offset %#08x\n",
                v, gicd_reg);
         goto write_ignore_32;
-    case GICD_IGROUPR ... GICD_IGROUPRN:
-    case GICD_ISENABLER ... GICD_ISENABLERN:
-    case GICD_ICENABLER ... GICD_ICENABLERN:
-    case GICD_ISPENDR ... GICD_ISPENDRN:
-    case GICD_ICPENDR ... GICD_ICPENDRN:
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
-    case GICD_ICACTIVER ... GICD_ICACTIVERN:
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
-    case GICD_ICFGR ... GICD_ICFGRN:
+
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
+    case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
         /* Above registers are common with GICR and GICD
          * Manage in common */
         return __vgic_v3_distr_common_mmio_write("vGICD", v, info,
                                                  gicd_reg, r);
-    case GICD_IROUTER32 ... GICD_IROUTER1019:
+
+    case VRANGE64(GICD_IROUTER32, GICD_IROUTER1019):
     {
         uint64_t irouter;
 
@@ -991,17 +1049,20 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_NSACR ... GICD_NSACRN:
+    case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
-    case GICD_SGIR:
+
+    case VREG32(GICD_SGIR):
         /* it is accessed as system register in GICv3 */
         goto write_ignore_32;
-    case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
+
+    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
         /* Replaced with GICR_ICPENDR0. So ignore write */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 0;
-    case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
+
+    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
         /* Replaced with GICR_ISPENDR0. So ignore write */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 0;
@@ -1010,7 +1071,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* Implementation defined identification registers */
        goto write_impl_defined;
 
-    case GICD_PIDR2:
+    case VREG32(GICD_PIDR2):
         /* RO -- write ignore */
         goto write_ignore_32;
 
diff --git a/xen/include/asm-arm/vgic-emul.h b/xen/include/asm-arm/vgic-emul.h
new file mode 100644
index 0000000..184a1f0
--- /dev/null
+++ b/xen/include/asm-arm/vgic-emul.h
@@ -0,0 +1,24 @@
+#ifndef __ASM_ARM_VGIC_EMUL_H__
+#define __ASM_ARM_VGIC_EMUL_H__
+
+/*
+ * Helpers to create easily a case to match emulate a single register or
+ * a range of registers
+ */
+
+#define VREG32(reg) reg ... reg + 3
+#define VREG64(reg) reg ... reg + 7
+
+#define VRANGE32(start, end) start ... end + 3
+#define VRANGE64(start, end) start ... end + 7
+
+#endif /* __ASM_ARM_VGIC_EMUL_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:53:50 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53: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 1a23Y6-0005Pp-QB; Thu, 26 Nov 2015 20:53: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 1a23Y5-0005PL-Nd
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:50 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	99/8F-29649-45177565; Thu, 26 Nov 2015 20:53:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1448571218!7009069!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11586 invoked from network); 26 Nov 2015 20:53:39 -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;
	26 Nov 2015 20:53:39 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xu-0003GL-Dd
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Xu-0000uD-Ax
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:38 +0000
Date: Thu, 26 Nov 2015 20:53:38 +0000
Message-Id: <E1a23Xu-0000uD-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Properly emulate the
	full register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a2b83f95bfad7c3533629cc7f3935cccc8e2d63d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:00 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:28 2015 +0000

    xen/arm: vgic: Properly emulate the full register
    
    The offset in the emulation is based on byte. As most of the registers
    are 64/32 bits, they will span over multiple bytes.
    
    However, the current emulation only cares about the first offset. This
    will result in not properly emulating any access on the register with
    any other offset.
    
    Introduce new macros to help implementing access on multiple byte and
    use them over the vGIC emulation.
    
    Note that I didn't convert the reserved/implementation defined
    registers. It will be done in a follow-up.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c          |   81 ++++++------
 xen/arch/arm/vgic-v3.c          |  287 +++++++++++++++++++++++---------------
 xen/include/asm-arm/vgic-emul.h |   24 ++++
 3 files changed, 240 insertions(+), 152 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 4fb954b..d1860a9 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -31,6 +31,7 @@
 #include <asm/mmio.h>
 #include <asm/platform.h>
 #include <asm/vgic.h>
+#include <asm/vgic-emul.h>
 
 static struct {
     bool_t enabled;
@@ -177,13 +178,14 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicd_reg )
     {
-    case GICD_CTLR:
+    case VREG32(GICD_CTLR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         vgic_lock(v);
         *r = vgic_reg32_extract(v->domain->arch.vgic.ctlr, info);
         vgic_unlock(v);
         return 1;
-    case GICD_TYPER:
+
+    case VREG32(GICD_TYPER):
     {
         uint32_t typer;
 
@@ -198,7 +200,8 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
 
         return 1;
     }
-    case GICD_IIDR:
+
+    case VREG32(GICD_IIDR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /*
          * XXX Do we need a JEP106 manufacturer ID?
@@ -211,11 +214,11 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case 0x020 ... 0x03c:
         goto read_as_zero;
 
-    case GICD_IGROUPR ... GICD_IGROUPRN:
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
 
-    case GICD_ISENABLER ... GICD_ISENABLERN:
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
@@ -224,7 +227,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
-    case GICD_ICENABLER ... GICD_ICENABLERN:
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
@@ -234,16 +237,16 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
 
     /* Read the pending status of an IRQ via GICD is not supported */
-    case GICD_ISPENDR ... GICD_ISPENDRN:
-    case GICD_ICPENDR ... GICD_ICPENDRN:
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         goto read_as_zero;
 
     /* Read the active status of an IRQ via GICD is not supported */
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
-    case GICD_ICACTIVER ... GICD_ICACTIVERN:
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         goto read_as_zero;
 
-    case GICD_ITARGETSR ... GICD_ITARGETSRN:
+    case VRANGE32(GICD_ITARGETSR, GICD_ITARGETSRN):
     {
         uint32_t itargetsr;
 
@@ -258,7 +261,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
         uint32_t ipriorityr;
 
@@ -276,7 +279,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_ICFGR ... GICD_ICFGRN:
+    case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
     {
         uint32_t icfgr;
 
@@ -292,26 +295,26 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_NSACR ... GICD_NSACRN:
+    case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
 
-    case GICD_SGIR:
+    case VREG32(GICD_SGIR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* Write only -- read unknown */
         *r = 0xdeadbeef;
         return 1;
 
     /* Setting/Clearing the SGI pending bit via GICD is not supported */
-    case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
-    case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
+    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
+    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
         goto read_as_zero;
 
     /* Implementation defined -- read as zero */
     case 0xfd0 ... 0xfe4:
         goto read_as_zero;
 
-    case GICD_ICPIDR2:
+    case VREG32(GICD_ICPIDR2):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR "%pv: vGICD: unhandled read from ICPIDR2\n", v);
         return 0;
@@ -396,7 +399,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicd_reg )
     {
-    case GICD_CTLR:
+    case VREG32(GICD_CTLR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* Ignore all but the enable bit */
         vgic_lock(v);
@@ -407,19 +410,19 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 1;
 
     /* R/O -- write ignored */
-    case GICD_TYPER:
-    case GICD_IIDR:
+    case VREG32(GICD_TYPER):
+    case VREG32(GICD_IIDR):
         goto write_ignore_32;
 
     /* Implementation defined -- write ignored */
     case 0x020 ... 0x03c:
         goto write_ignore;
 
-    case GICD_IGROUPR ... GICD_IGROUPRN:
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
 
-    case GICD_ISENABLER ... GICD_ISENABLERN:
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
@@ -430,7 +433,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
-    case GICD_ICENABLER ... GICD_ICENABLERN:
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
@@ -441,39 +444,39 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
-    case GICD_ISPENDR ... GICD_ISPENDRN:
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ISPENDR%d\n",
                v, r, gicd_reg - GICD_ISPENDR);
         return 0;
 
-    case GICD_ICPENDR ... GICD_ICPENDRN:
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ICPENDR%d\n",
                v, r, gicd_reg - GICD_ICPENDR);
         return 0;
 
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ISACTIVER%d\n",
                v, r, gicd_reg - GICD_ISACTIVER);
         return 0;
 
-    case GICD_ICACTIVER ... GICD_ICACTIVERN:
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
                v, r, gicd_reg - GICD_ICACTIVER);
         return 0;
 
-    case GICD_ITARGETSR ... GICD_ITARGETSR7:
+    case VRANGE32(GICD_ITARGETSR, GICD_ITARGETSR7):
         /* SGI/PPI target is read only */
         goto write_ignore_32;
 
-    case GICD_ITARGETSR8 ... GICD_ITARGETSRN:
+    case VRANGE32(GICD_ITARGETSR8, GICD_ITARGETSRN):
     {
         uint32_t itargetsr;
 
@@ -489,7 +492,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
         uint32_t *ipriorityr;
 
@@ -505,14 +508,14 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_ICFGR: /* SGIs */
+    case VREG32(GICD_ICFGR): /* SGIs */
         goto write_ignore_32;
 
-    case GICD_ICFGR1:
+    case VREG32(GICD_ICFGR1):
         /* It is implementation defined if these are writeable. We chose not */
         goto write_ignore_32;
 
-    case GICD_ICFGR2 ... GICD_ICFGRN: /* SPIs */
+    case VRANGE32(GICD_ICFGR2, GICD_ICFGRN): /* SPIs */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR, DABT_WORD);
         if ( rank == NULL) goto write_ignore;
@@ -523,22 +526,22 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
-    case GICD_NSACR ... GICD_NSACRN:
+    case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
 
-    case GICD_SGIR:
+    case VREG32(GICD_SGIR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return vgic_v2_to_sgi(v, r);
 
-    case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
+    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
                v, dabt.size ? "word" : "byte", r, gicd_reg - GICD_CPENDSGIR);
         return 0;
 
-    case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
+    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
@@ -550,7 +553,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         goto write_ignore;
 
     /* R/O -- write ignore */
-    case GICD_ICPIDR2:
+    case VREG32(GICD_ICPIDR2):
         goto write_ignore_32;
 
     /* Implementation defined -- write ignored */
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 0f6cb95..892104d 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -30,6 +30,7 @@
 #include <asm/mmio.h>
 #include <asm/gic_v3_defs.h>
 #include <asm/vgic.h>
+#include <asm/vgic-emul.h>
 
 /*
  * PIDR2: Only bits[7:4] are not implementation defined. We are
@@ -172,15 +173,16 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case GICR_CTLR:
+    case VREG32(GICR_CTLR):
         /* We have not implemented LPI's, read zero */
         goto read_as_zero_32;
-    case GICR_IIDR:
+
+    case VREG32(GICR_IIDR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICR_IIDR_VAL, info);
         return 1;
-    case GICR_TYPER:
-    case GICR_TYPER + 4:
+
+    case VREG64(GICR_TYPER):
     {
         uint64_t typer, aff;
 
@@ -199,40 +201,51 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
 
         return 1;
     }
-    case GICR_STATUSR:
+
+    case VREG32(GICR_STATUSR):
         /* Not implemented */
         goto read_as_zero_32;
-    case GICR_WAKER:
+
+    case VREG32(GICR_WAKER):
         /* Power management is not implemented */
         goto read_as_zero_32;
-    case GICR_SETLPIR:
+
+    case VREG64(GICR_SETLPIR):
         /* WO. Read as zero */
         goto read_as_zero_64;
-    case GICR_CLRLPIR:
+
+    case VREG64(GICR_CLRLPIR):
         /* WO. Read as zero */
         goto read_as_zero_64;
-    case GICR_PROPBASER:
+
+    case VREG64(GICR_PROPBASER):
         /* LPI's not implemented */
         goto read_as_zero_64;
-    case GICR_PENDBASER:
+
+    case VREG64(GICR_PENDBASER):
         /* LPI's not implemented */
         goto read_as_zero_64;
-    case GICR_INVLPIR:
+
+    case VREG64(GICR_INVLPIR):
         /* WO. Read as zero */
         goto read_as_zero_64;
-    case GICR_INVALLR:
+
+    case VREG64(GICR_INVALLR):
         /* WO. Read as zero */
         goto read_as_zero_64;
         return 0;
-    case GICR_SYNCR:
+
+    case VREG32(GICR_SYNCR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* RO . But when read it always returns busy bito bit[0] */
         *r = vgic_reg32_extract(GICR_SYNCR_NOT_BUSY, info);
         return 1;
-    case GICR_MOVLPIR:
+
+    case VREG64(GICR_MOVLPIR):
         /* WO Read as zero */
         goto read_as_zero_64;
-    case GICR_MOVALLR:
+
+    case VREG64(GICR_MOVALLR):
         /* WO Read as zero */
         goto read_as_zero_64;
 
@@ -240,7 +253,7 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* Implementation defined identification registers */
        goto read_impl_defined;
 
-    case GICR_PIDR2:
+    case VREG32(GICR_PIDR2):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICR_PIDR2, info);
          return 1;
@@ -287,46 +300,59 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case GICR_CTLR:
+    case VREG32(GICR_CTLR):
         /* LPI's not implemented */
         goto write_ignore_32;
-    case GICR_IIDR:
+
+    case VREG32(GICR_IIDR):
         /* RO */
         goto write_ignore_32;
-    case GICR_TYPER:
+
+    case VREG64(GICR_TYPER):
         /* RO */
         goto write_ignore_64;
-    case GICR_STATUSR:
+
+    case VREG32(GICR_STATUSR):
         /* Not implemented */
         goto write_ignore_32;
-    case GICR_WAKER:
+
+    case VREG32(GICR_WAKER):
         /* Power mgmt not implemented */
         goto write_ignore_32;
-    case GICR_SETLPIR:
+
+    case VREG64(GICR_SETLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_CLRLPIR:
+
+    case VREG64(GICR_CLRLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_PROPBASER:
+
+    case VREG64(GICR_PROPBASER):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_PENDBASER:
+
+    case VREG64(GICR_PENDBASER):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_INVLPIR:
+
+    case VREG64(GICR_INVLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_INVALLR:
+
+    case VREG64(GICR_INVALLR):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_SYNCR:
+
+    case VREG32(GICR_SYNCR):
         /* RO */
         goto write_ignore_32;
-    case GICR_MOVLPIR:
+
+    case VREG64(GICR_MOVLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
-    case GICR_MOVALLR:
+
+    case VREG64(GICR_MOVALLR):
         /* LPI is not implemented */
         goto write_ignore_64;
 
@@ -334,7 +360,7 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* Implementation defined identification registers */
        goto write_impl_defined;
 
-    case GICR_PIDR2:
+    case VREG32(GICR_PIDR2):
         /* RO */
         goto write_ignore_32;
 
@@ -379,11 +405,12 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
 
     switch ( reg )
     {
-    case GICD_IGROUPR ... GICD_IGROUPRN:
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, read zero */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         goto read_as_zero;
-    case GICD_ISENABLER ... GICD_ISENABLERN:
+
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
@@ -391,7 +418,8 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
-    case GICD_ICENABLER ... GICD_ICENABLERN:
+
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL ) goto read_as_zero;
@@ -399,17 +427,18 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         *r = vgic_reg32_extract(rank->ienable, info);
         vgic_unlock_rank(v, rank, flags);
         return 1;
+
     /* Read the pending status of an IRQ via GICD/GICR is not supported */
-    case GICD_ISPENDR ... GICD_ISPENDRN:
-    case GICD_ICPENDR ... GICD_ICPENDRN:
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDR):
         goto read_as_zero;
 
     /* Read the active status of an IRQ via GICD/GICR is not supported */
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
-    case GICD_ICACTIVER ... GICD_ICACTIVERN:
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVER):
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         goto read_as_zero;
 
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
         uint32_t ipriorityr;
 
@@ -427,7 +456,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
         return 1;
     }
 
-    case GICD_ICFGR ... GICD_ICFGRN:
+    case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
     {
         uint32_t icfgr;
 
@@ -442,6 +471,7 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
 
         return 1;
     }
+
     default:
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled read r%d offset %#08x\n",
@@ -471,10 +501,11 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
 
     switch ( reg )
     {
-    case GICD_IGROUPR ... GICD_IGROUPRN:
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
-    case GICD_ISENABLER ... GICD_ISENABLERN:
+
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, reg - GICD_ISENABLER, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
@@ -484,7 +515,8 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_enable_irqs(v, (rank->ienable) & (~tr), rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
-    case GICD_ICENABLER ... GICD_ICENABLERN:
+
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         rank = vgic_rank_offset(v, 1, reg - GICD_ICENABLER, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
@@ -494,35 +526,36 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_disable_irqs(v, (~rank->ienable) & tr, rank->index);
         vgic_unlock_rank(v, rank, flags);
         return 1;
-    case GICD_ISPENDR ... GICD_ISPENDRN:
+
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ISPENDR%d\n",
                v, name, r, reg - GICD_ISPENDR);
         return 0;
 
-    case GICD_ICPENDR ... GICD_ICPENDRN:
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ICPENDR%d\n",
                v, name, r, reg - GICD_ICPENDR);
         return 0;
 
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ISACTIVER%d\n",
                v, name, r, reg - GICD_ISACTIVER);
         return 0;
 
-    case GICD_ICACTIVER ... GICD_ICACTIVERN:
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: %s: unhandled word write %#"PRIregister" to ICACTIVER%d\n",
                v, name, r, reg - GICD_ICACTIVER);
         return 0;
 
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
         uint32_t *ipriorityr;
 
@@ -536,9 +569,11 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         vgic_unlock_rank(v, rank, flags);
         return 1;
     }
-    case GICD_ICFGR: /* Restricted to configure SGIs */
+
+    case VREG32(GICD_ICFGR): /* Restricted to configure SGIs */
         goto write_ignore_32;
-    case GICD_ICFGR + 4 ... GICD_ICFGRN: /* PPI + SPIs */
+
+    case VRANGE32(GICD_ICFGR + 4, GICD_ICFGRN): /* PPI + SPIs */
         /* ICFGR1 for PPI's, which is implementation defined
            if ICFGR1 is programmable or not. We chose to program */
         if ( dabt.size != DABT_WORD ) goto bad_width;
@@ -578,16 +613,17 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case GICR_IGRPMODR0:
+    case VREG32(GICR_IGRPMODR0):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
-    case GICR_IGROUPR0:
-    case GICR_ISENABLER0:
-    case GICR_ICENABLER0:
-    case GICR_ISACTIVER0:
-    case GICR_ICACTIVER0:
-    case GICR_IPRIORITYR0...GICR_IPRIORITYR7:
-    case GICR_ICFGR0... GICR_ICFGR1:
+
+    case VREG32(GICR_IGROUPR0):
+    case VREG32(GICR_ISENABLER0):
+    case VREG32(GICR_ICENABLER0):
+    case VREG32(GICR_ISACTIVER0):
+    case VREG32(GICR_ICACTIVER0):
+    case VRANGE32(GICR_IPRIORITYR0, GICR_IPRIORITYR7):
+    case VRANGE32(GICR_ICFGR0, GICR_ICFGR1):
          /*
           * Above registers offset are common with GICD.
           * So handle in common with GICD handling
@@ -596,11 +632,11 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
                                                 gicr_reg, r);
 
     /* Read the pending status of an SGI is via GICR is not supported */
-    case GICR_ISPENDR0:
-    case GICR_ICPENDR0:
+    case VREG32(GICR_ISPENDR0):
+    case VREG32(GICR_ICPENDR0):
         goto read_as_zero;
 
-    case GICR_NSACR:
+    case VREG32(GICR_NSACR):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
 
@@ -630,39 +666,42 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case GICR_IGRPMODR0:
+    case VREG32(GICR_IGRPMODR0):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
-    case GICR_IGROUPR0:
-    case GICR_ISENABLER0:
-    case GICR_ICENABLER0:
-    case GICR_ISACTIVER0:
-    case GICR_ICACTIVER0:
-    case GICR_ICFGR1:
-    case GICR_IPRIORITYR0...GICR_IPRIORITYR7:
+
+    case VREG32(GICR_IGROUPR0):
+    case VREG32(GICR_ISENABLER0):
+    case VREG32(GICR_ICENABLER0):
+    case VREG32(GICR_ISACTIVER0):
+    case VREG32(GICR_ICACTIVER0):
+    case VREG32(GICR_ICFGR1):
+    case VRANGE32(GICR_IPRIORITYR0, GICR_IPRIORITYR7):
          /*
           * Above registers offset are common with GICD.
           * So handle common with GICD handling
           */
         return __vgic_v3_distr_common_mmio_write("vGICR: SGI", v,
                                                  info, gicr_reg, r);
-    case GICR_ISPENDR0:
+
+    case VREG32(GICR_ISPENDR0):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ISPENDR0\n",
                v, r);
         return 0;
 
-    case GICR_ICPENDR0:
+    case VREG32(GICR_ICPENDR0):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled word write %#"PRIregister" to ICPENDR0\n",
                v, r);
         return 0;
 
-    case GICR_NSACR:
+    case VREG32(GICR_NSACR):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
+
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled write r%d offset %#08x\n",
@@ -761,13 +800,14 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicd_reg )
     {
-    case GICD_CTLR:
+    case VREG32(GICD_CTLR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         vgic_lock(v);
         *r = vgic_reg32_extract(v->domain->arch.vgic.ctlr, info);
         vgic_unlock(v);
         return 1;
-    case GICD_TYPER:
+
+    case VREG32(GICD_TYPER):
     {
         /*
          * Number of interrupt identifier bits supported by the GIC
@@ -792,34 +832,39 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
 
         return 1;
     }
-    case GICD_STATUSR:
+
+    case VREG32(GICD_STATUSR):
         /*
          *  Optional, Not implemented for now.
          *  Update to support guest debugging.
          */
         goto read_as_zero_32;
-    case GICD_IIDR:
+
+    case VREG32(GICD_IIDR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICD_IIDR_VAL, info);
         return 1;
+
     case 0x020 ... 0x03c:
     case 0xc000 ... 0xffcc:
         /* Implementation defined -- read as zero */
         goto read_as_zero_32;
-    case GICD_IGROUPR ... GICD_IGROUPRN:
-    case GICD_ISENABLER ... GICD_ISENABLERN:
-    case GICD_ICENABLER ... GICD_ICENABLERN:
-    case GICD_ISPENDR ... GICD_ISPENDRN:
-    case GICD_ICPENDR ... GICD_ICPENDRN:
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
-    case GICD_ICFGR ... GICD_ICFGRN:
+
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
+    case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
         /*
          * Above all register are common with GICR and GICD
          * Manage in common
          */
         return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg, r);
-    case GICD_IROUTER32 ... GICD_IROUTER1019:
+
+    case VRANGE64(GICD_IROUTER32, GICD_IROUTER1019):
     {
         uint64_t irouter;
 
@@ -836,16 +881,19 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_NSACR ... GICD_NSACRN:
+    case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
-    case GICD_SGIR:
+
+    case VREG32(GICD_SGIR):
         /* Read as ICH_SGIR system register with SRE set. So ignore */
         goto read_as_zero_32;
-    case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
+
+    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
         /* Replaced with GICR_ICPENDR0. So ignore write */
         goto read_as_zero_32;
-    case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
+
+    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
         /* Replaced with GICR_ISPENDR0. So ignore write */
         goto read_as_zero_32;
 
@@ -853,7 +901,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* Implementation defined identification registers */
        goto read_impl_defined;
 
-    case GICD_PIDR2:
+    case VREG32(GICD_PIDR2):
         /* GICv3 identification value */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         *r = vgic_reg32_extract(GICV3_GICD_PIDR2, info);
@@ -915,7 +963,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicd_reg )
     {
-    case GICD_CTLR:
+    case VREG32(GICD_CTLR):
     {
         uint32_t ctlr = 0;
 
@@ -934,27 +982,35 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
         return 1;
     }
-    case GICD_TYPER:
+
+    case VREG32(GICD_TYPER):
         /* RO -- write ignored */
         goto write_ignore_32;
-    case GICD_IIDR:
+
+    case VREG32(GICD_IIDR):
         /* RO -- write ignored */
         goto write_ignore_32;
-    case GICD_STATUSR:
+
+    case VREG32(GICD_STATUSR):
         /* RO -- write ignored */
         goto write_ignore_32;
-    case GICD_SETSPI_NSR:
+
+    case VREG32(GICD_SETSPI_NSR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
-    case GICD_CLRSPI_NSR:
+
+    case VREG32(GICD_CLRSPI_NSR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
-    case GICD_SETSPI_SR:
+
+    case VREG32(GICD_SETSPI_SR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
-    case GICD_CLRSPI_SR:
+
+    case VREG32(GICD_CLRSPI_SR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
+
     case 0x020 ... 0x03c:
     case 0xc000 ... 0xffcc:
         /* Implementation defined -- write ignored */
@@ -962,20 +1018,22 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
                "%pv: vGICD: WI on implementation defined register offset %#08x\n",
                v, gicd_reg);
         goto write_ignore_32;
-    case GICD_IGROUPR ... GICD_IGROUPRN:
-    case GICD_ISENABLER ... GICD_ISENABLERN:
-    case GICD_ICENABLER ... GICD_ICENABLERN:
-    case GICD_ISPENDR ... GICD_ISPENDRN:
-    case GICD_ICPENDR ... GICD_ICPENDRN:
-    case GICD_ISACTIVER ... GICD_ISACTIVERN:
-    case GICD_ICACTIVER ... GICD_ICACTIVERN:
-    case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
-    case GICD_ICFGR ... GICD_ICFGRN:
+
+    case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
+    case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
+    case VRANGE32(GICD_ICENABLER, GICD_ICENABLERN):
+    case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
+    case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
+    case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
+    case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
         /* Above registers are common with GICR and GICD
          * Manage in common */
         return __vgic_v3_distr_common_mmio_write("vGICD", v, info,
                                                  gicd_reg, r);
-    case GICD_IROUTER32 ... GICD_IROUTER1019:
+
+    case VRANGE64(GICD_IROUTER32, GICD_IROUTER1019):
     {
         uint64_t irouter;
 
@@ -991,17 +1049,20 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case GICD_NSACR ... GICD_NSACRN:
+    case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
-    case GICD_SGIR:
+
+    case VREG32(GICD_SGIR):
         /* it is accessed as system register in GICv3 */
         goto write_ignore_32;
-    case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
+
+    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
         /* Replaced with GICR_ICPENDR0. So ignore write */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 0;
-    case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
+
+    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
         /* Replaced with GICR_ISPENDR0. So ignore write */
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 0;
@@ -1010,7 +1071,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* Implementation defined identification registers */
        goto write_impl_defined;
 
-    case GICD_PIDR2:
+    case VREG32(GICD_PIDR2):
         /* RO -- write ignore */
         goto write_ignore_32;
 
diff --git a/xen/include/asm-arm/vgic-emul.h b/xen/include/asm-arm/vgic-emul.h
new file mode 100644
index 0000000..184a1f0
--- /dev/null
+++ b/xen/include/asm-arm/vgic-emul.h
@@ -0,0 +1,24 @@
+#ifndef __ASM_ARM_VGIC_EMUL_H__
+#define __ASM_ARM_VGIC_EMUL_H__
+
+/*
+ * Helpers to create easily a case to match emulate a single register or
+ * a range of registers
+ */
+
+#define VREG32(reg) reg ... reg + 3
+#define VREG64(reg) reg ... reg + 7
+
+#define VRANGE32(start, end) start ... end + 3
+#define VRANGE64(start, end) start ... end + 7
+
+#endif /* __ASM_ARM_VGIC_EMUL_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:53:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53: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 1a23Y8-0005QW-1v; Thu, 26 Nov 2015 20:53: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 1a23Y7-0005Po-84
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:51 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	F9/32-12946-E5177565; Thu, 26 Nov 2015 20:53:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1448571228!6347125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64449 invoked from network); 26 Nov 2015 20:53:49 -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;
	26 Nov 2015 20:53:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Y4-0003GP-NM
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Y4-0000uj-Li
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:48 +0000
Date: Thu, 26 Nov 2015 20:53:48 +0000
Message-Id: <E1a23Y4-0000uj-Li@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Remove GICR_MOVALLR
	and GICR_MOVLPIR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 49b6d4cf1fa79e764cddea2f412954fa7c347cf3
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:01 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:28 2015 +0000

    xen/arm: vgic-v3: Remove GICR_MOVALLR and GICR_MOVLPIR
    
    The 2 registers are not described in the software spec (ARM IHI 0069A)
    and their offsets are marked "implementation defined".
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c            |   20 ++++++++------------
 xen/include/asm-arm/gic_v3_defs.h |    2 --
 2 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 892104d..28f075a 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -241,13 +241,11 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = vgic_reg32_extract(GICR_SYNCR_NOT_BUSY, info);
         return 1;
 
-    case VREG64(GICR_MOVLPIR):
-        /* WO Read as zero */
-        goto read_as_zero_64;
+    case VREG64(0x0100):
+        goto read_impl_defined;
 
-    case VREG64(GICR_MOVALLR):
-        /* WO Read as zero */
-        goto read_as_zero_64;
+    case VREG64(0x0110):
+        goto read_impl_defined;
 
     case 0xFFD0 ... 0xFFE4:
         /* Implementation defined identification registers */
@@ -348,13 +346,11 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO */
         goto write_ignore_32;
 
-    case VREG64(GICR_MOVLPIR):
-        /* LPI is not implemented */
-        goto write_ignore_64;
+    case VREG64(0x0100):
+        goto write_impl_defined;
 
-    case VREG64(GICR_MOVALLR):
-        /* LPI is not implemented */
-        goto write_ignore_64;
+    case VREG64(0x0110):
+        goto write_impl_defined;
 
     case 0xFFD0 ... 0xFFE4:
         /* Implementation defined identification registers */
diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index 5a6938c..6d98491 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -77,8 +77,6 @@
 #define GICR_INVLPIR                 (0x00A0)
 #define GICR_INVALLR                 (0x00B0)
 #define GICR_SYNCR                   (0x00C0)
-#define GICR_MOVLPIR                 (0x100)
-#define GICR_MOVALLR                 (0x0110)
 #define GICR_PIDR2                   GICD_PIDR2
 
 /* GICR for SGI's & PPI's */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:53:52 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:53: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 1a23Y8-0005QW-1v; Thu, 26 Nov 2015 20:53: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 1a23Y7-0005Po-84
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:51 +0000
Received: from [85.158.137.68] by server-15.bemta-3.messagelabs.com id
	F9/32-12946-E5177565; Thu, 26 Nov 2015 20:53:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1448571228!6347125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 64449 invoked from network); 26 Nov 2015 20:53:49 -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;
	26 Nov 2015 20:53:49 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Y4-0003GP-NM
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Y4-0000uj-Li
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:48 +0000
Date: Thu, 26 Nov 2015 20:53:48 +0000
Message-Id: <E1a23Y4-0000uj-Li@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Remove GICR_MOVALLR
	and GICR_MOVLPIR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 49b6d4cf1fa79e764cddea2f412954fa7c347cf3
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:01 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:28 2015 +0000

    xen/arm: vgic-v3: Remove GICR_MOVALLR and GICR_MOVLPIR
    
    The 2 registers are not described in the software spec (ARM IHI 0069A)
    and their offsets are marked "implementation defined".
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c            |   20 ++++++++------------
 xen/include/asm-arm/gic_v3_defs.h |    2 --
 2 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 892104d..28f075a 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -241,13 +241,11 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = vgic_reg32_extract(GICR_SYNCR_NOT_BUSY, info);
         return 1;
 
-    case VREG64(GICR_MOVLPIR):
-        /* WO Read as zero */
-        goto read_as_zero_64;
+    case VREG64(0x0100):
+        goto read_impl_defined;
 
-    case VREG64(GICR_MOVALLR):
-        /* WO Read as zero */
-        goto read_as_zero_64;
+    case VREG64(0x0110):
+        goto read_impl_defined;
 
     case 0xFFD0 ... 0xFFE4:
         /* Implementation defined identification registers */
@@ -348,13 +346,11 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO */
         goto write_ignore_32;
 
-    case VREG64(GICR_MOVLPIR):
-        /* LPI is not implemented */
-        goto write_ignore_64;
+    case VREG64(0x0100):
+        goto write_impl_defined;
 
-    case VREG64(GICR_MOVALLR):
-        /* LPI is not implemented */
-        goto write_ignore_64;
+    case VREG64(0x0110):
+        goto write_impl_defined;
 
     case 0xFFD0 ... 0xFFE4:
         /* Implementation defined identification registers */
diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index 5a6938c..6d98491 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -77,8 +77,6 @@
 #define GICR_INVLPIR                 (0x00A0)
 #define GICR_INVALLR                 (0x00B0)
 #define GICR_SYNCR                   (0x00C0)
-#define GICR_MOVLPIR                 (0x100)
-#define GICR_MOVALLR                 (0x0110)
 #define GICR_PIDR2                   GICD_PIDR2
 
 /* GICR for SGI's & PPI's */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:54:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23YJ-0005SH-6G; Thu, 26 Nov 2015 20:54:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YH-0005S9-W0
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:02 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	6E/D4-13183-96177565; Thu, 26 Nov 2015 20:54:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1448571239!7009101!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13128 invoked from network); 26 Nov 2015 20:53:59 -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;
	26 Nov 2015 20:53:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YE-0003Gb-Tr
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YE-0000vG-Sl
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:58 +0000
Date: Thu, 26 Nov 2015 20:53:58 +0000
Message-Id: <E1a23YE-0000vG-Sl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Re-order the register
	emulations to match the memory map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5482d13dcfd675644148e807abbb0a5c4a5e660d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:02 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:28 2015 +0000

    xen/arm: vgic: Re-order the register emulations to match the memory map
    
    It helps to find quickly whether we forgot to emulate a register or not.
    
    At the same time add the missing reserved/implementation defined
    registers. All other missing registers will be added in a follow-up if
    necessary.
    
    Note that only the distributor register map explicitely say the
    size of a register (see 8.8 in ARM IHI 0069A). When the size is not
    known, the implementation defined/reserved may not be emulated
    correctly.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c |  177 ++++++++++++++++++-----------
 xen/arch/arm/vgic-v3.c |  298 +++++++++++++++++++++++++++++++++++-------------
 2 files changed, 328 insertions(+), 147 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index d1860a9..2c73133 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -210,9 +210,14 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = vgic_reg32_extract(0x0000043b, info);
         return 1;
 
-    /* Implementation defined -- read as zero */
-    case 0x020 ... 0x03c:
-        goto read_as_zero;
+    case VRANGE32(0x00C, 0x01C):
+        goto read_reserved;
+
+    case VRANGE32(0x020, 0x03C):
+        goto read_impl_defined;
+
+    case VRANGE32(0x040, 0x07C):
+        goto read_reserved;
 
     case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, read zero */
@@ -246,21 +251,6 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         goto read_as_zero;
 
-    case VRANGE32(GICD_ITARGETSR, GICD_ITARGETSRN):
-    {
-        uint32_t itargetsr;
-
-        if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
-        if ( rank == NULL) goto read_as_zero;
-        vgic_lock_rank(v, rank, flags);
-        itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
-        vgic_unlock_rank(v, rank, flags);
-        *r = vgic_reg32_extract(itargetsr, info);
-
-        return 1;
-    }
-
     case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
         uint32_t ipriorityr;
@@ -279,6 +269,27 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
+    case VREG32(0x7FC):
+        goto read_reserved;
+
+    case VRANGE32(GICD_ITARGETSR, GICD_ITARGETSRN):
+    {
+        uint32_t itargetsr;
+
+        if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
+        if ( rank == NULL) goto read_as_zero;
+        vgic_lock_rank(v, rank, flags);
+        itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
+        vgic_unlock_rank(v, rank, flags);
+        *r = vgic_reg32_extract(itargetsr, info);
+
+        return 1;
+    }
+
+    case VREG32(0xBFC):
+        goto read_reserved;
+
     case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
     {
         uint32_t icfgr;
@@ -295,6 +306,9 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
+    case VRANGE32(0xD00, 0xDFC):
+        goto read_impl_defined;
+
     case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
@@ -305,32 +319,27 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = 0xdeadbeef;
         return 1;
 
+    case VRANGE32(0xF04, 0xF0C):
+        goto read_reserved;
+
     /* Setting/Clearing the SGI pending bit via GICD is not supported */
     case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
     case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
         goto read_as_zero;
 
-    /* Implementation defined -- read as zero */
-    case 0xfd0 ... 0xfe4:
-        goto read_as_zero;
+    case VRANGE32(0xF30, 0xFCC):
+        goto read_reserved;
+
+    case VRANGE32(0xFD0, 0xFE4):
+        goto read_impl_defined;
 
     case VREG32(GICD_ICPIDR2):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR "%pv: vGICD: unhandled read from ICPIDR2\n", v);
         return 0;
 
-    /* Implementation defined -- read as zero */
-    case 0xfec ... 0xffc:
-        goto read_as_zero;
-
-    /* Reserved -- read as zero */
-    case 0x00c ... 0x01c:
-    case 0x040 ... 0x07c:
-    case 0x7fc:
-    case 0xbfc:
-    case 0xf04 ... 0xf0c:
-    case 0xf30 ... 0xfcc:
-        goto read_as_zero;
+    case VRANGE32(0xFEC, 0xFFC):
+        goto read_impl_defined;
 
     default:
         printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
@@ -349,6 +358,20 @@ read_as_zero_32:
 read_as_zero:
     *r = 0;
     return 1;
+
+read_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: RAZ on implemention defined register offset %#08x\n",
+           v, gicd_reg);
+    *r = 0;
+    return 1;
+
+read_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: RAZ on reserved register offset %#08x\n",
+           v, gicd_reg);
+    *r = 0;
+    return 1;
 }
 
 static int vgic_v2_to_sgi(struct vcpu *v, register_t sgir)
@@ -414,9 +437,14 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     case VREG32(GICD_IIDR):
         goto write_ignore_32;
 
-    /* Implementation defined -- write ignored */
-    case 0x020 ... 0x03c:
-        goto write_ignore;
+    case VRANGE32(0x00C, 0x01C):
+        goto write_reserved;
+
+    case VRANGE32(0x020, 0x03C):
+        goto write_impl_defined;
+
+    case VRANGE32(0x040, 0x07C):
+        goto write_reserved;
 
     case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, write ignore */
@@ -472,6 +500,25 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
                v, r, gicd_reg - GICD_ICACTIVER);
         return 0;
 
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
+    {
+        uint32_t *ipriorityr;
+
+        if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR, DABT_WORD);
+        if ( rank == NULL) goto write_ignore;
+        vgic_lock_rank(v, rank, flags);
+        ipriorityr = &rank->ipriorityr[REG_RANK_INDEX(8,
+                                                      gicd_reg - GICD_IPRIORITYR,
+                                                      DABT_WORD)];
+        vgic_reg32_update(ipriorityr, r, info);
+        vgic_unlock_rank(v, rank, flags);
+        return 1;
+    }
+
+    case VREG32(0x7FC):
+        goto write_reserved;
+
     case VRANGE32(GICD_ITARGETSR, GICD_ITARGETSR7):
         /* SGI/PPI target is read only */
         goto write_ignore_32;
@@ -492,21 +539,8 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
-    {
-        uint32_t *ipriorityr;
-
-        if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR, DABT_WORD);
-        if ( rank == NULL) goto write_ignore;
-        vgic_lock_rank(v, rank, flags);
-        ipriorityr = &rank->ipriorityr[REG_RANK_INDEX(8,
-                                                      gicd_reg - GICD_IPRIORITYR,
-                                                      DABT_WORD)];
-        vgic_reg32_update(ipriorityr, r, info);
-        vgic_unlock_rank(v, rank, flags);
-        return 1;
-    }
+    case VREG32(0xBFC):
+        goto write_reserved;
 
     case VREG32(GICD_ICFGR): /* SGIs */
         goto write_ignore_32;
@@ -526,6 +560,9 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
+    case VRANGE32(0xD00, 0xDFC):
+        goto write_impl_defined;
+
     case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
@@ -534,6 +571,9 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return vgic_v2_to_sgi(v, r);
 
+    case VRANGE32(0xF04, 0xF0C):
+        goto write_reserved;
+
     case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
@@ -548,26 +588,19 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
                v, dabt.size ? "word" : "byte", r, gicd_reg - GICD_SPENDSGIR);
         return 0;
 
-    /* Implementation defined -- write ignored */
-    case 0xfd0 ... 0xfe4:
-        goto write_ignore;
+    case VRANGE32(0xF30, 0xFCC):
+        goto write_reserved;
+
+    case VRANGE32(0xFD0, 0xFE4):
+        /* Implementation defined identification registers */
+        goto write_impl_defined;
 
     /* R/O -- write ignore */
     case VREG32(GICD_ICPIDR2):
         goto write_ignore_32;
 
-    /* Implementation defined -- write ignored */
-    case 0xfec ... 0xffc:
-        goto write_ignore;
-
-    /* Reserved -- write ignored */
-    case 0x00c ... 0x01c:
-    case 0x040 ... 0x07c:
-    case 0x7fc:
-    case 0xbfc:
-    case 0xf04 ... 0xf0c:
-    case 0xf30 ... 0xfcc:
-        goto write_ignore;
+    case VRANGE32(0xFEC, 0xFFC):
+        /* Implementation defined identification registers */
 
     default:
         printk(XENLOG_G_ERR
@@ -587,6 +620,18 @@ write_ignore_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
 write_ignore:
     return 1;
+
+write_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: WI on implementation defined register offset %#08x\n",
+           v, gicd_reg);
+    return 1;
+
+write_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: WI on implementation defined register offset %#08x\n",
+           v, gicd_reg);
+    return 1;
 }
 
 static const struct mmio_handler_ops vgic_v2_distr_mmio_handler = {
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 28f075a..f9d8ecb 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -210,6 +210,12 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* Power management is not implemented */
         goto read_as_zero_32;
 
+    case 0x0018:
+        goto read_reserved;
+
+    case 0x0020:
+        goto read_impl_defined;
+
     case VREG64(GICR_SETLPIR):
         /* WO. Read as zero */
         goto read_as_zero_64;
@@ -218,6 +224,9 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* WO. Read as zero */
         goto read_as_zero_64;
 
+    case 0x0050:
+        goto read_reserved;
+
     case VREG64(GICR_PROPBASER):
         /* LPI's not implemented */
         goto read_as_zero_64;
@@ -226,27 +235,48 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* LPI's not implemented */
         goto read_as_zero_64;
 
+    case 0x0080:
+        goto read_reserved;
+
     case VREG64(GICR_INVLPIR):
         /* WO. Read as zero */
         goto read_as_zero_64;
 
+    case 0x00A8:
+        goto read_reserved;
+
     case VREG64(GICR_INVALLR):
         /* WO. Read as zero */
         goto read_as_zero_64;
         return 0;
 
+    case 0x00B8:
+        goto read_reserved;
+
     case VREG32(GICR_SYNCR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* RO . But when read it always returns busy bito bit[0] */
         *r = vgic_reg32_extract(GICR_SYNCR_NOT_BUSY, info);
         return 1;
 
+    case 0x00C8:
+        goto read_reserved;
+
     case VREG64(0x0100):
         goto read_impl_defined;
 
+    case 0x0108:
+        goto read_reserved;
+
     case VREG64(0x0110):
         goto read_impl_defined;
 
+    case 0x0118 ... 0xBFFC:
+        goto read_reserved;
+
+    case 0xC000 ... 0xFFCC:
+        goto read_impl_defined;
+
     case 0xFFD0 ... 0xFFE4:
         /* Implementation defined identification registers */
        goto read_impl_defined;
@@ -284,7 +314,14 @@ read_as_zero_32:
 
 read_impl_defined:
     printk(XENLOG_G_DEBUG
-           "%pv: vGICR: RAZ on implemention defined register offset %#08x\n",
+           "%pv: vGICR: RAZ on implementation defined register offset %#08x\n",
+           v, gicr_reg);
+    *r = 0;
+    return 1;
+
+read_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: RAZ on reserved register offset %#08x\n",
            v, gicr_reg);
     *r = 0;
     return 1;
@@ -318,6 +355,12 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* Power mgmt not implemented */
         goto write_ignore_32;
 
+    case 0x0018:
+        goto write_reserved;
+
+    case 0x0020:
+        goto write_impl_defined;
+
     case VREG64(GICR_SETLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
@@ -326,6 +369,9 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* LPI is not implemented */
         goto write_ignore_64;
 
+    case 0x0050:
+        goto write_reserved;
+
     case VREG64(GICR_PROPBASER):
         /* LPI is not implemented */
         goto write_ignore_64;
@@ -334,24 +380,45 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* LPI is not implemented */
         goto write_ignore_64;
 
+    case 0x0080:
+        goto write_reserved;
+
     case VREG64(GICR_INVLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
 
+    case 0x00A8:
+        goto write_reserved;
+
     case VREG64(GICR_INVALLR):
         /* LPI is not implemented */
         goto write_ignore_64;
 
+    case 0x00B8:
+        goto write_reserved;
+
     case VREG32(GICR_SYNCR):
         /* RO */
         goto write_ignore_32;
 
+    case 0x00C8:
+        goto write_reserved;
+
     case VREG64(0x0100):
         goto write_impl_defined;
 
+    case 0x0108:
+        goto write_reserved;
+
     case VREG64(0x0110):
         goto write_impl_defined;
 
+    case 0x0118 ... 0xBFFC:
+        goto write_reserved;
+
+    case 0xC000 ... 0xFFCC:
+        goto write_impl_defined;
+
     case 0xFFD0 ... 0xFFE4:
         /* Implementation defined identification registers */
        goto write_impl_defined;
@@ -389,6 +456,12 @@ write_impl_defined:
            "%pv: vGICR: WI on implementation defined register offset %#08x\n",
            v, gicr_reg);
     return 1;
+
+write_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: WI on reserved register offset %#08x\n",
+           v, gicr_reg);
+    return 1;
 }
 
 static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
@@ -609,10 +682,6 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case VREG32(GICR_IGRPMODR0):
-        /* We do not implement security extensions for guests, read zero */
-        goto read_as_zero_32;
-
     case VREG32(GICR_IGROUPR0):
     case VREG32(GICR_ISENABLER0):
     case VREG32(GICR_ICENABLER0):
@@ -632,10 +701,23 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VREG32(GICR_ICPENDR0):
         goto read_as_zero;
 
+    case VREG32(GICR_IGRPMODR0):
+        /* We do not implement security extensions for guests, read zero */
+        goto read_as_zero_32;
+
     case VREG32(GICR_NSACR):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
 
+    case 0x0E04 ... 0xBFFC:
+        goto read_reserved;
+
+    case 0xC000 ... 0xFFCC:
+        goto read_impl_defined;
+
+    case 0xFFD0 ... 0xFFFC:
+        goto read_reserved;
+
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled read r%d offset %#08x\n",
@@ -653,6 +735,21 @@ read_as_zero_32:
 read_as_zero:
     *r = 0;
     return 1;
+
+read_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: SGI: RAZ on implementation defined register offset %#08x\n",
+           v, gicr_reg);
+    *r = 0;
+    return 1;
+
+read_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: SGI: RAZ on reserved register offset %#08x\n",
+           v, gicr_reg);
+    *r = 0;
+    return 1;
+
 }
 
 static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
@@ -662,10 +759,6 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case VREG32(GICR_IGRPMODR0):
-        /* We do not implement security extensions for guests, write ignore */
-        goto write_ignore_32;
-
     case VREG32(GICR_IGROUPR0):
     case VREG32(GICR_ISENABLER0):
     case VREG32(GICR_ICENABLER0):
@@ -694,6 +787,11 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
                v, r);
         return 0;
 
+    case VREG32(GICR_IGRPMODR0):
+        /* We do not implement security extensions for guests, write ignore */
+        goto write_ignore_32;
+
+
     case VREG32(GICR_NSACR):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
@@ -829,6 +927,14 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
+    case VREG32(GICD_IIDR):
+        if ( dabt.size != DABT_WORD ) goto bad_width;
+        *r = vgic_reg32_extract(GICV3_GICD_IIDR_VAL, info);
+        return 1;
+
+    case VREG32(0x000C):
+        goto read_reserved;
+
     case VREG32(GICD_STATUSR):
         /*
          *  Optional, Not implemented for now.
@@ -836,15 +942,23 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          */
         goto read_as_zero_32;
 
-    case VREG32(GICD_IIDR):
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICD_IIDR_VAL, info);
-        return 1;
+    case VRANGE32(0x0014, 0x001C):
+        goto read_reserved;
 
-    case 0x020 ... 0x03c:
-    case 0xc000 ... 0xffcc:
-        /* Implementation defined -- read as zero */
-        goto read_as_zero_32;
+    case VRANGE32(0x0020, 0x003C):
+        goto read_impl_defined;
+
+    case VREG32(0x0044):
+        goto read_reserved;
+
+    case VREG32(0x004C):
+        goto read_reserved;
+
+    case VREG32(0x0054):
+        goto read_reserved;
+
+    case VRANGE32(0x005C, 0x007C):
+        goto read_reserved;
 
     case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
     case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
@@ -860,6 +974,25 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          */
         return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg, r);
 
+    case VRANGE32(GICD_NSACR, GICD_NSACRN):
+        /* We do not implement security extensions for guests, read zero */
+        goto read_as_zero_32;
+
+    case VREG32(GICD_SGIR):
+        /* Read as ICH_SGIR system register with SRE set. So ignore */
+        goto read_as_zero_32;
+
+    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
+        /* Replaced with GICR_ICPENDR0. So ignore write */
+        goto read_as_zero_32;
+
+    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
+        /* Replaced with GICR_ISPENDR0. So ignore write */
+        goto read_as_zero_32;
+
+    case VRANGE32(0x0F30, 0x60FC):
+        goto read_reserved;
+
     case VRANGE64(GICD_IROUTER32, GICD_IROUTER1019):
     {
         uint64_t irouter;
@@ -877,23 +1010,13 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case VRANGE32(GICD_NSACR, GICD_NSACRN):
-        /* We do not implement security extensions for guests, read zero */
-        goto read_as_zero_32;
+    case VRANGE32(0x7FE0, 0xBFFC):
+        goto read_reserved;
 
-    case VREG32(GICD_SGIR):
-        /* Read as ICH_SGIR system register with SRE set. So ignore */
-        goto read_as_zero_32;
-
-    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
-        /* Replaced with GICR_ICPENDR0. So ignore write */
-        goto read_as_zero_32;
-
-    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
-        /* Replaced with GICR_ISPENDR0. So ignore write */
-        goto read_as_zero_32;
+    case VRANGE32(0xC000, 0xFFCC):
+        goto read_impl_defined;
 
-    case 0xFFD0 ... 0xFFE4:
+    case VRANGE32(0xFFD0, 0xFFE4):
         /* Implementation defined identification registers */
        goto read_impl_defined;
 
@@ -903,21 +1026,10 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = vgic_reg32_extract(GICV3_GICD_PIDR2, info);
         return 1;
 
-    case 0xFFEC ... 0xFFFC:
+    case VRANGE32(0xFFEC, 0xFFFC):
          /* Implementation defined identification registers */
          goto read_impl_defined;
 
-    case 0x00c:
-    case 0x044:
-    case 0x04c:
-    case 0x05c ... 0x07c:
-    case 0xf30 ... 0x5fcc:
-    case 0x8000 ... 0xbfcc:
-        /* These are reserved register addresses */
-        printk(XENLOG_G_DEBUG
-               "%pv: vGICD: RAZ on reserved register offset %#08x\n",
-               v, gicd_reg);
-        goto read_as_zero;
     default:
         printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
                v, dabt.reg, gicd_reg);
@@ -941,7 +1053,14 @@ read_as_zero:
 
 read_impl_defined:
     printk(XENLOG_G_DEBUG
-           "%pv: vGICD: RAZ on implemention defined register offset %#08x\n",
+           "%pv: vGICD: RAZ on implementation defined register offset %#08x\n",
+           v, gicd_reg);
+    *r = 0;
+    return 1;
+
+read_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: RAZ on reserved register offset %#08x\n",
            v, gicd_reg);
     *r = 0;
     return 1;
@@ -987,33 +1106,46 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO -- write ignored */
         goto write_ignore_32;
 
+    case VREG32(0x000C):
+        goto write_reserved;
+
     case VREG32(GICD_STATUSR):
         /* RO -- write ignored */
         goto write_ignore_32;
 
+    case VRANGE32(0x0014, 0x001C):
+        goto write_reserved;
+
+    case VRANGE32(0x0020, 0x003C):
+        goto write_impl_defined;
+
     case VREG32(GICD_SETSPI_NSR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
 
+    case VREG32(0x0044):
+        goto write_reserved;
+
     case VREG32(GICD_CLRSPI_NSR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
 
+    case VREG32(0x004C):
+        goto write_reserved;
+
     case VREG32(GICD_SETSPI_SR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
 
+    case VREG32(0x0054):
+        goto write_reserved;
+
     case VREG32(GICD_CLRSPI_SR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
 
-    case 0x020 ... 0x03c:
-    case 0xc000 ... 0xffcc:
-        /* Implementation defined -- write ignored */
-        printk(XENLOG_G_DEBUG
-               "%pv: vGICD: WI on implementation defined register offset %#08x\n",
-               v, gicd_reg);
-        goto write_ignore_32;
+    case VRANGE32(0x005C, 0x007C):
+        goto write_reserved;
 
     case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
     case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
@@ -1029,22 +1161,6 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return __vgic_v3_distr_common_mmio_write("vGICD", v, info,
                                                  gicd_reg, r);
 
-    case VRANGE64(GICD_IROUTER32, GICD_IROUTER1019):
-    {
-        uint64_t irouter;
-
-        if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
-        rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
-                                DABT_DOUBLE_WORD);
-        if ( rank == NULL ) goto write_ignore;
-        vgic_lock_rank(v, rank, flags);
-        irouter = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
-        vgic_reg64_update(&irouter, r, info);
-        vgic_store_irouter(v->domain, rank, gicd_reg - GICD_IROUTER, irouter);
-        vgic_unlock_rank(v, rank, flags);
-        return 1;
-    }
-
     case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
@@ -1063,7 +1179,32 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 0;
 
-    case 0xFFD0 ... 0xFFE4:
+    case VRANGE32(0x0F30, 0x60FC):
+        goto write_reserved;
+
+    case VRANGE64(GICD_IROUTER32, GICD_IROUTER1019):
+    {
+        uint64_t irouter;
+
+        if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
+        rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
+                                DABT_DOUBLE_WORD);
+        if ( rank == NULL ) goto write_ignore;
+        vgic_lock_rank(v, rank, flags);
+        irouter = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
+        vgic_reg64_update(&irouter, r, info);
+        vgic_store_irouter(v->domain, rank, gicd_reg - GICD_IROUTER, irouter);
+        vgic_unlock_rank(v, rank, flags);
+        return 1;
+    }
+
+    case VRANGE32(0x7FE0, 0xBFFC):
+        goto write_reserved;
+
+    case VRANGE32(0xC000, 0xFFCC):
+        goto write_impl_defined;
+
+    case VRANGE32(0xFFD0, 0xFFE4):
         /* Implementation defined identification registers */
        goto write_impl_defined;
 
@@ -1071,21 +1212,10 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO -- write ignore */
         goto write_ignore_32;
 
-    case 0xFFEC ... 0xFFFC:
+    case VRANGE32(0xFFEC, 0xFFFC):
          /* Implementation defined identification registers */
          goto write_impl_defined;
 
-    case 0x00c:
-    case 0x044:
-    case 0x04c:
-    case 0x05c ... 0x07c:
-    case 0xf30 ... 0x5fcc:
-    case 0x8000 ... 0xbfcc:
-        /* Reserved register addresses */
-        printk(XENLOG_G_DEBUG
-               "%pv: vGICD: write unknown 0x00c 0xfcc  r%d offset %#08x\n",
-               v, dabt.reg, gicd_reg);
-        goto write_ignore;
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
@@ -1112,6 +1242,12 @@ write_impl_defined:
            "%pv: vGICD: WI on implementation defined register offset %#08x\n",
            v, gicd_reg);
     return 1;
+
+write_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: WI on reserved register offset %#08x\n",
+           v, gicd_reg);
+    return 1;
 }
 
 static int vgic_v3_to_sgi(struct vcpu *v, register_t sgir)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:54:03 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23YJ-0005SH-6G; Thu, 26 Nov 2015 20:54:03 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YH-0005S9-W0
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:02 +0000
Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id
	6E/D4-13183-96177565; Thu, 26 Nov 2015 20:54:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1448571239!7009101!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13128 invoked from network); 26 Nov 2015 20:53:59 -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;
	26 Nov 2015 20:53:59 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YE-0003Gb-Tr
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YE-0000vG-Sl
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:53:58 +0000
Date: Thu, 26 Nov 2015 20:53:58 +0000
Message-Id: <E1a23YE-0000vG-Sl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic: Re-order the register
	emulations to match the memory map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5482d13dcfd675644148e807abbb0a5c4a5e660d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:02 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:28 2015 +0000

    xen/arm: vgic: Re-order the register emulations to match the memory map
    
    It helps to find quickly whether we forgot to emulate a register or not.
    
    At the same time add the missing reserved/implementation defined
    registers. All other missing registers will be added in a follow-up if
    necessary.
    
    Note that only the distributor register map explicitely say the
    size of a register (see 8.8 in ARM IHI 0069A). When the size is not
    known, the implementation defined/reserved may not be emulated
    correctly.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v2.c |  177 ++++++++++++++++++-----------
 xen/arch/arm/vgic-v3.c |  298 +++++++++++++++++++++++++++++++++++-------------
 2 files changed, 328 insertions(+), 147 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index d1860a9..2c73133 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -210,9 +210,14 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = vgic_reg32_extract(0x0000043b, info);
         return 1;
 
-    /* Implementation defined -- read as zero */
-    case 0x020 ... 0x03c:
-        goto read_as_zero;
+    case VRANGE32(0x00C, 0x01C):
+        goto read_reserved;
+
+    case VRANGE32(0x020, 0x03C):
+        goto read_impl_defined;
+
+    case VRANGE32(0x040, 0x07C):
+        goto read_reserved;
 
     case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, read zero */
@@ -246,21 +251,6 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
         goto read_as_zero;
 
-    case VRANGE32(GICD_ITARGETSR, GICD_ITARGETSRN):
-    {
-        uint32_t itargetsr;
-
-        if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
-        if ( rank == NULL) goto read_as_zero;
-        vgic_lock_rank(v, rank, flags);
-        itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
-        vgic_unlock_rank(v, rank, flags);
-        *r = vgic_reg32_extract(itargetsr, info);
-
-        return 1;
-    }
-
     case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     {
         uint32_t ipriorityr;
@@ -279,6 +269,27 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
+    case VREG32(0x7FC):
+        goto read_reserved;
+
+    case VRANGE32(GICD_ITARGETSR, GICD_ITARGETSRN):
+    {
+        uint32_t itargetsr;
+
+        if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR, DABT_WORD);
+        if ( rank == NULL) goto read_as_zero;
+        vgic_lock_rank(v, rank, flags);
+        itargetsr = vgic_fetch_itargetsr(rank, gicd_reg - GICD_ITARGETSR);
+        vgic_unlock_rank(v, rank, flags);
+        *r = vgic_reg32_extract(itargetsr, info);
+
+        return 1;
+    }
+
+    case VREG32(0xBFC):
+        goto read_reserved;
+
     case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
     {
         uint32_t icfgr;
@@ -295,6 +306,9 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
+    case VRANGE32(0xD00, 0xDFC):
+        goto read_impl_defined;
+
     case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
@@ -305,32 +319,27 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = 0xdeadbeef;
         return 1;
 
+    case VRANGE32(0xF04, 0xF0C):
+        goto read_reserved;
+
     /* Setting/Clearing the SGI pending bit via GICD is not supported */
     case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
     case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
         goto read_as_zero;
 
-    /* Implementation defined -- read as zero */
-    case 0xfd0 ... 0xfe4:
-        goto read_as_zero;
+    case VRANGE32(0xF30, 0xFCC):
+        goto read_reserved;
+
+    case VRANGE32(0xFD0, 0xFE4):
+        goto read_impl_defined;
 
     case VREG32(GICD_ICPIDR2):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR "%pv: vGICD: unhandled read from ICPIDR2\n", v);
         return 0;
 
-    /* Implementation defined -- read as zero */
-    case 0xfec ... 0xffc:
-        goto read_as_zero;
-
-    /* Reserved -- read as zero */
-    case 0x00c ... 0x01c:
-    case 0x040 ... 0x07c:
-    case 0x7fc:
-    case 0xbfc:
-    case 0xf04 ... 0xf0c:
-    case 0xf30 ... 0xfcc:
-        goto read_as_zero;
+    case VRANGE32(0xFEC, 0xFFC):
+        goto read_impl_defined;
 
     default:
         printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
@@ -349,6 +358,20 @@ read_as_zero_32:
 read_as_zero:
     *r = 0;
     return 1;
+
+read_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: RAZ on implemention defined register offset %#08x\n",
+           v, gicd_reg);
+    *r = 0;
+    return 1;
+
+read_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: RAZ on reserved register offset %#08x\n",
+           v, gicd_reg);
+    *r = 0;
+    return 1;
 }
 
 static int vgic_v2_to_sgi(struct vcpu *v, register_t sgir)
@@ -414,9 +437,14 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
     case VREG32(GICD_IIDR):
         goto write_ignore_32;
 
-    /* Implementation defined -- write ignored */
-    case 0x020 ... 0x03c:
-        goto write_ignore;
+    case VRANGE32(0x00C, 0x01C):
+        goto write_reserved;
+
+    case VRANGE32(0x020, 0x03C):
+        goto write_impl_defined;
+
+    case VRANGE32(0x040, 0x07C):
+        goto write_reserved;
 
     case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
         /* We do not implement security extensions for guests, write ignore */
@@ -472,6 +500,25 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
                v, r, gicd_reg - GICD_ICACTIVER);
         return 0;
 
+    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
+    {
+        uint32_t *ipriorityr;
+
+        if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR, DABT_WORD);
+        if ( rank == NULL) goto write_ignore;
+        vgic_lock_rank(v, rank, flags);
+        ipriorityr = &rank->ipriorityr[REG_RANK_INDEX(8,
+                                                      gicd_reg - GICD_IPRIORITYR,
+                                                      DABT_WORD)];
+        vgic_reg32_update(ipriorityr, r, info);
+        vgic_unlock_rank(v, rank, flags);
+        return 1;
+    }
+
+    case VREG32(0x7FC):
+        goto write_reserved;
+
     case VRANGE32(GICD_ITARGETSR, GICD_ITARGETSR7):
         /* SGI/PPI target is read only */
         goto write_ignore_32;
@@ -492,21 +539,8 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
-    {
-        uint32_t *ipriorityr;
-
-        if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
-        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR, DABT_WORD);
-        if ( rank == NULL) goto write_ignore;
-        vgic_lock_rank(v, rank, flags);
-        ipriorityr = &rank->ipriorityr[REG_RANK_INDEX(8,
-                                                      gicd_reg - GICD_IPRIORITYR,
-                                                      DABT_WORD)];
-        vgic_reg32_update(ipriorityr, r, info);
-        vgic_unlock_rank(v, rank, flags);
-        return 1;
-    }
+    case VREG32(0xBFC):
+        goto write_reserved;
 
     case VREG32(GICD_ICFGR): /* SGIs */
         goto write_ignore_32;
@@ -526,6 +560,9 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
+    case VRANGE32(0xD00, 0xDFC):
+        goto write_impl_defined;
+
     case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
@@ -534,6 +571,9 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return vgic_v2_to_sgi(v, r);
 
+    case VRANGE32(0xF04, 0xF0C):
+        goto write_reserved;
+
     case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
         if ( dabt.size != DABT_BYTE && dabt.size != DABT_WORD ) goto bad_width;
         printk(XENLOG_G_ERR
@@ -548,26 +588,19 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
                v, dabt.size ? "word" : "byte", r, gicd_reg - GICD_SPENDSGIR);
         return 0;
 
-    /* Implementation defined -- write ignored */
-    case 0xfd0 ... 0xfe4:
-        goto write_ignore;
+    case VRANGE32(0xF30, 0xFCC):
+        goto write_reserved;
+
+    case VRANGE32(0xFD0, 0xFE4):
+        /* Implementation defined identification registers */
+        goto write_impl_defined;
 
     /* R/O -- write ignore */
     case VREG32(GICD_ICPIDR2):
         goto write_ignore_32;
 
-    /* Implementation defined -- write ignored */
-    case 0xfec ... 0xffc:
-        goto write_ignore;
-
-    /* Reserved -- write ignored */
-    case 0x00c ... 0x01c:
-    case 0x040 ... 0x07c:
-    case 0x7fc:
-    case 0xbfc:
-    case 0xf04 ... 0xf0c:
-    case 0xf30 ... 0xfcc:
-        goto write_ignore;
+    case VRANGE32(0xFEC, 0xFFC):
+        /* Implementation defined identification registers */
 
     default:
         printk(XENLOG_G_ERR
@@ -587,6 +620,18 @@ write_ignore_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
 write_ignore:
     return 1;
+
+write_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: WI on implementation defined register offset %#08x\n",
+           v, gicd_reg);
+    return 1;
+
+write_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: WI on implementation defined register offset %#08x\n",
+           v, gicd_reg);
+    return 1;
 }
 
 static const struct mmio_handler_ops vgic_v2_distr_mmio_handler = {
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 28f075a..f9d8ecb 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -210,6 +210,12 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* Power management is not implemented */
         goto read_as_zero_32;
 
+    case 0x0018:
+        goto read_reserved;
+
+    case 0x0020:
+        goto read_impl_defined;
+
     case VREG64(GICR_SETLPIR):
         /* WO. Read as zero */
         goto read_as_zero_64;
@@ -218,6 +224,9 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* WO. Read as zero */
         goto read_as_zero_64;
 
+    case 0x0050:
+        goto read_reserved;
+
     case VREG64(GICR_PROPBASER):
         /* LPI's not implemented */
         goto read_as_zero_64;
@@ -226,27 +235,48 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         /* LPI's not implemented */
         goto read_as_zero_64;
 
+    case 0x0080:
+        goto read_reserved;
+
     case VREG64(GICR_INVLPIR):
         /* WO. Read as zero */
         goto read_as_zero_64;
 
+    case 0x00A8:
+        goto read_reserved;
+
     case VREG64(GICR_INVALLR):
         /* WO. Read as zero */
         goto read_as_zero_64;
         return 0;
 
+    case 0x00B8:
+        goto read_reserved;
+
     case VREG32(GICR_SYNCR):
         if ( dabt.size != DABT_WORD ) goto bad_width;
         /* RO . But when read it always returns busy bito bit[0] */
         *r = vgic_reg32_extract(GICR_SYNCR_NOT_BUSY, info);
         return 1;
 
+    case 0x00C8:
+        goto read_reserved;
+
     case VREG64(0x0100):
         goto read_impl_defined;
 
+    case 0x0108:
+        goto read_reserved;
+
     case VREG64(0x0110):
         goto read_impl_defined;
 
+    case 0x0118 ... 0xBFFC:
+        goto read_reserved;
+
+    case 0xC000 ... 0xFFCC:
+        goto read_impl_defined;
+
     case 0xFFD0 ... 0xFFE4:
         /* Implementation defined identification registers */
        goto read_impl_defined;
@@ -284,7 +314,14 @@ read_as_zero_32:
 
 read_impl_defined:
     printk(XENLOG_G_DEBUG
-           "%pv: vGICR: RAZ on implemention defined register offset %#08x\n",
+           "%pv: vGICR: RAZ on implementation defined register offset %#08x\n",
+           v, gicr_reg);
+    *r = 0;
+    return 1;
+
+read_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: RAZ on reserved register offset %#08x\n",
            v, gicr_reg);
     *r = 0;
     return 1;
@@ -318,6 +355,12 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* Power mgmt not implemented */
         goto write_ignore_32;
 
+    case 0x0018:
+        goto write_reserved;
+
+    case 0x0020:
+        goto write_impl_defined;
+
     case VREG64(GICR_SETLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
@@ -326,6 +369,9 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* LPI is not implemented */
         goto write_ignore_64;
 
+    case 0x0050:
+        goto write_reserved;
+
     case VREG64(GICR_PROPBASER):
         /* LPI is not implemented */
         goto write_ignore_64;
@@ -334,24 +380,45 @@ static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* LPI is not implemented */
         goto write_ignore_64;
 
+    case 0x0080:
+        goto write_reserved;
+
     case VREG64(GICR_INVLPIR):
         /* LPI is not implemented */
         goto write_ignore_64;
 
+    case 0x00A8:
+        goto write_reserved;
+
     case VREG64(GICR_INVALLR):
         /* LPI is not implemented */
         goto write_ignore_64;
 
+    case 0x00B8:
+        goto write_reserved;
+
     case VREG32(GICR_SYNCR):
         /* RO */
         goto write_ignore_32;
 
+    case 0x00C8:
+        goto write_reserved;
+
     case VREG64(0x0100):
         goto write_impl_defined;
 
+    case 0x0108:
+        goto write_reserved;
+
     case VREG64(0x0110):
         goto write_impl_defined;
 
+    case 0x0118 ... 0xBFFC:
+        goto write_reserved;
+
+    case 0xC000 ... 0xFFCC:
+        goto write_impl_defined;
+
     case 0xFFD0 ... 0xFFE4:
         /* Implementation defined identification registers */
        goto write_impl_defined;
@@ -389,6 +456,12 @@ write_impl_defined:
            "%pv: vGICR: WI on implementation defined register offset %#08x\n",
            v, gicr_reg);
     return 1;
+
+write_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: WI on reserved register offset %#08x\n",
+           v, gicr_reg);
+    return 1;
 }
 
 static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v,
@@ -609,10 +682,6 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case VREG32(GICR_IGRPMODR0):
-        /* We do not implement security extensions for guests, read zero */
-        goto read_as_zero_32;
-
     case VREG32(GICR_IGROUPR0):
     case VREG32(GICR_ISENABLER0):
     case VREG32(GICR_ICENABLER0):
@@ -632,10 +701,23 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VREG32(GICR_ICPENDR0):
         goto read_as_zero;
 
+    case VREG32(GICR_IGRPMODR0):
+        /* We do not implement security extensions for guests, read zero */
+        goto read_as_zero_32;
+
     case VREG32(GICR_NSACR):
         /* We do not implement security extensions for guests, read zero */
         goto read_as_zero_32;
 
+    case 0x0E04 ... 0xBFFC:
+        goto read_reserved;
+
+    case 0xC000 ... 0xFFCC:
+        goto read_impl_defined;
+
+    case 0xFFD0 ... 0xFFFC:
+        goto read_reserved;
+
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICR: SGI: unhandled read r%d offset %#08x\n",
@@ -653,6 +735,21 @@ read_as_zero_32:
 read_as_zero:
     *r = 0;
     return 1;
+
+read_impl_defined:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: SGI: RAZ on implementation defined register offset %#08x\n",
+           v, gicr_reg);
+    *r = 0;
+    return 1;
+
+read_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICR: SGI: RAZ on reserved register offset %#08x\n",
+           v, gicr_reg);
+    *r = 0;
+    return 1;
+
 }
 
 static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
@@ -662,10 +759,6 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     switch ( gicr_reg )
     {
-    case VREG32(GICR_IGRPMODR0):
-        /* We do not implement security extensions for guests, write ignore */
-        goto write_ignore_32;
-
     case VREG32(GICR_IGROUPR0):
     case VREG32(GICR_ISENABLER0):
     case VREG32(GICR_ICENABLER0):
@@ -694,6 +787,11 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info,
                v, r);
         return 0;
 
+    case VREG32(GICR_IGRPMODR0):
+        /* We do not implement security extensions for guests, write ignore */
+        goto write_ignore_32;
+
+
     case VREG32(GICR_NSACR):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
@@ -829,6 +927,14 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
+    case VREG32(GICD_IIDR):
+        if ( dabt.size != DABT_WORD ) goto bad_width;
+        *r = vgic_reg32_extract(GICV3_GICD_IIDR_VAL, info);
+        return 1;
+
+    case VREG32(0x000C):
+        goto read_reserved;
+
     case VREG32(GICD_STATUSR):
         /*
          *  Optional, Not implemented for now.
@@ -836,15 +942,23 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          */
         goto read_as_zero_32;
 
-    case VREG32(GICD_IIDR):
-        if ( dabt.size != DABT_WORD ) goto bad_width;
-        *r = vgic_reg32_extract(GICV3_GICD_IIDR_VAL, info);
-        return 1;
+    case VRANGE32(0x0014, 0x001C):
+        goto read_reserved;
 
-    case 0x020 ... 0x03c:
-    case 0xc000 ... 0xffcc:
-        /* Implementation defined -- read as zero */
-        goto read_as_zero_32;
+    case VRANGE32(0x0020, 0x003C):
+        goto read_impl_defined;
+
+    case VREG32(0x0044):
+        goto read_reserved;
+
+    case VREG32(0x004C):
+        goto read_reserved;
+
+    case VREG32(0x0054):
+        goto read_reserved;
+
+    case VRANGE32(0x005C, 0x007C):
+        goto read_reserved;
 
     case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
     case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
@@ -860,6 +974,25 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          */
         return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg, r);
 
+    case VRANGE32(GICD_NSACR, GICD_NSACRN):
+        /* We do not implement security extensions for guests, read zero */
+        goto read_as_zero_32;
+
+    case VREG32(GICD_SGIR):
+        /* Read as ICH_SGIR system register with SRE set. So ignore */
+        goto read_as_zero_32;
+
+    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
+        /* Replaced with GICR_ICPENDR0. So ignore write */
+        goto read_as_zero_32;
+
+    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
+        /* Replaced with GICR_ISPENDR0. So ignore write */
+        goto read_as_zero_32;
+
+    case VRANGE32(0x0F30, 0x60FC):
+        goto read_reserved;
+
     case VRANGE64(GICD_IROUTER32, GICD_IROUTER1019):
     {
         uint64_t irouter;
@@ -877,23 +1010,13 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         return 1;
     }
 
-    case VRANGE32(GICD_NSACR, GICD_NSACRN):
-        /* We do not implement security extensions for guests, read zero */
-        goto read_as_zero_32;
+    case VRANGE32(0x7FE0, 0xBFFC):
+        goto read_reserved;
 
-    case VREG32(GICD_SGIR):
-        /* Read as ICH_SGIR system register with SRE set. So ignore */
-        goto read_as_zero_32;
-
-    case VRANGE32(GICD_CPENDSGIR, GICD_CPENDSGIRN):
-        /* Replaced with GICR_ICPENDR0. So ignore write */
-        goto read_as_zero_32;
-
-    case VRANGE32(GICD_SPENDSGIR, GICD_SPENDSGIRN):
-        /* Replaced with GICR_ISPENDR0. So ignore write */
-        goto read_as_zero_32;
+    case VRANGE32(0xC000, 0xFFCC):
+        goto read_impl_defined;
 
-    case 0xFFD0 ... 0xFFE4:
+    case VRANGE32(0xFFD0, 0xFFE4):
         /* Implementation defined identification registers */
        goto read_impl_defined;
 
@@ -903,21 +1026,10 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
         *r = vgic_reg32_extract(GICV3_GICD_PIDR2, info);
         return 1;
 
-    case 0xFFEC ... 0xFFFC:
+    case VRANGE32(0xFFEC, 0xFFFC):
          /* Implementation defined identification registers */
          goto read_impl_defined;
 
-    case 0x00c:
-    case 0x044:
-    case 0x04c:
-    case 0x05c ... 0x07c:
-    case 0xf30 ... 0x5fcc:
-    case 0x8000 ... 0xbfcc:
-        /* These are reserved register addresses */
-        printk(XENLOG_G_DEBUG
-               "%pv: vGICD: RAZ on reserved register offset %#08x\n",
-               v, gicd_reg);
-        goto read_as_zero;
     default:
         printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
                v, dabt.reg, gicd_reg);
@@ -941,7 +1053,14 @@ read_as_zero:
 
 read_impl_defined:
     printk(XENLOG_G_DEBUG
-           "%pv: vGICD: RAZ on implemention defined register offset %#08x\n",
+           "%pv: vGICD: RAZ on implementation defined register offset %#08x\n",
+           v, gicd_reg);
+    *r = 0;
+    return 1;
+
+read_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: RAZ on reserved register offset %#08x\n",
            v, gicd_reg);
     *r = 0;
     return 1;
@@ -987,33 +1106,46 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO -- write ignored */
         goto write_ignore_32;
 
+    case VREG32(0x000C):
+        goto write_reserved;
+
     case VREG32(GICD_STATUSR):
         /* RO -- write ignored */
         goto write_ignore_32;
 
+    case VRANGE32(0x0014, 0x001C):
+        goto write_reserved;
+
+    case VRANGE32(0x0020, 0x003C):
+        goto write_impl_defined;
+
     case VREG32(GICD_SETSPI_NSR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
 
+    case VREG32(0x0044):
+        goto write_reserved;
+
     case VREG32(GICD_CLRSPI_NSR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
 
+    case VREG32(0x004C):
+        goto write_reserved;
+
     case VREG32(GICD_SETSPI_SR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
 
+    case VREG32(0x0054):
+        goto write_reserved;
+
     case VREG32(GICD_CLRSPI_SR):
         /* Message based SPI is not implemented */
         goto write_ignore_32;
 
-    case 0x020 ... 0x03c:
-    case 0xc000 ... 0xffcc:
-        /* Implementation defined -- write ignored */
-        printk(XENLOG_G_DEBUG
-               "%pv: vGICD: WI on implementation defined register offset %#08x\n",
-               v, gicd_reg);
-        goto write_ignore_32;
+    case VRANGE32(0x005C, 0x007C):
+        goto write_reserved;
 
     case VRANGE32(GICD_IGROUPR, GICD_IGROUPRN):
     case VRANGE32(GICD_ISENABLER, GICD_ISENABLERN):
@@ -1029,22 +1161,6 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         return __vgic_v3_distr_common_mmio_write("vGICD", v, info,
                                                  gicd_reg, r);
 
-    case VRANGE64(GICD_IROUTER32, GICD_IROUTER1019):
-    {
-        uint64_t irouter;
-
-        if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
-        rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
-                                DABT_DOUBLE_WORD);
-        if ( rank == NULL ) goto write_ignore;
-        vgic_lock_rank(v, rank, flags);
-        irouter = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
-        vgic_reg64_update(&irouter, r, info);
-        vgic_store_irouter(v->domain, rank, gicd_reg - GICD_IROUTER, irouter);
-        vgic_unlock_rank(v, rank, flags);
-        return 1;
-    }
-
     case VRANGE32(GICD_NSACR, GICD_NSACRN):
         /* We do not implement security extensions for guests, write ignore */
         goto write_ignore_32;
@@ -1063,7 +1179,32 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         if ( dabt.size != DABT_WORD ) goto bad_width;
         return 0;
 
-    case 0xFFD0 ... 0xFFE4:
+    case VRANGE32(0x0F30, 0x60FC):
+        goto write_reserved;
+
+    case VRANGE64(GICD_IROUTER32, GICD_IROUTER1019):
+    {
+        uint64_t irouter;
+
+        if ( !vgic_reg64_check_access(dabt) ) goto bad_width;
+        rank = vgic_rank_offset(v, 64, gicd_reg - GICD_IROUTER,
+                                DABT_DOUBLE_WORD);
+        if ( rank == NULL ) goto write_ignore;
+        vgic_lock_rank(v, rank, flags);
+        irouter = vgic_fetch_irouter(rank, gicd_reg - GICD_IROUTER);
+        vgic_reg64_update(&irouter, r, info);
+        vgic_store_irouter(v->domain, rank, gicd_reg - GICD_IROUTER, irouter);
+        vgic_unlock_rank(v, rank, flags);
+        return 1;
+    }
+
+    case VRANGE32(0x7FE0, 0xBFFC):
+        goto write_reserved;
+
+    case VRANGE32(0xC000, 0xFFCC):
+        goto write_impl_defined;
+
+    case VRANGE32(0xFFD0, 0xFFE4):
         /* Implementation defined identification registers */
        goto write_impl_defined;
 
@@ -1071,21 +1212,10 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         /* RO -- write ignore */
         goto write_ignore_32;
 
-    case 0xFFEC ... 0xFFFC:
+    case VRANGE32(0xFFEC, 0xFFFC):
          /* Implementation defined identification registers */
          goto write_impl_defined;
 
-    case 0x00c:
-    case 0x044:
-    case 0x04c:
-    case 0x05c ... 0x07c:
-    case 0xf30 ... 0x5fcc:
-    case 0x8000 ... 0xbfcc:
-        /* Reserved register addresses */
-        printk(XENLOG_G_DEBUG
-               "%pv: vGICD: write unknown 0x00c 0xfcc  r%d offset %#08x\n",
-               v, dabt.reg, gicd_reg);
-        goto write_ignore;
     default:
         printk(XENLOG_G_ERR
                "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
@@ -1112,6 +1242,12 @@ write_impl_defined:
            "%pv: vGICD: WI on implementation defined register offset %#08x\n",
            v, gicd_reg);
     return 1;
+
+write_reserved:
+    printk(XENLOG_G_DEBUG
+           "%pv: vGICD: WI on reserved register offset %#08x\n",
+           v, gicd_reg);
+    return 1;
 }
 
 static int vgic_v3_to_sgi(struct vcpu *v, register_t sgir)
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:54:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23YT-0005UA-Fr; Thu, 26 Nov 2015 20:54: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 1a23YR-0005Ts-LV
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:11 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	20/B4-00475-27177565; Thu, 26 Nov 2015 20:54:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1448571249!6644948!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26350 invoked from network); 26 Nov 2015 20:54: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;
	26 Nov 2015 20:54:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YP-0003HB-61
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YP-0000vr-4U
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:09 +0000
Date: Thu, 26 Nov 2015 20:54:09 +0000
Message-Id: <E1a23YP-0000vr-4U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Emulate read to
	GICD_ICACTIVER<n>
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 833a6939560fa634df8ee9e980e85de6c6c6e71d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:03 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:29 2015 +0000

    xen/arm: vgic-v3: Emulate read to GICD_ICACTIVER<n>
    
    The GICD_ICACTIVER<n> registers are missing in the read emulation of the
    distributor.
    
    Call the common emulation for the whole range.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index f9d8ecb..98104ba 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -966,6 +966,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
     case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
     case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
     case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
         /*
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:54:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23YT-0005UA-Fr; Thu, 26 Nov 2015 20:54: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 1a23YR-0005Ts-LV
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:11 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	20/B4-00475-27177565; Thu, 26 Nov 2015 20:54:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1448571249!6644948!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26350 invoked from network); 26 Nov 2015 20:54: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;
	26 Nov 2015 20:54:10 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YP-0003HB-61
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YP-0000vr-4U
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:09 +0000
Date: Thu, 26 Nov 2015 20:54:09 +0000
Message-Id: <E1a23YP-0000vr-4U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Emulate read to
	GICD_ICACTIVER<n>
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 833a6939560fa634df8ee9e980e85de6c6c6e71d
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:03 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:29 2015 +0000

    xen/arm: vgic-v3: Emulate read to GICD_ICACTIVER<n>
    
    The GICD_ICACTIVER<n> registers are missing in the read emulation of the
    distributor.
    
    Call the common emulation for the whole range.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index f9d8ecb..98104ba 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -966,6 +966,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VRANGE32(GICD_ISPENDR, GICD_ISPENDRN):
     case VRANGE32(GICD_ICPENDR, GICD_ICPENDRN):
     case VRANGE32(GICD_ISACTIVER, GICD_ISACTIVERN):
+    case VRANGE32(GICD_ICACTIVER, GICD_ICACTIVERN):
     case VRANGE32(GICD_IPRIORITYR, GICD_IPRIORITYRN):
     case VRANGE32(GICD_ICFGR, GICD_ICFGRN):
         /*
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:54:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23Yc-0005Vi-LE; Thu, 26 Nov 2015 20:54: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 1a23Yb-0005VR-Ha
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:21 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	4A/1F-06091-C7177565; Thu, 26 Nov 2015 20:54:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448571259!6815462!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14557 invoked from network); 26 Nov 2015 20:54:20 -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;
	26 Nov 2015 20:54:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YZ-0003HJ-GZ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YZ-0000wG-El
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:19 +0000
Date: Thu, 26 Nov 2015 20:54:19 +0000
Message-Id: <E1a23YZ-0000wG-El@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Remove spurious
	return in GICR_INVALLR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cdae22a41b95319e035f69c5105f41d4f84744aa
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:04 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:29 2015 +0000

    xen/arm: vgic-v3: Remove spurious return in GICR_INVALLR
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 98104ba..c68afdb 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -248,7 +248,6 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VREG64(GICR_INVALLR):
         /* WO. Read as zero */
         goto read_as_zero_64;
-        return 0;
 
     case 0x00B8:
         goto read_reserved;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:54:22 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23Yc-0005Vi-LE; Thu, 26 Nov 2015 20:54: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 1a23Yb-0005VR-Ha
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:21 +0000
Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id
	4A/1F-06091-C7177565; Thu, 26 Nov 2015 20:54:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1448571259!6815462!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14557 invoked from network); 26 Nov 2015 20:54:20 -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;
	26 Nov 2015 20:54:20 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YZ-0003HJ-GZ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23YZ-0000wG-El
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:19 +0000
Date: Thu, 26 Nov 2015 20:54:19 +0000
Message-Id: <E1a23YZ-0000wG-El@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Remove spurious
	return in GICR_INVALLR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cdae22a41b95319e035f69c5105f41d4f84744aa
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:04 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:29 2015 +0000

    xen/arm: vgic-v3: Remove spurious return in GICR_INVALLR
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 98104ba..c68afdb 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -248,7 +248,6 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VREG64(GICR_INVALLR):
         /* WO. Read as zero */
         goto read_as_zero_64;
-        return 0;
 
     case 0x00B8:
         goto read_reserved;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:54:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23Yn-0005Xu-QV; Thu, 26 Nov 2015 20:54:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ym-0005Xh-9d
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:32 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	2B/8A-01753-78177565; Thu, 26 Nov 2015 20:54:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448571270!6938233!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8152 invoked from network); 26 Nov 2015 20:54:30 -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;
	26 Nov 2015 20:54:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Yk-0003HR-0r
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Yj-0000xR-Up
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:29 +0000
Date: Thu, 26 Nov 2015 20:54:29 +0000
Message-Id: <E1a23Yj-0000xR-Up@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Don't implement
	write-only register read as zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c38f9e4d673a485c08c690dc1a2fe8455206fe25
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:05 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:29 2015 +0000

    xen/arm: vgic-v3: Don't implement write-only register read as zero
    
    A read to a write only register is unknown. Use a memorable value to
    differentiate from an actual RAZ register.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index c68afdb..44e926a 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -217,12 +217,12 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_impl_defined;
 
     case VREG64(GICR_SETLPIR):
-        /* WO. Read as zero */
-        goto read_as_zero_64;
+        /* WO. Read unknown */
+        goto read_unknown;
 
     case VREG64(GICR_CLRLPIR):
-        /* WO. Read as zero */
-        goto read_as_zero_64;
+        /* WO. Read unknown */
+        goto read_unknown;
 
     case 0x0050:
         goto read_reserved;
@@ -239,15 +239,15 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_reserved;
 
     case VREG64(GICR_INVLPIR):
-        /* WO. Read as zero */
-        goto read_as_zero_64;
+        /* WO. Read unknown */
+        goto read_unknown;
 
     case 0x00A8:
         goto read_reserved;
 
     case VREG64(GICR_INVALLR):
-        /* WO. Read as zero */
-        goto read_as_zero_64;
+        /* WO. Read unknown */
+        goto read_unknown;
 
     case 0x00B8:
         goto read_reserved;
@@ -324,6 +324,10 @@ read_reserved:
            v, gicr_reg);
     *r = 0;
     return 1;
+
+read_unknown:
+    *r = vgic_reg64_extract(0xdeadbeafdeadbeaf, info);
+    return 1;
 }
 
 static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:54:33 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23Yn-0005Xu-QV; Thu, 26 Nov 2015 20:54:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Ym-0005Xh-9d
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:32 +0000
Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id
	2B/8A-01753-78177565; Thu, 26 Nov 2015 20:54:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1448571270!6938233!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8152 invoked from network); 26 Nov 2015 20:54:30 -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;
	26 Nov 2015 20:54:30 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Yk-0003HR-0r
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Yj-0000xR-Up
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:29 +0000
Date: Thu, 26 Nov 2015 20:54:29 +0000
Message-Id: <E1a23Yj-0000xR-Up@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Don't implement
	write-only register read as zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c38f9e4d673a485c08c690dc1a2fe8455206fe25
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:05 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:29 2015 +0000

    xen/arm: vgic-v3: Don't implement write-only register read as zero
    
    A read to a write only register is unknown. Use a memorable value to
    differentiate from an actual RAZ register.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index c68afdb..44e926a 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -217,12 +217,12 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_impl_defined;
 
     case VREG64(GICR_SETLPIR):
-        /* WO. Read as zero */
-        goto read_as_zero_64;
+        /* WO. Read unknown */
+        goto read_unknown;
 
     case VREG64(GICR_CLRLPIR):
-        /* WO. Read as zero */
-        goto read_as_zero_64;
+        /* WO. Read unknown */
+        goto read_unknown;
 
     case 0x0050:
         goto read_reserved;
@@ -239,15 +239,15 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info,
         goto read_reserved;
 
     case VREG64(GICR_INVLPIR):
-        /* WO. Read as zero */
-        goto read_as_zero_64;
+        /* WO. Read unknown */
+        goto read_unknown;
 
     case 0x00A8:
         goto read_reserved;
 
     case VREG64(GICR_INVALLR):
-        /* WO. Read as zero */
-        goto read_as_zero_64;
+        /* WO. Read unknown */
+        goto read_unknown;
 
     case 0x00B8:
         goto read_reserved;
@@ -324,6 +324,10 @@ read_reserved:
            v, gicr_reg);
     *r = 0;
     return 1;
+
+read_unknown:
+    *r = vgic_reg64_extract(0xdeadbeafdeadbeaf, info);
+    return 1;
 }
 
 static int __vgic_v3_rdistr_rd_mmio_write(struct vcpu *v, mmio_info_t *info,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:54:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23Yx-0005ZL-Ts; Thu, 26 Nov 2015 20:54: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 1a23Yw-0005Z3-GK
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:42 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	E9/00-29649-19177565; Thu, 26 Nov 2015 20:54:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1448571280!6877730!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48775 invoked from network); 26 Nov 2015 20:54:41 -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;
	26 Nov 2015 20:54:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Yu-0003HZ-9B
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Yu-0000xv-6B
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:40 +0000
Date: Thu, 26 Nov 2015 20:54:40 +0000
Message-Id: <E1a23Yu-0000xv-6B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Make clear that
	GICD_*SPI_* registers are reserved
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a91f05083c33f69d19ec3ee037b4536f9dd4516
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:06 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:30 2015 +0000

    xen/arm: vgic-v3: Make clear that GICD_*SPI_* registers are reserved
    
    Our vGIC emulation have GICD_TYPER.MBIS set to 0 which means that
    GICD_*SPI_* registers are reserved. Implement them using the *_reserved
    labels.
    
    Also, implement theses registers for the read part.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 44e926a..985e866 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -951,15 +951,31 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VRANGE32(0x0020, 0x003C):
         goto read_impl_defined;
 
+    case VREG32(GICD_SETSPI_NSR):
+        /* Message based SPI is not implemented */
+        goto read_reserved;
+
     case VREG32(0x0044):
         goto read_reserved;
 
+    case VREG32(GICD_CLRSPI_NSR):
+        /* Message based SPI is not implemented */
+        goto read_reserved;
+
     case VREG32(0x004C):
         goto read_reserved;
 
+    case VREG32(GICD_SETSPI_SR):
+        /* Message based SPI is not implemented */
+        goto read_reserved;
+
     case VREG32(0x0054):
         goto read_reserved;
 
+    case VREG32(GICD_CLRSPI_SR):
+        /* Message based SPI is not implemented */
+        goto read_reserved;
+
     case VRANGE32(0x005C, 0x007C):
         goto read_reserved;
 
@@ -1125,28 +1141,28 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case VREG32(GICD_SETSPI_NSR):
         /* Message based SPI is not implemented */
-        goto write_ignore_32;
+        goto write_reserved;
 
     case VREG32(0x0044):
         goto write_reserved;
 
     case VREG32(GICD_CLRSPI_NSR):
         /* Message based SPI is not implemented */
-        goto write_ignore_32;
+        goto write_reserved;
 
     case VREG32(0x004C):
         goto write_reserved;
 
     case VREG32(GICD_SETSPI_SR):
         /* Message based SPI is not implemented */
-        goto write_ignore_32;
+        goto write_reserved;
 
     case VREG32(0x0054):
         goto write_reserved;
 
     case VREG32(GICD_CLRSPI_SR):
         /* Message based SPI is not implemented */
-        goto write_ignore_32;
+        goto write_reserved;
 
     case VRANGE32(0x005C, 0x007C):
         goto write_reserved;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:54:44 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23Yx-0005ZL-Ts; Thu, 26 Nov 2015 20:54: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 1a23Yw-0005Z3-GK
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:42 +0000
Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id
	E9/00-29649-19177565; Thu, 26 Nov 2015 20:54:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1448571280!6877730!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 48775 invoked from network); 26 Nov 2015 20:54:41 -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;
	26 Nov 2015 20:54:41 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Yu-0003HZ-9B
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Yu-0000xv-6B
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:40 +0000
Date: Thu, 26 Nov 2015 20:54:40 +0000
Message-Id: <E1a23Yu-0000xv-6B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vgic-v3: Make clear that
	GICD_*SPI_* registers are reserved
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a91f05083c33f69d19ec3ee037b4536f9dd4516
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Wed Nov 18 17:28:06 2015 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Nov 25 12:29:30 2015 +0000

    xen/arm: vgic-v3: Make clear that GICD_*SPI_* registers are reserved
    
    Our vGIC emulation have GICD_TYPER.MBIS set to 0 which means that
    GICD_*SPI_* registers are reserved. Implement them using the *_reserved
    labels.
    
    Also, implement theses registers for the read part.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic-v3.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 44e926a..985e866 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -951,15 +951,31 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
     case VRANGE32(0x0020, 0x003C):
         goto read_impl_defined;
 
+    case VREG32(GICD_SETSPI_NSR):
+        /* Message based SPI is not implemented */
+        goto read_reserved;
+
     case VREG32(0x0044):
         goto read_reserved;
 
+    case VREG32(GICD_CLRSPI_NSR):
+        /* Message based SPI is not implemented */
+        goto read_reserved;
+
     case VREG32(0x004C):
         goto read_reserved;
 
+    case VREG32(GICD_SETSPI_SR):
+        /* Message based SPI is not implemented */
+        goto read_reserved;
+
     case VREG32(0x0054):
         goto read_reserved;
 
+    case VREG32(GICD_CLRSPI_SR):
+        /* Message based SPI is not implemented */
+        goto read_reserved;
+
     case VRANGE32(0x005C, 0x007C):
         goto read_reserved;
 
@@ -1125,28 +1141,28 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
 
     case VREG32(GICD_SETSPI_NSR):
         /* Message based SPI is not implemented */
-        goto write_ignore_32;
+        goto write_reserved;
 
     case VREG32(0x0044):
         goto write_reserved;
 
     case VREG32(GICD_CLRSPI_NSR):
         /* Message based SPI is not implemented */
-        goto write_ignore_32;
+        goto write_reserved;
 
     case VREG32(0x004C):
         goto write_reserved;
 
     case VREG32(GICD_SETSPI_SR):
         /* Message based SPI is not implemented */
-        goto write_ignore_32;
+        goto write_reserved;
 
     case VREG32(0x0054):
         goto write_reserved;
 
     case VREG32(GICD_CLRSPI_SR):
         /* Message based SPI is not implemented */
-        goto write_ignore_32;
+        goto write_reserved;
 
     case VRANGE32(0x005C, 0x007C):
         goto write_reserved;
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:54:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23Z9-0005an-2S; Thu, 26 Nov 2015 20:54:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Z6-0005aT-RP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:52 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	20/1B-10678-C9177565; Thu, 26 Nov 2015 20:54:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1448571290!6806689!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15327 invoked from network); 26 Nov 2015 20:54:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:54:51 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Z4-0003Hh-IH
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Z4-0000yM-G6
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:50 +0000
Date: Thu, 26 Nov 2015 20:54:50 +0000
Message-Id: <E1a23Z4-0000yM-G6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] console: make printk() line
	continuation tracking per-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 1e8193b5783676087bbd12da6be7641e40073168
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Nov 25 17:18:21 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:18:21 2015 +0100

    console: make printk() line continuation tracking per-CPU
    
    This avoids cases where split messages (with other than the initial
    part not carrying a log level; single line messages only of course)
    issued on multiple CPUs interfere with each other, causing messages to
    be issued which are supposed to be suppressed due to the log level
    setting. E.g.
    
    	CPU A			CPU B
    XENLOG_G_DEBUG "abc"
    			XENLOG_G_DEBUG "def\n"
    "xyz\n"
    
    would cause the last message to be logged despite this obviously not
    being intended (at default log levels).
    
    Suggested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/console.c |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 4362400..e0083f1 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -620,15 +620,18 @@ static void printk_start_of_line(const char *prefix)
 
 static void vprintk_common(const char *prefix, const char *fmt, va_list args)
 {
+    struct vps {
+        bool_t continued, do_print;
+    }            *state;
+    static DEFINE_PER_CPU(struct vps, state);
     static char   buf[1024];
-    static int    start_of_line = 1, do_print;
-
     char         *p, *q;
     unsigned long flags;
 
     /* console_lock can be acquired recursively from __printk_ratelimit(). */
     local_irq_save(flags);
     spin_lock_recursive(&console_lock);
+    state = &this_cpu(state);
 
     (void)vsnprintf(buf, sizeof(buf), fmt, args);
 
@@ -637,30 +640,30 @@ static void vprintk_common(const char *prefix, const char *fmt, va_list args)
     while ( (q = strchr(p, '\n')) != NULL )
     {
         *q = '\0';
-        if ( start_of_line )
-            do_print = printk_prefix_check(p, &p);
-        if ( do_print )
+        if ( !state->continued )
+            state->do_print = printk_prefix_check(p, &p);
+        if ( state->do_print )
         {
-            if ( start_of_line )
+            if ( !state->continued )
                 printk_start_of_line(prefix);
             __putstr(p);
             __putstr("\n");
         }
-        start_of_line = 1;
+        state->continued = 0;
         p = q + 1;
     }
 
     if ( *p != '\0' )
     {
-        if ( start_of_line )
-            do_print = printk_prefix_check(p, &p);
-        if ( do_print )
+        if ( !state->continued )
+            state->do_print = printk_prefix_check(p, &p);
+        if ( state->do_print )
         {
-            if ( start_of_line )
+            if ( !state->continued )
                 printk_start_of_line(prefix);
             __putstr(p);
         }
-        start_of_line = 0;
+        state->continued = 1;
     }
 
     spin_unlock_recursive(&console_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 Thu Nov 26 20:54:55 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:54: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 1a23Z9-0005an-2S; Thu, 26 Nov 2015 20:54:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Z6-0005aT-RP
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:52 +0000
Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id
	20/1B-10678-C9177565; Thu, 26 Nov 2015 20:54:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1448571290!6806689!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15327 invoked from network); 26 Nov 2015 20:54:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Nov 2015 20:54:51 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Z4-0003Hh-IH
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Z4-0000yM-G6
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:54:50 +0000
Date: Thu, 26 Nov 2015 20:54:50 +0000
Message-Id: <E1a23Z4-0000yM-G6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] console: make printk() line
	continuation tracking per-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 1e8193b5783676087bbd12da6be7641e40073168
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Nov 25 17:18:21 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:18:21 2015 +0100

    console: make printk() line continuation tracking per-CPU
    
    This avoids cases where split messages (with other than the initial
    part not carrying a log level; single line messages only of course)
    issued on multiple CPUs interfere with each other, causing messages to
    be issued which are supposed to be suppressed due to the log level
    setting. E.g.
    
    	CPU A			CPU B
    XENLOG_G_DEBUG "abc"
    			XENLOG_G_DEBUG "def\n"
    "xyz\n"
    
    would cause the last message to be logged despite this obviously not
    being intended (at default log levels).
    
    Suggested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/char/console.c |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 4362400..e0083f1 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -620,15 +620,18 @@ static void printk_start_of_line(const char *prefix)
 
 static void vprintk_common(const char *prefix, const char *fmt, va_list args)
 {
+    struct vps {
+        bool_t continued, do_print;
+    }            *state;
+    static DEFINE_PER_CPU(struct vps, state);
     static char   buf[1024];
-    static int    start_of_line = 1, do_print;
-
     char         *p, *q;
     unsigned long flags;
 
     /* console_lock can be acquired recursively from __printk_ratelimit(). */
     local_irq_save(flags);
     spin_lock_recursive(&console_lock);
+    state = &this_cpu(state);
 
     (void)vsnprintf(buf, sizeof(buf), fmt, args);
 
@@ -637,30 +640,30 @@ static void vprintk_common(const char *prefix, const char *fmt, va_list args)
     while ( (q = strchr(p, '\n')) != NULL )
     {
         *q = '\0';
-        if ( start_of_line )
-            do_print = printk_prefix_check(p, &p);
-        if ( do_print )
+        if ( !state->continued )
+            state->do_print = printk_prefix_check(p, &p);
+        if ( state->do_print )
         {
-            if ( start_of_line )
+            if ( !state->continued )
                 printk_start_of_line(prefix);
             __putstr(p);
             __putstr("\n");
         }
-        start_of_line = 1;
+        state->continued = 0;
         p = q + 1;
     }
 
     if ( *p != '\0' )
     {
-        if ( start_of_line )
-            do_print = printk_prefix_check(p, &p);
-        if ( do_print )
+        if ( !state->continued )
+            state->do_print = printk_prefix_check(p, &p);
+        if ( state->do_print )
         {
-            if ( start_of_line )
+            if ( !state->continued )
                 printk_start_of_line(prefix);
             __putstr(p);
         }
-        start_of_line = 0;
+        state->continued = 1;
     }
 
     spin_unlock_recursive(&console_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 Thu Nov 26 20:55:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:55: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 1a23ZJ-0005c3-8N; Thu, 26 Nov 2015 20:55:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZI-0005bt-Ig
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:04 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	CC/87-05979-7A177565; Thu, 26 Nov 2015 20:55:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1448571301!6347237!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13451 invoked from network); 26 Nov 2015 20:55:03 -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;
	26 Nov 2015 20:55:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZE-0003Hp-Qy
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZE-0000yo-P7
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:00 +0000
Date: Thu, 26 Nov 2015 20:55:00 +0000
Message-Id: <E1a23ZE-0000yo-P7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: remove .d files from xen/ on a
	clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d9d610de33e48cc7c21ef76d0b43a803425b4b63
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Wed Nov 25 17:19:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:19:01 2015 +0100

    build: remove .d files from xen/ on a clean
    
    Dependency files were getting left behind in the xen
    directory (since 8b6ef9c152edceabecc7f90c811cd538a7b7a110),
    so append the $(DEPS) to the clean rule that runs in the
    hypervisor directory.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index c556198..fa9cf0a 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -88,7 +88,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core $(DEPS)
 	rm -f include/asm-*/asm-offsets.h
 	rm -f .banner
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:55:05 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:55: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 1a23ZJ-0005c3-8N; Thu, 26 Nov 2015 20:55:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZI-0005bt-Ig
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:04 +0000
Received: from [85.158.137.68] by server-14.bemta-3.messagelabs.com id
	CC/87-05979-7A177565; Thu, 26 Nov 2015 20:55:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1448571301!6347237!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13451 invoked from network); 26 Nov 2015 20:55:03 -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;
	26 Nov 2015 20:55:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZE-0003Hp-Qy
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZE-0000yo-P7
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:00 +0000
Date: Thu, 26 Nov 2015 20:55:00 +0000
Message-Id: <E1a23ZE-0000yo-P7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: remove .d files from xen/ on a
	clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d9d610de33e48cc7c21ef76d0b43a803425b4b63
Author:     Jonathan Creekmore <jonathan.creekmore@gmail.com>
AuthorDate: Wed Nov 25 17:19:01 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:19:01 2015 +0100

    build: remove .d files from xen/ on a clean
    
    Dependency files were getting left behind in the xen
    directory (since 8b6ef9c152edceabecc7f90c811cd538a7b7a110),
    so append the $(DEPS) to the clean rule that runs in the
    hypervisor directory.
    
    Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index c556198..fa9cf0a 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -88,7 +88,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core $(DEPS)
 	rm -f include/asm-*/asm-offsets.h
 	rm -f .banner
 
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:55:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23ZS-0005dU-Dw; Thu, 26 Nov 2015 20:55: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 1a23ZR-0005dG-FI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:13 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	94/35-00475-0B177565; Thu, 26 Nov 2015 20:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1448571311!6616545!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53284 invoked from network); 26 Nov 2015 20:55:12 -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;
	26 Nov 2015 20:55:12 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZP-0003IU-3H
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZP-0000zd-2J
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:11 +0000
Date: Thu, 26 Nov 2015 20:55:11 +0000
Message-Id: <E1a23ZP-0000zd-2J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsaves: using named operand
	instead numbered operand in xrstor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3ebe992aef32ed42ac6bb01f2e0a0e04560840e9
Author:     Shuai Ruan <shuai.ruan@intel.com>
AuthorDate: Wed Nov 25 17:19:45 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:19:45 2015 +0100

    x86/xsaves: using named operand instead numbered operand in xrstor
    
    This is pre-req patch for latter xsaves patch. This patch introduce
    a macro to handle restor fixup, also use named opreand instead of
    numbered operand in restor fixup code.
    
    Signed-off-by: Shuai Ruan <shuai.ruan@intel.com>
    [with the expectation of later doing some cleanup:]
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/xstate.c |   43 +++++++++++++++++++------------------------
 1 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 827e0e1..bb6d5e11 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -158,6 +158,16 @@ void xsave(struct vcpu *v, uint64_t mask)
         ptr->fpu_sse.x[FPU_WORD_SIZE_OFFSET] = word_size;
 }
 
+#define XRSTOR_FIXUP   ".section .fixup,\"ax\"           \n"    \
+                       "2: mov %[size],%%ecx             \n"    \
+                       "   xor %[lmask_out],%[lmask_out] \n"    \
+                       "   rep stosb                     \n"    \
+                       "   lea %[mem],%[ptr]             \n"    \
+                       "   mov %[lmask_in],%[lmask_out]  \n"    \
+                       "   jmp 1b                        \n"    \
+                       ".previous                        \n"    \
+                       _ASM_EXTABLE(1b, 2b)
+
 void xrstor(struct vcpu *v, uint64_t mask)
 {
     uint32_t hmask = mask >> 32;
@@ -188,38 +198,23 @@ void xrstor(struct vcpu *v, uint64_t mask)
     {
     default:
         asm volatile ( "1: .byte 0x48,0x0f,0xae,0x2f\n"
-                       ".section .fixup,\"ax\"      \n"
-                       "2: mov %5,%%ecx             \n"
-                       "   xor %1,%1                \n"
-                       "   rep stosb                \n"
-                       "   lea %2,%0                \n"
-                       "   mov %3,%1                \n"
-                       "   jmp 1b                   \n"
-                       ".previous                   \n"
-                       _ASM_EXTABLE(1b, 2b)
-                       : "+&D" (ptr), "+&a" (lmask)
-                       : "m" (*ptr), "g" (lmask), "d" (hmask),
-                         "m" (xsave_cntxt_size)
+                       XRSTOR_FIXUP
+                       : [ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)
+                       : [mem] "m" (*ptr), [lmask_in] "g" (lmask),
+                         [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
                        : "ecx" );
         break;
     case 4: case 2:
         asm volatile ( "1: .byte 0x0f,0xae,0x2f\n"
-                       ".section .fixup,\"ax\" \n"
-                       "2: mov %5,%%ecx        \n"
-                       "   xor %1,%1           \n"
-                       "   rep stosb           \n"
-                       "   lea %2,%0           \n"
-                       "   mov %3,%1           \n"
-                       "   jmp 1b              \n"
-                       ".previous              \n"
-                       _ASM_EXTABLE(1b, 2b)
-                       : "+&D" (ptr), "+&a" (lmask)
-                       : "m" (*ptr), "g" (lmask), "d" (hmask),
-                         "m" (xsave_cntxt_size)
+                       XRSTOR_FIXUP
+                       : [ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)
+                       : [mem] "m" (*ptr), [lmask_in] "g" (lmask),
+                         [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
                        : "ecx" );
         break;
     }
 }
+#undef XRSTOR_FIXUP
 
 bool_t xsave_enabled(const struct vcpu *v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:55:14 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20: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 1a23ZS-0005dU-Dw; Thu, 26 Nov 2015 20:55: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 1a23ZR-0005dG-FI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:13 +0000
Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id
	94/35-00475-0B177565; Thu, 26 Nov 2015 20:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1448571311!6616545!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 53284 invoked from network); 26 Nov 2015 20:55:12 -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;
	26 Nov 2015 20:55:12 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZP-0003IU-3H
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZP-0000zd-2J
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:11 +0000
Date: Thu, 26 Nov 2015 20:55:11 +0000
Message-Id: <E1a23ZP-0000zd-2J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsaves: using named operand
	instead numbered operand in xrstor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3ebe992aef32ed42ac6bb01f2e0a0e04560840e9
Author:     Shuai Ruan <shuai.ruan@intel.com>
AuthorDate: Wed Nov 25 17:19:45 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:19:45 2015 +0100

    x86/xsaves: using named operand instead numbered operand in xrstor
    
    This is pre-req patch for latter xsaves patch. This patch introduce
    a macro to handle restor fixup, also use named opreand instead of
    numbered operand in restor fixup code.
    
    Signed-off-by: Shuai Ruan <shuai.ruan@intel.com>
    [with the expectation of later doing some cleanup:]
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/xstate.c |   43 +++++++++++++++++++------------------------
 1 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 827e0e1..bb6d5e11 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -158,6 +158,16 @@ void xsave(struct vcpu *v, uint64_t mask)
         ptr->fpu_sse.x[FPU_WORD_SIZE_OFFSET] = word_size;
 }
 
+#define XRSTOR_FIXUP   ".section .fixup,\"ax\"           \n"    \
+                       "2: mov %[size],%%ecx             \n"    \
+                       "   xor %[lmask_out],%[lmask_out] \n"    \
+                       "   rep stosb                     \n"    \
+                       "   lea %[mem],%[ptr]             \n"    \
+                       "   mov %[lmask_in],%[lmask_out]  \n"    \
+                       "   jmp 1b                        \n"    \
+                       ".previous                        \n"    \
+                       _ASM_EXTABLE(1b, 2b)
+
 void xrstor(struct vcpu *v, uint64_t mask)
 {
     uint32_t hmask = mask >> 32;
@@ -188,38 +198,23 @@ void xrstor(struct vcpu *v, uint64_t mask)
     {
     default:
         asm volatile ( "1: .byte 0x48,0x0f,0xae,0x2f\n"
-                       ".section .fixup,\"ax\"      \n"
-                       "2: mov %5,%%ecx             \n"
-                       "   xor %1,%1                \n"
-                       "   rep stosb                \n"
-                       "   lea %2,%0                \n"
-                       "   mov %3,%1                \n"
-                       "   jmp 1b                   \n"
-                       ".previous                   \n"
-                       _ASM_EXTABLE(1b, 2b)
-                       : "+&D" (ptr), "+&a" (lmask)
-                       : "m" (*ptr), "g" (lmask), "d" (hmask),
-                         "m" (xsave_cntxt_size)
+                       XRSTOR_FIXUP
+                       : [ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)
+                       : [mem] "m" (*ptr), [lmask_in] "g" (lmask),
+                         [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
                        : "ecx" );
         break;
     case 4: case 2:
         asm volatile ( "1: .byte 0x0f,0xae,0x2f\n"
-                       ".section .fixup,\"ax\" \n"
-                       "2: mov %5,%%ecx        \n"
-                       "   xor %1,%1           \n"
-                       "   rep stosb           \n"
-                       "   lea %2,%0           \n"
-                       "   mov %3,%1           \n"
-                       "   jmp 1b              \n"
-                       ".previous              \n"
-                       _ASM_EXTABLE(1b, 2b)
-                       : "+&D" (ptr), "+&a" (lmask)
-                       : "m" (*ptr), "g" (lmask), "d" (hmask),
-                         "m" (xsave_cntxt_size)
+                       XRSTOR_FIXUP
+                       : [ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)
+                       : [mem] "m" (*ptr), [lmask_in] "g" (lmask),
+                         [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
                        : "ecx" );
         break;
     }
 }
+#undef XRSTOR_FIXUP
 
 bool_t xsave_enabled(const struct vcpu *v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:55:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23Zd-0005fR-LC; Thu, 26 Nov 2015 20:55:25 +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 1a23Zc-0005fI-S4
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:25 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	47/1C-05427-BB177565; Thu, 26 Nov 2015 20:55:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1448571321!6647814!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12323 invoked from network); 26 Nov 2015 20:55:22 -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;
	26 Nov 2015 20:55:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZZ-0003Ig-BJ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZZ-00010C-93
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:21 +0000
Date: Thu, 26 Nov 2015 20:55:21 +0000
Message-Id: <E1a23ZZ-00010C-93@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsaves: enable
	xsaves/xrstors/xsavec in 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 da62246e4c803464ed70db853148c3906c477e36
Author:     Shuai Ruan <shuai.ruan@linux.intel.com>
AuthorDate: Wed Nov 25 17:20:05 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:23:23 2015 +0100

    x86/xsaves: enable xsaves/xrstors/xsavec in xen
    
    This patch uses xsaves/xrstors/xsavec instead of xsaveopt/xrstor
    to perform the xsave_area switching so that xen itself
    can benefit from them when available.
    
    For xsaves/xrstors/xsavec only use compact format. Add format conversion
    support when perform guest os migration. Also, pv guest will not support
    xsaves/xrstors.
    
    Signed-off-by: Shuai Ruan <shuai.ruan@linux.intel.com>
    [dropped redundant uses of XRSTOR_FIXUP and fix formatting]
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain.c             |   10 ++-
 xen/arch/x86/domctl.c             |   30 +++++-
 xen/arch/x86/hvm/hvm.c            |   18 +++-
 xen/arch/x86/i387.c               |    4 +
 xen/arch/x86/traps.c              |    6 +-
 xen/arch/x86/xstate.c             |  217 ++++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/alternative.h |    3 +
 xen/include/asm-x86/xstate.h      |    2 +
 8 files changed, 261 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 3f9e5d2..2a8d5c1 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -910,7 +910,12 @@ int arch_set_info_guest(
     {
         memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt));
         if ( v->arch.xsave_area )
-             v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
+        {
+            v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
+            if ( cpu_has_xsaves || cpu_has_xsavec )
+                v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE |
+                                                         XSTATE_COMPACTION_ENABLED;
+        }
     }
 
     if ( !compat )
@@ -1594,6 +1599,9 @@ static void __context_switch(void)
 
             if ( xcr0 != get_xcr0() && !set_xcr0(xcr0) )
                 BUG();
+
+            if ( cpu_has_xsaves && has_hvm_container_vcpu(n) )
+                set_msr_xss(n->arch.hvm_vcpu.msr_xss);
         }
         vcpu_restore_fpu_eager(n);
         n->arch.ctxt_switch_to(n);
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 0f6fdb9..95b0747 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -897,9 +897,29 @@ long arch_do_domctl(
                 ret = -EFAULT;
 
             offset += sizeof(v->arch.xcr0_accum);
-            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
-                                              (void *)v->arch.xsave_area,
-                                              size - 2 * sizeof(uint64_t)) )
+            if ( !ret && (cpu_has_xsaves || cpu_has_xsavec) )
+            {
+                void *xsave_area;
+
+                xsave_area = xmalloc_bytes(size);
+                if ( !xsave_area )
+                {
+                    ret = -ENOMEM;
+                    vcpu_unpause(v);
+                    goto vcpuextstate_out;
+                }
+
+                expand_xsave_states(v, xsave_area,
+                                    size - 2 * sizeof(uint64_t));
+
+                if ( copy_to_guest_offset(evc->buffer, offset, xsave_area,
+                                          size - 2 * sizeof(uint64_t)) )
+                     ret = -EFAULT;
+                xfree(xsave_area);
+           }
+           else if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                                  (void *)v->arch.xsave_area,
+                                                  size - 2 * sizeof(uint64_t)) )
                 ret = -EFAULT;
 
             vcpu_unpause(v);
@@ -955,8 +975,8 @@ long arch_do_domctl(
                 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));
+                compress_xsave_states(v, _xsave_area,
+                                      evc->size - 2 * sizeof(uint64_t));
                 vcpu_unpause(v);
             }
             else
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 141a130..c981580 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2092,6 +2092,9 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
 
         memcpy(v->arch.xsave_area, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
         xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
+        if ( cpu_has_xsaves || cpu_has_xsavec )
+            xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE |
+                                             XSTATE_COMPACTION_ENABLED;
     }
     else
         memcpy(v->arch.fpu_ctxt, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
@@ -2161,8 +2164,8 @@ static int hvm_save_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
         ctxt->xfeature_mask = xfeature_mask;
         ctxt->xcr0 = v->arch.xcr0;
         ctxt->xcr0_accum = v->arch.xcr0_accum;
-        memcpy(&ctxt->save_area, v->arch.xsave_area,
-               size - offsetof(struct hvm_hw_cpu_xsave, save_area));
+        expand_xsave_states(v, &ctxt->save_area,
+                            size - offsetof(typeof(*ctxt), save_area));
     }
 
     return 0;
@@ -2261,9 +2264,9 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
     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,
-           min(desc->length, size) - offsetof(struct hvm_hw_cpu_xsave,
-           save_area));
+    compress_xsave_states(v, &ctxt->save_area,
+                          min(desc->length, size) -
+                          offsetof(struct hvm_hw_cpu_xsave,save_area));
 
     return 0;
 }
@@ -5503,7 +5506,12 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
     fpu_ctxt->fcw = FCW_RESET;
     fpu_ctxt->mxcsr = MXCSR_DEFAULT;
     if ( v->arch.xsave_area )
+    {
         v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP;
+        if ( cpu_has_xsaves || cpu_has_xsavec )
+            v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP |
+                                                     XSTATE_COMPACTION_ENABLED;
+    }
 
     v->arch.vgc_flags = VGCF_online;
     memset(&v->arch.user_regs, 0, sizeof(v->arch.user_regs));
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 66b51cb..b661d39 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -282,7 +282,11 @@ int vcpu_init_fpu(struct vcpu *v)
         return rc;
 
     if ( v->arch.xsave_area )
+    {
         v->arch.fpu_ctxt = &v->arch.xsave_area->fpu_sse;
+        if ( cpu_has_xsaves || cpu_has_xsavec )
+            v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_COMPACTION_ENABLED;
+    }
     else
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index e21fb78..075f98e 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -939,9 +939,9 @@ void pv_cpuid(struct cpu_user_regs *regs)
             goto unsupported;
         if ( regs->_ecx == 1 )
         {
-            a &= boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)];
-            if ( !cpu_has_xsaves )
-                b = c = d = 0;
+            a &= (boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)] &
+                  ~cpufeat_mask(X86_FEATURE_XSAVES));
+            b = c = d = 0;
         }
         break;
 
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index bb6d5e11..e41056d 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -24,6 +24,11 @@ static u32 __read_mostly xsave_cntxt_size;
 /* A 64-bit bitmask of the XSAVE/XRSTOR features supported by processor. */
 u64 __read_mostly xfeature_mask;
 
+static unsigned int *__read_mostly xstate_offsets;
+static unsigned int *__read_mostly xstate_sizes;
+static unsigned int __read_mostly xstate_features;
+static unsigned int __read_mostly xstate_comp_offsets[sizeof(xfeature_mask)*8];
+
 /* Cached xcr0 for fast read */
 static DEFINE_PER_CPU(uint64_t, xcr0);
 
@@ -79,6 +84,161 @@ uint64_t get_msr_xss(void)
     return this_cpu(xss);
 }
 
+static bool_t xsave_area_compressed(const struct xsave_struct *xsave_area)
+{
+     return xsave_area && (xsave_area->xsave_hdr.xcomp_bv
+                           & XSTATE_COMPACTION_ENABLED);
+}
+
+static int setup_xstate_features(bool_t bsp)
+{
+    unsigned int leaf, tmp, eax, ebx;
+
+    if ( bsp )
+    {
+        xstate_features = fls(xfeature_mask);
+        xstate_offsets = xzalloc_array(unsigned int, xstate_features);
+        if ( !xstate_offsets )
+            return -ENOMEM;
+
+        xstate_sizes = xzalloc_array(unsigned int, xstate_features);
+        if ( !xstate_sizes )
+            return -ENOMEM;
+    }
+
+    for ( leaf = 2; leaf < xstate_features; leaf++ )
+    {
+        if ( bsp )
+            cpuid_count(XSTATE_CPUID, leaf, &xstate_sizes[leaf],
+                        &xstate_offsets[leaf], &tmp, &tmp);
+        else
+        {
+            cpuid_count(XSTATE_CPUID, leaf, &eax,
+                        &ebx, &tmp, &tmp);
+            BUG_ON(eax != xstate_sizes[leaf]);
+            BUG_ON(ebx != xstate_offsets[leaf]);
+        }
+    }
+
+    return 0;
+}
+
+static void __init setup_xstate_comp(void)
+{
+    unsigned int i;
+
+    /*
+     * The FP xstates and SSE xstates are legacy states. They are always
+     * in the fixed offsets in the xsave area in either compacted form
+     * or standard form.
+     */
+    xstate_comp_offsets[0] = 0;
+    xstate_comp_offsets[1] = XSAVE_SSE_OFFSET;
+
+    xstate_comp_offsets[2] = FXSAVE_SIZE + XSAVE_HDR_SIZE;
+
+    for ( i = 3; i < xstate_features; i++ )
+    {
+        xstate_comp_offsets[i] = xstate_comp_offsets[i - 1] +
+                                 (((1ul << i) & xfeature_mask)
+                                  ? xstate_sizes[i - 1] : 0);
+        ASSERT(xstate_comp_offsets[i] + xstate_sizes[i] <= xsave_cntxt_size);
+    }
+}
+
+static void *get_xsave_addr(void *xsave, unsigned int xfeature_idx)
+{
+    if ( !((1ul << xfeature_idx) & xfeature_mask) )
+        return NULL;
+
+    return xsave + xstate_comp_offsets[xfeature_idx];
+}
+
+void expand_xsave_states(struct vcpu *v, void *dest, unsigned int size)
+{
+    struct xsave_struct *xsave = v->arch.xsave_area;
+    u64 xstate_bv = xsave->xsave_hdr.xstate_bv;
+    u64 valid;
+
+    if ( !cpu_has_xsaves && !cpu_has_xsavec )
+    {
+        memcpy(dest, xsave, size);
+        return;
+    }
+
+    ASSERT(xsave_area_compressed(xsave));
+    /*
+     * Copy legacy XSAVE area and XSAVE hdr area.
+     */
+    memcpy(dest, xsave, XSTATE_AREA_MIN_SIZE);
+
+    ((struct xsave_struct *)dest)->xsave_hdr.xcomp_bv =  0;
+
+    /*
+     * Copy each region from the possibly compacted offset to the
+     * non-compacted offset.
+     */
+    valid = xstate_bv & ~XSTATE_FP_SSE;
+    while ( valid )
+    {
+        u64 feature = valid & -valid;
+        unsigned int index = fls(feature) - 1;
+        const void *src = get_xsave_addr(xsave, index);
+
+        if ( src )
+        {
+            ASSERT((xstate_offsets[index] + xstate_sizes[index]) <= size);
+            memcpy(dest + xstate_offsets[index], src, xstate_sizes[index]);
+        }
+
+        valid &= ~feature;
+    }
+}
+
+void compress_xsave_states(struct vcpu *v, const void *src, unsigned int size)
+{
+    struct xsave_struct *xsave = v->arch.xsave_area;
+    u64 xstate_bv = ((const struct xsave_struct *)src)->xsave_hdr.xstate_bv;
+    u64 valid;
+
+    if ( !cpu_has_xsaves && !cpu_has_xsavec )
+    {
+        memcpy(xsave, src, size);
+        return;
+    }
+
+    ASSERT(!xsave_area_compressed(src));
+    /*
+     * Copy legacy XSAVE area, to avoid complications with CPUID
+     * leaves 0 and 1 in the loop below.
+     */
+    memcpy(xsave, src, FXSAVE_SIZE);
+
+    /* Set XSTATE_BV and XCOMP_BV.  */
+    xsave->xsave_hdr.xstate_bv = xstate_bv;
+    xsave->xsave_hdr.xcomp_bv = v->arch.xcr0_accum | XSTATE_COMPACTION_ENABLED;
+
+    /*
+     * Copy each region from the non-compacted offset to the
+     * possibly compacted offset.
+     */
+    valid = xstate_bv & ~XSTATE_FP_SSE;
+    while ( valid )
+    {
+        u64 feature = valid & -valid;
+        unsigned int index = fls(feature) - 1;
+        void *dest = get_xsave_addr(xsave, index);
+
+        if ( dest )
+        {
+            ASSERT((xstate_offsets[index] + xstate_sizes[index]) <= size);
+            memcpy(dest, src + xstate_offsets[index], xstate_sizes[index]);
+        }
+
+        valid &= ~feature;
+    }
+}
+
 void xsave(struct vcpu *v, uint64_t mask)
 {
     struct xsave_struct *ptr = v->arch.xsave_area;
@@ -91,7 +251,15 @@ void xsave(struct vcpu *v, uint64_t mask)
         typeof(ptr->fpu_sse.fip.sel) fcs = ptr->fpu_sse.fip.sel;
         typeof(ptr->fpu_sse.fdp.sel) fds = ptr->fpu_sse.fdp.sel;
 
-        if ( cpu_has_xsaveopt )
+        if ( cpu_has_xsaves )
+            asm volatile ( ".byte 0x48,0x0f,0xc7,0x2f"
+                           : "=m" (*ptr)
+                           : "a" (lmask), "d" (hmask), "D" (ptr) );
+        else if ( cpu_has_xsavec )
+            asm volatile ( ".byte 0x48,0x0f,0xc7,0x27"
+                           : "=m" (*ptr)
+                           : "a" (lmask), "d" (hmask), "D" (ptr) );
+        else if ( cpu_has_xsaveopt )
         {
             /*
              * xsaveopt may not write the FPU portion even when the respective
@@ -144,7 +312,15 @@ void xsave(struct vcpu *v, uint64_t mask)
     }
     else
     {
-        if ( cpu_has_xsaveopt )
+        if ( cpu_has_xsaves )
+            asm volatile ( ".byte 0x0f,0xc7,0x2f"
+                           : "=m" (*ptr)
+                           : "a" (lmask), "d" (hmask), "D" (ptr) );
+        else if ( cpu_has_xsavec )
+            asm volatile ( ".byte 0x0f,0xc7,0x27"
+                           : "=m" (*ptr)
+                           : "a" (lmask), "d" (hmask), "D" (ptr) );
+        else if ( cpu_has_xsaveopt )
             asm volatile ( ".byte 0x0f,0xae,0x37"
                            : "=m" (*ptr)
                            : "a" (lmask), "d" (hmask), "D" (ptr) );
@@ -197,20 +373,24 @@ void xrstor(struct vcpu *v, uint64_t mask)
     switch ( __builtin_expect(ptr->fpu_sse.x[FPU_WORD_SIZE_OFFSET], 8) )
     {
     default:
-        asm volatile ( "1: .byte 0x48,0x0f,0xae,0x2f\n"
-                       XRSTOR_FIXUP
-                       : [ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)
-                       : [mem] "m" (*ptr), [lmask_in] "g" (lmask),
-                         [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
-                       : "ecx" );
+        alternative_io("1: .byte 0x48,0x0f,0xae,0x2f\n"
+                       XRSTOR_FIXUP,
+                       ".byte 0x48,0x0f,0xc7,0x1f\n",
+                       X86_FEATURE_XSAVES,
+                       ASM_OUTPUT2([ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)),
+                       [mem] "m" (*ptr), [lmask_in] "g" (lmask),
+                       [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
+                       : "ecx");
         break;
     case 4: case 2:
-        asm volatile ( "1: .byte 0x0f,0xae,0x2f\n"
-                       XRSTOR_FIXUP
-                       : [ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)
-                       : [mem] "m" (*ptr), [lmask_in] "g" (lmask),
-                         [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
-                       : "ecx" );
+        alternative_io("1: .byte 0x0f,0xae,0x2f\n"
+                       XRSTOR_FIXUP,
+                       ".byte 0x0f,0xc7,0x1f\n",
+                       X86_FEATURE_XSAVES,
+                       ASM_OUTPUT2([ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)),
+                       [mem] "m" (*ptr), [lmask_in] "g" (lmask),
+                       [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
+                       : "ecx");
         break;
     }
 }
@@ -338,11 +518,18 @@ void xstate_init(struct cpuinfo_x86 *c)
 
     /* Mask out features not currently understood by Xen. */
     eax &= (cpufeat_mask(X86_FEATURE_XSAVEOPT) |
-            cpufeat_mask(X86_FEATURE_XSAVEC));
+            cpufeat_mask(X86_FEATURE_XSAVEC) |
+            cpufeat_mask(X86_FEATURE_XGETBV1) |
+            cpufeat_mask(X86_FEATURE_XSAVES));
 
     c->x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)] = eax;
 
     BUG_ON(eax != boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)]);
+
+    if ( setup_xstate_features(bsp) && bsp )
+        BUG();
+    if ( bsp && (cpu_has_xsaves || cpu_has_xsavec) )
+        setup_xstate_comp();
 }
 
 static bool_t valid_xcr0(u64 xcr0)
diff --git a/xen/include/asm-x86/alternative.h b/xen/include/asm-x86/alternative.h
index 23c9b9f..7ddbd76 100644
--- a/xen/include/asm-x86/alternative.h
+++ b/xen/include/asm-x86/alternative.h
@@ -94,6 +94,9 @@ extern void alternative_instructions(void);
 	asm volatile (ALTERNATIVE(oldinstr, newinstr, feature)		\
 		: output : "i" (0), ## input)
 
+/* Use this macro(s) if you need more than one output parameter. */
+#define ASM_OUTPUT2(a...) a
+
 #endif  /*  __ASSEMBLY__  */
 
 #endif /* __X86_ALTERNATIVE_H__ */
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index b95a5b5..414cc99 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -91,6 +91,8 @@ void xrstor(struct vcpu *v, uint64_t mask);
 bool_t xsave_enabled(const struct vcpu *v);
 int __must_check validate_xstate(u64 xcr0, u64 xcr0_accum, u64 xstate_bv);
 int __must_check handle_xsetbv(u32 index, u64 new_bv);
+void expand_xsave_states(struct vcpu *v, void *dest, unsigned int size);
+void compress_xsave_states(struct vcpu *v, const void *src, unsigned int size);
 
 /* extended state init and cleanup functions */
 void xstate_free_save_area(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:55:25 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23Zd-0005fR-LC; Thu, 26 Nov 2015 20:55:25 +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 1a23Zc-0005fI-S4
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:25 +0000
Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id
	47/1C-05427-BB177565; Thu, 26 Nov 2015 20:55:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1448571321!6647814!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12323 invoked from network); 26 Nov 2015 20:55:22 -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;
	26 Nov 2015 20:55:22 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZZ-0003Ig-BJ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23ZZ-00010C-93
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:21 +0000
Date: Thu, 26 Nov 2015 20:55:21 +0000
Message-Id: <E1a23ZZ-00010C-93@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsaves: enable
	xsaves/xrstors/xsavec in 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 da62246e4c803464ed70db853148c3906c477e36
Author:     Shuai Ruan <shuai.ruan@linux.intel.com>
AuthorDate: Wed Nov 25 17:20:05 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:23:23 2015 +0100

    x86/xsaves: enable xsaves/xrstors/xsavec in xen
    
    This patch uses xsaves/xrstors/xsavec instead of xsaveopt/xrstor
    to perform the xsave_area switching so that xen itself
    can benefit from them when available.
    
    For xsaves/xrstors/xsavec only use compact format. Add format conversion
    support when perform guest os migration. Also, pv guest will not support
    xsaves/xrstors.
    
    Signed-off-by: Shuai Ruan <shuai.ruan@linux.intel.com>
    [dropped redundant uses of XRSTOR_FIXUP and fix formatting]
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain.c             |   10 ++-
 xen/arch/x86/domctl.c             |   30 +++++-
 xen/arch/x86/hvm/hvm.c            |   18 +++-
 xen/arch/x86/i387.c               |    4 +
 xen/arch/x86/traps.c              |    6 +-
 xen/arch/x86/xstate.c             |  217 ++++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/alternative.h |    3 +
 xen/include/asm-x86/xstate.h      |    2 +
 8 files changed, 261 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 3f9e5d2..2a8d5c1 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -910,7 +910,12 @@ int arch_set_info_guest(
     {
         memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt));
         if ( v->arch.xsave_area )
-             v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
+        {
+            v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
+            if ( cpu_has_xsaves || cpu_has_xsavec )
+                v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE |
+                                                         XSTATE_COMPACTION_ENABLED;
+        }
     }
 
     if ( !compat )
@@ -1594,6 +1599,9 @@ static void __context_switch(void)
 
             if ( xcr0 != get_xcr0() && !set_xcr0(xcr0) )
                 BUG();
+
+            if ( cpu_has_xsaves && has_hvm_container_vcpu(n) )
+                set_msr_xss(n->arch.hvm_vcpu.msr_xss);
         }
         vcpu_restore_fpu_eager(n);
         n->arch.ctxt_switch_to(n);
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 0f6fdb9..95b0747 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -897,9 +897,29 @@ long arch_do_domctl(
                 ret = -EFAULT;
 
             offset += sizeof(v->arch.xcr0_accum);
-            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
-                                              (void *)v->arch.xsave_area,
-                                              size - 2 * sizeof(uint64_t)) )
+            if ( !ret && (cpu_has_xsaves || cpu_has_xsavec) )
+            {
+                void *xsave_area;
+
+                xsave_area = xmalloc_bytes(size);
+                if ( !xsave_area )
+                {
+                    ret = -ENOMEM;
+                    vcpu_unpause(v);
+                    goto vcpuextstate_out;
+                }
+
+                expand_xsave_states(v, xsave_area,
+                                    size - 2 * sizeof(uint64_t));
+
+                if ( copy_to_guest_offset(evc->buffer, offset, xsave_area,
+                                          size - 2 * sizeof(uint64_t)) )
+                     ret = -EFAULT;
+                xfree(xsave_area);
+           }
+           else if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                                  (void *)v->arch.xsave_area,
+                                                  size - 2 * sizeof(uint64_t)) )
                 ret = -EFAULT;
 
             vcpu_unpause(v);
@@ -955,8 +975,8 @@ long arch_do_domctl(
                 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));
+                compress_xsave_states(v, _xsave_area,
+                                      evc->size - 2 * sizeof(uint64_t));
                 vcpu_unpause(v);
             }
             else
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 141a130..c981580 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2092,6 +2092,9 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
 
         memcpy(v->arch.xsave_area, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
         xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
+        if ( cpu_has_xsaves || cpu_has_xsavec )
+            xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE |
+                                             XSTATE_COMPACTION_ENABLED;
     }
     else
         memcpy(v->arch.fpu_ctxt, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
@@ -2161,8 +2164,8 @@ static int hvm_save_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
         ctxt->xfeature_mask = xfeature_mask;
         ctxt->xcr0 = v->arch.xcr0;
         ctxt->xcr0_accum = v->arch.xcr0_accum;
-        memcpy(&ctxt->save_area, v->arch.xsave_area,
-               size - offsetof(struct hvm_hw_cpu_xsave, save_area));
+        expand_xsave_states(v, &ctxt->save_area,
+                            size - offsetof(typeof(*ctxt), save_area));
     }
 
     return 0;
@@ -2261,9 +2264,9 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
     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,
-           min(desc->length, size) - offsetof(struct hvm_hw_cpu_xsave,
-           save_area));
+    compress_xsave_states(v, &ctxt->save_area,
+                          min(desc->length, size) -
+                          offsetof(struct hvm_hw_cpu_xsave,save_area));
 
     return 0;
 }
@@ -5503,7 +5506,12 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
     fpu_ctxt->fcw = FCW_RESET;
     fpu_ctxt->mxcsr = MXCSR_DEFAULT;
     if ( v->arch.xsave_area )
+    {
         v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP;
+        if ( cpu_has_xsaves || cpu_has_xsavec )
+            v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP |
+                                                     XSTATE_COMPACTION_ENABLED;
+    }
 
     v->arch.vgc_flags = VGCF_online;
     memset(&v->arch.user_regs, 0, sizeof(v->arch.user_regs));
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 66b51cb..b661d39 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -282,7 +282,11 @@ int vcpu_init_fpu(struct vcpu *v)
         return rc;
 
     if ( v->arch.xsave_area )
+    {
         v->arch.fpu_ctxt = &v->arch.xsave_area->fpu_sse;
+        if ( cpu_has_xsaves || cpu_has_xsavec )
+            v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_COMPACTION_ENABLED;
+    }
     else
     {
         v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse), 16);
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index e21fb78..075f98e 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -939,9 +939,9 @@ void pv_cpuid(struct cpu_user_regs *regs)
             goto unsupported;
         if ( regs->_ecx == 1 )
         {
-            a &= boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)];
-            if ( !cpu_has_xsaves )
-                b = c = d = 0;
+            a &= (boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)] &
+                  ~cpufeat_mask(X86_FEATURE_XSAVES));
+            b = c = d = 0;
         }
         break;
 
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index bb6d5e11..e41056d 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -24,6 +24,11 @@ static u32 __read_mostly xsave_cntxt_size;
 /* A 64-bit bitmask of the XSAVE/XRSTOR features supported by processor. */
 u64 __read_mostly xfeature_mask;
 
+static unsigned int *__read_mostly xstate_offsets;
+static unsigned int *__read_mostly xstate_sizes;
+static unsigned int __read_mostly xstate_features;
+static unsigned int __read_mostly xstate_comp_offsets[sizeof(xfeature_mask)*8];
+
 /* Cached xcr0 for fast read */
 static DEFINE_PER_CPU(uint64_t, xcr0);
 
@@ -79,6 +84,161 @@ uint64_t get_msr_xss(void)
     return this_cpu(xss);
 }
 
+static bool_t xsave_area_compressed(const struct xsave_struct *xsave_area)
+{
+     return xsave_area && (xsave_area->xsave_hdr.xcomp_bv
+                           & XSTATE_COMPACTION_ENABLED);
+}
+
+static int setup_xstate_features(bool_t bsp)
+{
+    unsigned int leaf, tmp, eax, ebx;
+
+    if ( bsp )
+    {
+        xstate_features = fls(xfeature_mask);
+        xstate_offsets = xzalloc_array(unsigned int, xstate_features);
+        if ( !xstate_offsets )
+            return -ENOMEM;
+
+        xstate_sizes = xzalloc_array(unsigned int, xstate_features);
+        if ( !xstate_sizes )
+            return -ENOMEM;
+    }
+
+    for ( leaf = 2; leaf < xstate_features; leaf++ )
+    {
+        if ( bsp )
+            cpuid_count(XSTATE_CPUID, leaf, &xstate_sizes[leaf],
+                        &xstate_offsets[leaf], &tmp, &tmp);
+        else
+        {
+            cpuid_count(XSTATE_CPUID, leaf, &eax,
+                        &ebx, &tmp, &tmp);
+            BUG_ON(eax != xstate_sizes[leaf]);
+            BUG_ON(ebx != xstate_offsets[leaf]);
+        }
+    }
+
+    return 0;
+}
+
+static void __init setup_xstate_comp(void)
+{
+    unsigned int i;
+
+    /*
+     * The FP xstates and SSE xstates are legacy states. They are always
+     * in the fixed offsets in the xsave area in either compacted form
+     * or standard form.
+     */
+    xstate_comp_offsets[0] = 0;
+    xstate_comp_offsets[1] = XSAVE_SSE_OFFSET;
+
+    xstate_comp_offsets[2] = FXSAVE_SIZE + XSAVE_HDR_SIZE;
+
+    for ( i = 3; i < xstate_features; i++ )
+    {
+        xstate_comp_offsets[i] = xstate_comp_offsets[i - 1] +
+                                 (((1ul << i) & xfeature_mask)
+                                  ? xstate_sizes[i - 1] : 0);
+        ASSERT(xstate_comp_offsets[i] + xstate_sizes[i] <= xsave_cntxt_size);
+    }
+}
+
+static void *get_xsave_addr(void *xsave, unsigned int xfeature_idx)
+{
+    if ( !((1ul << xfeature_idx) & xfeature_mask) )
+        return NULL;
+
+    return xsave + xstate_comp_offsets[xfeature_idx];
+}
+
+void expand_xsave_states(struct vcpu *v, void *dest, unsigned int size)
+{
+    struct xsave_struct *xsave = v->arch.xsave_area;
+    u64 xstate_bv = xsave->xsave_hdr.xstate_bv;
+    u64 valid;
+
+    if ( !cpu_has_xsaves && !cpu_has_xsavec )
+    {
+        memcpy(dest, xsave, size);
+        return;
+    }
+
+    ASSERT(xsave_area_compressed(xsave));
+    /*
+     * Copy legacy XSAVE area and XSAVE hdr area.
+     */
+    memcpy(dest, xsave, XSTATE_AREA_MIN_SIZE);
+
+    ((struct xsave_struct *)dest)->xsave_hdr.xcomp_bv =  0;
+
+    /*
+     * Copy each region from the possibly compacted offset to the
+     * non-compacted offset.
+     */
+    valid = xstate_bv & ~XSTATE_FP_SSE;
+    while ( valid )
+    {
+        u64 feature = valid & -valid;
+        unsigned int index = fls(feature) - 1;
+        const void *src = get_xsave_addr(xsave, index);
+
+        if ( src )
+        {
+            ASSERT((xstate_offsets[index] + xstate_sizes[index]) <= size);
+            memcpy(dest + xstate_offsets[index], src, xstate_sizes[index]);
+        }
+
+        valid &= ~feature;
+    }
+}
+
+void compress_xsave_states(struct vcpu *v, const void *src, unsigned int size)
+{
+    struct xsave_struct *xsave = v->arch.xsave_area;
+    u64 xstate_bv = ((const struct xsave_struct *)src)->xsave_hdr.xstate_bv;
+    u64 valid;
+
+    if ( !cpu_has_xsaves && !cpu_has_xsavec )
+    {
+        memcpy(xsave, src, size);
+        return;
+    }
+
+    ASSERT(!xsave_area_compressed(src));
+    /*
+     * Copy legacy XSAVE area, to avoid complications with CPUID
+     * leaves 0 and 1 in the loop below.
+     */
+    memcpy(xsave, src, FXSAVE_SIZE);
+
+    /* Set XSTATE_BV and XCOMP_BV.  */
+    xsave->xsave_hdr.xstate_bv = xstate_bv;
+    xsave->xsave_hdr.xcomp_bv = v->arch.xcr0_accum | XSTATE_COMPACTION_ENABLED;
+
+    /*
+     * Copy each region from the non-compacted offset to the
+     * possibly compacted offset.
+     */
+    valid = xstate_bv & ~XSTATE_FP_SSE;
+    while ( valid )
+    {
+        u64 feature = valid & -valid;
+        unsigned int index = fls(feature) - 1;
+        void *dest = get_xsave_addr(xsave, index);
+
+        if ( dest )
+        {
+            ASSERT((xstate_offsets[index] + xstate_sizes[index]) <= size);
+            memcpy(dest, src + xstate_offsets[index], xstate_sizes[index]);
+        }
+
+        valid &= ~feature;
+    }
+}
+
 void xsave(struct vcpu *v, uint64_t mask)
 {
     struct xsave_struct *ptr = v->arch.xsave_area;
@@ -91,7 +251,15 @@ void xsave(struct vcpu *v, uint64_t mask)
         typeof(ptr->fpu_sse.fip.sel) fcs = ptr->fpu_sse.fip.sel;
         typeof(ptr->fpu_sse.fdp.sel) fds = ptr->fpu_sse.fdp.sel;
 
-        if ( cpu_has_xsaveopt )
+        if ( cpu_has_xsaves )
+            asm volatile ( ".byte 0x48,0x0f,0xc7,0x2f"
+                           : "=m" (*ptr)
+                           : "a" (lmask), "d" (hmask), "D" (ptr) );
+        else if ( cpu_has_xsavec )
+            asm volatile ( ".byte 0x48,0x0f,0xc7,0x27"
+                           : "=m" (*ptr)
+                           : "a" (lmask), "d" (hmask), "D" (ptr) );
+        else if ( cpu_has_xsaveopt )
         {
             /*
              * xsaveopt may not write the FPU portion even when the respective
@@ -144,7 +312,15 @@ void xsave(struct vcpu *v, uint64_t mask)
     }
     else
     {
-        if ( cpu_has_xsaveopt )
+        if ( cpu_has_xsaves )
+            asm volatile ( ".byte 0x0f,0xc7,0x2f"
+                           : "=m" (*ptr)
+                           : "a" (lmask), "d" (hmask), "D" (ptr) );
+        else if ( cpu_has_xsavec )
+            asm volatile ( ".byte 0x0f,0xc7,0x27"
+                           : "=m" (*ptr)
+                           : "a" (lmask), "d" (hmask), "D" (ptr) );
+        else if ( cpu_has_xsaveopt )
             asm volatile ( ".byte 0x0f,0xae,0x37"
                            : "=m" (*ptr)
                            : "a" (lmask), "d" (hmask), "D" (ptr) );
@@ -197,20 +373,24 @@ void xrstor(struct vcpu *v, uint64_t mask)
     switch ( __builtin_expect(ptr->fpu_sse.x[FPU_WORD_SIZE_OFFSET], 8) )
     {
     default:
-        asm volatile ( "1: .byte 0x48,0x0f,0xae,0x2f\n"
-                       XRSTOR_FIXUP
-                       : [ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)
-                       : [mem] "m" (*ptr), [lmask_in] "g" (lmask),
-                         [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
-                       : "ecx" );
+        alternative_io("1: .byte 0x48,0x0f,0xae,0x2f\n"
+                       XRSTOR_FIXUP,
+                       ".byte 0x48,0x0f,0xc7,0x1f\n",
+                       X86_FEATURE_XSAVES,
+                       ASM_OUTPUT2([ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)),
+                       [mem] "m" (*ptr), [lmask_in] "g" (lmask),
+                       [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
+                       : "ecx");
         break;
     case 4: case 2:
-        asm volatile ( "1: .byte 0x0f,0xae,0x2f\n"
-                       XRSTOR_FIXUP
-                       : [ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)
-                       : [mem] "m" (*ptr), [lmask_in] "g" (lmask),
-                         [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
-                       : "ecx" );
+        alternative_io("1: .byte 0x0f,0xae,0x2f\n"
+                       XRSTOR_FIXUP,
+                       ".byte 0x0f,0xc7,0x1f\n",
+                       X86_FEATURE_XSAVES,
+                       ASM_OUTPUT2([ptr] "+&D" (ptr), [lmask_out] "+&a" (lmask)),
+                       [mem] "m" (*ptr), [lmask_in] "g" (lmask),
+                       [hmask] "d" (hmask), [size] "m" (xsave_cntxt_size)
+                       : "ecx");
         break;
     }
 }
@@ -338,11 +518,18 @@ void xstate_init(struct cpuinfo_x86 *c)
 
     /* Mask out features not currently understood by Xen. */
     eax &= (cpufeat_mask(X86_FEATURE_XSAVEOPT) |
-            cpufeat_mask(X86_FEATURE_XSAVEC));
+            cpufeat_mask(X86_FEATURE_XSAVEC) |
+            cpufeat_mask(X86_FEATURE_XGETBV1) |
+            cpufeat_mask(X86_FEATURE_XSAVES));
 
     c->x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)] = eax;
 
     BUG_ON(eax != boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)]);
+
+    if ( setup_xstate_features(bsp) && bsp )
+        BUG();
+    if ( bsp && (cpu_has_xsaves || cpu_has_xsavec) )
+        setup_xstate_comp();
 }
 
 static bool_t valid_xcr0(u64 xcr0)
diff --git a/xen/include/asm-x86/alternative.h b/xen/include/asm-x86/alternative.h
index 23c9b9f..7ddbd76 100644
--- a/xen/include/asm-x86/alternative.h
+++ b/xen/include/asm-x86/alternative.h
@@ -94,6 +94,9 @@ extern void alternative_instructions(void);
 	asm volatile (ALTERNATIVE(oldinstr, newinstr, feature)		\
 		: output : "i" (0), ## input)
 
+/* Use this macro(s) if you need more than one output parameter. */
+#define ASM_OUTPUT2(a...) a
+
 #endif  /*  __ASSEMBLY__  */
 
 #endif /* __X86_ALTERNATIVE_H__ */
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index b95a5b5..414cc99 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -91,6 +91,8 @@ void xrstor(struct vcpu *v, uint64_t mask);
 bool_t xsave_enabled(const struct vcpu *v);
 int __must_check validate_xstate(u64 xcr0, u64 xcr0_accum, u64 xstate_bv);
 int __must_check handle_xsetbv(u32 index, u64 new_bv);
+void expand_xsave_states(struct vcpu *v, void *dest, unsigned int size);
+void compress_xsave_states(struct vcpu *v, const void *src, unsigned int size);
 
 /* extended state init and cleanup functions */
 void xstate_free_save_area(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:55:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:55: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 1a23Zn-0005hV-QM; Thu, 26 Nov 2015 20:55:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Zm-0005hJ-Hs
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:34 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	2B/AA-02804-5C177565; Thu, 26 Nov 2015 20:55:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1448571331!6877827!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62552 invoked from network); 26 Nov 2015 20:55:32 -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;
	26 Nov 2015 20:55:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Zj-0003JC-ME
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Zj-00011A-KM
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:31 +0000
Date: Thu, 26 Nov 2015 20:55:31 +0000
Message-Id: <E1a23Zj-00011A-KM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsaves: enable xsaves/xrstors for
	hvm 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 460b9a4b3630f03ce4f1ee24249541bdfea08fd4
Author:     Shuai Ruan <shuai.ruan@linux.intel.com>
AuthorDate: Wed Nov 25 17:23:51 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:23:51 2015 +0100

    x86/xsaves: enable xsaves/xrstors for hvm guest
    
    This patch enables xsaves for hvm guest, includes:
    1.handle xsaves vmcs init and vmexit.
    2.add logic to write/read the XSS msr.
    
    Add IA32_XSS_MSR save/rstore support.
    
    Signed-off-by: Shuai Ruan <shuai.ruan@linux.intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c             |   27 +++++++++++++++++++++++++++
 xen/arch/x86/hvm/vmx/vmcs.c        |    5 ++++-
 xen/arch/x86/hvm/vmx/vmx.c         |   35 ++++++++++++++++++++++++++++++++++-
 xen/arch/x86/xstate.c              |    2 +-
 xen/include/asm-x86/hvm/vmx/vmcs.h |    4 ++++
 xen/include/asm-x86/hvm/vmx/vmx.h  |    2 ++
 xen/include/asm-x86/xstate.h       |    1 +
 7 files changed, 73 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c981580..6c2b512 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4606,6 +4606,20 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
                     *ebx = _eax + _ebx;
             }
         }
+        if ( count == 1 )
+        {
+            if ( cpu_has_xsaves && cpu_has_vmx_xsaves )
+            {
+                *ebx = XSTATE_AREA_MIN_SIZE;
+                if ( v->arch.xcr0 | v->arch.hvm_vcpu.msr_xss )
+                    for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ )
+                        if ( (v->arch.xcr0 | v->arch.hvm_vcpu.msr_xss) &
+                             (1ULL << sub_leaf) )
+                            *ebx += xstate_sizes[sub_leaf];
+            }
+            else
+                *ebx = *ecx = *edx = 0;
+        }
         break;
 
     case 0x80000001:
@@ -4705,6 +4719,12 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         *msr_content = v->arch.hvm_vcpu.guest_efer;
         break;
 
+    case MSR_IA32_XSS:
+        if ( !cpu_has_xsaves )
+            goto gp_fault;
+        *msr_content = v->arch.hvm_vcpu.msr_xss;
+        break;
+
     case MSR_IA32_TSC:
         *msr_content = _hvm_rdtsc_intercept();
         break;
@@ -4837,6 +4857,13 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content,
            return X86EMUL_EXCEPTION;
         break;
 
+    case MSR_IA32_XSS:
+        /* No XSS features currently supported for guests. */
+        if ( !cpu_has_xsaves || msr_content != 0 )
+            goto gp_fault;
+        v->arch.hvm_vcpu.msr_xss = msr_content;
+        break;
+
     case MSR_IA32_TSC:
         hvm_set_guest_tsc(v, msr_content);
         break;
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 202c0a4..000d06e 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -241,7 +241,8 @@ static int vmx_init_vmcs_config(void)
                SECONDARY_EXEC_PAUSE_LOOP_EXITING |
                SECONDARY_EXEC_ENABLE_INVPCID |
                SECONDARY_EXEC_ENABLE_VM_FUNCTIONS |
-               SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS);
+               SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS |
+               SECONDARY_EXEC_XSAVES);
         rdmsrl(MSR_IA32_VMX_MISC, _vmx_misc_cap);
         if ( _vmx_misc_cap & VMX_MISC_VMWRITE_ALL )
             opt |= SECONDARY_EXEC_ENABLE_VMCS_SHADOWING;
@@ -1273,6 +1274,8 @@ static int construct_vmcs(struct vcpu *v)
         __vmwrite(HOST_PAT, host_pat);
         __vmwrite(GUEST_PAT, guest_pat);
     }
+    if ( cpu_has_vmx_xsaves )
+        __vmwrite(XSS_EXIT_BITMAP, 0);
 
     vmx_vmcs_exit(v);
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 374eebf..9ad6d82 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -625,7 +625,7 @@ static int vmx_load_vmcs_ctxt(struct vcpu *v, struct hvm_hw_cpu *ctxt)
 
 static unsigned int __init vmx_init_msr(void)
 {
-    return !!cpu_has_mpx;
+    return !!cpu_has_mpx + !!cpu_has_xsaves;
 }
 
 static void vmx_save_msr(struct vcpu *v, struct hvm_msr *ctxt)
@@ -640,6 +640,13 @@ static void vmx_save_msr(struct vcpu *v, struct hvm_msr *ctxt)
     }
 
     vmx_vmcs_exit(v);
+
+    if ( cpu_has_xsaves )
+    {
+        ctxt->msr[ctxt->count].val = v->arch.hvm_vcpu.msr_xss;
+        if ( ctxt->msr[ctxt->count].val )
+            ctxt->msr[ctxt->count++].index = MSR_IA32_XSS;
+    }
 }
 
 static int vmx_load_msr(struct vcpu *v, struct hvm_msr *ctxt)
@@ -659,6 +666,12 @@ static int vmx_load_msr(struct vcpu *v, struct hvm_msr *ctxt)
             else
                 err = -ENXIO;
             break;
+        case MSR_IA32_XSS:
+            if ( cpu_has_xsaves )
+                v->arch.hvm_vcpu.msr_xss = ctxt->msr[i].val;
+            else
+                err = -ENXIO;
+            break;
         default:
             continue;
         }
@@ -2819,6 +2832,18 @@ static void vmx_idtv_reinject(unsigned long idtv_info)
     }
 }
 
+static void vmx_handle_xsaves(void)
+{
+    gdprintk(XENLOG_ERR, "xsaves should not cause vmexit\n");
+    domain_crash(current->domain);
+}
+
+static void vmx_handle_xrstors(void)
+{
+    gdprintk(XENLOG_ERR, "xrstors should not cause vmexit\n");
+    domain_crash(current->domain);
+}
+
 static int vmx_handle_apic_write(void)
 {
     unsigned long exit_qualification;
@@ -3396,6 +3421,14 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
         vmx_vcpu_flush_pml_buffer(v);
         break;
 
+    case EXIT_REASON_XSAVES:
+        vmx_handle_xsaves();
+        break;
+
+    case EXIT_REASON_XRSTORS:
+        vmx_handle_xrstors();
+        break;
+
     case EXIT_REASON_ACCESS_GDTR_OR_IDTR:
     case EXIT_REASON_ACCESS_LDTR_OR_TR:
     case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index e41056d..262f850 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -25,7 +25,7 @@ static u32 __read_mostly xsave_cntxt_size;
 u64 __read_mostly xfeature_mask;
 
 static unsigned int *__read_mostly xstate_offsets;
-static unsigned int *__read_mostly xstate_sizes;
+unsigned int *__read_mostly xstate_sizes;
 static unsigned int __read_mostly xstate_features;
 static unsigned int __read_mostly xstate_comp_offsets[sizeof(xfeature_mask)*8];
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 0a69a44..b3b0946 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -235,6 +235,7 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000
 #define SECONDARY_EXEC_ENABLE_PML               0x00020000
 #define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000
+#define SECONDARY_EXEC_XSAVES                   0x00100000
 extern u32 vmx_secondary_exec_control;
 
 #define VMX_EPT_EXEC_ONLY_SUPPORTED                         0x00000001
@@ -300,6 +301,8 @@ extern u64 vmx_ept_vpid_cap;
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS)
 #define cpu_has_vmx_pml \
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_PML)
+#define cpu_has_vmx_xsaves \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_XSAVES)
 
 #define VMCS_RID_TYPE_MASK              0x80000000
 
@@ -374,6 +377,7 @@ enum vmcs_field {
     VMREAD_BITMAP                   = 0x00002026,
     VMWRITE_BITMAP                  = 0x00002028,
     VIRT_EXCEPTION_INFO             = 0x0000202a,
+    XSS_EXIT_BITMAP                 = 0x0000202c,
     GUEST_PHYSICAL_ADDRESS          = 0x00002400,
     VMCS_LINK_POINTER               = 0x00002800,
     GUEST_IA32_DEBUGCTL             = 0x00002802,
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 7831b9a..1719965 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -211,6 +211,8 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
 #define EXIT_REASON_INVPCID             58
 #define EXIT_REASON_VMFUNC              59
 #define EXIT_REASON_PML_FULL            62
+#define EXIT_REASON_XSAVES              63
+#define EXIT_REASON_XRSTORS             64
 
 /*
  * Interruption-information format
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 414cc99..12d939b 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -45,6 +45,7 @@
 #define XSTATE_COMPACTION_ENABLED  (1ULL << 63)
 
 extern u64 xfeature_mask;
+extern unsigned int *xstate_sizes;
 
 /* extended state save area */
 struct __packed __attribute__((aligned (64))) xsave_struct
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:55:36 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:55: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 1a23Zn-0005hV-QM; Thu, 26 Nov 2015 20:55:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Zm-0005hJ-Hs
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:34 +0000
Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id
	2B/AA-02804-5C177565; Thu, 26 Nov 2015 20:55:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1448571331!6877827!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 62552 invoked from network); 26 Nov 2015 20:55:32 -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;
	26 Nov 2015 20:55:32 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Zj-0003JC-ME
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Zj-00011A-KM
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:31 +0000
Date: Thu, 26 Nov 2015 20:55:31 +0000
Message-Id: <E1a23Zj-00011A-KM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsaves: enable xsaves/xrstors for
	hvm 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 460b9a4b3630f03ce4f1ee24249541bdfea08fd4
Author:     Shuai Ruan <shuai.ruan@linux.intel.com>
AuthorDate: Wed Nov 25 17:23:51 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:23:51 2015 +0100

    x86/xsaves: enable xsaves/xrstors for hvm guest
    
    This patch enables xsaves for hvm guest, includes:
    1.handle xsaves vmcs init and vmexit.
    2.add logic to write/read the XSS msr.
    
    Add IA32_XSS_MSR save/rstore support.
    
    Signed-off-by: Shuai Ruan <shuai.ruan@linux.intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c             |   27 +++++++++++++++++++++++++++
 xen/arch/x86/hvm/vmx/vmcs.c        |    5 ++++-
 xen/arch/x86/hvm/vmx/vmx.c         |   35 ++++++++++++++++++++++++++++++++++-
 xen/arch/x86/xstate.c              |    2 +-
 xen/include/asm-x86/hvm/vmx/vmcs.h |    4 ++++
 xen/include/asm-x86/hvm/vmx/vmx.h  |    2 ++
 xen/include/asm-x86/xstate.h       |    1 +
 7 files changed, 73 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c981580..6c2b512 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4606,6 +4606,20 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
                     *ebx = _eax + _ebx;
             }
         }
+        if ( count == 1 )
+        {
+            if ( cpu_has_xsaves && cpu_has_vmx_xsaves )
+            {
+                *ebx = XSTATE_AREA_MIN_SIZE;
+                if ( v->arch.xcr0 | v->arch.hvm_vcpu.msr_xss )
+                    for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ )
+                        if ( (v->arch.xcr0 | v->arch.hvm_vcpu.msr_xss) &
+                             (1ULL << sub_leaf) )
+                            *ebx += xstate_sizes[sub_leaf];
+            }
+            else
+                *ebx = *ecx = *edx = 0;
+        }
         break;
 
     case 0x80000001:
@@ -4705,6 +4719,12 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         *msr_content = v->arch.hvm_vcpu.guest_efer;
         break;
 
+    case MSR_IA32_XSS:
+        if ( !cpu_has_xsaves )
+            goto gp_fault;
+        *msr_content = v->arch.hvm_vcpu.msr_xss;
+        break;
+
     case MSR_IA32_TSC:
         *msr_content = _hvm_rdtsc_intercept();
         break;
@@ -4837,6 +4857,13 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content,
            return X86EMUL_EXCEPTION;
         break;
 
+    case MSR_IA32_XSS:
+        /* No XSS features currently supported for guests. */
+        if ( !cpu_has_xsaves || msr_content != 0 )
+            goto gp_fault;
+        v->arch.hvm_vcpu.msr_xss = msr_content;
+        break;
+
     case MSR_IA32_TSC:
         hvm_set_guest_tsc(v, msr_content);
         break;
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 202c0a4..000d06e 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -241,7 +241,8 @@ static int vmx_init_vmcs_config(void)
                SECONDARY_EXEC_PAUSE_LOOP_EXITING |
                SECONDARY_EXEC_ENABLE_INVPCID |
                SECONDARY_EXEC_ENABLE_VM_FUNCTIONS |
-               SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS);
+               SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS |
+               SECONDARY_EXEC_XSAVES);
         rdmsrl(MSR_IA32_VMX_MISC, _vmx_misc_cap);
         if ( _vmx_misc_cap & VMX_MISC_VMWRITE_ALL )
             opt |= SECONDARY_EXEC_ENABLE_VMCS_SHADOWING;
@@ -1273,6 +1274,8 @@ static int construct_vmcs(struct vcpu *v)
         __vmwrite(HOST_PAT, host_pat);
         __vmwrite(GUEST_PAT, guest_pat);
     }
+    if ( cpu_has_vmx_xsaves )
+        __vmwrite(XSS_EXIT_BITMAP, 0);
 
     vmx_vmcs_exit(v);
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 374eebf..9ad6d82 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -625,7 +625,7 @@ static int vmx_load_vmcs_ctxt(struct vcpu *v, struct hvm_hw_cpu *ctxt)
 
 static unsigned int __init vmx_init_msr(void)
 {
-    return !!cpu_has_mpx;
+    return !!cpu_has_mpx + !!cpu_has_xsaves;
 }
 
 static void vmx_save_msr(struct vcpu *v, struct hvm_msr *ctxt)
@@ -640,6 +640,13 @@ static void vmx_save_msr(struct vcpu *v, struct hvm_msr *ctxt)
     }
 
     vmx_vmcs_exit(v);
+
+    if ( cpu_has_xsaves )
+    {
+        ctxt->msr[ctxt->count].val = v->arch.hvm_vcpu.msr_xss;
+        if ( ctxt->msr[ctxt->count].val )
+            ctxt->msr[ctxt->count++].index = MSR_IA32_XSS;
+    }
 }
 
 static int vmx_load_msr(struct vcpu *v, struct hvm_msr *ctxt)
@@ -659,6 +666,12 @@ static int vmx_load_msr(struct vcpu *v, struct hvm_msr *ctxt)
             else
                 err = -ENXIO;
             break;
+        case MSR_IA32_XSS:
+            if ( cpu_has_xsaves )
+                v->arch.hvm_vcpu.msr_xss = ctxt->msr[i].val;
+            else
+                err = -ENXIO;
+            break;
         default:
             continue;
         }
@@ -2819,6 +2832,18 @@ static void vmx_idtv_reinject(unsigned long idtv_info)
     }
 }
 
+static void vmx_handle_xsaves(void)
+{
+    gdprintk(XENLOG_ERR, "xsaves should not cause vmexit\n");
+    domain_crash(current->domain);
+}
+
+static void vmx_handle_xrstors(void)
+{
+    gdprintk(XENLOG_ERR, "xrstors should not cause vmexit\n");
+    domain_crash(current->domain);
+}
+
 static int vmx_handle_apic_write(void)
 {
     unsigned long exit_qualification;
@@ -3396,6 +3421,14 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
         vmx_vcpu_flush_pml_buffer(v);
         break;
 
+    case EXIT_REASON_XSAVES:
+        vmx_handle_xsaves();
+        break;
+
+    case EXIT_REASON_XRSTORS:
+        vmx_handle_xrstors();
+        break;
+
     case EXIT_REASON_ACCESS_GDTR_OR_IDTR:
     case EXIT_REASON_ACCESS_LDTR_OR_TR:
     case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index e41056d..262f850 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -25,7 +25,7 @@ static u32 __read_mostly xsave_cntxt_size;
 u64 __read_mostly xfeature_mask;
 
 static unsigned int *__read_mostly xstate_offsets;
-static unsigned int *__read_mostly xstate_sizes;
+unsigned int *__read_mostly xstate_sizes;
 static unsigned int __read_mostly xstate_features;
 static unsigned int __read_mostly xstate_comp_offsets[sizeof(xfeature_mask)*8];
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 0a69a44..b3b0946 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -235,6 +235,7 @@ extern u32 vmx_vmentry_control;
 #define SECONDARY_EXEC_ENABLE_VMCS_SHADOWING    0x00004000
 #define SECONDARY_EXEC_ENABLE_PML               0x00020000
 #define SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS   0x00040000
+#define SECONDARY_EXEC_XSAVES                   0x00100000
 extern u32 vmx_secondary_exec_control;
 
 #define VMX_EPT_EXEC_ONLY_SUPPORTED                         0x00000001
@@ -300,6 +301,8 @@ extern u64 vmx_ept_vpid_cap;
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS)
 #define cpu_has_vmx_pml \
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_PML)
+#define cpu_has_vmx_xsaves \
+    (vmx_secondary_exec_control & SECONDARY_EXEC_XSAVES)
 
 #define VMCS_RID_TYPE_MASK              0x80000000
 
@@ -374,6 +377,7 @@ enum vmcs_field {
     VMREAD_BITMAP                   = 0x00002026,
     VMWRITE_BITMAP                  = 0x00002028,
     VIRT_EXCEPTION_INFO             = 0x0000202a,
+    XSS_EXIT_BITMAP                 = 0x0000202c,
     GUEST_PHYSICAL_ADDRESS          = 0x00002400,
     VMCS_LINK_POINTER               = 0x00002800,
     GUEST_IA32_DEBUGCTL             = 0x00002802,
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 7831b9a..1719965 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -211,6 +211,8 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc)
 #define EXIT_REASON_INVPCID             58
 #define EXIT_REASON_VMFUNC              59
 #define EXIT_REASON_PML_FULL            62
+#define EXIT_REASON_XSAVES              63
+#define EXIT_REASON_XRSTORS             64
 
 /*
  * Interruption-information format
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 414cc99..12d939b 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -45,6 +45,7 @@
 #define XSTATE_COMPACTION_ENABLED  (1ULL << 63)
 
 extern u64 xfeature_mask;
+extern unsigned int *xstate_sizes;
 
 /* extended state save area */
 struct __packed __attribute__((aligned (64))) xsave_struct
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:55:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:55: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 1a23Zy-0005j6-50; Thu, 26 Nov 2015 20:55:46 +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 1a23Zw-0005iw-Dz
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:44 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	53/4A-10715-FC177565; Thu, 26 Nov 2015 20:55:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1448571342!6654936!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34502 invoked from network); 26 Nov 2015 20:55:43 -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;
	26 Nov 2015 20:55:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Zt-0003Jl-VY
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Zt-00011e-SO
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:41 +0000
Date: Thu, 26 Nov 2015 20:55:41 +0000
Message-Id: <E1a23Zt-00011e-SO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: expose xsaves/xgetbv1/xsavec to
	hvm 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 c708181305621e5393b5e1ee316b6784585bdf93
Author:     Shuai Ruan <shuai.ruan@intel.com>
AuthorDate: Wed Nov 25 17:24:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:24:17 2015 +0100

    libxc: expose xsaves/xgetbv1/xsavec to hvm guest
    
    This patch exposes xsaves/xgetbv1/xsavec to hvm guest.
    The reserved bits of eax/ebx/ecx/edx must be cleaned up
    when call cpuid(0dh) with leaf 1 or 2..63.
    
    According to the spec the following bits must be reserved:
    For leaf 1, bits 03-04/08-31 of ecx is reserved. Edx is reserved.
    For leaf 2...63, bits 01-31 of ecx is reserved, Edx is reserved.
    
    But as no XSS festures are currently supported, even in HVM guests,
    for leaf 2...63, ecx should be zero at the moment.
    
    Signed-off-by: Shuai Ruan <shuai.ruan@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_cpuid_x86.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index 031c848..8882c01 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -282,6 +282,9 @@ static void intel_xc_cpuid_policy(xc_interface *xch,
 }
 
 #define XSAVEOPT        (1 << 0)
+#define XSAVEC          (1 << 1)
+#define XGETBV1         (1 << 2)
+#define XSAVES          (1 << 3)
 /* Configure extended state enumeration leaves (0x0000000D for xsave) */
 static void xc_cpuid_config_xsave(xc_interface *xch,
                                   const struct cpuid_domain_info *info,
@@ -318,8 +321,11 @@ static void xc_cpuid_config_xsave(xc_interface *xch,
         regs[1] = 512 + 64; /* FP/SSE + XSAVE.HEADER */
         break;
     case 1: /* leaf 1 */
-        regs[0] &= XSAVEOPT;
-        regs[1] = regs[2] = regs[3] = 0;
+        regs[0] &= (XSAVEOPT | XSAVEC | XGETBV1 | XSAVES);
+        if ( !info->hvm )
+            regs[0] &= ~XSAVES;
+        regs[2] &= info->xfeature_mask;
+        regs[3] = 0;
         break;
     case 2 ... 63: /* sub-leaves */
         if ( !(info->xfeature_mask & (1ULL << input[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 Thu Nov 26 20:55:47 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:55: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 1a23Zy-0005j6-50; Thu, 26 Nov 2015 20:55:46 +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 1a23Zw-0005iw-Dz
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:44 +0000
Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id
	53/4A-10715-FC177565; Thu, 26 Nov 2015 20:55:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1448571342!6654936!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: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 34502 invoked from network); 26 Nov 2015 20:55:43 -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;
	26 Nov 2015 20:55:43 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Zt-0003Jl-VY
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23Zt-00011e-SO
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:41 +0000
Date: Thu, 26 Nov 2015 20:55:41 +0000
Message-Id: <E1a23Zt-00011e-SO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: expose xsaves/xgetbv1/xsavec to
	hvm 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 c708181305621e5393b5e1ee316b6784585bdf93
Author:     Shuai Ruan <shuai.ruan@intel.com>
AuthorDate: Wed Nov 25 17:24:17 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:24:17 2015 +0100

    libxc: expose xsaves/xgetbv1/xsavec to hvm guest
    
    This patch exposes xsaves/xgetbv1/xsavec to hvm guest.
    The reserved bits of eax/ebx/ecx/edx must be cleaned up
    when call cpuid(0dh) with leaf 1 or 2..63.
    
    According to the spec the following bits must be reserved:
    For leaf 1, bits 03-04/08-31 of ecx is reserved. Edx is reserved.
    For leaf 2...63, bits 01-31 of ecx is reserved, Edx is reserved.
    
    But as no XSS festures are currently supported, even in HVM guests,
    for leaf 2...63, ecx should be zero at the moment.
    
    Signed-off-by: Shuai Ruan <shuai.ruan@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_cpuid_x86.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index 031c848..8882c01 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -282,6 +282,9 @@ static void intel_xc_cpuid_policy(xc_interface *xch,
 }
 
 #define XSAVEOPT        (1 << 0)
+#define XSAVEC          (1 << 1)
+#define XGETBV1         (1 << 2)
+#define XSAVES          (1 << 3)
 /* Configure extended state enumeration leaves (0x0000000D for xsave) */
 static void xc_cpuid_config_xsave(xc_interface *xch,
                                   const struct cpuid_domain_info *info,
@@ -318,8 +321,11 @@ static void xc_cpuid_config_xsave(xc_interface *xch,
         regs[1] = 512 + 64; /* FP/SSE + XSAVE.HEADER */
         break;
     case 1: /* leaf 1 */
-        regs[0] &= XSAVEOPT;
-        regs[1] = regs[2] = regs[3] = 0;
+        regs[0] &= (XSAVEOPT | XSAVEC | XGETBV1 | XSAVES);
+        if ( !info->hvm )
+            regs[0] &= ~XSAVES;
+        regs[2] &= info->xfeature_mask;
+        regs[3] = 0;
         break;
     case 2 ... 63: /* sub-leaves */
         if ( !(info->xfeature_mask & (1ULL << input[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 Thu Nov 26 20:55:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:55:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23a8-0005kd-9M; Thu, 26 Nov 2015 20:55:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23a6-0005kP-OJ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:54 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	AD/38-25438-AD177565; Thu, 26 Nov 2015 20:55:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1448571352!6645130!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32101 invoked from network); 26 Nov 2015 20:55:53 -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;
	26 Nov 2015 20:55:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23a4-0003Jt-9a
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23a4-00012B-74
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:52 +0000
Date: Thu, 26 Nov 2015 20:55:52 +0000
Message-Id: <E1a23a4-00012B-74@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: check for not allowed
	sections before linking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d380b3559734739ae009cd3c0e9aabb5602863e2
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Wed Nov 25 17:24:36 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:24:36 2015 +0100

    x86/boot: check for not allowed sections before linking
    
    Currently check for not allowed sections is performed just after
    compilation. However, if compilation succeeds and check fails then
    second build will create xen.gz/xen.efi without any visible error.
    This happens because %.o: %.c recipe created object file during first
    run and make do not execute this recipe during second run. So, look
    for not allowed sections before linking. This way check will be
    executed every time.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/boot/build32.mk |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk
index c208249..4a1421f 100644
--- a/xen/arch/x86/boot/build32.mk
+++ b/xen/arch/x86/boot/build32.mk
@@ -16,11 +16,7 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 	$(OBJCOPY) -O binary $< $@
 
 %.lnk: %.o
-	$(LD) $(LDFLAGS_DIRECT) -N -Ttext 0 -o $@ $<
-
-%.o: %.c
-	$(CC) $(CFLAGS) -c -fpic $< -o $@
-	$(OBJDUMP) -h $@ | sed -n '/[0-9]/{s,00*,0,g;p;}' |\
+	$(OBJDUMP) -h $< | sed -n '/[0-9]/{s,00*,0,g;p;}' |\
 		while read idx name sz rest; do \
 			case "$$name" in \
 			.data|.data.*|.rodata|.rodata.*|.bss|.bss.*) \
@@ -29,6 +25,10 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 				exit $$(expr $$idx + 1);; \
 			esac; \
 		done
+	$(LD) $(LDFLAGS_DIRECT) -N -Ttext 0 -o $@ $<
+
+%.o: %.c
+	$(CC) $(CFLAGS) -c -fpic $< -o $@
 
 reloc.o: reloc.c $(RELOC_DEPS)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:55:56 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:55:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1a23a8-0005kd-9M; Thu, 26 Nov 2015 20:55:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23a6-0005kP-OJ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:54 +0000
Received: from [193.109.254.147] by server-10.bemta-14.messagelabs.com id
	AD/38-25438-AD177565; Thu, 26 Nov 2015 20:55:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1448571352!6645130!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32101 invoked from network); 26 Nov 2015 20:55:53 -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;
	26 Nov 2015 20:55:53 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23a4-0003Jt-9a
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23a4-00012B-74
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:55:52 +0000
Date: Thu, 26 Nov 2015 20:55:52 +0000
Message-Id: <E1a23a4-00012B-74@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/boot: check for not allowed
	sections before linking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d380b3559734739ae009cd3c0e9aabb5602863e2
Author:     Daniel Kiper <daniel.kiper@oracle.com>
AuthorDate: Wed Nov 25 17:24:36 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:24:36 2015 +0100

    x86/boot: check for not allowed sections before linking
    
    Currently check for not allowed sections is performed just after
    compilation. However, if compilation succeeds and check fails then
    second build will create xen.gz/xen.efi without any visible error.
    This happens because %.o: %.c recipe created object file during first
    run and make do not execute this recipe during second run. So, look
    for not allowed sections before linking. This way check will be
    executed every time.
    
    Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/boot/build32.mk |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk
index c208249..4a1421f 100644
--- a/xen/arch/x86/boot/build32.mk
+++ b/xen/arch/x86/boot/build32.mk
@@ -16,11 +16,7 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 	$(OBJCOPY) -O binary $< $@
 
 %.lnk: %.o
-	$(LD) $(LDFLAGS_DIRECT) -N -Ttext 0 -o $@ $<
-
-%.o: %.c
-	$(CC) $(CFLAGS) -c -fpic $< -o $@
-	$(OBJDUMP) -h $@ | sed -n '/[0-9]/{s,00*,0,g;p;}' |\
+	$(OBJDUMP) -h $< | sed -n '/[0-9]/{s,00*,0,g;p;}' |\
 		while read idx name sz rest; do \
 			case "$$name" in \
 			.data|.data.*|.rodata|.rodata.*|.bss|.bss.*) \
@@ -29,6 +25,10 @@ CFLAGS := $(filter-out -flto,$(CFLAGS))
 				exit $$(expr $$idx + 1);; \
 			esac; \
 		done
+	$(LD) $(LDFLAGS_DIRECT) -N -Ttext 0 -o $@ $<
+
+%.o: %.c
+	$(CC) $(CFLAGS) -c -fpic $< -o $@
 
 reloc.o: reloc.c $(RELOC_DEPS)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Nov 26 20:56:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:56: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 1a23aI-0005mA-DT; Thu, 26 Nov 2015 20:56:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23aG-0005lv-PJ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:56:04 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	22/72-23747-4E177565; Thu, 26 Nov 2015 20:56:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1448571362!6860621!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39341 invoked from network); 26 Nov 2015 20:56:03 -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;
	26 Nov 2015 20:56:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23aE-0003KU-JV
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:56:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23aE-00012p-GI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:56:02 +0000
Date: Thu, 26 Nov 2015 20:56:02 +0000
Message-Id: <E1a23aE-00012p-GI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/event_channel.h: correct comment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 713b7e4ef2aa4ec3ae697cde9c81d5a57548f9b1
Author:     Peng Fan <van.freenix@gmail.com>
AuthorDate: Wed Nov 25 17:26:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:26:09 2015 +0100

    public/event_channel.h: correct comment
    
    According to definition of structure evtchn_alloc_unbound,
    there is an entry "domid_t remote_dom", no "rdom". So
    using "remote_dom" in comments instead of "rdom".
    
    Signed-off-by: Peng Fan <van.freenix@gmail.com>
---
 xen/include/public/event_channel.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
index 05e531d..44c549d 100644
--- a/xen/include/public/event_channel.h
+++ b/xen/include/public/event_channel.h
@@ -85,7 +85,7 @@ DEFINE_XEN_GUEST_HANDLE(evtchn_port_t);
  * is allocated in <dom> and returned as <port>.
  * NOTES:
  *  1. If the caller is unprivileged then <dom> must be DOMID_SELF.
- *  2. <rdom> may be DOMID_SELF, allowing loopback connections.
+ *  2. <remote_dom> may be DOMID_SELF, allowing loopback connections.
  */
 struct evtchn_alloc_unbound {
     /* IN parameters */
--
generated by git-patchbot for /home/xen/git/xen.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 Nov 26 20:56:06 2015
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Nov 2015 20:56: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 1a23aI-0005mA-DT; Thu, 26 Nov 2015 20:56:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23aG-0005lv-PJ
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:56:04 +0000
Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id
	22/72-23747-4E177565; Thu, 26 Nov 2015 20:56:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1448571362!6860621!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 7.19.2; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 39341 invoked from network); 26 Nov 2015 20:56:03 -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;
	26 Nov 2015 20:56:03 -0000
Received: from xenbits.xenproject.org ([50.57.170.242] helo=xenbits.xen.org)
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23aE-0003KU-JV
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:56:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1a23aE-00012p-GI
	for xen-changelog@lists.xensource.com; Thu, 26 Nov 2015 20:56:02 +0000
Date: Thu, 26 Nov 2015 20:56:02 +0000
Message-Id: <E1a23aE-00012p-GI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] public/event_channel.h: correct comment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 713b7e4ef2aa4ec3ae697cde9c81d5a57548f9b1
Author:     Peng Fan <van.freenix@gmail.com>
AuthorDate: Wed Nov 25 17:26:09 2015 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Nov 25 17:26:09 2015 +0100

    public/event_channel.h: correct comment
    
    According to definition of structure evtchn_alloc_unbound,
    there is an entry "domid_t remote_dom", no "rdom". So
    using "remote_dom" in comments instead of "rdom".
    
    Signed-off-by: Peng Fan <van.freenix@gmail.com>
---
 xen/include/public/event_channel.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
index 05e531d..44c549d 100644
--- a/xen/include/public/event_channel.h
+++ b/xen/include/public/event_channel.h
@@ -85,7 +85,7 @@ DEFINE_XEN_GUEST_HANDLE(evtchn_port_t);
  * is allocated in <dom> and returned as <port>.
  * NOTES:
  *  1. If the caller is unprivileged then <dom> must be DOMID_SELF.
- *  2. <rdom> may be DOMID_SELF, allowing loopback connections.
+ *  2. <remote_dom> may be DOMID_SELF, allowing loopback connections.
  */
 struct evtchn_alloc_unbound {
     /* IN parameters */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

